📄 ieee80211.h
字号:
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_authentication { struct ieee80211_header_data header; u16 algorithm; u16 transaction; u16 status; //struct ieee80211_info_element info_element;} __attribute__ ((packed));struct ieee80211_probe_request { struct ieee80211_header_data header; /*struct ieee80211_info_element info_element;*/} __attribute__ ((packed));struct ieee80211_probe_response { struct ieee80211_header_data header; u32 time_stamp[2]; u16 beacon_interval; u16 capability; struct ieee80211_info_element info_element;} __attribute__ ((packed));struct ieee80211_assoc_request_frame { u16 capability; u16 listen_interval; u8 current_ap[ETH_ALEN]; struct ieee80211_info_element info_element;} __attribute__ ((packed));struct ieee80211_association_request_hdr{ u16 frame_control; u16 duration; u8 addr1[ETH_ALEN]; u8 addr2[ETH_ALEN]; u8 addr3[ETH_ALEN]; u16 seq; u16 capability; u16 listen_interval; } __attribute__ ((packed));struct ieee80211_association_response_hdr{ u16 frame_control; u16 duration; u8 addr1[ETH_ALEN]; u8 addr2[ETH_ALEN]; u8 addr3[ETH_ALEN]; u16 seq; u16 capability; u16 status; u16 id; } __attribute__ ((packed));/* SWEEP TABLE ENTRIES NUMBER*/#define MAX_SWEEP_TAB_ENTRIES 42#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7#define MAX_RATES_LENGTH ((u8)8)#define MAX_BEACON_COUNT 128#ifdef IW_ESSID_MAX_SIZE#define SSID_LENGTH IW_ESSID_MAX_SIZE#else#define SSID_LENGTH ((u8)32)#endif#define CRC_LENGTH 4U#define SSID_11B_RATE_1MB 0x0001#define SSID_11B_RATE_2MB 0x0002#define SSID_11B_RATE_5MB 0x0004#define SSID_11B_RATE_11MB 0x0008#define SSID_11B_RATE_22MB 0x0010#define BEACON_CAPABILITY_WEP 0x0010struct ieee80211_beacon { u8 bssid[ETH_ALEN]; u8 ssid_len; s8 rssi; u16 capability; u8 channel; u8 rates[MAX_RATES_LENGTH]; u8 rates_len; u32 last_scanned; /* Ensure null-terminated for any debug msgs */ u8 ssid[SSID_LENGTH + 1]; u8 quality; u16 interval; struct list_head list;};struct ieee80211_helper_functions { void (*set_security)(struct ieee80211_device *ieee, struct ieee80211_security *sec); /* these functions are defined in hardware model specific files * (hostap_{cs,plx,pci}.c */ int (*card_present)(struct ieee80211_device *ieee); void (*cor_sreset)(struct ieee80211_device *ieee); int (*dev_open)(struct ieee80211_device *ieee); int (*dev_close)(struct ieee80211_device *ieee); void (*genesis_reset)(struct ieee80211_device *ieee, int hcr); /* Turn on unencrypted packet filtering at the HW level */ void (*set_unencrypted_filter)(struct ieee80211_device *ieee, int flag); /* the following functions are from hostap_hw.c, but they may have some * hardware model specific code */ int (*hw_enable)(struct net_device *dev, int initial); int (*hw_config)(struct net_device *dev, int initial); void (*hw_reset)(struct net_device *dev); void (*hw_shutdown)(struct net_device *dev, int no_disable); int (*reset_port)(struct net_device *dev); /*int (*tx)(struct sk_buff *skb, struct net_device *dev);*/ void (*schedule_reset)(struct ieee80211_device *ieee); int (*tx_80211)(struct sk_buff *skb, struct net_device *dev); void (*set_chan)(struct net_device *dev,short ch); void (*start_scan)(struct net_device *dev); void (*stop_scan)(struct net_device *dev); void (*associate)(struct net_device *dev, struct ieee80211_beacon *beacon); void (*hard_data_xmit)(struct net_device *dev,struct sk_buff *skb,short morefrag); void (*data_poll_hard_stop)(struct net_device *dev); void (*data_poll_hard_resume)(struct net_device *dev);};struct ieee80211_txb { u8 nr_frags; u8 encrypted; u16 reserved; u16 frag_size; u16 payload_size; struct sk_buff *fragments[0];};typedef struct tx_pending_t{ int frag; struct ieee80211_txb *txb;}tx_pending_t;typedef struct mac_htable_t { u8 adr[ETH_ALEN]; unsigned long time; struct mac_htable_t *next;} mac_htable_t;struct ieee80211_device { struct net_device *dev; /* Bookkeeping structures */ struct net_device_stats stats; struct ieee80211_stats ieee_stats; void *priv; int iw_mode; /* operating mode (IW_MODE_*) */ spinlock_t lock; spinlock_t irq_lock; struct list_head beacons; /*used by the association workqueue, when associated contains info on the NET*/ struct ieee80211_beacon *ass_beacon; struct timer_list associate_timer; /*struct workqueue_struct *workqueue; struct work_struct associate_tasklet; */ unsigned long associate_seq; int assoc_id; short associate_state; //wait_queue_head_t assoc_queue; int link_state; u16 seq_ctrl; //this contains the seq number (not the frag) //u8 *ssid; //null if noone request to associate, point to essid if set by iwconfig u8 ssid[SSID_LENGTH + 1]; int sifs_time; short rate; int tx_payload_only; /* set to 1 if HW only expects the Tx SKB * to contain the payload (vs. a fully configured * 802.11 header for a data frame) */ short queue_stop; struct tx_pending_t tx_pending; /* WEP and other encryption related settings at the device level */ int open_wep; /* Set to 1 to allow unencrypted frames */ short hw_wep; /* Set to let TX reserve space for IV and ICV, and RX discard IV and ICV, assume the HW decrypt/encrypt packets*/ short hw_seq; int reset_on_keychange; /* Set to 1 if the HW needs to be reset on * WEP key changes */ /* If the host performs {en,de}cryption, then set to 1 */ int host_encrypt; int host_decrypt; int ieee_802_1x; /* is IEEE 802.1X used */ struct list_head crypt_deinit_list; struct ieee80211_crypt_data *crypt[WEP_KEYS]; int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ struct timer_list crypt_deinit_timer; int bcrx_sta_key; /* use individual keys to override default keys even * with RX of broad/multicast frames */ /* Fragmentation structures */ struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN]; unsigned int frag_next_idx; u16 fts; /* Fragmentation Threshold */ /* Callback vtable */ struct ieee80211_helper_functions *func; u8 beacon_cell_ssid[ETH_ALEN]; u8 *master_essid; u16 beacon_interval; u8 master_chan; u8 ap[ETH_ALEN]; struct mac_htable_t *bridge_htable[MAC_HTABLE_ENTRY]; struct mac_htable_t *assoc_htable[MAC_HTABLE_ENTRY];};extern inline int ieee80211_get_hdrlen(u16 fc){ int hdrlen = 24; switch (WLAN_FC_GET_TYPE(fc)) { case IEEE802_11_FTYPE_DATA: if ((fc & IEEE802_11_FCTL_FROMDS) && (fc & IEEE802_11_FCTL_TODS)) hdrlen = 30; /* Addr4 */ break; case IEEE802_11_FTYPE_CTL: switch (WLAN_FC_GET_STYPE(fc)) { case IEEE802_11_STYPE_CTS: case IEEE802_11_STYPE_ACK: hdrlen = 10; break; default: hdrlen = 16; break; } break; } return hdrlen;}/* ieee80211.c */extern struct ieee80211_device * ieee80211_r8180_alloc(struct net_device *dev, void *priv);extern void ieee80211_r8180_free(struct ieee80211_device *ieee);extern int ieee80211_set_encryption(struct ieee80211_device *ieee);extern void ieee80211_associate_step2(struct ieee80211_device *ieee);extern void ieee80211_associate_step1(struct ieee80211_device *ieee);extern void ieee80211_associate_complete(struct ieee80211_device *ieee);extern void ieee80211_associate_abort(struct ieee80211_device *ieee);extern void ieee80211_probe_hidden(struct ieee80211_device *ieee);void ieee80211_resp_to_auth(struct ieee80211_device *ieee, int s, u8* dest);void ieee80211_resp_to_assoc_rq(struct ieee80211_device *ieee, u8* dest);/* ieee80211_tx.c */#if 0extern struct ieee80211_txb *ieee80211_r8180_skb_to_txb(struct ieee80211_device *ieee, struct sk_buff *skb);extern void ieee80211_r8180_txb_free(struct ieee80211_txb *);extern struct ieee80211_txb *ieee80211_r8180_alloc_txb(int nr_frags, int txb_size, int gfp_mask);#endif/* ieee80211_rx.c */extern int ieee80211_r8180_rx(struct ieee80211_device *ieee, struct sk_buff *skb, struct ieee80211_rx_stats *rx_stats);/* iee80211_wx.c */extern int ieee80211_r8180_wx_set_encode(struct ieee80211_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *key);extern int ieee80211_r8180_wx_get_encode(struct ieee80211_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *key); /* iee80211_wx.c */extern int ieee80211_r8180_wx_get_scan(struct ieee80211_device *ieee,struct iw_request_info *a,union iwreq_data *wrqu,char *extra);extern int ieee80211_r8180_wx_get_essid(struct ieee80211_device *ieee, struct iw_request_info *a,union iwreq_data *wrqu,char *b);extern int ieee80211_r8180_wx_set_essid(struct ieee80211_device *ieee, struct iw_request_info *a,union iwreq_data *wrqu,char *b);extern int ieee80211_r8180_wx_get_rate(struct ieee80211_device *ieee, struct iw_request_info *a,union iwreq_data *wrqu,char *b);extern int ieee80211_r8180_wx_set_rate(struct ieee80211_device *ieee, struct iw_request_info *a,union iwreq_data *wrqu,char *b);extern void ieee80211_new_net(struct ieee80211_device *ieee, struct ieee80211_beacon *beacon);extern void ieee80211_r8180_set_master_essid(struct ieee80211_device *ieee, char* essid, int len);extern void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest);extern void ieee80211_r8180_stop_queue(struct ieee80211_device *ieee);extern void ieee80211_r8180_wake_queue(struct ieee80211_device *ieee);extern void ieee80211_r8180_reset_queue(struct ieee80211_device *ieee);extern int ieee80211_r8180_8023_hardstartxmit(struct sk_buff *skb, struct ieee80211_device *ieee);extern void ieee80211_r8180_flush_scan(struct ieee80211_device *ieee);extern int ieee80211_r8180_wx_set_wap(struct ieee80211_device *ieee, struct iw_request_info *info, union iwreq_data *awrq, char *extra);extern short is_associated(struct ieee80211_device *ieee,u8 *adr);extern short is_bridged(struct ieee80211_device *ieee,u8 *adr);extern short add_associate(struct ieee80211_device *ieee,u8 *adr);extern short add_bridged(struct ieee80211_device *ieee,u8 *adr);extern short is_broadcast(u8 *adr);extern short is_multicast(u8 *adr);#endif /* IEEE80211_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -