-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmonitor.h
66 lines (59 loc) · 1.54 KB
/
monitor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
enum {
STA_AUTH_SUCCESS = 0x02,
STA_ASSOC_SUCCESS = 0x04,
};
/* Per station info structure */
struct sta_info
{
MACADDR_TYPE(mac_address);
MACADDR_TYPE(bssid);
int channel;
int rate;
int rssi;
unsigned long long pkt_bytes;
int state;
struct sta_info *next;
};
struct client_list
{
struct sta_info *first;
struct sta_info *last;
struct sta_info *current;
int count;
};
/* Access point structure */
struct ap_conf
{
MACADDR_TYPE(bssid);
MACADDR_TYPE(mac_address);
IPADDR_TYPE(ip_address);
unsigned char essid[33];
int channel;
int freq;
int rate;
int tx_power;
unsigned short interval;
u_int16_t capability;
u_int64_t timestamp;
int seq_ctrl; // we must track sequence number in a per-AP basis, if possible
struct client_list clist;
u_char rates_supp[EID_SUPPORTED_RATES_LENGHT];
u_char rates_supp_ext[EID_SUPPORTED_RATES_EXT_LENGHT];
};
struct monitor_fn_t {
int (*mon_frame_handler)(struct monitor_fn_t *mfn,
const u_char *pkt, int len,
struct mif *mi, int rate, int rssi, int subtype);
int (*mon_tx_tun_frame)(struct monitor_fn_t *mfn,
u_char *pkt, int len, struct mif *mi);
void (*periodic_beacon)(struct monitor_fn_t *mfn);
void (*csa_beacon)(struct monitor_fn_t *mfn, MACADDR_TYPE(addr), u_int8_t channel);
void (*free)(struct monitor_fn_t *mfn);
void *mfn_priv;
struct tif *dv_ti;
struct mif *dv_mi;
void *evtimer;
int time_beacon;
int rate;
};
struct monitor_fn_t *init_function(struct config_values *config);