📄 ieee80211.h
字号:
u8 received_channel; u8 control; u8 mask; u8 freq; u16 len;};/* IEEE 802.11 requires that STA supports concurrent reception of at least * three fragmented frames. This define can be increased to support more * concurrent frames, but it should be noted that each entry can consume about * 2 kB of RAM and increasing cache size will slow down frame reassembly. */#define IEEE80211_FRAG_CACHE_LEN 4struct ieee80211_frag_entry { unsigned long first_frag_time; unsigned int seq; unsigned int last_frag; struct sk_buff *skb; u8 src_addr[ETH_ALEN]; u8 dst_addr[ETH_ALEN];};struct ieee80211_stats { unsigned int tx_unicast_frames; unsigned int tx_multicast_frames; unsigned int tx_fragments; unsigned int tx_unicast_octets; unsigned int tx_multicast_octets; unsigned int tx_deferred_transmissions; unsigned int tx_single_retry_frames; unsigned int tx_multiple_retry_frames; unsigned int tx_retry_limit_exceeded; unsigned int tx_discards; unsigned int rx_unicast_frames; unsigned int rx_multicast_frames; unsigned int rx_fragments; unsigned int rx_unicast_octets; unsigned int rx_multicast_octets; unsigned int rx_fcs_errors; unsigned int rx_discards_no_buffer; unsigned int tx_discards_wrong_sa; unsigned int rx_discards_undecryptable; unsigned int rx_message_in_msg_fragments; unsigned int rx_message_in_bad_msg_fragments;};struct ieee80211_device;#include "ieee80211_crypt.h"#define SEC_KEY_1 (1<<0)#define SEC_KEY_2 (1<<1)#define SEC_KEY_3 (1<<2)#define SEC_KEY_4 (1<<3)#define SEC_ACTIVE_KEY (1<<4)#define SEC_AUTH_MODE (1<<5)#define SEC_UNICAST_GROUP (1<<6)#define SEC_LEVEL (1<<7)#define SEC_ENABLED (1<<8)#define SEC_ENCRYPT (1<<9)#define SEC_LEVEL_0 0 /* None */#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */#define SEC_LEVEL_2 2 /* Level 1 + TKIP */#define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */#define SEC_LEVEL_3 4 /* Level 2 + CCMP */#define SEC_ALG_NONE 0#define SEC_ALG_WEP 1#define SEC_ALG_TKIP 2#define SEC_ALG_CCMP 3#define WEP_KEYS 4#define WEP_KEY_LEN 13#define SCM_KEY_LEN 32#define SCM_TEMPORAL_KEY_LENGTH 16struct ieee80211_security { u16 active_key:2, enabled:1, auth_mode:2, auth_algo:4, unicast_uses_group:1, encrypt:1; u8 encode_alg[WEP_KEYS]; u8 key_sizes[WEP_KEYS]; u8 keys[WEP_KEYS][SCM_KEY_LEN]; u8 level; u16 flags;} __attribute__ ((packed));/* 802.11 data frame from AP ,-------------------------------------------------------------------.Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 | |------|------|---------|---------|---------|------|---------|------|Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | frame | fcs | | | tion | (BSSID) | | | ence | data | | `-------------------------------------------------------------------'Total: 28-2340 bytes*/#define BEACON_PROBE_SSID_ID_POSITION 12/* Management Frame Information Element Types */enum ieee80211_mfie { MFIE_TYPE_SSID = 0, MFIE_TYPE_RATES = 1, MFIE_TYPE_FH_SET = 2, MFIE_TYPE_DS_SET = 3, MFIE_TYPE_CF_SET = 4, MFIE_TYPE_TIM = 5, MFIE_TYPE_IBSS_SET = 6, MFIE_TYPE_COUNTRY = 7, MFIE_TYPE_HOP_PARAMS = 8, MFIE_TYPE_HOP_TABLE = 9, MFIE_TYPE_REQUEST = 10, MFIE_TYPE_CHALLENGE = 16, MFIE_TYPE_POWER_CONSTRAINT = 32, MFIE_TYPE_POWER_CAPABILITY = 33, MFIE_TYPE_TPC_REQUEST = 34, MFIE_TYPE_TPC_REPORT = 35, MFIE_TYPE_SUPP_CHANNELS = 36, MFIE_TYPE_CSA = 37, MFIE_TYPE_MEASURE_REQUEST = 38, MFIE_TYPE_MEASURE_REPORT = 39, MFIE_TYPE_QUIET = 40, MFIE_TYPE_IBSS_DFS = 41, MFIE_TYPE_ERP_INFO = 42, MFIE_TYPE_RSN = 48, MFIE_TYPE_RATES_EX = 50, MFIE_TYPE_GENERIC = 221, MFIE_TYPE_QOS_PARAMETER = 222,};/* Minimal header; can be used for passing 802.11 frames with sufficient * information to determine what type of underlying data type is actually * stored in the data. */struct ieee80211_hdr { __le16 frame_ctl; __le16 duration_id; u8 payload[0];} __attribute__ ((packed));struct ieee80211_hdr_1addr { __le16 frame_ctl; __le16 duration_id; u8 addr1[ETH_ALEN]; u8 payload[0];} __attribute__ ((packed));struct ieee80211_hdr_2addr { __le16 frame_ctl; __le16 duration_id; u8 addr1[ETH_ALEN]; u8 addr2[ETH_ALEN]; u8 payload[0];} __attribute__ ((packed));struct ieee80211_hdr_3addr { __le16 frame_ctl; __le16 duration_id; u8 addr1[ETH_ALEN]; u8 addr2[ETH_ALEN]; u8 addr3[ETH_ALEN]; __le16 seq_ctl; u8 payload[0];} __attribute__ ((packed));struct ieee80211_hdr_4addr { __le16 frame_ctl; __le16 duration_id; u8 addr1[ETH_ALEN]; u8 addr2[ETH_ALEN]; u8 addr3[ETH_ALEN]; __le16 seq_ctl; u8 addr4[ETH_ALEN]; u8 payload[0];} __attribute__ ((packed));struct ieee80211_hdr_3addrqos { __le16 frame_ctl; __le16 duration_id; u8 addr1[ETH_ALEN]; u8 addr2[ETH_ALEN]; u8 addr3[ETH_ALEN]; __le16 seq_ctl; u8 payload[0]; __le16 qos_ctl;} __attribute__ ((packed));struct ieee80211_hdr_4addrqos { __le16 frame_ctl; __le16 duration_id; u8 addr1[ETH_ALEN]; u8 addr2[ETH_ALEN]; u8 addr3[ETH_ALEN]; __le16 seq_ctl; u8 addr4[ETH_ALEN]; u8 payload[0]; __le16 qos_ctl;} __attribute__ ((packed));struct ieee80211_info_element { u8 id; u8 len; u8 data[0];} __attribute__ ((packed));/* * These are the data types that can make up management packets * u16 auth_algorithm; u16 auth_sequence; u16 beacon_interval; u16 capability; u8 current_ap[ETH_ALEN]; u16 listen_interval; struct { u16 association_id:14, reserved:2; } __attribute__ ((packed)); u32 time_stamp[2]; u16 reason; u16 status;*/struct ieee80211_auth { struct ieee80211_hdr_3addr header; __le16 algorithm; __le16 transaction; __le16 status; /* challenge */ struct ieee80211_info_element info_element[0];} __attribute__ ((packed));struct ieee80211_disassoc { struct ieee80211_hdr_3addr header; __le16 reason;} __attribute__ ((packed));/* Alias deauth for disassoc */#define ieee80211_deauth ieee80211_disassocstruct ieee80211_probe_request { struct ieee80211_hdr_3addr header; /* SSID, supported rates */ struct ieee80211_info_element info_element[0];} __attribute__ ((packed));struct ieee80211_probe_response { struct ieee80211_hdr_3addr header; u32 time_stamp[2]; __le16 beacon_interval; __le16 capability; /* SSID, supported rates, FH params, DS params, * CF params, IBSS params, TIM (if beacon), RSN */ struct ieee80211_info_element info_element[0];} __attribute__ ((packed));/* Alias beacon for probe_response */#define ieee80211_beacon ieee80211_probe_responsestruct ieee80211_assoc_request { struct ieee80211_hdr_3addr header; __le16 capability; __le16 listen_interval; /* SSID, supported rates, RSN */ struct ieee80211_info_element info_element[0];} __attribute__ ((packed));struct ieee80211_reassoc_request { struct ieee80211_hdr_3addr header; __le16 capability; __le16 listen_interval; u8 current_ap[ETH_ALEN]; struct ieee80211_info_element info_element[0];} __attribute__ ((packed));struct ieee80211_assoc_response { struct ieee80211_hdr_3addr header; __le16 capability; __le16 status; __le16 aid; /* supported rates */ struct ieee80211_info_element info_element[0];} __attribute__ ((packed));struct ieee80211_txb { u8 nr_frags; u8 encrypted; u8 rts_included; u8 reserved; __le16 frag_size; __le16 payload_size; struct sk_buff *fragments[0];};/* SWEEP TABLE ENTRIES NUMBER */#define MAX_SWEEP_TAB_ENTRIES 42#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7/* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs * only use 8, and then use extended rates for the remaining supported * rates. Other APs, however, stick all of their supported rates on the * main rates information element... */#define MAX_RATES_LENGTH ((u8)12)#define MAX_RATES_EX_LENGTH ((u8)16)#define MAX_NETWORK_COUNT 128#define CRC_LENGTH 4U#define MAX_WPA_IE_LEN 64#define NETWORK_EMPTY_ESSID (1<<0)#define NETWORK_HAS_OFDM (1<<1)#define NETWORK_HAS_CCK (1<<2)/* QoS structure */#define NETWORK_HAS_QOS_PARAMETERS (1<<3)#define NETWORK_HAS_QOS_INFORMATION (1<<4)#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | NETWORK_HAS_QOS_INFORMATION)#define QOS_QUEUE_NUM 4#define QOS_OUI_LEN 3#define QOS_OUI_TYPE 2#define QOS_ELEMENT_ID 221#define QOS_OUI_INFO_SUB_TYPE 0#define QOS_OUI_PARAM_SUB_TYPE 1#define QOS_VERSION_1 1#define QOS_AIFSN_MIN_VALUE 2struct ieee80211_qos_information_element { u8 elementID; u8 length; u8 qui[QOS_OUI_LEN]; u8 qui_type; u8 qui_subtype; u8 version; u8 ac_info;} __attribute__ ((packed));struct ieee80211_qos_ac_parameter { u8 aci_aifsn; u8 ecw_min_max; __le16 tx_op_limit;} __attribute__ ((packed));struct ieee80211_qos_parameter_info { struct ieee80211_qos_information_element info_element; u8 reserved; struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];} __attribute__ ((packed));struct ieee80211_qos_parameters { __le16 cw_min[QOS_QUEUE_NUM]; __le16 cw_max[QOS_QUEUE_NUM]; u8 aifs[QOS_QUEUE_NUM]; u8 flag[QOS_QUEUE_NUM]; __le16 tx_op_limit[QOS_QUEUE_NUM];} __attribute__ ((packed));struct ieee80211_qos_data { struct ieee80211_qos_parameters parameters; int active; int supported; u8 param_count; u8 old_param_count;};struct ieee80211_tim_parameters { u8 tim_count; u8 tim_period;} __attribute__ ((packed));/*******************************************************/struct ieee80211_network { /* These entries are used to identify a unique network */ u8 bssid[ETH_ALEN]; u8 channel; /* Ensure null-terminated for any debug msgs */ u8 ssid[IW_ESSID_MAX_SIZE + 1]; u8 ssid_len; struct ieee80211_qos_data qos_data; /* These are network statistics */ struct ieee80211_rx_stats stats; u16 capability;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -