14 #define ETH_P_ALL 0x0003
17 #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
18 #endif /* ETH_P_PAE */
21 #define BIT(x) (1 << (x))
25 #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
26 #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
35 } __attribute__ ((packed
));
38 struct ieee80211_hdr
{
45 /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
47 } __attribute__ ((packed
));
49 #define IEEE80211_DA_FROMDS addr1
50 #define IEEE80211_BSSID_FROMDS addr2
51 #define IEEE80211_SA_FROMDS addr3
53 #define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
55 #define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
57 /* MTU to be set for the wlan#ap device; this is mainly needed for IEEE 802.1X
58 * frames that might be longer than normal default MTU and they are not
60 #define HOSTAPD_MTU 2290
62 extern unsigned char rfc1042_header
[6];
64 typedef struct hostapd_data hostapd
;
66 struct hostap_sta_driver_data
{
67 unsigned long rx_packets
, tx_packets
, rx_bytes
, tx_bytes
;
72 struct radius_server_data
;
75 struct hostapd_config
*conf
;
80 int num_sta
; /* number of entries in sta_list */
81 struct sta_info
*sta_list
; /* STA info list head */
82 struct sta_info
*sta_hash
[STA_HASH_SIZE
];
84 /* pointers to STA info; based on allocated AID or NULL if AID free
85 * AID is in the range 1-2007, so sta_aid[0] corresponders to AID 1
88 struct sta_info
*sta_aid
[MAX_AID_TABLE_SIZE
];
90 struct driver_ops
*driver
;
93 u8 default_wep_key_idx
;
95 struct radius_client_data
*radius
;
96 u32 acct_session_id_hi
, acct_session_id_lo
;
98 struct iapp_data
*iapp
;
100 enum { DO_NOT_ASSOC
= 0, WAIT_BEACON
, AUTHENTICATE
, ASSOCIATE
,
101 ASSOCIATED
} assoc_ap_state
;
102 char assoc_ap_ssid
[33];
103 int assoc_ap_ssid_len
;
106 struct hostapd_cached_radius_acl
*acl_cache
;
107 struct hostapd_acl_query_data
*acl_queries
;
111 struct wpa_authenticator
*wpa_auth
;
113 #define PMKID_HASH_SIZE 128
114 #define PMKID_HASH(pmkid) (unsigned int) ((pmkid)[0] & 0x7f)
115 struct rsn_pmksa_cache
*pmkid
[PMKID_HASH_SIZE
];
116 struct rsn_pmksa_cache
*pmksa
;
119 struct rsn_preauth_interface
*preauth_iface
;
120 time_t michael_mic_failure
;
121 int michael_mic_failures
;
122 int tkip_countermeasures
;
125 struct wpa_ctrl_dst
*ctrl_dst
;
128 void *eap_sim_db_priv
;
129 struct radius_server_data
*radius_srv
;
132 void hostapd_new_assoc_sta(hostapd
*hapd
, struct sta_info
*sta
, int reassoc
);
133 void hostapd_logger(struct hostapd_data
*hapd
, const u8
*addr
,
134 unsigned int module
, int level
, const char *fmt
,
135 ...) __attribute__ ((format (printf
, 5, 6)));
138 #define HOSTAPD_DEBUG(level, args...) \
140 if (hapd->conf == NULL || hapd->conf->debug >= (level)) \
144 #define HOSTAPD_DEBUG_COND(level) (hapd->conf->debug >= (level))
146 const char * hostapd_ip_txt(const struct hostapd_ip_addr
*addr
, char *buf
,
149 #endif /* HOSTAPD_H */