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
6.6 KiB

  1. //=============================================================================
  2. // Copyright (c) 1999 Microsoft Corporation
  3. // File: ifip.h
  4. //
  5. // Author: K.S.Lokesh (lokeshs@) 8-1-99
  6. //=============================================================================
  7. #ifndef __IFIP_H
  8. #define __IFIP_H
  9. #define DBG1 0
  10. //kslksl
  11. #define TCP_XMT_CHECKSUM_OFFLOAD 0x00000001
  12. #define IP_XMT_CHECKSUM_OFFLOAD 0x00000002
  13. #define TCP_RCV_CHECKSUM_OFFLOAD 0x00000004
  14. #define IP_RCV_CHECKSUM_OFFLOAD 0x00000008
  15. #define TCP_LARGE_SEND_OFFLOAD 0x00000010
  16. //
  17. // IPSEC General Xmit\Recv capabilities
  18. //
  19. #define IPSEC_OFFLOAD_CRYPTO_ONLY 0x00000020 // Raw crypto mode supported
  20. #define IPSEC_OFFLOAD_AH_ESP 0x00000040 // Combined AH+ESP supported
  21. #define IPSEC_OFFLOAD_TPT_TUNNEL 0x00000080 // Combined Tpt+Tunnel supported
  22. #define IPSEC_OFFLOAD_V4_OPTIONS 0x00000100 // IPV4 Options supported
  23. #define IPSEC_OFFLOAD_QUERY_SPI 0x00000200 // Get SPI supported
  24. //
  25. // IPSEC AH Xmit\Recv capabilities
  26. //
  27. #define IPSEC_OFFLOAD_AH_XMT 0x00000400 // IPSEC supported on Xmit
  28. #define IPSEC_OFFLOAD_AH_RCV 0x00000800 // IPSEC supported on Rcv
  29. #define IPSEC_OFFLOAD_AH_TPT 0x00001000 // IPSEC transport mode supported
  30. #define IPSEC_OFFLOAD_AH_TUNNEL 0x00002000 // IPSEC tunnel mode supported
  31. #define IPSEC_OFFLOAD_AH_MD5 0x00004000 // MD5 supported as AH and ESP algo
  32. #define IPSEC_OFFLOAD_AH_SHA_1 0x00008000 // SHA_1 supported as AH and ESP algo
  33. //
  34. // IPSEC ESP Xmit\Recv capabilities
  35. //
  36. #define IPSEC_OFFLOAD_ESP_XMT 0x00010000 // IPSEC supported on Xmit
  37. #define IPSEC_OFFLOAD_ESP_RCV 0x00020000 // IPSEC supported on Rcv
  38. #define IPSEC_OFFLOAD_ESP_TPT 0x00040000 // IPSEC transport mode supported
  39. #define IPSEC_OFFLOAD_ESP_TUNNEL 0x00080000 // IPSEC tunnel mode supported
  40. #define IPSEC_OFFLOAD_ESP_DES 0x00100000 // DES supported as ESP algo
  41. #define IPSEC_OFFLOAD_ESP_DES_40 0x00200000 // DES40 supported as ESP algo
  42. #define IPSEC_OFFLOAD_ESP_3_DES 0x00400000 // 3DES supported as ESP algo
  43. #define IPSEC_OFFLOAD_ESP_NONE 0x00800000 // Null ESP supported as ESP algo
  44. #define IFIP_GUID \
  45. {0x89d00931, 0x1e00, 0x11d3, {0x87, 0x38, 0x00, 0x60, 0x08, 0x37, 0xc7, 0x75} }
  46. #define IFIP_VERSION 1
  47. #define ADD_FLAG 1
  48. #define SET_FLAG 2
  49. #define DEL_FLAG 4
  50. #define RETURN_ERROR_OKAY(dwErr) \
  51. return (dwErr) == NO_ERROR? ERROR_OKAY : dwErr;
  52. #if DBG1
  53. #define DEBUG_PRINT_CONFIG(pRemoteIpInfo) {\
  54. DisplayMessage(g_hModule, MSG_DEBUG_HDR);\
  55. DisplayMessage(g_hModule,\
  56. MSG_IPADDR_LIST,\
  57. (pRemoteIpInfo)->pszwIpAddrList,\
  58. (pRemoteIpInfo)->pszwSubnetMaskList);\
  59. \
  60. DisplayMessage(g_hModule,\
  61. MSG_OPTIONS_LIST,\
  62. (pRemoteIpInfo)->pszwOptionList);\
  63. DisplayMessage(g_hModule, MSG_DEBUG_HDR);\
  64. \
  65. }
  66. #else
  67. #define DEBUG_PRINT_CONFIG(pRemoteIpInfo)
  68. #endif
  69. typedef enum _DISPLAY_TYPE {
  70. TYPE_ADDR=0x01,
  71. TYPE_GATEWAY=0x02,
  72. TYPE_IPADDR=0x03,
  73. TYPE_DNS=0x04,
  74. TYPE_WINS=0x08,
  75. TYPE_IFMETRIC=0x10,
  76. TYPE_DDNS=0x20,
  77. TYPE_IP_ALL=0xff,
  78. TYPE_OFFLOAD=0x0100
  79. } DISPLAY_TYPE;
  80. typedef enum _REGISTER_MODE {
  81. REGISTER_NONE = 0,
  82. REGISTER_PRIMARY = 1,
  83. REGISTER_BOTH = 3,
  84. REGISTER_UNCHANGED = 0xff
  85. } REGISTER_MODE;
  86. NS_HELPER_START_FN IfIpStartHelper;
  87. NS_CONTEXT_DUMP_FN IfIpDump;
  88. FN_HANDLE_CMD IfIpHandleSetAddress;
  89. FN_HANDLE_CMD IfIpHandleSetDns;
  90. FN_HANDLE_CMD IfIpHandleSetWins;
  91. FN_HANDLE_CMD IfIpHandleAddAddress;
  92. FN_HANDLE_CMD IfIpHandleAddDns;
  93. FN_HANDLE_CMD IfIpHandleAddWins;
  94. FN_HANDLE_CMD IfIpHandleSetLmhosts;
  95. DWORD
  96. IfIpAddMany(
  97. IN PWCHAR *ppwcArguments,
  98. IN DWORD dwCurrentIndex,
  99. IN DWORD dwArgCount,
  100. IN BOOL *pbDone,
  101. IN DWORD Type
  102. );
  103. DWORD
  104. IfIpSetDhcpModeMany(
  105. LPCWSTR pwszIfFriendlyName,
  106. GUID *pGuid,
  107. DWORD dwRegisterMode,
  108. DISPLAY_TYPE Type
  109. );
  110. DWORD
  111. IfIpAddSetAddress(
  112. LPCWSTR pwszIfFriendlyName,
  113. GUID *pGuid,
  114. LPCWSTR pwszAddr,
  115. LPCWSTR pwszMask,
  116. DWORD Flags
  117. );
  118. DWORD
  119. IfIpAddSetGateway(
  120. LPCWSTR pwszIfFriendlyName,
  121. GUID *pGuid,
  122. LPCWSTR pwszGateway,
  123. LPCWSTR pwszGatewayMetric,
  124. DWORD Flags
  125. );
  126. FN_HANDLE_CMD IfIpHandleDelAddress;
  127. FN_HANDLE_CMD IfIpHandleDelDns;
  128. FN_HANDLE_CMD IfIpHandleDelWins;
  129. DWORD
  130. IfIpDelMany(
  131. IN PWCHAR *ppwcArguments,
  132. IN DWORD dwCurrentIndex,
  133. IN DWORD dwArgCount,
  134. IN BOOL *pbDone,
  135. IN DISPLAY_TYPE Type
  136. );
  137. FN_HANDLE_CMD IfIpHandleShowConfig;
  138. FN_HANDLE_CMD IfIpHandleShowAddress;
  139. FN_HANDLE_CMD IfIpHandleShowOffload;
  140. FN_HANDLE_CMD IfIpHandleShowDns;
  141. FN_HANDLE_CMD IfIpHandleShowWins;
  142. FN_HANDLE_CMD IfIpHandleDelArpCache;
  143. FN_HANDLE_CMD IfIpHandleReset;
  144. DWORD
  145. ShowInfoIpaddr(
  146. ULONG IfIndex,
  147. GUID *pGuid,
  148. PWCHAR pFriendlyIfName
  149. );
  150. DWORD
  151. IfIpShowMany(
  152. IN LPCWSTR pwszMachineName,
  153. IN PWCHAR *ppwcArguments,
  154. IN DWORD dwCurrentIndex,
  155. IN DWORD dwArgCount,
  156. IN BOOL *pbDone,
  157. IN DISPLAY_TYPE dtType
  158. );
  159. DWORD
  160. IfIpShowAllInterfaceInfo(
  161. LPCWSTR pwszMachineName,
  162. DISPLAY_TYPE Type,
  163. HANDLE hFile
  164. );
  165. DWORD
  166. IfIpHandleDelIpaddrEx(
  167. LPCWSTR wszIfFriendlyName,
  168. GUID *pGuid,
  169. LPCWSTR pwszIpAddr,
  170. LPCWSTR pwszGateway,
  171. ULONG Flags
  172. );
  173. DWORD
  174. OpenDriver(
  175. HANDLE *Handle,
  176. LPWSTR DriverName
  177. );
  178. NTSTATUS
  179. DoIoctl(
  180. HANDLE Handle,
  181. DWORD IoctlCode,
  182. PVOID Request,
  183. DWORD RequestSize,
  184. PVOID Response,
  185. PDWORD ResponseSize
  186. );
  187. DWORD
  188. IfIpShowManyEx(
  189. LPCWSTR pwszMachineName,
  190. ULONG IfIndex,
  191. PWCHAR wszIfFriendlyName,
  192. GUID *guid,
  193. DISPLAY_TYPE dtType,
  194. HANDLE hFile
  195. );
  196. DWORD
  197. IfIpShowManyExEx(
  198. LPCWSTR pwszMachineName,
  199. ULONG IfIndex,
  200. PWCHAR pFriendlyIfName,
  201. GUID *pGuid,
  202. ULONG Flags,
  203. HANDLE hFile
  204. );
  205. DWORD
  206. IfIpShowInfoOffload(
  207. ULONG IfIndex,
  208. PWCHAR wszIfFriendlyName
  209. );
  210. DWORD
  211. IfIpGetInfoOffload(
  212. ULONG IfIndex,
  213. PULONG Flags
  214. );
  215. DWORD
  216. IfIpSetMany(
  217. IN PWCHAR *ppwcArguments,
  218. IN DWORD dwCurrentIndex,
  219. IN DWORD dwArgCount,
  220. IN BOOL *pbDone,
  221. IN DWORD Type
  222. );
  223. DWORD
  224. IfIpAddSetDelMany(
  225. PWCHAR wszIfFriendlyName,
  226. GUID *pGuid,
  227. PWCHAR pwszAddress,
  228. DWORD dwIndex,
  229. DWORD dwRegisterMode,
  230. DISPLAY_TYPE Type,
  231. DWORD Flags
  232. );
  233. #endif