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.

277 lines
6.4 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. ipmontr.h
  5. Abstract:
  6. This file contains definitions which are needed by IPMONTR.DLL
  7. and all NetSh helper DLLs which register under it.
  8. --*/
  9. #ifndef _IPMONTR_H_
  10. #define _IPMONTR_H_
  11. #if _MSC_VER > 1000
  12. #pragma once
  13. #endif
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. // {65EC23C0-D1B9-11d2-89E4-006008B0E5B9}
  18. #define ROUTING_GUID \
  19. { 0x65ec23c0, 0xd1b9, 0x11d2, { 0x89, 0xe4, 0x0, 0x60, 0x8, 0xb0, 0xe5, 0xb9 } }
  20. // {0705ECA0-7AAC-11d2-89DC-006008B0E5B9}
  21. #define IPMONTR_GUID \
  22. { 0x705eca0, 0x7aac, 0x11d2, { 0x89, 0xdc, 0x0, 0x60, 0x8, 0xb0, 0xe5, 0xb9 } }
  23. #define IPMON_VERSION_50 0x0005000
  24. #define ADDR_LENGTH 24
  25. #define ADDR_LEN 4
  26. #define PRINT_IPADDR(x) \
  27. ((x)&0x000000ff),(((x)&0x0000ff00)>>8),(((x)&0x00ff0000)>>16),(((x)&0xff000000)>>24)
  28. #define IP_TO_WSTR(str,addr) swprintf((str),L"%d.%d.%d.%d", \
  29. (addr)[0], \
  30. (addr)[1], \
  31. (addr)[2], \
  32. (addr)[3])
  33. #ifdef UNICODE
  34. #define MakeUnicodeIpAddr(ptszUnicode,pszAddr) \
  35. MultiByteToWideChar(CP_ACP, \
  36. 0, \
  37. (pszAddr), \
  38. -1, \
  39. (ptszUnicode), \
  40. ADDR_LENGTH)
  41. #else
  42. #define MakeUnicodeIpAddr(ptszUnicode,pszAddr) \
  43. strcpy((ptszUnicode),(pszAddr))
  44. #endif //UNICODE
  45. //
  46. // API prototypes and structures used by them
  47. //
  48. typedef
  49. DWORD
  50. (WINAPI IP_CONTEXT_ENTRY_FN)(
  51. IN PWCHAR pwszMachine,
  52. IN PTCHAR *pptcArguments,
  53. IN DWORD dwArgCount,
  54. IN DWORD dwFlags,
  55. IN MIB_SERVER_HANDLE hMIBServer,
  56. OUT PWCHAR pwcNewContext
  57. );
  58. typedef IP_CONTEXT_ENTRY_FN *PIP_CONTEXT_ENTRY_FN;
  59. typedef
  60. DWORD
  61. (WINAPI ROUTING_CONTEXT_ENTRY_FN)(
  62. IN PWCHAR pwszRouter,
  63. IN PTCHAR *pptcArguments,
  64. IN DWORD dwArgCount,
  65. IN DWORD dwFlags,
  66. OUT PWCHAR pwcNewContext
  67. );
  68. typedef ROUTING_CONTEXT_ENTRY_FN *PROUTING_CONTEXT_ENTRY_FN;
  69. typedef
  70. DWORD
  71. (WINAPI ROUTING_CONTEXT_COMMIT_FN)(
  72. IN DWORD dwAction
  73. );
  74. typedef ROUTING_CONTEXT_COMMIT_FN *PROUTING_CONTEXT_COMMIT_FN;
  75. DWORD WINAPI
  76. IpmontrDeleteInfoBlockFromInterfaceInfo(
  77. IN PWCHAR pwszIfName,
  78. IN DWORD dwType
  79. );
  80. DWORD WINAPI
  81. IpmontrDeleteInfoBlockFromGlobalInfo(
  82. IN DWORD dwType
  83. );
  84. DWORD WINAPI
  85. IpmontrDeleteProtocol(
  86. IN DWORD dwProtoId
  87. );
  88. DWORD WINAPI
  89. IpmontrGetInfoBlockFromGlobalInfo(
  90. IN DWORD dwType,
  91. OUT BYTE **ppbInfoBlk,
  92. OUT PDWORD pdwSize,
  93. OUT PDWORD pdwCount
  94. );
  95. DWORD WINAPI
  96. IpmontrGetInfoBlockFromInterfaceInfo(
  97. IN PWCHAR pwszIfName,
  98. IN DWORD dwType,
  99. OUT BYTE **ppbInfoBlk,
  100. OUT PDWORD pdwSize,
  101. OUT PDWORD pdwCount,
  102. OUT PDWORD pdwIfType
  103. );
  104. DWORD WINAPI
  105. IpmontrSetInfoBlockInGlobalInfo(
  106. IN DWORD dwType,
  107. IN PBYTE pbInfoBlk,
  108. IN DWORD dwSize,
  109. IN DWORD dwCount
  110. );
  111. DWORD WINAPI
  112. IpmontrSetInfoBlockInInterfaceInfo(
  113. IN PWCHAR pwszIfName,
  114. IN DWORD dwType,
  115. IN PBYTE pbInfoBlk,
  116. IN DWORD dwSize,
  117. IN DWORD dwCount
  118. );
  119. DWORD WINAPI
  120. IpmontrInterfaceEnum(
  121. OUT BYTE **ppb,
  122. OUT PDWORD pdwCount,
  123. OUT PDWORD pdwTotal
  124. );
  125. typedef
  126. BOOL
  127. (WINAPI *PIM_ROUTER_STATUS)(
  128. VOID
  129. );
  130. DWORD WINAPI
  131. IpmontrGetInterfaceType(
  132. IN PWCHAR pwszIfName,
  133. OUT PDWORD pdwIfType
  134. );
  135. typedef
  136. DWORD
  137. (WINAPI *PIM_MATCH_ROUT_PROTO)(
  138. IN PWCHAR pwszToken
  139. );
  140. DWORD WINAPI
  141. IpmontrGetFriendlyNameFromIfIndex(
  142. IN MIB_SERVER_HANDLE hMibServer,
  143. IN DWORD dwIfIndex,
  144. OUT PWCHAR pwszBuffer,
  145. IN DWORD dwBufferSize
  146. );
  147. DWORD WINAPI
  148. IpmontrGetIfIndexFromFriendlyName(
  149. IN MIB_SERVER_HANDLE hMibServer,
  150. IN PWCHAR pwszBuffer,
  151. OUT PDWORD pdwIfIndex
  152. );
  153. DWORD WINAPI
  154. IpmontrGetFriendlyNameFromIfName(
  155. IN PWCHAR pwszName,
  156. OUT PWCHAR pwszBuffer,
  157. IN PDWORD pdwBufSize
  158. );
  159. DWORD WINAPI
  160. IpmontrGetIfNameFromFriendlyName(
  161. IN PWCHAR pwszName,
  162. OUT PWCHAR pwszBuffer,
  163. IN PDWORD pdwBufSize
  164. );
  165. DWORD WINAPI
  166. IpmontrCreateInterface(
  167. IN PWCHAR pwszMachineName,
  168. IN PWCHAR pwszInterfaceName,
  169. IN DWORD dwLocalAddress,
  170. IN DWORD dwRemoteAddress,
  171. IN BYTE byTtl
  172. );
  173. DWORD WINAPI
  174. IpmontrDeleteInterface(
  175. IN PWCHAR pwszMachineName,
  176. IN PWCHAR pwszInterfaceName
  177. );
  178. NS_DISPLAY_PARENT_HELP DisplayRoutingHelp;
  179. NS_DISPLAY_PARENT_HELP DisplayIpHelp;
  180. #if _MSC_VER >= 1200
  181. #pragma warning(push)
  182. #endif
  183. #pragma warning(disable:4201)
  184. typedef struct _IP_CONTEXT_ATTRIBUTES
  185. {
  186. #ifdef __cplusplus
  187. NS_BASE_CONTEXT_ATTRIBUTES bca;
  188. #else
  189. NS_BASE_CONTEXT_ATTRIBUTES;
  190. #endif
  191. PIP_CONTEXT_ENTRY_FN pfnEntryFn;
  192. PVOID pfnCommitFn; // UNUSED
  193. PNS_CONTEXT_DUMP_FN pfnDumpFn;
  194. PVOID pfnConnectFn; // UNUSED
  195. PVOID pfnSubEntryFn; // UNUSED
  196. PVOID pfnHelpFn; // UNUSED
  197. }IP_CONTEXT_ATTRIBUTES, *PIP_CONTEXT_ATTRIBUTES;
  198. typedef struct _ROUTING_CONTEXT_ATTRIBUTES
  199. {
  200. #ifdef __cplusplus
  201. NS_BASE_CONTEXT_ATTRIBUTES bca;
  202. #else
  203. NS_BASE_CONTEXT_ATTRIBUTES;
  204. #endif
  205. PROUTING_CONTEXT_ENTRY_FN pfnEntryFn;
  206. PROUTING_CONTEXT_COMMIT_FN pfnCommitFn;
  207. PNS_CONTEXT_DUMP_FN pfnDumpFn;
  208. PVOID pfnConnectFn; // UNUSED
  209. PVOID pfnSubEntryFn; // UNUSED
  210. PNS_CONTEXT_HELP_FN pfnHelpFn;
  211. }ROUTING_CONTEXT_ATTRIBUTES, *PROUTING_CONTEXT_ATTRIBUTES;
  212. #if _MSC_VER >= 1200
  213. #pragma warning(pop)
  214. #else
  215. #pragma warning(default:4201)
  216. #endif
  217. typedef
  218. DWORD
  219. (WINAPI *PIP_REGISTER_CONTEXT)(
  220. IN PIP_CONTEXT_ATTRIBUTES pAttributes
  221. );
  222. #ifdef __cplusplus
  223. }
  224. #endif
  225. #endif // _IPMONTR_H_