📄 monitor.h
字号:
/* $Id: monitor.h,v 1.41 2001/09/29 16:06:39 jm Exp $ * Header files for Monitor module * * Dynamic hierarchial IP tunnel * Copyright (C) 1998-2001, Dynamics group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. See README and COPYING for * more details. */#ifndef MONITOR_H#define MONITOR_H#include <values.h>#include <asm/types.h>#include <sys/types.h>#include <sys/socket.h>#include <sys/time.h>#include <linux/wireless.h>#include <netinet/in.h>#include "mn.h"#include "owntypes.h"#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1#include <net/ethernet.h> /* the L2 protocols */#include <netinet/if_ether.h>#else#include <linux/if_ether.h> /* The L2 protocols */#endif/* defaults */#define DEFAULT_THRESHOLD 90 /* 0 < treshold < 100. Quality treshold for changing FA (in percent) *//* if more than MAX_MONITOR FAs to monitor, then drop worst FA from the iwspy list. Don't drop before the entry has been there WORST_MIN_TIME seconds. If some entry is older than WORST_MAX_TIME, then drop that one. NOTICE: If WORST_MAX_TIME is smaller than FA agent advertisement interval, then the first found entry is dropped (not good). NOTICE: If WORST_MIN_TIME is smaller than the FA agent advertisement interval, then the worst entry may not have enough time to get the quality value */#define DEFAULT_WORST_MIN_TIME 10 #define DEFAULT_WORST_MAX_TIME 20 #define DEFAULT_MIN_BALANCE 10#define DEFAULT_EARLY_EXPIRE_TIME 50#define DEFAULT_AVG_LEN 3#define MAX_MONITOR 20 /* with SQ_cache the max number of entries */#define MAX_KERNEL IW_MAX_SPY /* NOTICE! If you're using wvlan 0.2.7 or below, use IW_MAX_SPY-2 because there is bug */#define OLD_FA_FACTOR 50 /* 0 < factor < 100. multiply with this and divide with 100 if the advertisement isn't fresh */#define DEFAULT_WIRELESS_PRIO 1.0 /* priority for single wireless interface */#define DEFAULT_DEV_PRIO_PERCENT 0 /* don't use device priority for wireless interfaces */#define MAXPRIORITY MAXINT /* Maximum priority for FA *//* MON_CONF API call types */#define GET_MONCONF 1#define GET_MONCONF_VAR 2#define SET_MONCONF_VAR 3/* structures */struct monitor_address { struct agentadv_data *adv; int active; /* 1 = used, -1 = not used or old, 0 not initialized */ __u16 fa_adv_lifetime; struct iw_quality qual; __u8 q10[10]; unsigned short q10_index; unsigned short avg; struct timeval updated; struct timeval added;};struct monitor_global_data { int current_fa; char current_dev[IFNAMSIZ]; int interfaces; int iwspy_supported; int dev_priority_percentage; /* The weight of the device priority */ int priority_factor; int threshold; int default_ch; int old_fa_factor; int expiretime; int min_balance; int worst_min_time; int worst_max_time; int average_length; int rec_qual; int SQ_cache; struct agentadv_data **current_adv; struct timeval *reg_send_timer;};struct monitor_interface { short in_use; short priority; short channel_get_support; /* is ch get supported */ short channel_support; /* is ch set supported */ short iwspy_support; char ifname[IFNAMSIZ]; int sock; int spy_number; int channel; int test_slot; struct iw_range range; /* If the link quality parameter is updated lately mark it update */ short vector_update[MAX_MONITOR]; /* Save information about the link quality to the FA */ struct monitor_address mon[MAX_MONITOR]; char ap_hwaddr[ETH_ALEN]; /* last polled AP hw address */};/* State variables */struct monitor_conf_vars { char *name; /* name for mn_tool (etc.) */ int min_chars; /* minimum number of chars that must be compared */ int *value; /* pointer to the variable */ int min; /* minimun value (-1 no minimum) */ int max; /* maximum (-1, no maximu) */};/* module interface */void MONITOR_register_module(void);int MONITOR_unregister_module(void);struct mn_data;void monitor_poll_ap_addresses(struct mn_data *mn);/* monitor_api.c */int monitor_api_get_ch(unsigned char *buffer, __u16 *length);int monitor_api_set_ch(char *ifname, int channel);int monitor_api_mon_conf(char *buffer, int len, int type);/* monitor_util.c */int next(int p);int prev(int p);int drop_worst(struct timeval *tstamp, struct monitor_interface *dev);int get_free_slot(struct timeval *tstamp, struct monitor_interface *dev);struct monitor_interface *monitor_get_dev(char *ifname);void print_entries(void);int find_current_fa_iter(struct node *nod, void *data);#endif /* MONITOR_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -