Leaked source code of windows server 2003
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.

1236 lines
23 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. winipsec.h
  5. Abstract:
  6. Header file for IPSec WINAPIs.
  7. Author:
  8. krishnaG 21-September-1999
  9. Environment:
  10. User Level: Win32
  11. Revision History:
  12. abhisheV 21-September-1999 Added the structures.
  13. --*/
  14. #ifndef _WINIPSEC_
  15. #define _WINIPSEC_
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #define PERSIST_SPD_OBJECT (ULONG) 0x00000001
  20. #define IP_ADDRESS_ME (ULONG) 0x00000000
  21. #define IP_ADDRESS_MASK_NONE (ULONG) 0xFFFFFFFF
  22. #define SUBNET_ADDRESS_ANY (ULONG) 0x00000000
  23. #define SUBNET_MASK_ANY (ULONG) 0x00000000
  24. #define FILTER_NATURE_PASS_THRU 0x00000001
  25. #define FILTER_NATURE_BLOCKING 0x00000002
  26. #define FILTER_DIRECTION_INBOUND 0x00000004
  27. #define FILTER_DIRECTION_OUTBOUND 0x00000008
  28. #define ENUM_GENERIC_FILTERS 0x00000001
  29. #define ENUM_SELECT_SPECIFIC_FILTERS 0x00000002
  30. #define ENUM_SPECIFIC_FILTERS 0x00000004
  31. //
  32. // Policy flags.
  33. //
  34. #define IPSEC_MM_POLICY_ENABLE_DIAGNOSTICS 0x00000001
  35. #define IPSEC_MM_POLICY_DEFAULT_POLICY 0x00000002
  36. #define IPSEC_MM_POLICY_ON_NO_MATCH 0x00000004
  37. #define IPSEC_MM_POLICY_DISABLE_CRL 0x00000008
  38. #define IPSEC_MM_POLICY_DISABLE_NEGOTIATE 0x00000010
  39. #define IPSEC_QM_POLICY_TRANSPORT_MODE 0x00000000
  40. #define IPSEC_QM_POLICY_TUNNEL_MODE 0x00000001
  41. #define IPSEC_QM_POLICY_DEFAULT_POLICY 0x00000002
  42. #define IPSEC_QM_POLICY_ALLOW_SOFT 0x00000004
  43. #define IPSEC_QM_POLICY_ON_NO_MATCH 0x00000008
  44. #define IPSEC_QM_POLICY_DISABLE_NEGOTIATE 0x00000010
  45. #define IPSEC_MM_AUTH_DEFAULT_AUTH 0x00000001
  46. #define IPSEC_MM_AUTH_ON_NO_MATCH 0x00000002
  47. #define RETURN_DEFAULTS_ON_NO_MATCH 0x00000001
  48. //
  49. // Delete MM SA flags.
  50. //
  51. #define IPSEC_MM_DELETE_ASSOCIATED_QMS 0x00000001
  52. #define IPSEC_SA_TUNNEL 0x00000001
  53. #define IPSEC_SA_REPLAY 0x00000002
  54. #define IPSEC_SA_DELETE 0x00000004
  55. #define IPSEC_SA_MANUAL 0x00000010
  56. #define IPSEC_SA_MULTICAST_MIRROR 0x00000020
  57. #define IPSEC_SA_INBOUND 0x00000040
  58. #define IPSEC_SA_OUTBOUND 0x00000080
  59. #define IPSEC_SA_DISABLE_IDLE_OUT 0x00000100
  60. #define IPSEC_SA_DISABLE_ANTI_REPLAY_CHECK 0x00000200
  61. #define IPSEC_SA_DISABLE_LIFETIME_CHECK 0x00000400
  62. //
  63. // Bounds for number of offers
  64. //
  65. #define IPSEC_MAX_MM_OFFERS 20
  66. #define IPSEC_MAX_QM_OFFERS 50
  67. typedef enum _ADDR_TYPE {
  68. IP_ADDR_UNIQUE = 1,
  69. IP_ADDR_SUBNET,
  70. IP_ADDR_INTERFACE,
  71. } ADDR_TYPE, * PADDR_TYPE;
  72. typedef struct _ADDR {
  73. ADDR_TYPE AddrType;
  74. ULONG uIpAddr;
  75. ULONG uSubNetMask;
  76. GUID gInterfaceID;
  77. } ADDR, * PADDR;
  78. typedef enum _PROTOCOL_TYPE {
  79. PROTOCOL_UNIQUE = 1,
  80. } PROTOCOL_TYPE, * PPROTOCOL_TYPE;
  81. typedef struct _PROTOCOL {
  82. PROTOCOL_TYPE ProtocolType;
  83. DWORD dwProtocol;
  84. } PROTOCOL, * PPROTOCOL;
  85. typedef enum _PORT_TYPE {
  86. PORT_UNIQUE = 1,
  87. } PORT_TYPE, * PPORT_TYPE;
  88. typedef struct _PORT {
  89. PORT_TYPE PortType;
  90. WORD wPort;
  91. } PORT, * PPORT;
  92. typedef enum _IF_TYPE {
  93. INTERFACE_TYPE_ALL = 1,
  94. INTERFACE_TYPE_LAN,
  95. INTERFACE_TYPE_DIALUP,
  96. INTERFACE_TYPE_MAX
  97. } IF_TYPE, * PIF_TYPE;
  98. typedef enum _FILTER_FLAG {
  99. PASS_THRU = 1,
  100. BLOCKING,
  101. NEGOTIATE_SECURITY,
  102. FILTER_FLAG_MAX
  103. } FILTER_FLAG, * PFILTER_FLAG;
  104. typedef struct _TRANSPORT_FILTER {
  105. GUID gFilterID;
  106. LPWSTR pszFilterName;
  107. IF_TYPE InterfaceType;
  108. BOOL bCreateMirror;
  109. DWORD dwFlags;
  110. ADDR SrcAddr;
  111. ADDR DesAddr;
  112. PROTOCOL Protocol;
  113. PORT SrcPort;
  114. PORT DesPort;
  115. FILTER_FLAG InboundFilterFlag;
  116. FILTER_FLAG OutboundFilterFlag;
  117. DWORD dwDirection;
  118. DWORD dwWeight;
  119. GUID gPolicyID;
  120. } TRANSPORT_FILTER, * PTRANSPORT_FILTER;
  121. //
  122. // Maximum number of transport filters that can be enumerated
  123. // by SPD at a time.
  124. //
  125. #define MAX_TRANSPORTFILTER_ENUM_COUNT 1000
  126. typedef struct _TUNNEL_FILTER {
  127. GUID gFilterID;
  128. LPWSTR pszFilterName;
  129. IF_TYPE InterfaceType;
  130. BOOL bCreateMirror;
  131. DWORD dwFlags;
  132. ADDR SrcAddr;
  133. ADDR DesAddr;
  134. PROTOCOL Protocol;
  135. PORT SrcPort;
  136. PORT DesPort;
  137. ADDR SrcTunnelAddr;
  138. ADDR DesTunnelAddr;
  139. FILTER_FLAG InboundFilterFlag;
  140. FILTER_FLAG OutboundFilterFlag;
  141. DWORD dwDirection;
  142. DWORD dwWeight;
  143. GUID gPolicyID;
  144. } TUNNEL_FILTER, * PTUNNEL_FILTER;
  145. //
  146. // Maximum number of tunnel filters that can be enumerated
  147. // by SPD at a time.
  148. //
  149. #define MAX_TUNNELFILTER_ENUM_COUNT 1000
  150. typedef struct _MM_FILTER {
  151. GUID gFilterID;
  152. LPWSTR pszFilterName;
  153. IF_TYPE InterfaceType;
  154. BOOL bCreateMirror;
  155. DWORD dwFlags;
  156. ADDR SrcAddr;
  157. ADDR DesAddr;
  158. DWORD dwDirection;
  159. DWORD dwWeight;
  160. GUID gMMAuthID;
  161. GUID gPolicyID;
  162. } MM_FILTER, * PMM_FILTER;
  163. //
  164. // Maximum number of main mode filters that can be enumerated
  165. // by SPD at a time.
  166. //
  167. #define MAX_MMFILTER_ENUM_COUNT 1000
  168. //
  169. // Common Structures for Main Mode and Quick Mode Policies.
  170. //
  171. //
  172. // IPSEC DOI ESP algorithms supported by SPD.
  173. //
  174. typedef enum _IPSEC_DOI_ESP_ALGO {
  175. IPSEC_DOI_ESP_NONE = 0,
  176. IPSEC_DOI_ESP_DES,
  177. IPSEC_DOI_ESP_3_DES = 3,
  178. IPSEC_DOI_ESP_MAX
  179. } IPSEC_DOI_ESP_ALGO, * PIPSEC_DOI_ESP_ALGO;
  180. //
  181. // IPSEC DOI AH algorithms supported by SPD.
  182. //
  183. typedef enum _IPSEC_DOI_AH_ALGO {
  184. IPSEC_DOI_AH_NONE = 0,
  185. IPSEC_DOI_AH_MD5,
  186. IPSEC_DOI_AH_SHA1,
  187. IPSEC_DOI_AH_MAX
  188. } IPSEC_DOI_AH_ALGO, * PIPSEC_DOI_AH_ALGO;
  189. //
  190. // Types of IPSEC Operations supported by SPD.
  191. //
  192. typedef enum _IPSEC_OPERATION {
  193. NONE = 0,
  194. AUTHENTICATION,
  195. ENCRYPTION,
  196. COMPRESSION,
  197. SA_DELETE
  198. } IPSEC_OPERATION, * PIPSEC_OPERATION;
  199. //
  200. // HMAC authentication algorithm to use with IPSEC
  201. // Encryption operation.
  202. //
  203. typedef enum _HMAC_AH_ALGO {
  204. HMAC_AH_NONE = 0,
  205. HMAC_AH_MD5,
  206. HMAC_AH_SHA1,
  207. HMAC_AH_MAX
  208. } HMAC_AH_ALGO, * PHMAC_AH_ALGO;
  209. //
  210. // Key Lifetime structure.
  211. //
  212. typedef struct _KEY_LIFETIME {
  213. ULONG uKeyExpirationTime;
  214. ULONG uKeyExpirationKBytes;
  215. } KEY_LIFETIME, * PKEY_LIFETIME;
  216. //
  217. // Main mode policy structures.
  218. //
  219. //
  220. // Main mode authentication algorithms supported by SPD.
  221. //
  222. typedef enum _MM_AUTH_ENUM {
  223. IKE_PRESHARED_KEY = 1,
  224. IKE_DSS_SIGNATURE,
  225. IKE_RSA_SIGNATURE,
  226. IKE_RSA_ENCRYPTION,
  227. IKE_SSPI
  228. } MM_AUTH_ENUM, * PMM_AUTH_ENUM;
  229. //
  230. // Main mode authentication information structure.
  231. //
  232. typedef struct _IPSEC_MM_AUTH_INFO {
  233. MM_AUTH_ENUM AuthMethod;
  234. DWORD dwAuthInfoSize;
  235. #ifdef __midl
  236. [size_is(dwAuthInfoSize)] LPBYTE pAuthInfo;
  237. #else
  238. LPBYTE pAuthInfo;
  239. #endif
  240. } IPSEC_MM_AUTH_INFO, * PIPSEC_MM_AUTH_INFO;
  241. //
  242. // Main mode authentication methods.
  243. //
  244. typedef struct _MM_AUTH_METHODS {
  245. GUID gMMAuthID;
  246. DWORD dwFlags;
  247. DWORD dwNumAuthInfos;
  248. #ifdef __midl
  249. [size_is(dwNumAuthInfos)] PIPSEC_MM_AUTH_INFO pAuthenticationInfo;
  250. #else
  251. PIPSEC_MM_AUTH_INFO pAuthenticationInfo;
  252. #endif
  253. } MM_AUTH_METHODS, * PMM_AUTH_METHODS;
  254. //
  255. // Maximum number of main mode auth methods that can be enumerated
  256. // by SPD at a time.
  257. //
  258. #define MAX_MMAUTH_ENUM_COUNT 1000
  259. //
  260. // Main mode algorithm structure.
  261. //
  262. typedef struct _IPSEC_MM_ALGO {
  263. ULONG uAlgoIdentifier;
  264. ULONG uAlgoKeyLen;
  265. ULONG uAlgoRounds;
  266. } IPSEC_MM_ALGO, * PIPSEC_MM_ALGO;
  267. //
  268. // Main mode policy offer structure.
  269. //
  270. typedef struct _IPSEC_MM_OFFER {
  271. KEY_LIFETIME Lifetime;
  272. DWORD dwFlags;
  273. DWORD dwQuickModeLimit;
  274. DWORD dwDHGroup;
  275. IPSEC_MM_ALGO EncryptionAlgorithm;
  276. IPSEC_MM_ALGO HashingAlgorithm;
  277. } IPSEC_MM_OFFER, * PIPSEC_MM_OFFER;
  278. //
  279. // Defines for DH groups.
  280. //
  281. #define DH_GROUP_1 0x00000001 // For Diffe Hellman group 1.
  282. #define DH_GROUP_2 0x00000002 // For Diffe Hellman group 2.
  283. //
  284. // Default Main Mode key expiration time.
  285. //
  286. #define DEFAULT_MM_KEY_EXPIRATION_TIME 480*60 // 8 hours expressed in seconds.
  287. //
  288. // Maximum number of main mode policies that can be enumerated
  289. // by SPD at a time.
  290. //
  291. #define MAX_MMPOLICY_ENUM_COUNT 10
  292. //
  293. // Main mode policy structure.
  294. //
  295. typedef struct _IPSEC_MM_POLICY {
  296. GUID gPolicyID;
  297. LPWSTR pszPolicyName;
  298. DWORD dwFlags;
  299. ULONG uSoftSAExpirationTime;
  300. DWORD dwOfferCount;
  301. #ifdef __midl
  302. [size_is(dwOfferCount)] PIPSEC_MM_OFFER pOffers;
  303. #else
  304. PIPSEC_MM_OFFER pOffers;
  305. #endif
  306. } IPSEC_MM_POLICY, * PIPSEC_MM_POLICY;
  307. //
  308. // Quick mode policy structures.
  309. //
  310. typedef DWORD IPSEC_QM_SPI, * PIPSEC_QM_SPI;
  311. //
  312. // Quick mode algorithm structure.
  313. //
  314. typedef struct _IPSEC_QM_ALGO {
  315. IPSEC_OPERATION Operation;
  316. ULONG uAlgoIdentifier;
  317. HMAC_AH_ALGO uSecAlgoIdentifier;
  318. ULONG uAlgoKeyLen;
  319. ULONG uSecAlgoKeyLen;
  320. ULONG uAlgoRounds;
  321. IPSEC_QM_SPI MySpi;
  322. IPSEC_QM_SPI PeerSpi;
  323. } IPSEC_QM_ALGO, * PIPSEC_QM_ALGO;
  324. //
  325. // Maximum number of quick mode algorithms in
  326. // a quick mode policy offer.
  327. //
  328. #define QM_MAX_ALGOS 2
  329. //
  330. // Quick mode policy offer structure.
  331. //
  332. typedef struct _IPSEC_QM_OFFER {
  333. KEY_LIFETIME Lifetime;
  334. DWORD dwFlags;
  335. BOOL bPFSRequired;
  336. DWORD dwPFSGroup;
  337. DWORD dwNumAlgos;
  338. IPSEC_QM_ALGO Algos[QM_MAX_ALGOS];
  339. } IPSEC_QM_OFFER, * PIPSEC_QM_OFFER;
  340. //
  341. // Defines for PFS groups.
  342. //
  343. #define PFS_GROUP_NONE 0x00000000 // If PFS is not required.
  344. #define PFS_GROUP_1 0x00000001 // For Diffe Hellman group 1 PFS.
  345. #define PFS_GROUP_2 0x00000002 // For Diffe Hellman group 2 PFS.
  346. #define PFS_GROUP_MM 0x10000000 // Use group negotiated in MM
  347. //
  348. // Default Quick Mode key expiration time.
  349. //
  350. #define DEFAULT_QM_KEY_EXPIRATION_TIME 60*60 // 1 hour expressed in seconds.
  351. //
  352. // Default Quick Mode key expiration kbytes.
  353. //
  354. #define DEFAULT_QM_KEY_EXPIRATION_KBYTES 100*1000 // 100 MB expressed in KB.
  355. //
  356. // Maximum number of quick mode policies that can be enumerated
  357. // by SPD at a time.
  358. //
  359. #define MAX_QMPOLICY_ENUM_COUNT 10
  360. //
  361. // Quick mode policy structure.
  362. //
  363. typedef struct _IPSEC_QM_POLICY {
  364. GUID gPolicyID;
  365. LPWSTR pszPolicyName;
  366. DWORD dwFlags;
  367. DWORD dwOfferCount;
  368. #ifdef __midl
  369. [size_is(dwOfferCount)] PIPSEC_QM_OFFER pOffers;
  370. #else
  371. PIPSEC_QM_OFFER pOffers;
  372. #endif
  373. } IPSEC_QM_POLICY, * PIPSEC_QM_POLICY;
  374. //
  375. // IKE structures.
  376. //
  377. typedef struct _IKE_STATISTICS {
  378. DWORD dwActiveAcquire;
  379. DWORD dwActiveReceive;
  380. DWORD dwAcquireFail;
  381. DWORD dwReceiveFail;
  382. DWORD dwSendFail;
  383. DWORD dwAcquireHeapSize;
  384. DWORD dwReceiveHeapSize;
  385. DWORD dwNegotiationFailures;
  386. DWORD dwAuthenticationFailures;
  387. DWORD dwInvalidCookiesReceived;
  388. DWORD dwTotalAcquire;
  389. DWORD dwTotalGetSpi;
  390. DWORD dwTotalKeyAdd;
  391. DWORD dwTotalKeyUpdate;
  392. DWORD dwGetSpiFail;
  393. DWORD dwKeyAddFail;
  394. DWORD dwKeyUpdateFail;
  395. DWORD dwIsadbListSize;
  396. DWORD dwConnListSize;
  397. DWORD dwOakleyMainModes;
  398. DWORD dwOakleyQuickModes;
  399. DWORD dwSoftAssociations;
  400. DWORD dwInvalidPacketsReceived;
  401. } IKE_STATISTICS, * PIKE_STATISTICS;
  402. typedef LARGE_INTEGER IKE_COOKIE, * PIKE_COOKIE;
  403. typedef struct _IKE_COOKIE_PAIR {
  404. IKE_COOKIE Initiator;
  405. IKE_COOKIE Responder;
  406. } IKE_COOKIE_PAIR, * PIKE_COOKIE_PAIR;
  407. typedef struct _IPSEC_BYTE_BLOB {
  408. DWORD dwSize;
  409. #ifdef __midl
  410. [size_is(dwSize)] LPBYTE pBlob;
  411. #else
  412. LPBYTE pBlob;
  413. #endif
  414. } IPSEC_BYTE_BLOB, * PIPSEC_BYTE_BLOB;
  415. typedef struct _IPSEC_MM_SA {
  416. GUID gMMPolicyID;
  417. IPSEC_MM_OFFER SelectedMMOffer;
  418. MM_AUTH_ENUM MMAuthEnum;
  419. IKE_COOKIE_PAIR MMSpi;
  420. ADDR Me;
  421. IPSEC_BYTE_BLOB MyId;
  422. IPSEC_BYTE_BLOB MyCertificateChain;
  423. ADDR Peer;
  424. IPSEC_BYTE_BLOB PeerId;
  425. IPSEC_BYTE_BLOB PeerCertificateChain;
  426. DWORD dwFlags;
  427. } IPSEC_MM_SA, * PIPSEC_MM_SA;
  428. typedef enum _QM_FILTER_TYPE {
  429. QM_TRANSPORT_FILTER = 1,
  430. QM_TUNNEL_FILTER
  431. } QM_FILTER_TYPE, * PQM_FILTER_TYPE;
  432. typedef struct _IPSEC_QM_FILTER {
  433. QM_FILTER_TYPE QMFilterType;
  434. ADDR SrcAddr;
  435. ADDR DesAddr;
  436. PROTOCOL Protocol;
  437. PORT SrcPort;
  438. PORT DesPort;
  439. ADDR MyTunnelEndpt;
  440. ADDR PeerTunnelEndpt;
  441. DWORD dwFlags;
  442. } IPSEC_QM_FILTER, * PIPSEC_QM_FILTER;
  443. typedef struct _IPSEC_QM_SA {
  444. GUID gQMPolicyID;
  445. IPSEC_QM_OFFER SelectedQMOffer;
  446. GUID gQMFilterID;
  447. IPSEC_QM_FILTER IpsecQMFilter;
  448. IKE_COOKIE_PAIR MMSpi;
  449. } IPSEC_QM_SA, * PIPSEC_QM_SA;
  450. #define MAX_QMSA_ENUM_COUNT 1000
  451. typedef enum _SA_FAIL_MODE {
  452. MAIN_MODE = 1,
  453. QUICK_MODE,
  454. } SA_FAIL_MODE, * PSA_FAIL_MODE;
  455. typedef enum _SA_FAIL_POINT {
  456. FAIL_POINT_ME = 1,
  457. FAIL_POINT_PEER,
  458. } SA_FAIL_POINT, * PSA_FAIL_POINT;
  459. typedef struct _SA_NEGOTIATION_STATUS_INFO {
  460. SA_FAIL_MODE FailMode;
  461. SA_FAIL_POINT FailPoint;
  462. DWORD dwError;
  463. } SA_NEGOTIATION_STATUS_INFO, * PSA_NEGOTIATION_STATUS_INFO;
  464. //
  465. // IPSec structures.
  466. //
  467. typedef struct _IPSEC_STATISTICS {
  468. DWORD dwNumActiveAssociations;
  469. DWORD dwNumOffloadedSAs;
  470. DWORD dwNumPendingKeyOps;
  471. DWORD dwNumKeyAdditions;
  472. DWORD dwNumKeyDeletions;
  473. DWORD dwNumReKeys;
  474. DWORD dwNumActiveTunnels;
  475. DWORD dwNumBadSPIPackets;
  476. DWORD dwNumPacketsNotDecrypted;
  477. DWORD dwNumPacketsNotAuthenticated;
  478. DWORD dwNumPacketsWithReplayDetection;
  479. ULARGE_INTEGER uConfidentialBytesSent;
  480. ULARGE_INTEGER uConfidentialBytesReceived;
  481. ULARGE_INTEGER uAuthenticatedBytesSent;
  482. ULARGE_INTEGER uAuthenticatedBytesReceived;
  483. ULARGE_INTEGER uTransportBytesSent;
  484. ULARGE_INTEGER uTransportBytesReceived;
  485. ULARGE_INTEGER uBytesSentInTunnels;
  486. ULARGE_INTEGER uBytesReceivedInTunnels;
  487. ULARGE_INTEGER uOffloadedBytesSent;
  488. ULARGE_INTEGER uOffloadedBytesReceived;
  489. } IPSEC_STATISTICS, * PIPSEC_STATISTICS;
  490. typedef struct _IPSEC_INTERFACE_INFO {
  491. GUID gInterfaceID;
  492. DWORD dwIndex;
  493. LPWSTR pszInterfaceName;
  494. LPWSTR pszDeviceName;
  495. DWORD dwInterfaceType;
  496. ULONG uIpAddr;
  497. } IPSEC_INTERFACE_INFO, * PIPSEC_INTERFACE_INFO;
  498. //
  499. // If dwInterfaceType is MIB_IF_TYPE_ETHERNET or MIB_IF_TYPE_FDDI
  500. // or MIB_IF_TYPE_TOKENRING then its a LAN interface.
  501. // If dwInterfaceType is MIB_IF_TYPE_PPP or MIB_IF_TYPE_SLIP
  502. // then its a WAN/DIALUP interface.
  503. //
  504. #define MAX_INTERFACE_ENUM_COUNT 100
  505. typedef struct _Record {
  506. DWORD SrcIpAddress;
  507. DWORD DesIpAddress;
  508. }RECORD, *PRECORD;
  509. //
  510. // IPSEC SPD APIs.
  511. //
  512. DWORD
  513. WINAPI
  514. SPDApiBufferAllocate(
  515. DWORD dwByteCount,
  516. LPVOID * ppBuffer
  517. );
  518. VOID
  519. WINAPI
  520. SPDApiBufferFree(
  521. LPVOID pBuffer
  522. );
  523. DWORD
  524. WINAPI
  525. AddTransportFilter(
  526. LPWSTR pServerName,
  527. DWORD dwFlags,
  528. PTRANSPORT_FILTER pTransportFilter,
  529. PHANDLE phFilter
  530. );
  531. DWORD
  532. WINAPI
  533. DeleteTransportFilter(
  534. HANDLE hFilter
  535. );
  536. DWORD
  537. WINAPI
  538. EnumTransportFilters(
  539. LPWSTR pServerName,
  540. DWORD dwLevel,
  541. GUID gGenericFilterID,
  542. PTRANSPORT_FILTER * ppTransportFilters,
  543. DWORD dwPreferredNumEntries,
  544. LPDWORD pdwNumFilters,
  545. LPDWORD pdwResumeHandle
  546. );
  547. DWORD
  548. WINAPI
  549. SetTransportFilter(
  550. HANDLE hFilter,
  551. PTRANSPORT_FILTER pTransportFilter
  552. );
  553. DWORD
  554. WINAPI
  555. GetTransportFilter(
  556. HANDLE hFilter,
  557. PTRANSPORT_FILTER * ppTransportFilter
  558. );
  559. DWORD
  560. WINAPI
  561. AddQMPolicy(
  562. LPWSTR pServerName,
  563. DWORD dwFlags,
  564. PIPSEC_QM_POLICY pQMPolicy
  565. );
  566. DWORD
  567. WINAPI
  568. DeleteQMPolicy(
  569. LPWSTR pServerName,
  570. LPWSTR pszPolicyName
  571. );
  572. DWORD
  573. WINAPI
  574. EnumQMPolicies(
  575. LPWSTR pServerName,
  576. PIPSEC_QM_POLICY * ppQMPolicies,
  577. DWORD dwPreferredNumEntries,
  578. LPDWORD pdwNumPolicies,
  579. LPDWORD pdwResumeHandle
  580. );
  581. DWORD
  582. WINAPI
  583. SetQMPolicy(
  584. LPWSTR pServerName,
  585. LPWSTR pszPolicyName,
  586. PIPSEC_QM_POLICY pQMPolicy
  587. );
  588. DWORD
  589. WINAPI
  590. GetQMPolicy(
  591. LPWSTR pServerName,
  592. LPWSTR pszPolicyName,
  593. PIPSEC_QM_POLICY * ppQMPolicy
  594. );
  595. DWORD
  596. WINAPI
  597. AddMMPolicy(
  598. LPWSTR pServerName,
  599. DWORD dwFlags,
  600. PIPSEC_MM_POLICY pMMPolicy
  601. );
  602. DWORD
  603. WINAPI
  604. DeleteMMPolicy(
  605. LPWSTR pServerName,
  606. LPWSTR pszPolicyName
  607. );
  608. DWORD
  609. WINAPI
  610. EnumMMPolicies(
  611. LPWSTR pServerName,
  612. PIPSEC_MM_POLICY * ppMMPolicies,
  613. DWORD dwPreferredNumEntries,
  614. LPDWORD pdwNumPolicies,
  615. LPDWORD pdwResumeHandle
  616. );
  617. DWORD
  618. WINAPI
  619. SetMMPolicy(
  620. LPWSTR pServerName,
  621. LPWSTR pszPolicyName,
  622. PIPSEC_MM_POLICY pMMPolicy
  623. );
  624. DWORD
  625. WINAPI
  626. GetMMPolicy(
  627. LPWSTR pServerName,
  628. LPWSTR pszPolicyName,
  629. PIPSEC_MM_POLICY * ppMMPolicy
  630. );
  631. DWORD
  632. WINAPI
  633. AddMMFilter(
  634. LPWSTR pServerName,
  635. DWORD dwFlags,
  636. PMM_FILTER pMMFilter,
  637. PHANDLE phMMFilter
  638. );
  639. DWORD
  640. WINAPI
  641. DeleteMMFilter(
  642. HANDLE hMMFilter
  643. );
  644. DWORD
  645. WINAPI
  646. EnumMMFilters(
  647. LPWSTR pServerName,
  648. DWORD dwLevel,
  649. GUID gGenericFilterID,
  650. PMM_FILTER * ppMMFilters,
  651. DWORD dwPreferredNumEntries,
  652. LPDWORD pdwNumMMFilters,
  653. LPDWORD pdwResumeHandle
  654. );
  655. DWORD
  656. WINAPI
  657. SetMMFilter(
  658. HANDLE hMMFilter,
  659. PMM_FILTER pMMFilter
  660. );
  661. DWORD
  662. WINAPI
  663. GetMMFilter(
  664. HANDLE hMMFilter,
  665. PMM_FILTER * ppMMFilter
  666. );
  667. DWORD
  668. WINAPI
  669. MatchMMFilter(
  670. LPWSTR pServerName,
  671. PMM_FILTER pMMFilter,
  672. DWORD dwFlags,
  673. PMM_FILTER * ppMatchedMMFilters,
  674. PIPSEC_MM_POLICY * ppMatchedMMPolicies,
  675. PMM_AUTH_METHODS * ppMatchedMMAuthMethods,
  676. DWORD dwPreferredNumEntries,
  677. LPDWORD pdwNumMatches,
  678. LPDWORD pdwResumeHandle
  679. );
  680. DWORD
  681. WINAPI
  682. MatchTransportFilter(
  683. LPWSTR pServerName,
  684. PTRANSPORT_FILTER pTxFilter,
  685. DWORD dwFlags,
  686. PTRANSPORT_FILTER * ppMatchedTxFilters,
  687. PIPSEC_QM_POLICY * ppMatchedQMPolicies,
  688. DWORD dwPreferredNumEntries,
  689. LPDWORD pdwNumMatches,
  690. LPDWORD pdwResumeHandle
  691. );
  692. DWORD
  693. WINAPI
  694. GetQMPolicyByID(
  695. LPWSTR pServerName,
  696. GUID gQMPolicyID,
  697. PIPSEC_QM_POLICY * ppQMPolicy
  698. );
  699. DWORD
  700. WINAPI
  701. GetMMPolicyByID(
  702. LPWSTR pServerName,
  703. GUID gMMPolicyID,
  704. PIPSEC_MM_POLICY * ppMMPolicy
  705. );
  706. DWORD
  707. WINAPI
  708. AddMMAuthMethods(
  709. LPWSTR pServerName,
  710. DWORD dwFlags,
  711. PMM_AUTH_METHODS pMMAuthMethods
  712. );
  713. DWORD
  714. WINAPI
  715. DeleteMMAuthMethods(
  716. LPWSTR pServerName,
  717. GUID gMMAuthID
  718. );
  719. DWORD
  720. WINAPI
  721. EnumMMAuthMethods(
  722. LPWSTR pServerName,
  723. PMM_AUTH_METHODS * ppMMAuthMethods,
  724. DWORD dwPreferredNumEntries,
  725. LPDWORD pdwNumAuthMethods,
  726. LPDWORD pdwResumeHandle
  727. );
  728. DWORD
  729. WINAPI
  730. SetMMAuthMethods(
  731. LPWSTR pServerName,
  732. GUID gMMAuthID,
  733. PMM_AUTH_METHODS pMMAuthMethods
  734. );
  735. DWORD
  736. WINAPI
  737. GetMMAuthMethods(
  738. LPWSTR pServerName,
  739. GUID gMMAuthID,
  740. PMM_AUTH_METHODS * ppMMAuthMethods
  741. );
  742. DWORD
  743. IPSecInitiateIKENegotiation(
  744. LPWSTR pServerName,
  745. PIPSEC_QM_FILTER pQMFilter,
  746. DWORD dwClientProcessId,
  747. HANDLE hClientEvent,
  748. DWORD dwFlags,
  749. PHANDLE phNegotiation
  750. );
  751. DWORD
  752. IPSecQueryIKENegotiationStatus(
  753. HANDLE hNegotiation,
  754. PSA_NEGOTIATION_STATUS_INFO pNegotiationStatus
  755. );
  756. DWORD
  757. IPSecCloseIKENegotiationHandle(
  758. HANDLE hNegotiation
  759. );
  760. DWORD
  761. IPSecEnumMMSAs(
  762. LPWSTR pServerName,
  763. PIPSEC_MM_SA pMMTemplate,
  764. PIPSEC_MM_SA * ppMMSAs,
  765. LPDWORD pdwNumEntries,
  766. LPDWORD pdwTotalMMsAvailable,
  767. LPDWORD pdwEnumHandle,
  768. DWORD dwFlags
  769. );
  770. DWORD
  771. IPSecDeleteMMSAs(
  772. LPWSTR pServerName,
  773. PIPSEC_MM_SA pMMTemplate,
  774. DWORD dwFlags
  775. );
  776. DWORD
  777. IPSecDeleteQMSAs(
  778. LPWSTR pServerName,
  779. PIPSEC_QM_SA pIpsecQMSA,
  780. DWORD dwFlags
  781. );
  782. DWORD
  783. IPSecQueryIKEStatistics(
  784. LPWSTR pServerName,
  785. PIKE_STATISTICS pIKEStatistics
  786. );
  787. DWORD
  788. IPSecRegisterIKENotifyClient(
  789. LPWSTR pServerName,
  790. DWORD dwClientProcessId,
  791. HANDLE hClientEvent,
  792. IPSEC_QM_SA QMTemplate,
  793. PHANDLE phNotifyHandle,
  794. DWORD dwFlags
  795. );
  796. DWORD IPSecQueryNotifyData(
  797. HANDLE hNotifyHandle,
  798. PDWORD pdwNumEntries,
  799. PIPSEC_QM_SA *ppQMSAs,
  800. DWORD dwFlags
  801. );
  802. DWORD IPSecCloseNotifyHandle(
  803. HANDLE hNotifyHandle
  804. );
  805. DWORD
  806. WINAPI
  807. QueryIPSecStatistics(
  808. LPWSTR pServerName,
  809. PIPSEC_STATISTICS * ppIpsecStatistics
  810. );
  811. DWORD
  812. WINAPI
  813. EnumQMSAs(
  814. LPWSTR pServerName,
  815. PIPSEC_QM_SA pQMSATemplate,
  816. PIPSEC_QM_SA * ppQMSAs,
  817. DWORD dwPreferredNumEntries,
  818. LPDWORD pdwNumQMSAs,
  819. LPDWORD pdwNumTotalQMSAs,
  820. LPDWORD pdwResumeHandle,
  821. DWORD dwFlags
  822. );
  823. DWORD
  824. WINAPI
  825. AddTunnelFilter(
  826. LPWSTR pServerName,
  827. DWORD dwFlags,
  828. PTUNNEL_FILTER pTunnelFilter,
  829. PHANDLE phFilter
  830. );
  831. DWORD
  832. WINAPI
  833. DeleteTunnelFilter(
  834. HANDLE hFilter
  835. );
  836. DWORD
  837. WINAPI
  838. EnumTunnelFilters(
  839. LPWSTR pServerName,
  840. DWORD dwLevel,
  841. GUID gGenericFilterID,
  842. PTUNNEL_FILTER * ppTunnelFilters,
  843. DWORD dwPreferredNumEntries,
  844. LPDWORD pdwNumFilters,
  845. LPDWORD pdwResumeHandle
  846. );
  847. DWORD
  848. WINAPI
  849. SetTunnelFilter(
  850. HANDLE hFilter,
  851. PTUNNEL_FILTER pTunnelFilter
  852. );
  853. DWORD
  854. WINAPI
  855. GetTunnelFilter(
  856. HANDLE hFilter,
  857. PTUNNEL_FILTER * ppTunnelFilter
  858. );
  859. DWORD
  860. WINAPI
  861. MatchTunnelFilter(
  862. LPWSTR pServerName,
  863. PTUNNEL_FILTER pTnFilter,
  864. DWORD dwFlags,
  865. PTUNNEL_FILTER * ppMatchedTnFilters,
  866. PIPSEC_QM_POLICY * ppMatchedQMPolicies,
  867. DWORD dwPreferredNumEntries,
  868. LPDWORD pdwNumMatches,
  869. LPDWORD pdwResumeHandle
  870. );
  871. DWORD
  872. WINAPI
  873. OpenMMFilterHandle(
  874. LPWSTR pServerName,
  875. PMM_FILTER pMMFilter,
  876. PHANDLE phMMFilter
  877. );
  878. DWORD
  879. WINAPI
  880. CloseMMFilterHandle(
  881. HANDLE hMMFilter
  882. );
  883. DWORD
  884. WINAPI
  885. OpenTransportFilterHandle(
  886. LPWSTR pServerName,
  887. PTRANSPORT_FILTER pTransportFilter,
  888. PHANDLE phTxFilter
  889. );
  890. DWORD
  891. WINAPI
  892. CloseTransportFilterHandle(
  893. HANDLE hTxFilter
  894. );
  895. DWORD
  896. WINAPI
  897. OpenTunnelFilterHandle(
  898. LPWSTR pServerName,
  899. PTUNNEL_FILTER pTunnelFilter,
  900. PHANDLE phTnFilter
  901. );
  902. DWORD
  903. WINAPI
  904. CloseTunnelFilterHandle(
  905. HANDLE hTnFilter
  906. );
  907. DWORD
  908. WINAPI
  909. EnumIPSecInterfaces(
  910. LPWSTR pServerName,
  911. PIPSEC_INTERFACE_INFO pIpsecIfTemplate,
  912. PIPSEC_INTERFACE_INFO * ppIpsecInterfaces,
  913. DWORD dwPreferredNumEntries,
  914. LPDWORD pdwNumInterfaces,
  915. LPDWORD pdwNumTotalInterfaces,
  916. LPDWORD pdwResumeHandle,
  917. DWORD dwFlags
  918. );
  919. DWORD
  920. WINAPI
  921. IPSecAddSAs(
  922. LPWSTR pServerName,
  923. PIPSEC_QM_OFFER pQMOffer,
  924. PIPSEC_QM_FILTER pQMFilter,
  925. HANDLE *hLarvalContext,
  926. DWORD dwInboundKeyMatLen,
  927. BYTE *pInboundKeyMat,
  928. DWORD dwOutboundKeyMatLen,
  929. BYTE *pOutboundKeyMat,
  930. BYTE *pContextInfo,
  931. DWORD dwFlags
  932. );
  933. #ifdef __cplusplus
  934. }
  935. #endif
  936. #endif // _WINIPSEC_