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.

280 lines
4.3 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. ipsecshr.h
  5. Abstract:
  6. Header file for IPSec Shared lib
  7. Author:
  8. BrianSw 10-19-2000
  9. Environment:
  10. User Level: Win32 / kernel
  11. Revision History:
  12. --*/
  13. #ifndef _IPSECSHR_
  14. #define _IPSECSHR_
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #define IN_CLASSE(i) (((long)(i) & 0xF0000000) == 0xF0000000)
  19. BOOL WINAPI CmpBlob(IPSEC_BYTE_BLOB* c1, IPSEC_BYTE_BLOB *c2);
  20. BOOL WINAPI CmpData(BYTE* c1, BYTE *c2, DWORD size);
  21. BOOL WINAPI CmpAddr(ADDR *Template, ADDR *a2);
  22. BOOL WINAPI CmpTypeStruct(BYTE *Template, BYTE *comp,
  23. DWORD dwTypeSize, DWORD dwStructSize);
  24. BOOL WINAPI CmpFilter(IPSEC_QM_FILTER *Template, IPSEC_QM_FILTER* f2);
  25. BOOL WINAPI CmpQMAlgo(PIPSEC_QM_ALGO Template, PIPSEC_QM_ALGO a2);
  26. BOOL WINAPI CmpQMOffer(PIPSEC_QM_OFFER Template, PIPSEC_QM_OFFER o2);
  27. BOOL WINAPI MatchQMSATemplate(IPSEC_QM_SA *Template,IPSEC_QM_SA *CurInfo);
  28. BOOL WINAPI MatchMMSATemplate(IPSEC_MM_SA *MMTemplate, IPSEC_MM_SA *SaData);
  29. DWORD
  30. ValidateMMPolicy(
  31. PIPSEC_MM_POLICY pMMPolicy
  32. );
  33. DWORD
  34. ValidateMMOffers(
  35. DWORD dwOfferCount,
  36. PIPSEC_MM_OFFER pOffers
  37. );
  38. DWORD
  39. ValidateMMAuthMethods(
  40. PMM_AUTH_METHODS pMMAuthMethods
  41. );
  42. DWORD
  43. ValidateQMPolicy(
  44. PIPSEC_QM_POLICY pQMPolicy
  45. );
  46. DWORD
  47. ValidateQMOffers(
  48. DWORD dwOfferCount,
  49. PIPSEC_QM_OFFER pOffers
  50. );
  51. DWORD
  52. ValidateMMFilter(
  53. PMM_FILTER pMMFilter
  54. );
  55. DWORD
  56. VerifyAddresses(
  57. ADDR Addr,
  58. BOOL bAcceptMe,
  59. BOOL bIsDesAddr
  60. );
  61. DWORD
  62. VerifySubNetAddress(
  63. ULONG uSubNetAddr,
  64. ULONG uSubNetMask,
  65. BOOL bIsDesAddr
  66. );
  67. BOOL
  68. bIsValidIPMask(
  69. ULONG uMask
  70. );
  71. BOOL
  72. bIsValidIPAddress(
  73. ULONG uIpAddr,
  74. BOOL bAcceptMe,
  75. BOOL bIsDesAddr
  76. );
  77. BOOL
  78. bIsValidSubnet(
  79. ULONG uIpAddr,
  80. ULONG uMask,
  81. BOOL bIsDesAddr
  82. );
  83. BOOL
  84. AddressesConflict(
  85. ADDR SrcAddr,
  86. ADDR DesAddr
  87. );
  88. DWORD
  89. ValidateTransportFilter(
  90. PTRANSPORT_FILTER pTransportFilter
  91. );
  92. DWORD
  93. ValidateIPSecQMFilter(
  94. PIPSEC_QM_FILTER pQMFilter
  95. );
  96. DWORD
  97. VerifyProtocols(
  98. PROTOCOL Protocol
  99. );
  100. DWORD
  101. VerifyPortsForProtocol(
  102. PORT Port,
  103. PROTOCOL Protocol
  104. );
  105. DWORD
  106. ValidateMMFilterTemplate(
  107. PMM_FILTER pMMFilter
  108. );
  109. DWORD
  110. ValidateTxFilterTemplate(
  111. PTRANSPORT_FILTER pTxFilter
  112. );
  113. DWORD
  114. ValidateTunnelFilter(
  115. PTUNNEL_FILTER pTunnelFilter
  116. );
  117. DWORD
  118. ValidateTnFilterTemplate(
  119. PTUNNEL_FILTER pTnFilter
  120. );
  121. DWORD
  122. ApplyMulticastFilterValidation(
  123. ADDR Addr,
  124. BOOL bCreateMirror
  125. );
  126. #ifdef __IPSEC_VALIDATE
  127. DWORD
  128. ValidateInitiateIKENegotiation(
  129. STRING_HANDLE pServerName,
  130. PQM_FILTER_CONTAINER pQMFilterContainer,
  131. DWORD dwClientProcessId,
  132. ULONG uhClientEvent,
  133. DWORD dwFlags,
  134. IKENEGOTIATION_HANDLE * phIKENegotiation
  135. );
  136. DWORD
  137. ValidateQueryIKENegotiationStatus(
  138. IKENEGOTIATION_HANDLE hIKENegotiation,
  139. SA_NEGOTIATION_STATUS_INFO *NegotiationStatus
  140. );
  141. DWORD
  142. ValidateCloseIKENegotiationHandle(
  143. IKENEGOTIATION_HANDLE * phIKENegotiation
  144. );
  145. DWORD
  146. ValidateEnumMMSAs(
  147. STRING_HANDLE pServerName,
  148. PMM_SA_CONTAINER pMMTemplate,
  149. PMM_SA_CONTAINER *ppMMSAContainer,
  150. LPDWORD pdwNumEntries,
  151. LPDWORD pdwTotalMMsAvailable,
  152. LPDWORD pdwEnumHandle,
  153. DWORD dwFlags
  154. );
  155. DWORD
  156. ValidateDeleteMMSAs(
  157. STRING_HANDLE pServerName,
  158. PMM_SA_CONTAINER pMMTemplate,
  159. DWORD dwFlags
  160. );
  161. DWORD
  162. ValidateQueryIKEStatistics(
  163. STRING_HANDLE pServerName,
  164. IKE_STATISTICS *pIKEStatistics
  165. );
  166. DWORD
  167. ValidateRegisterIKENotifyClient(
  168. STRING_HANDLE pServerName,
  169. DWORD dwClientProcessId,
  170. ULONG uhClientEvent,
  171. PQM_SA_CONTAINER pQMSATemplateContainer,
  172. IKENOTIFY_HANDLE *phNotifyHandle,
  173. DWORD dwFlags
  174. );
  175. DWORD ValidateQueryNotifyData(
  176. IKENOTIFY_HANDLE uhNotifyHandle,
  177. PDWORD pdwNumEntries,
  178. PQM_SA_CONTAINER *ppQMSAContainer,
  179. DWORD dwFlags
  180. );
  181. DWORD ValidateCloseNotifyHandle(
  182. IKENOTIFY_HANDLE *phHandle
  183. );
  184. DWORD ValidateIPSecAddSA(
  185. STRING_HANDLE pServerName,
  186. PIPSEC_QM_POLICY_CONTAINER pQMPolicyContainer,
  187. PQM_FILTER_CONTAINER pQMFilterContainer,
  188. DWORD *uhLarvalContext,
  189. DWORD dwInboundKeyMatLen,
  190. BYTE *pInboundKeyMat,
  191. DWORD dwOutboundKeyMatLen,
  192. BYTE *pOutboundKeyMat,
  193. BYTE *pContextInfo,
  194. DWORD dwFlags);
  195. #endif //__IPSEC_VALIDATE
  196. #ifdef __cplusplus
  197. }
  198. #endif
  199. #endif // _WINIPSEC_