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.

261 lines
8.4 KiB

  1. /*/////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // authif.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares the interface for extensions to the Internet Authentication
  12. // Service.
  13. //
  14. // MODIFICATION HISTORY
  15. //
  16. // 09/28/1998 Original version.
  17. //
  18. /////////////////////////////////////////////////////////////////////////////*/
  19. #ifndef _AUTHIF_H_
  20. #define _AUTHIF_H_
  21. #if _MSC_VER >= 1000
  22. #pragma once
  23. #endif
  24. /*
  25. * Enumerates the attribute types that are passed to the extension DLL. The
  26. * RADIUS standard attributes are included for convenience and should not be
  27. * considered exhaustive.
  28. */
  29. typedef enum _RADIUS_ATTRIBUTE_TYPE {
  30. /* Used to terminate attribute arrays. */
  31. ratMinimum = 0,
  32. /* RADIUS standard attributes. */
  33. ratUserName = 1,
  34. ratUserPassword = 2,
  35. ratCHAPPassword = 3,
  36. ratNASIPAddress = 4,
  37. ratNASPort = 5,
  38. ratServiceType = 6,
  39. ratFramedProtocol = 7,
  40. ratFramedIPAddress = 8,
  41. ratFramedIPNetmask = 9,
  42. ratFramedRouting = 10,
  43. ratFilterId = 11,
  44. ratFramedMTU = 12,
  45. ratFramedCompression = 13,
  46. ratLoginIPHost = 14,
  47. ratLoginService = 15,
  48. ratLoginPort = 16,
  49. ratReplyMessage = 18,
  50. ratCallbackNumber = 19,
  51. ratCallbackId = 20,
  52. ratFramedRoute = 22,
  53. ratFramedIPXNetwork = 23,
  54. ratState = 24,
  55. ratClass = 25,
  56. ratVendorSpecific = 26,
  57. ratSessionTimeout = 27,
  58. ratIdleTimeout = 28,
  59. ratTerminationAction = 29,
  60. ratCalledStationId = 30,
  61. ratCallingStationId = 31,
  62. ratNASIdentifier = 32,
  63. ratProxyState = 33,
  64. ratLoginLATService = 34,
  65. ratLoginLATNode = 35,
  66. ratLoginLATGroup = 36,
  67. ratFramedAppleTalkLink = 37,
  68. ratFramedAppleTalkNetwork = 38,
  69. ratFramedAppleTalkZone = 39,
  70. ratAcctStatusType = 40,
  71. ratAcctDelayTime = 41,
  72. ratAcctInputOctets = 42,
  73. ratAcctOutputOctets = 43,
  74. ratAcctSessionId = 44,
  75. ratAcctAuthentic = 45,
  76. ratAcctSessionTime = 46,
  77. ratAcctInputPackets = 47,
  78. ratAcctOutputPackets = 48,
  79. ratAcctTerminationCause = 49,
  80. ratCHAPChallenge = 60,
  81. ratNASPortType = 61,
  82. ratPortLimit = 62,
  83. /* Extended attribute types used to pass additional information. */
  84. ratCode = 262, /* Request type code. */
  85. ratIdentifier = 263, /* Request identifier. */
  86. ratAuthenticator = 264, /* Request authenticator. */
  87. ratSrcIPAddress = 265, /* Source IP address. */
  88. ratSrcPort = 266, /* Source IP port. */
  89. ratProvider = 267, /* Authentication provider. */
  90. ratStrippedUserName = 268, /* User-Name with realm stripped. */
  91. ratFQUserName = 269, /* Fully-Qualified-User-Name. */
  92. ratPolicyName = 270 /* Remote Access Policy name. */
  93. } RADIUS_ATTRIBUTE_TYPE;
  94. /*
  95. * Enumerates the different authentication providers used for processing a
  96. * request. Used for the ratProvider extended attribute.
  97. */
  98. typedef enum _RADIUS_AUTHENTICATION_PROVIDER {
  99. rapUnknown,
  100. rapUsersFile,
  101. rapProxy,
  102. rapWindowsNT,
  103. rapMCIS,
  104. rapODBC,
  105. rapNone
  106. } RADIUS_AUTHENTICATION_PROVIDER;
  107. /*
  108. * Enumerates the different RADIUS data types. A type of 'rdtUnknown' means
  109. * the attribute was not recognized by the dictionary.
  110. */
  111. typedef enum _RADIUS_DATA_TYPE {
  112. rdtUnknown,
  113. rdtString,
  114. rdtAddress,
  115. rdtInteger,
  116. rdtTime
  117. } RADIUS_DATA_TYPE;
  118. /*
  119. * Struct representing a RADIUS or extended attribute.
  120. */
  121. typedef struct _RADIUS_ATTRIBUTE {
  122. DWORD dwAttrType; /* Attribute type */
  123. RADIUS_DATA_TYPE fDataType; /* RADIUS_DATA_TYPE of the value */
  124. DWORD cbDataLength; /* Length of the value (in bytes) */
  125. union {
  126. DWORD dwValue; /* For rdtAddress, rdtInteger, and rdtTime */
  127. PCSTR lpValue; /* For rdtUnknown, and rdtString */
  128. };
  129. } RADIUS_ATTRIBUTE, *PRADIUS_ATTRIBUTE;
  130. /*
  131. * Enumerates the different actions an extension DLL can generate in
  132. * response to an Access-Request.
  133. */
  134. typedef enum _RADIUS_ACTION {
  135. raContinue,
  136. raReject,
  137. raAccept
  138. } RADIUS_ACTION, *PRADIUS_ACTION;
  139. /*
  140. * Routines exported by a RADIUS extension DLL.
  141. */
  142. /*
  143. * RadiusExtensionInit is optional. If it exists, it will be invoked prior to
  144. * the service coming on-line. A return value other than NO_ERROR prevents the
  145. * service from initializing.
  146. */
  147. #define RADIUS_EXTENSION_INIT "RadiusExtensionInit"
  148. typedef DWORD (WINAPI *PRADIUS_EXTENSION_INIT)( VOID );
  149. /*
  150. * RadiusExtensionTerm is optional. If it exists, it will be invoked prior to
  151. * unloading the DLL to give the extension a chance to clean-up.
  152. */
  153. #define RADIUS_EXTENSION_TERM "RadiusExtensionTerm"
  154. typedef VOID (WINAPI *PRADIUS_EXTENSION_TERM)( VOID );
  155. /*
  156. * RadiusExtensionProcess is mandatory for NT4. For Windows 2000, an
  157. * extension may export RadiusExtensionProcessEx (q.v.) instead.
  158. *
  159. * Parameters:
  160. * pAttrs Array of attributes from the request. It is terminated by an
  161. * attribute with dwAttrType set to ratMinimum. These attributes
  162. * should be treated as read-only and must not be referenced
  163. * after the function returns.
  164. * pfAction For Access-Requests, this parameter will be non-NULL with
  165. * *pfAction == raContinue. The extension DLL can set *pfAction
  166. * to abort further processing and force an Access-Accept or
  167. * Access-Reject. For all other request types, this parameter
  168. * will be NULL.
  169. *
  170. * Return Value:
  171. * A return value other than NO_ERROR causes the request to be discarded.
  172. */
  173. #define RADIUS_EXTENSION_PROCESS "RadiusExtensionProcess"
  174. typedef DWORD (WINAPI *PRADIUS_EXTENSION_PROCESS)(
  175. IN CONST RADIUS_ATTRIBUTE *pAttrs,
  176. OUT OPTIONAL PRADIUS_ACTION pfAction
  177. );
  178. /*
  179. * RadiusExtensionProcessEx is only supported on Windows 2000. If it exits,
  180. * RadiusExtensionProcess is ignored.
  181. *
  182. * Parameters:
  183. * pInAttrs Array of attributes from the request. It is terminated by an
  184. * attribute with dwAttrType set to ratMinimum. These attributes
  185. * should be treated as read-only and must not be referenced
  186. * after the function returns.
  187. * pOutAttrs Array of attributes to add to the response. It is terminated
  188. * by an attribute with dwAttrType set to ratMinimum.
  189. * *pOutAttrs may be set to NULL if no attributes are returned.
  190. * pfAction For Access-Requests, this parameter will be non-NULL with
  191. * *pfAction == raContinue. The extension DLL can set *pfAction
  192. * to abort further processing and force an Access-Accept or
  193. * Access-Reject. For all other request types, this parameter
  194. * will be NULL.
  195. *
  196. * Return Value:
  197. * A return value other than NO_ERROR causes the request to be discarded.
  198. */
  199. #define RADIUS_EXTENSION_PROCESS_EX "RadiusExtensionProcessEx"
  200. typedef DWORD (WINAPI *PRADIUS_EXTENSION_PROCESS_EX)(
  201. IN CONST RADIUS_ATTRIBUTE *pInAttrs,
  202. OUT PRADIUS_ATTRIBUTE *pOutAttrs,
  203. OUT OPTIONAL PRADIUS_ACTION pfAction
  204. );
  205. /*
  206. * RadiusExtensionFreeAttributes must be defined if RadiusExtensionProcessEx
  207. * is defined. It is used to free the attributes returned by
  208. * RadiusExtensionProcessEx
  209. *
  210. * Parameters:
  211. * pAttrs Array of attributes to be freed.
  212. */
  213. #define RADIUS_EXTENSION_FREE_ATTRIBUTES "RadiusExtensionFreeAttributes"
  214. typedef VOID (WINAPI *PRADIUS_EXTENSION_FREE_ATTRIBUTES)(
  215. IN PRADIUS_ATTRIBUTE pAttrs
  216. );
  217. /*
  218. * Defines used for installation of an extension DLL.
  219. * The following registry values are used for loading extensions:
  220. *
  221. * HKLM\System\CurrentControlSet\Services\AuthSrv\Parameters
  222. * ExtensionDLLs (REG_MULTI_SZ) <list of DLL paths>
  223. * AuthorizationDLLs (REG_MULTI_SZ) <list of DLL paths>
  224. *
  225. * ExtensionDLLs are invoked before any of the built-in authentication
  226. * providers. They receive all the attributes from the request plus all
  227. * the extended attribute types.
  228. *
  229. * AuthorizationDLLs are invoked after the built-in authentication and
  230. * authorization providers. They receive all the attributes from the
  231. * response plus all the extended attributes types. AuthorizationDLLs may
  232. * not return an action of raAccept.
  233. */
  234. #define AUTHSRV_PARAMETERS_KEY_W \
  235. L"System\\CurrentControlSet\\Services\\AuthSrv\\Parameters"
  236. #define AUTHSRV_EXTENSIONS_VALUE_W \
  237. L"ExtensionDLLs"
  238. #define AUTHSRV_AUTHORIZATION_VALUE_W \
  239. L"AuthorizationDLLs"
  240. #endif /* _AUTHIF_H_ */