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.

323 lines
7.8 KiB

  1. /*****************************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright (C) Microsoft Corp., 1992-1993 **/
  4. /*****************************************************************************/
  5. //***
  6. // File Name:
  7. // SRVAUTH.H
  8. //
  9. // Function:
  10. // Contains header information for Supervisor and Server
  11. // Authentication Transport module
  12. //
  13. // History:
  14. // 05/18/92 - Michael Salamone (MikeSa) - Original Version 1.0
  15. //***
  16. #ifndef _SRVAUTH_
  17. #define _SRVAUTH_
  18. /* This flag enables the NT31/WFW311 RAS compression support re-added for the
  19. ** NT-PPC release.
  20. */
  21. #define RASCOMPRESSION 1
  22. #include <lmcons.h>
  23. #include <rasman.h>
  24. #ifndef MAX_PHONE_NUMBER_LEN
  25. #define MAX_PHONE_NUMBER_LEN 48
  26. #endif
  27. #ifndef MAX_INIT_NAMES
  28. #define MAX_INIT_NAMES 16
  29. #endif
  30. //
  31. // Used for establishing session with remote netbios clients
  32. //
  33. #define AUTH_NETBIOS_NAME "DIALIN_GATEWAY "
  34. //
  35. // Used for passing NetBIOS projection info to Supervisor
  36. //
  37. typedef struct _NAME_STRUCT
  38. {
  39. BYTE NBName[NETBIOS_NAME_LEN]; // NetBIOS name
  40. WORD wType; // GROUP, UNIQUE, COMPUTER
  41. } NAME_STRUCT, *PNAME_STRUCT;
  42. //
  43. // Manifests used to find location and type of name in the buffer returned
  44. // by the NCB.STATUS call
  45. //
  46. #define NCB_GROUP_NAME 0x0080
  47. #define UNIQUE_INAME 0x0001
  48. #define GROUP_INAME 0x0002
  49. #define COMPUTER_INAME 0x0004 // A computer name is also unique
  50. //
  51. // Projection result codes. If not success, then the reason code
  52. // (below) should be examined. These values are used in wResult
  53. // field in structs define below.
  54. //
  55. #define AUTH_PROJECTION_SUCCESS 0
  56. #define AUTH_PROJECTION_FAILURE 1
  57. //
  58. // Projection reason codes.
  59. //
  60. #define FATAL_ERROR 0x80000000
  61. #define AUTH_DUPLICATE_NAME (FATAL_ERROR | 0x00000001)
  62. #define AUTH_OUT_OF_RESOURCES (FATAL_ERROR | 0x00000002)
  63. #define AUTH_STACK_NAME_TABLE_FULL (FATAL_ERROR | 0x00000003)
  64. #define AUTH_MESSENGER_NAME_NOT_ADDED 0x00000004
  65. #define AUTH_CANT_ALLOC_ROUTE (FATAL_ERROR | 0x00000005)
  66. #define AUTH_LAN_ADAPTER_FAILURE (FATAL_ERROR | 0x00000006)
  67. //
  68. // Projection result info must be copied into this structure.
  69. //
  70. typedef struct _IP_PROJECTION_RESULT
  71. {
  72. DWORD Result;
  73. DWORD Reason;
  74. } IP_PROJECTION_RESULT, *PIP_PROJECTION_RESULT;
  75. typedef struct _IPX_PROJECTION_RESULT
  76. {
  77. DWORD Result;
  78. DWORD Reason;
  79. } IPX_PROJECTION_RESULT, *PIPX_PROJECTION_RESULT;
  80. typedef struct _NETBIOS_PROJECTION_RESULT
  81. {
  82. DWORD Result;
  83. DWORD Reason;
  84. char achName[NETBIOS_NAME_LEN];
  85. } NETBIOS_PROJECTION_RESULT, *PNETBIOS_PROJECTION_RESULT;
  86. typedef struct _AUTH_PROJECTION_RESULT
  87. {
  88. IP_PROJECTION_RESULT IpResult;
  89. IPX_PROJECTION_RESULT IpxResult;
  90. NETBIOS_PROJECTION_RESULT NetbiosResult;
  91. } AUTH_PROJECTION_RESULT, *PAUTH_PROJECTION_RESULT;
  92. //
  93. // The Supervisor will supply this structure to the Auth Xport (in
  94. // the AuthStart API) so it knows what transport, as well as any
  95. // necessary info for that transport, to use for authenticating on
  96. // the given port.
  97. //
  98. typedef struct _AUTH_XPORT_INFO
  99. {
  100. RAS_PROTOCOLTYPE Protocol;
  101. BYTE bLana; // Only valid if Protocol == ASYBEUI
  102. } AUTH_XPORT_INFO, *PAUTH_XPORT_INFO;
  103. #ifndef _CLAUTH_
  104. typedef WORD (*MSG_ROUTINE)(WORD, PVOID);
  105. //
  106. // Used to initialize the Auth Xport module
  107. //
  108. DWORD
  109. AuthInitialize(
  110. IN HPORT *phPorts, // pointer to array of port handles
  111. IN WORD cPorts, // number of port handles in array
  112. IN WORD cRetries, // number of retries clients will get if initial
  113. // authentication attemps fails
  114. IN MSG_ROUTINE MsgSend,
  115. IN DWORD dwLocalIpAddress,
  116. IN LPVOID lpfnRasAuthProviderAuthenticateUser,
  117. IN LPVOID lpfnRasAuthProviderFreeAttributes,
  118. IN LPVOID lpfnRasAcctProviderStartAccounting,
  119. IN LPVOID lpfnRasAcctProviderInterimAccounting,
  120. IN LPVOID lpfnRasAcctProviderStopAccounting,
  121. IN LPVOID lpfnRasAcctProviderFreeAttributes,
  122. IN LPVOID GetNextAccountingSessionId
  123. );
  124. //
  125. // Returned by AuthInitialize
  126. //
  127. #define AUTH_INIT_SUCCESS 0
  128. #define AUTH_INIT_FAILURE 1
  129. //
  130. // Used by Supervisor to tell Auth Xport module that it has completed its
  131. // callback request.
  132. //
  133. VOID AuthCallbackDone(
  134. IN HPORT hPort
  135. );
  136. //
  137. // Used by Supervisor to tell Auth Xport module that it has completed its
  138. // projection request.
  139. //
  140. VOID AuthProjectionDone(
  141. IN HPORT hPort,
  142. IN PAUTH_PROJECTION_RESULT
  143. );
  144. //
  145. // Returned by AuthRecognizeFrame
  146. //
  147. #define AUTH_FRAME_RECOGNIZED 0
  148. #define AUTH_FRAME_NOT_RECOGNIZED 1
  149. //
  150. // To kick off an Authentication thread for the given port.
  151. //
  152. WORD AuthStart(
  153. IN HPORT,
  154. IN PAUTH_XPORT_INFO
  155. );
  156. //
  157. // Returned by AuthStart:
  158. //
  159. #define AUTH_START_SUCCESS 0
  160. #define AUTH_START_FAILURE 1
  161. //
  162. // Used by Supervisor to tell Auth Xport module to halt authentication
  163. // processing on the given port.
  164. //
  165. WORD AuthStop(
  166. IN HPORT hPort
  167. );
  168. //
  169. // Returned by AuthStop
  170. //
  171. #define AUTH_STOP_SUCCESS 0
  172. #define AUTH_STOP_PENDING 1
  173. #define AUTH_STOP_FAILURE 2
  174. //
  175. // The following messages are sent from Authentication to Supervisor via
  176. // MESSAGE.DLL and are to be used in wMsgId in message struct below:
  177. //
  178. #define AUTH_DONE 100
  179. #define AUTH_FAILURE 101
  180. #define AUTH_STOP_COMPLETED 102
  181. #define AUTH_PROJECTION_REQUEST 103
  182. #define AUTH_CALLBACK_REQUEST 104
  183. #define AUTH_ACCT_OK 105
  184. //
  185. // These are the structures that accompany each message defined above:
  186. //
  187. // No structure for AUTH_DONE
  188. // Structure for AUTH_FAILURE
  189. typedef struct _AUTH_FAILURE_INFO
  190. {
  191. WORD wReason;
  192. BYTE szLogonDomain[DNLEN + 1];
  193. BYTE szUserName[UNLEN + 1];
  194. } AUTH_FAILURE_INFO, *PAUTH_FAILURE_INFO;
  195. //
  196. // These are the reasons that Authentication might fail:
  197. //
  198. #define AUTH_XPORT_ERROR 200
  199. #define AUTH_NOT_AUTHENTICATED 201
  200. #define AUTH_ALL_PROJECTIONS_FAILED 202
  201. #define AUTH_INTERNAL_ERROR 203
  202. #define AUTH_ACCT_EXPIRED 204
  203. #define AUTH_NO_DIALIN_PRIVILEGE 205
  204. #define AUTH_UNSUPPORTED_VERSION 206
  205. #define AUTH_ENCRYPTION_REQUIRED 207
  206. #define AUTH_PASSWORD_EXPIRED 208
  207. #define AUTH_LICENSE_LIMIT_EXCEEDED 209
  208. // No structure for AUTH_STOP_COMPLETED
  209. typedef BOOL IP_PROJECTION_INFO, *PIP_PROJECTION_INFO;
  210. typedef BOOL IPX_PROJECTION_INFO, *PIPX_PROJECTION_INFO;
  211. typedef struct _NETBIOS_PROJECTION_INFO
  212. {
  213. BOOL fProject;
  214. WORD cNames;
  215. NAME_STRUCT Names[MAX_INIT_NAMES];
  216. } NETBIOS_PROJECTION_INFO, *PNETBIOS_PROJECTION_INFO;
  217. typedef struct _AUTH_PROJECTION_REQUEST_INFO
  218. {
  219. IP_PROJECTION_INFO IpInfo;
  220. IPX_PROJECTION_INFO IpxInfo;
  221. NETBIOS_PROJECTION_INFO NetbiosInfo;
  222. } AUTH_PROJECTION_REQUEST_INFO, *PAUTH_PROJECTION_REQUEST_INFO;
  223. typedef struct _AUTH_CALLBACK_REQUEST_INFO
  224. {
  225. BOOL fUseCallbackDelay;
  226. WORD CallbackDelay; // Valid only if fUseCallbackDelay == TRUE
  227. CHAR szCallbackNumber[MAX_PHONE_NUMBER_LEN + 1];
  228. } AUTH_CALLBACK_REQUEST_INFO, *PAUTH_CALLBACK_REQUEST_INFO;
  229. typedef struct _AUTH_ACCT_OK_INFO
  230. {
  231. BYTE szUserName[UNLEN + 1];
  232. BYTE szLogonDomain[DNLEN + 1];
  233. BOOL fAdvancedServer;
  234. HANDLE hLicense;
  235. } AUTH_ACCT_OK_INFO, *PAUTH_ACCT_OK_INFO;
  236. //
  237. // This is the structure used in sending messages to the Supervisor
  238. //
  239. typedef struct _AUTH_MESSAGE
  240. {
  241. WORD wMsgId;
  242. HPORT hPort;
  243. union
  244. {
  245. AUTH_FAILURE_INFO FailureInfo;
  246. AUTH_PROJECTION_REQUEST_INFO ProjectionRequest;
  247. AUTH_CALLBACK_REQUEST_INFO CallbackRequest;
  248. AUTH_ACCT_OK_INFO AcctOkInfo;
  249. };
  250. } AUTH_MESSAGE, *PAUTH_MESSAGE;
  251. #endif // _CLAUTH_
  252. #endif // _SRVAUTH_