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.

396 lines
11 KiB

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // Module: iaspolcy.idl
  6. //
  7. // Project: Everest
  8. //
  9. // Description: IAS Policy Subsystem Interface
  10. //
  11. // Author: TLP 12/1/97
  12. //
  13. ///////////////////////////////////////////////////////////////////////////
  14. // This file will be processed by the MIDL tool to
  15. // produce the type library (iaspolcy.tlb) and marshalling code.
  16. import "oaidl.idl";
  17. import "ocidl.idl";
  18. //////////
  19. // IAS Reason-Codes
  20. //////////
  21. typedef enum {
  22. IAS_SUCCESS = 0x00,
  23. IAS_INTERNAL_ERROR = 0x01,
  24. IAS_ACCESS_DENIED = 0x02,
  25. IAS_MALFORMED_REQUEST = 0x03,
  26. IAS_GLOBAL_CATALOG_UNAVAILABLE = 0x04,
  27. IAS_DOMAIN_UNAVAILABLE = 0x05,
  28. IAS_SERVER_UNAVAILABLE = 0x06,
  29. IAS_NO_SUCH_DOMAIN = 0x07,
  30. IAS_NO_SUCH_USER = 0x08,
  31. IAS_AUTH_FAILURE = 0x10,
  32. IAS_CHANGE_PASSWORD_FAILURE = 0x11,
  33. IAS_UNSUPPORTED_AUTH_TYPE = 0x12,
  34. IAS_NO_CLEARTEXT_PASSWORD = 0x13,
  35. IAS_LM_NOT_ALLOWED = 0x14,
  36. IAS_LOCAL_USERS_ONLY = 0x20,
  37. IAS_PASSWORD_MUST_CHANGE = 0x21,
  38. IAS_ACCOUNT_DISABLED = 0x22,
  39. IAS_ACCOUNT_EXPIRED = 0x23,
  40. IAS_ACCOUNT_LOCKED_OUT = 0x24,
  41. IAS_INVALID_LOGON_HOURS = 0x25,
  42. IAS_ACCOUNT_RESTRICTION = 0x26,
  43. IAS_NO_POLICY_MATCH = 0x30,
  44. IAS_NO_CONNECTION_REQUEST_POLICY_MATCH = 0x31,
  45. IAS_DIALIN_LOCKED_OUT = 0x40,
  46. IAS_DIALIN_DISABLED = 0x41,
  47. IAS_INVALID_AUTH_TYPE = 0x42,
  48. IAS_INVALID_CALLING_STATION = 0x43,
  49. IAS_INVALID_DIALIN_HOURS = 0x44,
  50. IAS_INVALID_CALLED_STATION = 0x45,
  51. IAS_INVALID_PORT_TYPE = 0x46,
  52. IAS_DIALIN_RESTRICTION = 0x47,
  53. IAS_CPW_NOT_ALLOWED = 0x48,
  54. IAS_INVALID_CERT_EKU = 0x49,
  55. IAS_NO_RECORD = 0x50,
  56. IAS_SESSION_TIMEOUT = 0x60,
  57. IAS_UNEXPECTED_REQUEST = 0x61,
  58. IAS_PROXY_REJECT = 0x70,
  59. IAS_PROXY_UNKNOWN_GROUP = 0x71,
  60. IAS_PROXY_UNKNOWN_SERVER = 0x72,
  61. IAS_PROXY_PACKET_TOO_LONG = 0x73,
  62. IAS_PROXY_SEND_ERROR = 0x74,
  63. IAS_PROXY_TIMEOUT = 0x75,
  64. IAS_PROXY_MALFORMED_RESPONSE = 0x76
  65. } IASREASON;
  66. /////////////////////////////////////////////
  67. // IASATTRIBUTE structure (raw IAS attribute)
  68. /////////////////////////////////////////////
  69. // Allowed syntaxes
  70. typedef enum IASTYPEENUM {
  71. IASTYPE_INVALID = 0,
  72. IASTYPE_BOOLEAN,
  73. IASTYPE_INTEGER,
  74. IASTYPE_ENUM,
  75. IASTYPE_INET_ADDR,
  76. IASTYPE_STRING,
  77. IASTYPE_OCTET_STRING,
  78. IASTYPE_UTC_TIME,
  79. IASTYPE_PROV_SPECIFIC
  80. } IASTYPE;
  81. // C/C++ type for each allowed syntax.
  82. typedef DWORD IAS_BOOLEAN, *PIAS_BOOLEAN;
  83. typedef DWORD IAS_INTEGER, *PIAS_INTEGER;
  84. typedef DWORD IAS_ENUM, *PIAS_ENUM;
  85. typedef DWORD IAS_INET_ADDR, *PIAS_INET_ADDR;
  86. typedef FILETIME IAS_UTC_TIME, *PIAS_UTC_TIME;
  87. typedef struct _IAS_STRING {
  88. LPSTR pszAnsi;
  89. LPWSTR pszWide;
  90. } IAS_STRING, *PIAS_STRING;
  91. typedef struct _IAS_OCTET_STRING {
  92. DWORD dwLength;
  93. BYTE *lpValue;
  94. } IAS_OCTET_STRING, *PIAS_OCTET_STRING;
  95. typedef IAS_OCTET_STRING IAS_PROV_SPECIFIC, *PIAS_PROV_SPECIFIC;
  96. // Attribute value structure.
  97. typedef struct _IASVALUE
  98. {
  99. IASTYPE itType;
  100. [ switch_is((DWORD)itType) ] union
  101. {
  102. [ case(IASTYPE_BOOLEAN) ]
  103. IAS_BOOLEAN Boolean;
  104. [ case(IASTYPE_INTEGER) ]
  105. IAS_INTEGER Integer;
  106. [ case(IASTYPE_ENUM) ]
  107. IAS_ENUM Enumerator;
  108. [ case(IASTYPE_INET_ADDR) ]
  109. IAS_INET_ADDR InetAddr;
  110. [ case(IASTYPE_STRING) ]
  111. IAS_STRING String;
  112. [ case(IASTYPE_OCTET_STRING) ]
  113. IAS_OCTET_STRING OctetString;
  114. [ case(IASTYPE_UTC_TIME) ]
  115. IAS_UTC_TIME UTCTime;
  116. [ case(IASTYPE_PROV_SPECIFIC) ]
  117. IAS_PROV_SPECIFIC ProviderSpecific;
  118. };
  119. } IASVALUE, *PIASVALUE;
  120. //
  121. // these are the bit values
  122. cpp_quote ("#define IAS_INCLUDE_IN_ACCEPT 0x00000001")
  123. cpp_quote ("#define IAS_INCLUDE_IN_REJECT 0x00000002")
  124. cpp_quote ("#define IAS_INCLUDE_IN_CHALLENGE 0x00000004")
  125. cpp_quote ("#define IAS_INCLUDE_IN_RESPONSE (IAS_INCLUDE_IN_ACCEPT | IAS_INCLUDE_IN_REJECT | IAS_INCLUDE_IN_CHALLENGE)")
  126. cpp_quote ("#define IAS_RECVD_FROM_CLIENT 0x00000008")
  127. cpp_quote ("#define IAS_RECVD_FROM_PROTOCOL 0x00000010")
  128. // Attribute structure.
  129. typedef struct _IASATTRIBUTE {
  130. /////////////////////////////////////////////////////////////////
  131. // (1) dwReserved should be hidden from users
  132. // (2) dwFlags is temporary... plan is to have an in attribute
  133. // collection and an out attribute collection on the request.
  134. //
  135. // Make these changes after NT 5 beta.
  136. /////////////////////////////////////////////////////////////////
  137. DWORD dwReserved; // Reserved (reference count)
  138. DWORD dwFlags; // Reserved (protocol state)
  139. DWORD dwId; // Unique attribute ID - from IAS Dictionary
  140. IASVALUE Value; // Attribute value
  141. } IASATTRIBUTE, *PIASATTRIBUTE;
  142. ////////////////////////////////////////////////////////////
  143. // IAS request object interface
  144. ////////////////////////////////////////////////////////////
  145. // Request Identifiers
  146. typedef enum _IASREQUEST
  147. {
  148. IAS_REQUEST_ACCESS_REQUEST,
  149. IAS_REQUEST_ACCOUNTING,
  150. IAS_REQUEST_CHALLENGE_RESPONSE,
  151. IAS_REQUEST_NAS_STATE,
  152. // Obsolete.
  153. IAS_REQUEST_PROXY_PACKET = 999
  154. } IASREQUEST;
  155. // Response Identifiers
  156. typedef enum _IASRESPONSE
  157. {
  158. IAS_RESPONSE_INVALID,
  159. IAS_RESPONSE_ACCESS_ACCEPT,
  160. IAS_RESPONSE_ACCESS_REJECT,
  161. IAS_RESPONSE_ACCESS_CHALLENGE,
  162. IAS_RESPONSE_ACCOUNTING,
  163. IAS_RESPONSE_DISCARD_PACKET,
  164. // Obsolete.
  165. IAS_RESPONSE_FORWARD_PACKET = 999,
  166. IAS_RESPONSE_RAS,
  167. // New Response Identifiers Here...
  168. IAS_RESPONSE_MAX = 2048
  169. } IASRESPONSE;
  170. // Protocol Identifiers
  171. typedef enum _IASPROTOCOL
  172. {
  173. IAS_PROTOCOL_INVALID=0,
  174. IAS_PROTOCOL_NONE,
  175. IAS_PROTOCOL_RADIUS,
  176. IAS_PROTOCOL_TACACSPLUS,
  177. IAS_PROTOCOL_LDAP,
  178. IAS_PROTOCOL_RAS
  179. // New Protocol Identifiers Here...
  180. } IASPROTOCOL;
  181. // Providers
  182. typedef enum _IASPROVIDER
  183. {
  184. IAS_PROVIDER_NONE,
  185. IAS_PROVIDER_WINDOWS,
  186. IAS_PROVIDER_RADIUS_PROXY
  187. } IASPROVIDER;
  188. interface IRequestSource; // Forward reference
  189. // Request status
  190. typedef [public] enum _IASREQUESTSTATUS
  191. {
  192. IAS_REQUEST_STATUS_ABORT, // Request cannot be handled
  193. IAS_REQUEST_STATUS_CONTINUE, // Pass request to next handler
  194. IAS_REQUEST_STATUS_HANDLED, // Request has been handled
  195. // New Status Types Here...
  196. IAS_REQUEST_STATUS_INVALID
  197. } IASREQUESTSTATUS;
  198. [
  199. object,
  200. uuid(6BC096A7-0CE6-11D1-BAAE-00C04FC2E20D),
  201. pointer_default(unique)
  202. ]
  203. interface IRequest : IUnknown
  204. {
  205. [propget, id(1)] HRESULT Request([out, retval] LONG *pVal);
  206. [propput, id(1)] HRESULT Request([in] LONG newVal);
  207. [propget, id(2)] HRESULT Response([out, retval] LONG *pVal);
  208. [propget, id(3)] HRESULT Reason([out, retval] LONG *pVal);
  209. [propget, id(4)] HRESULT Protocol([out, retval] IASPROTOCOL *pVal);
  210. [propput, id(4)] HRESULT Protocol([in] IASPROTOCOL newVal);
  211. [propget, id(5)] HRESULT Source([out, retval] IRequestSource** pVal);
  212. [propput, id(5)] HRESULT Source([in] IRequestSource* newVal);
  213. [id(7)] HRESULT SetResponse([in] IASRESPONSE eResponse,
  214. [in] LONG lReason);
  215. [id(8)] HRESULT ReturnToSource([in] IASREQUESTSTATUS eStatus);
  216. };
  217. ////////////////////////////////////////////////////////////
  218. // Raw interface to an IAS request object's attributes
  219. ////////////////////////////////////////////////////////////
  220. typedef struct _ATTRIBUTEPOSITION
  221. {
  222. DWORD dwReserved; // For use by request object
  223. PIASATTRIBUTE pAttribute;
  224. } ATTRIBUTEPOSITION, *PATTRIBUTEPOSITION;
  225. [
  226. object,
  227. hidden,
  228. restricted,
  229. uuid(6BC096A8-0CE6-11D1-BAAE-00C04FC2E20D),
  230. pointer_default(unique)
  231. ]
  232. interface IAttributesRaw : IUnknown
  233. {
  234. HRESULT AddAttributes([in] DWORD dwPosCount, [in, out] PATTRIBUTEPOSITION pPositions);
  235. HRESULT RemoveAttributes([in] DWORD dwPosCount, [in] PATTRIBUTEPOSITION pPositions);
  236. HRESULT RemoveAttributesByType([in] DWORD dwAttrIDCount, [in] LPDWORD lpdwAttrIDs);
  237. HRESULT GetAttributeCount([in]LPDWORD lpdwCount);
  238. HRESULT GetAttributes([in, out] LPDWORD lpdwPosCount, [out] PATTRIBUTEPOSITION pPositions, [in] DWORD dwAttrIDCount, [in] LPDWORD lpdwAttrIDs);
  239. };
  240. ////////////////////////////////////////////////////////////
  241. // Raw interface to an IAS request object's state
  242. ////////////////////////////////////////////////////////////
  243. [
  244. object,
  245. hidden,
  246. restricted,
  247. uuid(6BC096BA-0CE6-11D1-BAAE-00C04FC2E20D),
  248. pointer_default(unique)
  249. ]
  250. interface IRequestState : IUnknown
  251. {
  252. HRESULT Push([in] unsigned hyper State);
  253. HRESULT Pop([out] unsigned hyper* pState);
  254. HRESULT Top([out] unsigned hyper* pState);
  255. }
  256. ////////////////////////////////////////////////////////////
  257. // Interface exported by request comsumer components
  258. ////////////////////////////////////////////////////////////
  259. [
  260. object,
  261. uuid(6BC096AA-0CE6-11D1-BAAE-00C04FC2E20D),
  262. dual,
  263. pointer_default(unique)
  264. ]
  265. interface IRequestHandler : IDispatch
  266. {
  267. [id(1)] HRESULT OnRequest(IRequest* pRequest);
  268. };
  269. ////////////////////////////////////////////////////////////
  270. // Interface exported by request producer components
  271. ////////////////////////////////////////////////////////////
  272. [
  273. object,
  274. oleautomation,
  275. uuid(6BC096A9-0CE6-11D1-BAAE-00C04FC2E20D),
  276. pointer_default(unique)
  277. ]
  278. interface IRequestSource : IUnknown
  279. {
  280. HRESULT OnRequestComplete(IRequest* pRequest, IASREQUESTSTATUS eStatus);
  281. };
  282. //////////////////////////////////////////////////////////////////////////
  283. // Request Handler Quality Control Interface
  284. //////////////////////////////////////////////////////////////////////////
  285. // INOPERABLE - Request handler cannot process requests. Note that this
  286. // is not necessarily a permanent condition.
  287. //
  288. // FLOODED - Request handler is too busy to accept any more requests.
  289. //
  290. // READY - Request handler is operational and can process requests.
  291. //
  292. // UNKNOWN - Initial state before the handle reports its state
  293. typedef enum _QUALITYSTATUS
  294. {
  295. QUALITY_STATUS_INOPERABLE = 0x0001,
  296. QUALITY_STATUS_FLOODED,
  297. QUALITY_STATUS_READY,
  298. QUALITY_STATUS_UNKNOWN
  299. } QUALITYSTATUS;
  300. [
  301. object,
  302. uuid(6BC096AB-0CE6-11D1-BAAE-00C04FC2E20D),
  303. dual,
  304. pointer_default(unique)
  305. ]
  306. interface IQualityControl : IDispatch
  307. {
  308. HRESULT OnQualityNotify(QUALITYSTATUS eQualityStatus, LONG lObjectID);
  309. HRESULT SetQualityNotify(IQualityControl* pQualityControl);
  310. };
  311. ///////////////
  312. // Type Library
  313. ///////////////
  314. [
  315. uuid(6BC096A5-0CE6-11D1-BAAE-00C04FC2E20D),
  316. version(1.0),
  317. helpstring("IAS Policy 1.0 Type Library")
  318. ]
  319. library IASPolicyLib
  320. {
  321. importlib("stdole2.tlb");
  322. //////////
  323. // Classes
  324. //////////
  325. //////////////////////////////////////////////////////////////////////////
  326. [
  327. uuid(6BC096B1-0CE6-11D1-BAAE-00C04FC2E20D),
  328. helpstring("Request Class")
  329. ]
  330. coclass Request
  331. {
  332. [default] interface IRequest;
  333. };
  334. };