hostapd_defs.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #ifndef HOSTAPD_DEFS_H
  16. #define HOSTAPD_DEFS_H
  17. #ifndef ETH_ALEN
  18. #define ETH_ALEN 6
  19. #endif
  20. #ifndef IFNAMSIZ
  21. #define IFNAMSIZ 16
  22. #endif
  23. #ifndef ETH_P_ALL
  24. #define ETH_P_ALL 0x0003
  25. #endif
  26. #ifndef ETH_P_PAE
  27. #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
  28. #endif /* ETH_P_PAE */
  29. #ifndef ETH_P_EAPOL
  30. #define ETH_P_EAPOL ETH_P_PAE
  31. #endif /* ETH_P_EAPOL */
  32. #ifndef ETH_P_RRB
  33. #define ETH_P_RRB 0x890D
  34. #endif /* ETH_P_RRB */
  35. #ifdef _MSC_VER
  36. #pragma pack(push, 1)
  37. #endif /* _MSC_VER */
  38. #define MAX_VLAN_ID 4094
  39. struct ieee8023_hdr {
  40. u8 dest[6];
  41. u8 src[6];
  42. u16 ethertype;
  43. } STRUCT_PACKED;
  44. struct ieee80211_hdr {
  45. le16 frame_control;
  46. le16 duration_id;
  47. u8 addr1[6];
  48. u8 addr2[6];
  49. u8 addr3[6];
  50. le16 seq_ctrl;
  51. /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
  52. */
  53. } STRUCT_PACKED;
  54. #ifdef _MSC_VER
  55. #pragma pack(pop)
  56. #endif /* _MSC_VER */
  57. #define IEEE80211_DA_FROMDS addr1
  58. #define IEEE80211_BSSID_FROMDS addr2
  59. #define IEEE80211_SA_FROMDS addr3
  60. #define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
  61. #define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
  62. /* MTU to be set for the wlan#ap device; this is mainly needed for IEEE 802.1X
  63. * frames that might be longer than normal default MTU and they are not
  64. * fragmented */
  65. #define HOSTAPD_MTU 2290
  66. #endif /* HOSTAPD_DEFS_H */