eap_defs.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * EAP server/peer: Shared EAP definitions
  3. * Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Alternatively, this software may be distributed under the terms of BSD
  10. * license.
  11. *
  12. * See README and COPYING for more details.
  13. */
  14. #ifndef EAP_DEFS_H
  15. #define EAP_DEFS_H
  16. /* RFC 3748 - Extensible Authentication Protocol (EAP) */
  17. #ifdef _MSC_VER
  18. #pragma pack(push, 1)
  19. #endif /* _MSC_VER */
  20. struct eap_hdr {
  21. u8 code;
  22. u8 identifier;
  23. be16 length; /* including code and identifier; network byte order */
  24. /* followed by length-4 octets of data */
  25. } STRUCT_PACKED;
  26. #ifdef _MSC_VER
  27. #pragma pack(pop)
  28. #endif /* _MSC_VER */
  29. enum { EAP_CODE_REQUEST = 1, EAP_CODE_RESPONSE = 2, EAP_CODE_SUCCESS = 3,
  30. EAP_CODE_FAILURE = 4 };
  31. /* EAP Request and Response data begins with one octet Type. Success and
  32. * Failure do not have additional data. */
  33. /*
  34. * EAP Method Types as allocated by IANA:
  35. * http://www.iana.org/assignments/eap-numbers
  36. */
  37. typedef enum {
  38. EAP_TYPE_NONE = 0,
  39. EAP_TYPE_IDENTITY = 1 /* RFC 3748 */,
  40. EAP_TYPE_NOTIFICATION = 2 /* RFC 3748 */,
  41. EAP_TYPE_NAK = 3 /* Response only, RFC 3748 */,
  42. EAP_TYPE_MD5 = 4, /* RFC 3748 */
  43. EAP_TYPE_OTP = 5 /* RFC 3748 */,
  44. EAP_TYPE_GTC = 6, /* RFC 3748 */
  45. EAP_TYPE_TLS = 13 /* RFC 2716 */,
  46. EAP_TYPE_LEAP = 17 /* Cisco proprietary */,
  47. EAP_TYPE_SIM = 18 /* RFC 4186 */,
  48. EAP_TYPE_TTLS = 21 /* RFC 5281 */,
  49. EAP_TYPE_AKA = 23 /* RFC 4187 */,
  50. EAP_TYPE_PEAP = 25 /* draft-josefsson-pppext-eap-tls-eap-06.txt */,
  51. EAP_TYPE_MSCHAPV2 = 26 /* draft-kamath-pppext-eap-mschapv2-00.txt */,
  52. EAP_TYPE_TLV = 33 /* draft-josefsson-pppext-eap-tls-eap-07.txt */,
  53. EAP_TYPE_TNC = 38 /* TNC IF-T v1.0-r3; note: tentative assignment;
  54. * type 38 has previously been allocated for
  55. * EAP-HTTP Digest, (funk.com) */,
  56. EAP_TYPE_FAST = 43 /* RFC 4851 */,
  57. EAP_TYPE_PAX = 46 /* RFC 4746 */,
  58. EAP_TYPE_PSK = 47 /* RFC 4764 */,
  59. EAP_TYPE_SAKE = 48 /* RFC 4763 */,
  60. EAP_TYPE_IKEV2 = 49 /* RFC 5106 */,
  61. EAP_TYPE_AKA_PRIME = 50 /* draft-arkko-eap-aka-kdf-10.txt */,
  62. EAP_TYPE_GPSK = 51 /* RFC 5433 */,
  63. EAP_TYPE_EXPANDED = 254 /* RFC 3748 */
  64. } EapType;
  65. /* SMI Network Management Private Enterprise Code for vendor specific types */
  66. enum {
  67. EAP_VENDOR_IETF = 0,
  68. EAP_VENDOR_MICROSOFT = 0x000137 /* Microsoft */,
  69. EAP_VENDOR_WFA = 0x00372A /* Wi-Fi Alliance */
  70. };
  71. #define EAP_MSK_LEN 64
  72. #define EAP_EMSK_LEN 64
  73. #endif /* EAP_DEFS_H */