Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

196 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 1999, Microsoft Corporation
  3. Module Name:
  4. elprotocol.h
  5. Abstract:
  6. This module contains definitions and declarations related to EAPOL
  7. protocol
  8. Revision History:
  9. sachins, Apr 30 2000, Created
  10. --*/
  11. #ifndef _EAPOL_PROTOCOL_H_
  12. #define _EAPOL_PROTOCOL_H_
  13. //
  14. // EAPOL packet types
  15. //
  16. typedef enum _EAPOL_PACKET_TYPE
  17. {
  18. EAP_Packet = 0,
  19. EAPOL_Start,
  20. EAPOL_Logoff,
  21. EAPOL_Key
  22. } EAPOL_PACKET_TYPE;
  23. //
  24. // Authorization Result Code
  25. //
  26. typedef enum _AUTH_RESULT_CODE
  27. {
  28. AUTH_Continuing = 0,
  29. AUTH_Authorized,
  30. AUTH_Unauthorized,
  31. AUTH_Unknown
  32. } AUTH_RESULT_CODE;
  33. //
  34. // Structure: EAPOL_PACKET
  35. //
  36. typedef struct _EAPOL_PACKET
  37. {
  38. BYTE EthernetType[2];
  39. BYTE ProtocolVersion;
  40. BYTE PacketType;
  41. BYTE PacketBodyLength[2];
  42. BYTE PacketBody[1];
  43. } EAPOL_PACKET, *PEAPOL_PACKET;
  44. typedef struct _EAPOL_PACKET_D8
  45. {
  46. BYTE EthernetType[2];
  47. BYTE ProtocolVersion;
  48. BYTE PacketType;
  49. BYTE AuthResultCode[2];
  50. BYTE PacketBodyLength[2];
  51. BYTE PacketBody[1];
  52. } EAPOL_PACKET_D8, *PEAPOL_PACKET_D8;
  53. typedef struct _EAPOL_PACKET_D8_D7
  54. {
  55. BYTE AuthResultCode[2];
  56. BYTE EthernetType[2];
  57. BYTE ProtocolVersion;
  58. BYTE PacketType;
  59. BYTE PacketBodyLength[2];
  60. BYTE PacketBody[1];
  61. } EAPOL_PACKET_D8_D7, *PEAPOL_PACKET_D8_D7;
  62. //
  63. // Structure: EAPOL_KEY_PACKET
  64. //
  65. typedef struct _EAPOL_KEY_DESCRIPTOR
  66. {
  67. BYTE SignatureType;
  68. BYTE EncryptType;
  69. BYTE KeyLength[2];
  70. BYTE ReplayCounter[8];
  71. BYTE Key_IV[16];
  72. BYTE KeyIndex;
  73. BYTE KeySignature[16];
  74. BYTE Key[1];
  75. } EAPOL_KEY_DESC, *PEAPOL_KEY_DESC;
  76. typedef struct _EAPOL_KEY_DESCRIPTOR_D8
  77. {
  78. BYTE DescriptorType;
  79. BYTE KeyLength[2];
  80. BYTE ReplayCounter[8];
  81. BYTE Key_IV[16];
  82. BYTE KeyIndex;
  83. BYTE KeySignature[16];
  84. BYTE Key[1];
  85. } EAPOL_KEY_DESC_D8, *PEAPOL_KEY_DESC_D8;
  86. //
  87. // CONSTANTS
  88. //
  89. #define MAX_EAPOL_PACKET_TYPE EAPOL_Key
  90. //
  91. // FUNCTION DECLARATIONS
  92. //
  93. VOID
  94. ElProcessReceivedPacket (
  95. IN PVOID pvContext
  96. );
  97. DWORD
  98. FSMDisconnected (
  99. IN EAPOL_PCB *pPCB
  100. );
  101. DWORD
  102. FSMLogoff (
  103. IN EAPOL_PCB *pPCB
  104. );
  105. DWORD
  106. FSMConnecting (
  107. IN EAPOL_PCB *pPCB
  108. );
  109. DWORD
  110. FSMAcquired (
  111. IN EAPOL_PCB *pPCB,
  112. IN EAPOL_PACKET *pEapolPkt
  113. );
  114. DWORD
  115. FSMAuthenticating (
  116. IN EAPOL_PCB *pPCB,
  117. IN EAPOL_PACKET *pEapolPkt
  118. );
  119. DWORD
  120. FSMHeld (
  121. IN EAPOL_PCB *pPCB
  122. );
  123. DWORD
  124. FSMAuthenticated (
  125. IN EAPOL_PCB *pPCB,
  126. IN EAPOL_PACKET *pEapolPkt
  127. );
  128. DWORD
  129. FSMRxKey (
  130. IN EAPOL_PCB *pPCB,
  131. IN EAPOL_PACKET *pEapolPkt
  132. );
  133. VOID
  134. ElTimeoutCallbackRoutine (
  135. IN PVOID pvContext,
  136. IN BOOLEAN fTimerOfWaitFired
  137. );
  138. DWORD
  139. ElEapWork (
  140. IN EAPOL_PCB *pPCB,
  141. IN PPP_EAP_PACKET *pRecvPkt
  142. );
  143. DWORD
  144. ElExtractMPPESendRecvKeys (
  145. IN EAPOL_PCB *pPCB,
  146. IN RAS_AUTH_ATTRIBUTE *pUserAttributes,
  147. IN BYTE *pChallenge,
  148. IN BYTE *pResponse
  149. );
  150. DWORD
  151. ElProcessEapSuccess (
  152. IN EAPOL_PCB *pPCB,
  153. IN EAPOL_PACKET *pEapolPkt
  154. );
  155. DWORD
  156. ElProcessEapFail (
  157. IN EAPOL_PCB *pPCB,
  158. IN EAPOL_PACKET *pEapolPkt
  159. );
  160. #endif // _EAPOL_PROTOCOL_H_