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.

119 lines
2.7 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: radpkt.h
  4. //
  5. // Synopsis: This file holds the declarations for the
  6. // RADIUS protocol specific structs and macros
  7. //
  8. //
  9. // History: 9/23/97 MKarki Created
  10. //
  11. // Copyright (C) 1997-98 Microsoft Corporation
  12. // All rights reserved.
  13. //
  14. //----------------------------------------------------------------
  15. #ifndef _RADPKT_H_
  16. #define _RADPKT_H_
  17. //
  18. // here are the values for the RADIUS packet codes
  19. //
  20. typedef enum _packettype_
  21. {
  22. ACCESS_REQUEST = 1,
  23. ACCESS_ACCEPT = 2,
  24. ACCESS_REJECT = 3,
  25. ACCOUNTING_REQUEST = 4,
  26. ACCOUNTING_RESPONSE = 5,
  27. ACCESS_CHALLENGE = 11
  28. } PACKETTYPE, *PPACKETTYPE;
  29. //
  30. // RADIUS attribute types
  31. //
  32. #define PROXY_STATE_ATTRIB 33
  33. #define USER_NAME_ATTRIB 1
  34. #define USER_PASSWORD_ATTRIB 2
  35. #define CHAP_PASSWORD_ATTRIB 3
  36. #define NAS_IP_ADDRESS_ATTRIB 4
  37. #define CLASS_ATTRIB 25
  38. #define NAS_IDENTIFIER_ATTRIB 32
  39. #define ACCT_STATUS_TYPE_ATTRIB 40
  40. #define ACCT_SESSION_ID_ATTRIB 44
  41. #define TUNNEL_PASSWORD_ATTRIB 69
  42. #define EAP_MESSAGE_ATTRIB 79
  43. #define SIGNATURE_ATTRIB 80
  44. //
  45. // these are the largest values that the attribute type
  46. // packet type have
  47. //
  48. #define MAX_ATTRIBUTE_TYPE 255
  49. #define MAX_PACKET_TYPE 11
  50. //
  51. // number of IAS attribute created by the
  52. // RADIUS protocol component
  53. // 1) IAS_ATTRIBUTE_CLIENT_IP_ADDRESS
  54. // 2) IAS_ATTRIBUTE_CLIENT_UDP_PORT
  55. // 3) IAS_ATTRIBUTE_CLIENT_PACKET_HEADER
  56. // 4) IAS_ATTRIBUTE_SHARED_SECRET
  57. // 5) IAS_ATTRIBUTE_CLIENT_VENDOR_TYPE
  58. // 6) IAS_ATTRIBUTE_CLIENT_NAME
  59. //
  60. #define COMPONENT_SPECIFIC_ATTRIBUTE_COUNT 6
  61. //
  62. // these are the related constants
  63. //
  64. #define MIN_PACKET_SIZE 20
  65. #define MAX_PACKET_SIZE 4096
  66. #define AUTHENTICATOR_SIZE 16
  67. #define SIGNATURE_SIZE 16
  68. #define MAX_PASSWORD_SIZE 253
  69. #define MAX_ATTRIBUTE_LENGTH 253
  70. #define MAX_VSA_ATTRIBUTE_LENGTH 247
  71. //
  72. // using BYTE alignment here
  73. //
  74. #pragma pack(push,1)
  75. //
  76. // here we define an ATTRIBUTE type
  77. // used to access the attribute fields of the RAIDUS packet
  78. //
  79. typedef struct _attribute_
  80. {
  81. BYTE byType;
  82. BYTE byLength;
  83. BYTE ValueStart[1];
  84. } ATTRIBUTE, *PATTRIBUTE;
  85. //
  86. // we define the RADIUSPACKET struct
  87. // for simpler access to the RADIUS packet
  88. //
  89. typedef struct _radiuspacket_
  90. {
  91. BYTE byCode;
  92. BYTE byIdentifier;
  93. WORD wLength;
  94. BYTE Authenticator[AUTHENTICATOR_SIZE];
  95. BYTE AttributeStart[1];
  96. } RADIUSPACKET, *PRADIUSPACKET;
  97. #pragma pack (pop)
  98. #define ATTRIBUTE_HEADER_SIZE 2 //byType + byLength
  99. #define PACKET_HEADER_SIZE 20 // byCode+byIdentifier+wLength+Authenticator
  100. #endif // ifndef _RADPKT_H_