-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwifi_packet.h
executable file
·62 lines (53 loc) · 1.87 KB
/
wifi_packet.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
#ifndef __WIFI_PACKET_H__
#define __WIFI_PACKET_H__
#include "channel.h" //enum chan_width
struct uwifi_packet_info {
/* general */
unsigned int pkt_types; /* bitmask of packet types */
/* wlan phy (from radiotap) */
int phy_signal; /* signal strength (usually dBm) */
unsigned int phy_rate; /* physical rate * 10 (=in 100kbps) */
unsigned char phy_rate_idx; /* MCS index */
unsigned char phy_rate_flags; /* MCS flags */
unsigned int phy_freq; /* frequency from driver */
unsigned int phy_flags; /* A, B, G, shortpre */
/* wlan mac */
unsigned int wlan_len; /* packet length */
uint16_t wlan_type; /* frame control field */
unsigned char wlan_src[MAC_LEN]; /* transmitter (TA) */
unsigned char wlan_dst[MAC_LEN]; /* receiver (RA) */
unsigned char wlan_bssid[MAC_LEN];
char wlan_essid[WLAN_MAX_SSID_LEN];
uint64_t wlan_tsf; /* timestamp from beacon */
unsigned int wlan_bintval; /* beacon interval */
unsigned int wlan_mode; /* AP, STA or IBSS */
unsigned char wlan_channel; /* channel from beacon, probe */
enum uwifi_chan_width wlan_chan_width;
unsigned char wlan_tx_streams;
unsigned char wlan_rx_streams;
unsigned char wlan_qos_class; /* for QDATA frames */
unsigned int wlan_nav; /* frame NAV duration */
unsigned int wlan_seqno; /* sequence number */
/* flags */
unsigned int wlan_wep:1, /* WEP on/off */
wlan_retry:1,
wlan_wpa:1,
wlan_rsn:1,
wlan_ht40plus:1;
/* batman-adv */
unsigned char bat_version;
unsigned char bat_packet_type;
unsigned char bat_gw:1;
/* IP */
unsigned int ip_src;
unsigned int ip_dst;
unsigned int tcpudp_port;
unsigned int olsr_type;
unsigned int olsr_neigh;
unsigned int olsr_tc;
/* calculated from other values */
unsigned int pkt_duration; /* packet "airtime" */
int pkt_chan_idx; /* received while on channel */
int wlan_retries; /* retry count for this frame */
};
#endif