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.

282 lines
6.3 KiB

  1. #define IPSEC_ISAKMP_PORT2 0x9411 // 4500 in NBO
  2. #define IPSEC_ISAKMP_PORT 0xf401 // 500 in NBO
  3. #define IPSEC_KERBEROS_PORT 0x5800 // 88 in NBO
  4. #define IPSEC_LDAP_PORT 0x8501 // 389 in NBO
  5. #define IPSEC_L2TP_PORT 0xa506
  6. IPSEC_ACTION
  7. IPSecHandlePacket(
  8. IN PUCHAR pIPHeader,
  9. IN PVOID pData,
  10. IN PVOID IPContext,
  11. IN PNDIS_PACKET Packet,
  12. IN OUT PULONG pExtraBytes,
  13. IN OUT PULONG pMTU,
  14. OUT PVOID *pNewData,
  15. IN OUT PULONG pIpsecFlags,
  16. IN UCHAR DestType
  17. );
  18. IPSEC_ACTION
  19. IPSecSendPacket(
  20. IN PUCHAR pIPHeader,
  21. IN PVOID pData,
  22. IN PVOID IPContext,
  23. IN PNDIS_PACKET Packet,
  24. IN OUT PULONG pExtraBytes,
  25. IN OUT PULONG pMTU,
  26. OUT PVOID *pNewData,
  27. IN OUT PULONG pIpsecFlags,
  28. OUT PIPSEC_DROP_STATUS pDropStatus,
  29. IN UCHAR DestType
  30. );
  31. IPSEC_ACTION
  32. IPSecRecvPacket(
  33. IN PUCHAR *pIPHeader,
  34. IN PVOID pData,
  35. IN PVOID IPContext,
  36. IN PNDIS_PACKET Packet,
  37. IN OUT PULONG pExtraBytes,
  38. IN OUT PULONG pIpsecFlags,
  39. OUT PIPSEC_DROP_STATUS pDropStatus,
  40. IN UCHAR DestType
  41. );
  42. NTSTATUS
  43. IPSecVerifyIncomingFilterSA(IN PUCHAR * pIPHeader,
  44. IN PVOID pData,
  45. IN PSA_TABLE_ENTRY pSA,
  46. IN UCHAR DestType,
  47. BOOLEAN fLoopback,
  48. BOOLEAN fReinject,
  49. IN PIPSEC_UDP_ENCAP_CONTEXT pNatContext
  50. );
  51. VOID
  52. IPSecCalcHeaderOverheadFromSA(
  53. IN PSA_TABLE_ENTRY pSA,
  54. OUT PULONG pOverhead
  55. );
  56. NTSTATUS
  57. IPSecParsePacket(
  58. IN PUCHAR pIPHeader,
  59. IN PVOID *pData,
  60. OUT tSPI *pSPI,
  61. OUT BOOLEAN *bNatEncap,
  62. OUT IPSEC_UDP_ENCAP_CONTEXT *pNatContext
  63. );
  64. PSA_TABLE_ENTRY
  65. IPSecLookupSAInLarval(
  66. IN ULARGE_INTEGER uliSrcDstAddr,
  67. IN ULARGE_INTEGER uliProtoSrcDstPort
  68. );
  69. NTSTATUS
  70. IPSecClassifyPacket(
  71. IN PUCHAR pHeader,
  72. IN PVOID pData,
  73. OUT PSA_TABLE_ENTRY *ppSA,
  74. OUT PSA_TABLE_ENTRY *ppNextSA,
  75. OUT USHORT *pFilterFlags,
  76. #if GPC
  77. IN CLASSIFICATION_HANDLE GpcHandle,
  78. #endif
  79. IN BOOLEAN fOutbound,
  80. IN BOOLEAN fFWPacket,
  81. IN BOOLEAN fDoBypassCheck,
  82. IN BOOLEAN fRecvReinject,
  83. IN BOOLEAN fVerify,
  84. IN UCHAR DestType,
  85. IN PIPSEC_UDP_ENCAP_CONTEXT pNatContext
  86. );
  87. VOID
  88. IPSecSendComplete(
  89. IN PNDIS_PACKET Packet,
  90. IN PVOID pData,
  91. IN PIPSEC_SEND_COMPLETE_CONTEXT pContext,
  92. IN IP_STATUS Status,
  93. OUT PVOID *ppNewData
  94. );
  95. VOID
  96. IPSecProtocolSendComplete (
  97. IN PVOID pContext,
  98. IN PNDIS_BUFFER pMdl,
  99. IN IP_STATUS Status
  100. );
  101. NTSTATUS
  102. IPSecChkReplayWindow(
  103. IN ULONG Seq,
  104. IN PSA_TABLE_ENTRY pSA,
  105. IN ULONG Index
  106. );
  107. NTSTATUS
  108. IPSecPrepareReinjectPacket(
  109. IN PVOID pData,
  110. IN PNDIS_PACKET_EXTENSION pPktExt,
  111. OUT PNDIS_BUFFER * ppHdrMdl,
  112. OUT PUCHAR * ppIPH,
  113. OUT PNDIS_BUFFER * ppOptMdl,
  114. OUT PNDIS_BUFFER * ppDataMdl,
  115. OUT PIPSEC_SEND_COMPLETE_CONTEXT * ppContext,
  116. OUT PULONG pLen
  117. );
  118. NTSTATUS
  119. IPSecReinjectPreparedPacket(
  120. IN PNDIS_BUFFER pHdrMdl,
  121. IN PIPSEC_SEND_COMPLETE_CONTEXT pContext,
  122. IN ULONG len,
  123. IN PUCHAR pIPHeader
  124. );
  125. NTSTATUS
  126. IPSecReinjectPacket(
  127. IN PVOID pData,
  128. IN PNDIS_PACKET_EXTENSION pPktExt
  129. );
  130. NTSTATUS
  131. IPSecQueuePacket(
  132. IN PSA_TABLE_ENTRY pSA,
  133. IN PVOID pDataBuf
  134. );
  135. VOID
  136. IPSecIPAddrToUnicodeString(
  137. IN IPAddr Addr,
  138. OUT PWCHAR UCIPAddrBuffer
  139. );
  140. VOID
  141. IPSecCountToUnicodeString(
  142. IN ULONG Count,
  143. OUT PWCHAR UCCountBuffer
  144. );
  145. VOID
  146. IPSecESPStatus(
  147. IN UCHAR StatusType,
  148. IN IP_STATUS StatusCode,
  149. IN IPAddr OrigDest,
  150. IN IPAddr OrigSrc,
  151. IN IPAddr Src,
  152. IN ULONG Param,
  153. IN PVOID Data
  154. );
  155. VOID
  156. IPSecAHStatus(
  157. IN UCHAR StatusType,
  158. IN IP_STATUS StatusCode,
  159. IN IPAddr OrigDest,
  160. IN IPAddr OrigSrc,
  161. IN IPAddr Src,
  162. IN ULONG Param,
  163. IN PVOID Data
  164. );
  165. VOID
  166. IPSecProcessPMTU(
  167. IN IPAddr OrigDest,
  168. IN IPAddr OrigSrc,
  169. IN tSPI SPI,
  170. IN OPERATION_E Operation,
  171. IN ULONG NewMTU
  172. );
  173. IPSEC_ACTION
  174. IPSecRcvFWPacket(
  175. IN PCHAR pIPHeader,
  176. IN PVOID pData,
  177. IN UINT DataLength,
  178. IN UCHAR DestType
  179. );
  180. NTSTATUS
  181. IPSecRekeyInboundSA(
  182. IN PSA_TABLE_ENTRY pSA
  183. );
  184. NTSTATUS
  185. IPSecRekeyOutboundSA(
  186. IN PSA_TABLE_ENTRY pSA
  187. );
  188. NTSTATUS
  189. IPSecPuntInboundSA(
  190. IN PSA_TABLE_ENTRY pSA
  191. );
  192. NTSTATUS
  193. IPSecPuntOutboundSA(
  194. IN PSA_TABLE_ENTRY pSA
  195. );
  196. BOOLEAN
  197. IPSecQueryStatus(
  198. IN CLASSIFICATION_HANDLE GpcHandle
  199. );
  200. NTSTATUS IPSecDisableUdpXsum(
  201. IN IPRcvBuf *pData
  202. );
  203. NTSTATUS AddShimContext(IN PUCHAR *pIpHeader,
  204. IN PVOID pData,
  205. IPSEC_UDP_ENCAP_CONTEXT *pNatContext);
  206. NTSTATUS
  207. GetIpBufferForICMP(
  208. PUCHAR pucIPHeader,
  209. PVOID pvData,
  210. PUCHAR * ppucIpBuffer,
  211. PUCHAR * ppucStorage
  212. );
  213. NTSTATUS
  214. IPSecGetSendBuffer(
  215. PMDL * ppMdlChain,
  216. ULONG uOffset,
  217. ULONG uBytesNeeded,
  218. PVOID pvStorage,
  219. PULONG puLastWalkedMdlOffset,
  220. PUCHAR * ppucReturnBuf
  221. );
  222. NTSTATUS
  223. IPSecCopyMdlToBuffer(
  224. PMDL * ppMdlChain,
  225. ULONG uOffset,
  226. PVOID pvBuffer,
  227. ULONG uBytesToCopy,
  228. PULONG puLastWalkedMdlOffset,
  229. PULONG puBytesCopied
  230. );
  231. IPSEC_ACTION IPSecProcessBoottime(IN PUCHAR pIPHeader,
  232. IN PVOID pData,
  233. IN PNDIS_PACKET Packet,
  234. IN ULONG IpsecFlags,
  235. IN UCHAR DestType);
  236. BOOLEAN
  237. IPSecIsGenericPortsProtocolOf(
  238. ULARGE_INTEGER uliGenericPortProtocol,
  239. ULARGE_INTEGER uliSpecificPortProtocol
  240. );