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.

234 lines
5.0 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(GetConsoleOutputCP(), \
  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 LPCWSTR pwszMachine,
  52. IN OUT LPWSTR *pptcArguments,
  53. IN DWORD dwArgCount,
  54. IN DWORD dwFlags,
  55. IN MIB_SERVER_HANDLE hMIBServer,
  56. OUT LPWSTR pwcNewContext
  57. );
  58. typedef IP_CONTEXT_ENTRY_FN *PIP_CONTEXT_ENTRY_FN;
  59. typedef
  60. DWORD
  61. (WINAPI ROUTING_CONTEXT_ENTRY_FN)(
  62. IN LPCWSTR pwszRouter,
  63. IN OUT LPSTR *pptcArguments,
  64. IN DWORD dwArgCount,
  65. IN DWORD dwFlags,
  66. OUT LPSTR 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 LPCWSTR 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 LPCWSTR 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 LPCWSTR 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 LPCWSTR pwszIfName,
  133. OUT PDWORD pdwIfType
  134. );
  135. typedef
  136. DWORD
  137. (WINAPI *PIM_MATCH_ROUT_PROTO)(
  138. IN LPCWSTR pwszToken
  139. );
  140. DWORD WINAPI
  141. IpmontrGetFriendlyNameFromIfIndex(
  142. IN MIB_SERVER_HANDLE hMibServer,
  143. IN DWORD dwIfIndex,
  144. OUT LPWSTR pwszBuffer,
  145. IN DWORD dwBufferSize
  146. );
  147. DWORD WINAPI
  148. IpmontrGetIfIndexFromFriendlyName(
  149. IN MIB_SERVER_HANDLE hMibServer,
  150. IN LPCWSTR pwszBuffer,
  151. OUT PDWORD pdwIfIndex
  152. );
  153. DWORD WINAPI
  154. IpmontrGetFriendlyNameFromIfName(
  155. IN LPCWSTR pwszName,
  156. OUT LPWSTR pwszBuffer,
  157. IN PDWORD pdwBufSize
  158. );
  159. DWORD WINAPI
  160. IpmontrGetIfNameFromFriendlyName(
  161. IN LPCWSTR pwszName,
  162. OUT LPWSTR pwszBuffer,
  163. IN PDWORD pdwBufSize
  164. );
  165. DWORD WINAPI
  166. IpmontrCreateInterface(
  167. IN LPCWSTR pwszMachineName,
  168. IN LPCWSTR pwszInterfaceName,
  169. IN DWORD dwLocalAddress,
  170. IN DWORD dwRemoteAddress,
  171. IN BYTE byTtl
  172. );
  173. DWORD WINAPI
  174. IpmontrDeleteInterface(
  175. IN LPCWSTR pwszMachineName,
  176. IN LPCWSTR pwszInterfaceName
  177. );
  178. #if _MSC_VER >= 1200
  179. #pragma warning(push)
  180. #endif
  181. #pragma warning(disable:4201)
  182. #if _MSC_VER >= 1200
  183. #pragma warning(pop)
  184. #else
  185. #pragma warning(default:4201)
  186. #endif
  187. #ifdef __cplusplus
  188. }
  189. #endif
  190. #endif // _IPMONTR_H_