14 #define ETH_P_ALL 0x0003
17 #include "hostap_common.h"
24 } __attribute__ ((packed));
27 struct ieee80211_hdr {
34 /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
36 } __attribute__ ((packed));
38 #define IEEE80211_DA_FROMDS addr1
39 #define IEEE80211_BSSID_FROMDS addr2
40 #define IEEE80211_SA_FROMDS addr3
42 #define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
44 #define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
46 /* MTU to be set for the wlan#ap device; this is mainly needed for IEEE 802.1X
47 * frames that might be longer than normal default MTU and they are not
49 #define HOSTAPD_MTU 2290
51 extern unsigned char rfc1042_header[6];
53 typedef struct hostapd_data hostapd;
55 struct hostap_sta_driver_data {
56 unsigned long rx_packets, tx_packets, rx_bytes, tx_bytes;
61 struct radius_server_data;
64 struct hostapd_config *conf;
69 int num_sta; /* number of entries in sta_list */
70 struct sta_info *sta_list; /* STA info list head */
71 struct sta_info *sta_hash[STA_HASH_SIZE];
73 /* pointers to STA info; based on allocated AID or NULL if AID free
74 * AID is in the range 1-2007, so sta_aid[0] corresponders to AID 1
77 struct sta_info *sta_aid[MAX_AID_TABLE_SIZE];
79 struct driver_ops *driver;
82 u8 default_wep_key_idx;
84 struct radius_client_data *radius;
85 u32 acct_session_id_hi, acct_session_id_lo;
87 struct iapp_data *iapp;
89 enum { DO_NOT_ASSOC = 0, WAIT_BEACON, AUTHENTICATE, ASSOCIATE,
90 ASSOCIATED } assoc_ap_state;
91 char assoc_ap_ssid[33];
92 int assoc_ap_ssid_len;
95 struct hostapd_cached_radius_acl *acl_cache;
96 struct hostapd_acl_query_data *acl_queries;
100 struct wpa_authenticator *wpa_auth;
102 #define PMKID_HASH_SIZE 128
103 #define PMKID_HASH(pmkid) (unsigned int) ((pmkid)[0] & 0x7f)
104 struct rsn_pmksa_cache *pmkid[PMKID_HASH_SIZE];
105 struct rsn_pmksa_cache *pmksa;
108 struct rsn_preauth_interface *preauth_iface;
109 time_t michael_mic_failure;
110 int michael_mic_failures;
111 int tkip_countermeasures;
114 struct wpa_ctrl_dst *ctrl_dst;
117 void *eap_sim_db_priv;
118 struct radius_server_data *radius_srv;
121 void hostapd_new_assoc_sta(hostapd *hapd, struct sta_info *sta);
122 void hostapd_logger(hostapd *hapd, u8 *addr, unsigned int module, int level,
123 char *fmt, ...) __attribute__ ((format (printf, 5, 6)));
126 #define HOSTAPD_DEBUG(level, args...) \
128 if (hapd->conf == NULL || hapd->conf->debug >= (level)) \
132 #define HOSTAPD_DEBUG_COND(level) (hapd->conf->debug >= (level))
134 #endif /* HOSTAPD_H */