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.

560 lines
17 KiB

  1. /*++
  2. Copyright (c) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. ipsec.h
  5. Abstract:
  6. Generic include file used by components to access the IPSEC driver.
  7. Contains the SAAPI IOCTLs and the structures relevant to them.
  8. Author:
  9. Sanjay Anand (SanjayAn) 2-January-1997
  10. Environment:
  11. Kernel mode
  12. Revision History:
  13. --*/
  14. #ifndef _IPSEC_H
  15. #define _IPSEC_H
  16. #include <windef.h>
  17. #include <winipsec.h>
  18. //
  19. // NOTE: all addresses are expected in Network byte order
  20. //
  21. typedef unsigned long IPAddr;
  22. typedef unsigned long IPMask;
  23. //
  24. // This should go into a global header
  25. //
  26. #define DD_IPSEC_DEVICE_NAME L"\\Device\\IPSEC"
  27. #define DD_IPSEC_SYM_NAME L"\\DosDevices\\IPSECDev"
  28. #define DD_IPSEC_DOS_NAME L"\\\\.\\IPSECDev"
  29. //
  30. // This is the name of the event that will be signaled after any policy changes have been applied.
  31. //
  32. #define IPSEC_POLICY_CHANGE_NOTIFY L"IPSEC_POLICY_CHANGE_NOTIFY"
  33. // //
  34. // IOCTL code definitions and related structures //
  35. // All the IOCTLs are synchronous and need administrator privilege //
  36. // //
  37. #define FSCTL_IPSEC_BASE FILE_DEVICE_NETWORK
  38. #define _IPSEC_CTL_CODE(function, method, access) \
  39. CTL_CODE(FSCTL_IPSEC_BASE, function, method, access)
  40. //
  41. // Security Association/Policy APIs implemented as Ioctls
  42. //
  43. #define IOCTL_IPSEC_ADD_FILTER \
  44. _IPSEC_CTL_CODE(0, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  45. #define IOCTL_IPSEC_DELETE_FILTER \
  46. _IPSEC_CTL_CODE(1, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  47. #define IOCTL_IPSEC_POST_FOR_ACQUIRE_SA \
  48. _IPSEC_CTL_CODE(2, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  49. #define IOCTL_IPSEC_GET_SPI \
  50. _IPSEC_CTL_CODE(3, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  51. #define IOCTL_IPSEC_UPDATE_SA \
  52. _IPSEC_CTL_CODE(4, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  53. #define IOCTL_IPSEC_ADD_SA \
  54. _IPSEC_CTL_CODE(5, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  55. #define IOCTL_IPSEC_DELETE_SA \
  56. _IPSEC_CTL_CODE(6, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  57. #define IOCTL_IPSEC_EXPIRE_SA \
  58. _IPSEC_CTL_CODE(7, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  59. #define IOCTL_IPSEC_ENUM_SAS \
  60. _IPSEC_CTL_CODE(8, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  61. #define IOCTL_IPSEC_ENUM_FILTERS \
  62. _IPSEC_CTL_CODE(9, METHOD_OUT_DIRECT, FILE_WRITE_ACCESS)
  63. #define IOCTL_IPSEC_QUERY_EXPORT \
  64. _IPSEC_CTL_CODE(10, METHOD_BUFFERED, FILE_ANY_ACCESS)
  65. #define IOCTL_IPSEC_QUERY_STATS \
  66. _IPSEC_CTL_CODE(11, METHOD_BUFFERED, FILE_ANY_ACCESS)
  67. #define IOCTL_IPSEC_QUERY_SPI \
  68. _IPSEC_CTL_CODE(12, METHOD_BUFFERED, FILE_ANY_ACCESS)
  69. #define IOCTL_IPSEC_SET_OPERATION_MODE \
  70. _IPSEC_CTL_CODE(13, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  71. #define IOCTL_IPSEC_SET_TCPIP_STATUS \
  72. _IPSEC_CTL_CODE(14, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  73. #define IOCTL_IPSEC_REGISTER_PROTOCOL \
  74. _IPSEC_CTL_CODE(15, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  75. #define IOCTL_IPSEC_GET_OPERATION_MODE \
  76. _IPSEC_CTL_CODE(16, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  77. #define IOCTL_IPSEC_SET_DIAGNOSTIC_MODE \
  78. _IPSEC_CTL_CODE(17, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  79. //
  80. // Structures to go with the ioctls above
  81. //
  82. #define FILTER_FLAGS_PASS_THRU 0x0001
  83. #define FILTER_FLAGS_DROP 0x0002
  84. #define FILTER_FLAGS_INBOUND 0x0004
  85. #define FILTER_FLAGS_OUTBOUND 0x0008
  86. #define FILTER_FLAGS_MANUAL 0x0010
  87. // Flags for DestType in acquire
  88. #define IPSEC_BCAST 0x1
  89. #define IPSEC_MCAST 0x2
  90. //
  91. // Special constants for ExType member of _IPSEC_FILTER
  92. //
  93. #define EXT_NORMAL 0x00
  94. #define EXT_DNS_SERVER 0X01
  95. #define EXT_WINS_SERVER 0X02
  96. #define EXT_DHCP_SERVER 0X03
  97. #define EXT_DEFAULT_GATEWAY 0X04
  98. // The following flag is OR-ed with the above to specify that the
  99. // destination address is the special address. If not OR-ed, it this
  100. // means the source address is the special address.
  101. #define EXT_DEST 0x80
  102. //
  103. // for IOCTL_IPSEC_ADD_FILTER
  104. //
  105. typedef struct _IPSEC_FILTER {
  106. IPAddr SrcAddr;
  107. IPMask SrcMask;
  108. IPAddr DestAddr;
  109. IPMask DestMask;
  110. IPAddr TunnelAddr;
  111. DWORD Protocol;
  112. WORD SrcPort;
  113. WORD DestPort;
  114. BOOLEAN TunnelFilter;
  115. UCHAR ExType;
  116. WORD Flags;
  117. } IPSEC_FILTER, *PIPSEC_FILTER;
  118. typedef struct _IPSEC_FILTER_INFO {
  119. GUID FilterId; // unique identifier to identify a filter
  120. GUID PolicyId; // unique identifier to identify a policy entry
  121. ULONG Index; // hint on where this entry fits in the ordered list of filters
  122. IPSEC_FILTER AssociatedFilter;
  123. } IPSEC_FILTER_INFO, *PIPSEC_FILTER_INFO;
  124. typedef struct _IPSEC_ADD_FILTER {
  125. DWORD NumEntries;
  126. IPSEC_FILTER_INFO pInfo[1];
  127. } IPSEC_ADD_FILTER, *PIPSEC_ADD_FILTER;
  128. //
  129. // for IOCTL_IPSEC_DELETE_FILTER
  130. //
  131. typedef IPSEC_ADD_FILTER IPSEC_DELETE_FILTER, *PIPSEC_DELETE_FILTER;
  132. //
  133. // for IOCTL_IPSEC_ENUM_FILTERS
  134. //
  135. typedef struct _IPSEC_ENUM_FILTERS {
  136. DWORD NumEntries; // num entries for which there is space
  137. DWORD NumEntriesPresent; // num entries actually present in the driver
  138. IPSEC_FILTER_INFO pInfo[1];
  139. } IPSEC_ENUM_FILTERS, *PIPSEC_ENUM_FILTERS;
  140. //
  141. // for IOCTL_IPSEC_QUERY_STATS
  142. //
  143. typedef IPSEC_STATISTICS IPSEC_QUERY_STATS, *PIPSEC_QUERY_STATS;
  144. //
  145. // for IOCTL_IPSEC_SET_OPERATION_MODE
  146. // & IOCTL_IPSEC_GET_OPERATION_MODE
  147. //
  148. typedef enum _OPERATION_MODE {
  149. IPSEC_BYPASS_MODE = 0,
  150. IPSEC_BLOCK_MODE,
  151. IPSEC_SECURE_MODE,
  152. IPSEC_BOOTTIME_STATEFUL_MODE,
  153. IPSEC_OPERATION_MODE_MAX
  154. } OPERATION_MODE;
  155. //defines the forwarding behavior to apply in
  156. //boot and boottime stateful mode
  157. typedef enum _IPSEC_FORWARDING_BEHAVIOR{
  158. IPSEC_FORWARD_BYPASS =0,
  159. IPSEC_FORWARD_BLOCK,
  160. IPSEC_FORWARD_MAX
  161. } IPSEC_FORWARDING_BEHAVIOR;
  162. // Following defines and structs
  163. // for boot time security
  164. #define EXEMPT_DIRECTION_INBOUND 0x1
  165. #define EXEMPT_DIRECTION_OUTBOUND 0x2
  166. #define EXEMPT_TYPE_PDP 0x1
  167. typedef struct _IPSEC_EXEMPT_ENTRY {
  168. ULONG Type;
  169. ULONG Size;
  170. BYTE Protocol;
  171. BYTE Direction;
  172. USHORT SrcPort;
  173. USHORT DestPort;
  174. USHORT Reserved;
  175. } IPSEC_EXEMPT_ENTRY, *PIPSEC_EXEMPT_ENTRY;
  176. typedef struct _IPSEC_SET_OPERATION_MODE {
  177. OPERATION_MODE OperationMode;
  178. } IPSEC_SET_OPERATION_MODE, *PIPSEC_SET_OPERATION_MODE;
  179. typedef struct _IPSEC_GET_OPERATION_MODE {
  180. OPERATION_MODE OperationMode;
  181. } IPSEC_GET_OPERATION_MODE, * PIPSEC_GET_OPERATION_MODE;
  182. // For IOCTL_IPSEC_SET_DIAGNOSTIC_MODE
  183. #define IPSEC_DIAGNOSTIC_DISABLE_LOG 0x00000000
  184. #define IPSEC_DIAGNOSTIC_ENABLE_LOG 0x00000001
  185. #define IPSEC_DIAGNOSTIC_INBOUND 0x00000002
  186. #define IPSEC_DIAGNOSTIC_OUTBOUND 0x00000004
  187. #define IPSEC_DIAGNOSTIC_MAX 0x00000007
  188. typedef struct _IPSEC_SET_DIAGNOSTIC_MODE{
  189. DWORD Mode;
  190. DWORD LogInterval;
  191. } IPSEC_SET_DIAGNOSTIC_MODE, * PIPSEC_SET_DIAGNOSTIC_MODE;
  192. // For IOCTL_IPSEC_REGISTER_PROTOCOL.
  193. //
  194. typedef enum _REGISTER_IPSEC_PROTOCOL {
  195. IPSEC_REGISTER_PROTOCOLS = 0,
  196. IPSEC_DEREGISTER_PROTOCOLS,
  197. REGISTER_IPSEC_PROTOCOL_MAX
  198. } REGISTER_IPSEC_PROTOCOL, * PREGISTER_IPSEC_PROTOCOL;
  199. typedef struct _IPSEC_REGISTER_PROTOCOL {
  200. REGISTER_IPSEC_PROTOCOL RegisterProtocol;
  201. } IPSEC_REGISTER_PROTOCOL, * PIPSEC_REGISTER_PROTOCOL;
  202. //
  203. // for IOCTL_IPSEC_SET_TCPIP_STATUS
  204. //
  205. typedef struct _IPSEC_SET_TCPIP_STATUS {
  206. BOOLEAN TcpipStatus;
  207. PVOID TcpipFreeBuff;
  208. PVOID TcpipAllocBuff;
  209. PVOID TcpipGetInfo;
  210. PVOID TcpipNdisRequest;
  211. PVOID TcpipSetIPSecStatus;
  212. PVOID TcpipSetIPSecPtr;
  213. PVOID TcpipUnSetIPSecPtr;
  214. PVOID TcpipUnSetIPSecSendPtr;
  215. PVOID TcpipTCPXsum;
  216. PVOID TcpipSendICMPErr;
  217. } IPSEC_SET_TCPIP_STATUS, *PIPSEC_SET_TCPIP_STATUS;
  218. //
  219. // The base Security Association structure for IOCTL_IPSEC_*_SA
  220. //
  221. typedef ULONG SPI_TYPE;
  222. typedef enum _Operation {
  223. None = 0,
  224. Auth, // AH
  225. Encrypt, // ESP
  226. Compress
  227. } OPERATION_E;
  228. //
  229. // IPSEC DOI ESP algorithms
  230. //
  231. typedef enum _ESP_ALGO {
  232. IPSEC_ESP_NONE = 0,
  233. IPSEC_ESP_DES,
  234. IPSEC_ESP_DES_40,
  235. IPSEC_ESP_3_DES,
  236. IPSEC_ESP_MAX
  237. } ESP_ALGO;
  238. //
  239. // IPSEC DOI AH algorithms
  240. //
  241. typedef enum _AH_ALGO {
  242. IPSEC_AH_NONE = 0,
  243. IPSEC_AH_MD5,
  244. IPSEC_AH_SHA,
  245. IPSEC_AH_MAX
  246. } AH_ALGO;
  247. //
  248. // Lifetime structure - 0 => not significant
  249. //
  250. typedef struct _LIFETIME {
  251. ULONG KeyExpirationTime; // lifetime of key - in seconds
  252. ULONG KeyExpirationBytes; // max # of KBytes xformed till re-key
  253. } LIFETIME, *PLIFETIME;
  254. //
  255. // describes generic algorithm properties
  256. //
  257. typedef struct _ALGO_INFO {
  258. ULONG algoIdentifier; // ESP_ALGO or AH_ALGO
  259. ULONG algoKeylen; // len in bytes
  260. ULONG algoRounds; // # of algo rounds
  261. } ALGO_INFO, *PALGO_INFO;
  262. //
  263. // Security Association
  264. //
  265. //
  266. // Flags - not mutually exclusive
  267. //
  268. typedef ULONG SA_FLAGS;
  269. #define IPSEC_SA_INTERNAL_IOCTL_DELETE 0x10000000
  270. #define MAX_SAS 3 // COMP, ESP, AH
  271. #define MAX_OPS MAX_SAS
  272. typedef struct _SECURITY_ASSOCIATION {
  273. OPERATION_E Operation; // ordered set of operations
  274. SPI_TYPE SPI; // SPI in order of operations in OperationArray
  275. ALGO_INFO IntegrityAlgo; // AH
  276. ALGO_INFO ConfAlgo; // ESP
  277. PVOID CompAlgo; // compression algo info
  278. } SECURITY_ASSOCIATION, *PSECURITY_ASSOCIATION;
  279. typedef struct _SA_STRUCT {
  280. HANDLE Context; // context of the original ACQUIRE request
  281. ULONG NumSAs; // number of SAs following
  282. SA_FLAGS Flags;
  283. IPAddr TunnelAddr; // Tunnel end IP Addr
  284. IPAddr SrcTunnelAddr; // Tunnel src IP Addr
  285. LIFETIME Lifetime;
  286. IPSEC_FILTER InstantiatedFilter; // the actual addresses for which this SA was setup
  287. SECURITY_ASSOCIATION SecAssoc[MAX_SAS];
  288. DWORD dwQMPFSGroup;
  289. IKE_COOKIE_PAIR CookiePair;
  290. IPSEC_SA_UDP_ENCAP_TYPE EncapType;
  291. WORD SrcEncapPort; //Src, Dst encapsulation ports for NAT
  292. WORD DestEncapPort;
  293. IPAddr PeerPrivateAddr;
  294. ULONG KeyLen; // key len in # of chars
  295. UCHAR KeyMat[1];
  296. } SA_STRUCT, *PSA_STRUCT;
  297. typedef struct _IPSEC_ADD_UPDATE_SA {
  298. SA_STRUCT SAInfo;
  299. } IPSEC_ADD_UPDATE_SA, *PIPSEC_ADD_UPDATE_SA;
  300. //
  301. // Outbound SAs are typically deleted
  302. //
  303. typedef struct _IPSEC_DELETE_SA {
  304. IPSEC_QM_SA SATemplate; // template used for SA match
  305. } IPSEC_DELETE_SA, *PIPSEC_DELETE_SA;
  306. //
  307. // Inbound SAs are typically expired
  308. //
  309. typedef struct _IPSEC_DELETE_INFO {
  310. IPAddr DestAddr;
  311. IPAddr SrcAddr;
  312. SPI_TYPE SPI;
  313. } IPSEC_DELETE_INFO, *PIPSEC_DELETE_INFO;
  314. typedef struct _IPSEC_EXPIRE_SA {
  315. IPSEC_DELETE_INFO DelInfo;
  316. } IPSEC_EXPIRE_SA, *PIPSEC_EXPIRE_SA;
  317. typedef struct _IPSEC_GET_SPI {
  318. HANDLE Context; // context to represent this SA negotiation
  319. IPSEC_FILTER InstantiatedFilter; // the actual addresses for which this SA was setup
  320. SPI_TYPE SPI; // filled out on return
  321. } IPSEC_GET_SPI, *PIPSEC_GET_SPI;
  322. typedef IPSEC_GET_SPI IPSEC_SET_SPI, *PIPSEC_SET_SPI;
  323. typedef struct _IPSEC_SA_ALGO_INFO {
  324. ALGO_INFO IntegrityAlgo;
  325. ALGO_INFO ConfAlgo;
  326. ALGO_INFO CompAlgo;
  327. } IPSEC_SA_ALGO_INFO, *PIPSEC_SA_ALGO_INFO;
  328. typedef ULONG SA_ENUM_FLAGS;
  329. #define SA_ENUM_FLAGS_INITIATOR 0x00000001
  330. #define SA_ENUM_FLAGS_MTU_BUMPED 0x00000002
  331. #define SA_ENUM_FLAGS_OFFLOADED 0x00000004
  332. #define SA_ENUM_FLAGS_OFFLOAD_FAILED 0x00000008
  333. #define SA_ENUM_FLAGS_OFFLOADABLE 0x00000010
  334. #define SA_ENUM_FLAGS_IN_REKEY 0x00000020
  335. typedef struct _IPSEC_SA_STATS {
  336. ULARGE_INTEGER ConfidentialBytesSent;
  337. ULARGE_INTEGER ConfidentialBytesReceived;
  338. ULARGE_INTEGER AuthenticatedBytesSent;
  339. ULARGE_INTEGER AuthenticatedBytesReceived;
  340. ULARGE_INTEGER TotalBytesSent;
  341. ULARGE_INTEGER TotalBytesReceived;
  342. ULARGE_INTEGER OffloadedBytesSent;
  343. ULARGE_INTEGER OffloadedBytesReceived;
  344. } IPSEC_SA_STATS, *PIPSEC_SA_STATS;
  345. typedef struct _IPSEC_SA_INFO {
  346. GUID PolicyId; // unique identifier to identify a policy entry
  347. GUID FilterId;
  348. LIFETIME Lifetime;
  349. IPAddr InboundTunnelAddr;
  350. ULONG NumOps;
  351. SPI_TYPE InboundSPI[MAX_OPS];
  352. SPI_TYPE OutboundSPI[MAX_OPS];
  353. OPERATION_E Operation[MAX_OPS];
  354. IPSEC_SA_ALGO_INFO AlgoInfo[MAX_OPS];
  355. IPSEC_FILTER AssociatedFilter;
  356. DWORD dwQMPFSGroup;
  357. IKE_COOKIE_PAIR CookiePair;
  358. SA_ENUM_FLAGS EnumFlags;
  359. IPSEC_SA_STATS Stats;
  360. UDP_ENCAP_INFO EncapInfo;
  361. } IPSEC_SA_INFO, *PIPSEC_SA_INFO;
  362. typedef struct _SECURITY_ASSOCIATION_OUT {
  363. DWORD Operation; // ordered set of operations
  364. SPI_TYPE SPI; // SPI in order of operations in OperationArray
  365. ALGO_INFO IntegrityAlgo; // AH
  366. ALGO_INFO ConfAlgo; // ESP
  367. ALGO_INFO CompAlgo; // compression algo info
  368. } SECURITY_ASSOCIATION_OUT, *PSECURITY_ASSOCIATION_OUT;
  369. typedef struct _IPSEC_SA_QUERY_INFO {
  370. GUID PolicyId; // unique identifier to identify a policy entry
  371. LIFETIME Lifetime;
  372. ULONG NumSAs;
  373. SECURITY_ASSOCIATION_OUT SecAssoc[MAX_SAS];
  374. IPSEC_FILTER AssociatedFilter;
  375. DWORD Flags;
  376. IKE_COOKIE_PAIR AssociatedMainMode;
  377. } IPSEC_SA_QUERY_INFO, *PIPSEC_SA_QUERY_INFO;
  378. typedef struct _IPSEC_ENUM_SAS {
  379. DWORD NumEntries; // num entries for which there is space
  380. DWORD NumEntriesPresent; // num entries actually present in the driver
  381. DWORD Index; // num entries to skip
  382. IPSEC_QM_SA SATemplate; // template used for SA match
  383. IPSEC_SA_INFO pInfo[1];
  384. } IPSEC_ENUM_SAS, *PIPSEC_ENUM_SAS;
  385. typedef struct _IPSEC_POST_FOR_ACQUIRE_SA {
  386. HANDLE IdentityInfo; // identity of Principal
  387. HANDLE Context; // context to represent this SA negotiation
  388. GUID PolicyId; // GUID for QM policy
  389. IPAddr SrcAddr;
  390. IPMask SrcMask;
  391. IPAddr DestAddr;
  392. IPMask DestMask;
  393. IPAddr TunnelAddr;
  394. IPAddr InboundTunnelAddr;
  395. DWORD Protocol;
  396. IKE_COOKIE_PAIR CookiePair; // only used for notify
  397. WORD SrcPort;
  398. WORD DestPort;
  399. BOOLEAN TunnelFilter; // TRUE => this is a tunnel filter
  400. UCHAR DestType;
  401. WORD SrcEncapPort;
  402. WORD DestEncapPort;
  403. BYTE Pad1[4];
  404. UCHAR Pad2[2];
  405. } IPSEC_POST_FOR_ACQUIRE_SA, *PIPSEC_POST_FOR_ACQUIRE_SA;
  406. //NB. This must be <= size as the IPSEC_POST_FOR_ACQUIRE_SA
  407. typedef struct _IPSEC_POST_EXPIRE_NOTIFY {
  408. HANDLE IdentityInfo; // identity of Principal
  409. HANDLE Context; // context to represent this SA negotiation
  410. SPI_TYPE InboundSpi;
  411. SPI_TYPE OutboundSpi;
  412. DWORD Flags;
  413. IPAddr SrcAddr;
  414. IPMask SrcMask;
  415. IPAddr DestAddr;
  416. IPMask DestMask;
  417. IPAddr TunnelAddr;
  418. IPAddr InboundTunnelAddr;
  419. DWORD Protocol;
  420. IKE_COOKIE_PAIR CookiePair;
  421. WORD SrcPort;
  422. WORD DestPort;
  423. BOOLEAN TunnelFilter; // TRUE => this is a tunnel filter
  424. WORD SrcEncapPort;
  425. WORD DestEncapPort;
  426. IPAddr PeerPrivateAddr;
  427. UCHAR Pad[3];
  428. } IPSEC_POST_EXPIRE_NOTIFY, *PIPSEC_POST_EXPIRE_NOTIFY;
  429. typedef struct _IPSEC_QUERY_EXPORT {
  430. BOOLEAN Export;
  431. } IPSEC_QUERY_EXPORT, *PIPSEC_QUERY_EXPORT;
  432. typedef struct _IPSEC_FILTER_SPI {
  433. IPSEC_FILTER Filter;
  434. SPI_TYPE Spi;
  435. DWORD Operation;
  436. DWORD Flags;
  437. struct _IPSEC_FILTER_SPI *Next;
  438. } IPSEC_FILTER_SPI, *PIPSEC_FILTER_SPI;
  439. typedef struct _QOS_FILTER_SPI {
  440. IPAddr SrcAddr;
  441. IPAddr DestAddr;
  442. DWORD Protocol;
  443. WORD SrcPort;
  444. WORD DestPort;
  445. DWORD Operation;
  446. DWORD Flags;
  447. SPI_TYPE Spi;
  448. } QOS_FILTER_SPI, *PQOS_FILTER_SPI;
  449. typedef struct _IPSEC_QUERY_SPI {
  450. IPSEC_FILTER Filter;
  451. SPI_TYPE Spi; // inbound spi
  452. SPI_TYPE OtherSpi; // outbound spi
  453. DWORD Operation;
  454. } IPSEC_QUERY_SPI, *PIPSEC_QUERY_SPI;
  455. #define IPSEC_NOTIFY_EXPIRE_CONTEXT 0x00000000
  456. #define IPSEC_RPC_CONTEXT 0x00000001
  457. #endif _IPSEC_H