nl80211: Replace hostapd WEXT events with nl80211 events
[wpasupplicant] / hostapd / hostapd_defs.h
1 /*
2  * hostapd / Initialization and configuration
3  * Host AP kernel driver
4  * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * Alternatively, this software may be distributed under the terms of BSD
11  * license.
12  *
13  * See README and COPYING for more details.
14  */
15
16 #ifndef HOSTAPD_DEFS_H
17 #define HOSTAPD_DEFS_H
18
19 #ifndef ETH_ALEN
20 #define ETH_ALEN 6
21 #endif
22 #ifndef IFNAMSIZ
23 #define IFNAMSIZ 16
24 #endif
25 #ifndef ETH_P_ALL
26 #define ETH_P_ALL 0x0003
27 #endif
28 #ifndef ETH_P_PAE
29 #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
30 #endif /* ETH_P_PAE */
31 #ifndef ETH_P_EAPOL
32 #define ETH_P_EAPOL ETH_P_PAE
33 #endif /* ETH_P_EAPOL */
34
35 #ifndef ETH_P_RRB
36 #define ETH_P_RRB 0x890D
37 #endif /* ETH_P_RRB */
38
39 #ifdef _MSC_VER
40 #pragma pack(push, 1)
41 #endif /* _MSC_VER */
42
43 #define MAX_VLAN_ID 4094
44
45 struct ieee8023_hdr {
46         u8 dest[6];
47         u8 src[6];
48         u16 ethertype;
49 } STRUCT_PACKED;
50
51
52 struct ieee80211_hdr {
53         le16 frame_control;
54         le16 duration_id;
55         u8 addr1[6];
56         u8 addr2[6];
57         u8 addr3[6];
58         le16 seq_ctrl;
59         /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
60          */
61 } STRUCT_PACKED;
62
63 #ifdef _MSC_VER
64 #pragma pack(pop)
65 #endif /* _MSC_VER */
66
67 #define IEEE80211_DA_FROMDS addr1
68 #define IEEE80211_BSSID_FROMDS addr2
69 #define IEEE80211_SA_FROMDS addr3
70
71 #define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
72
73 #define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
74
75 /* MTU to be set for the wlan#ap device; this is mainly needed for IEEE 802.1X
76  * frames that might be longer than normal default MTU and they are not
77  * fragmented */
78 #define HOSTAPD_MTU 2290
79
80 #endif /* HOSTAPD_DEFS_H */