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.

252 lines
8.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1998 - 1999
  5. //
  6. // File: U P D A T E . H
  7. //
  8. // Contents: Declaration of RAS configuration objects.
  9. //
  10. // Notes:
  11. //
  12. // Author: shaunco 21 Mar 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. //nclude <ncxbase.h>
  17. //nclude <nceh.h>
  18. //nclude <notifval.h>
  19. #include <mprapi.h>
  20. //nclude "ndiswan.h"
  21. #include "resource.h"
  22. //nclude "rasaf.h"
  23. //nclude "rasdata.h"
  24. //nclude "ncutil.h"
  25. #include "netcfgx.h"
  26. #include "bindobj.h"
  27. //
  28. // Frame type definitions
  29. //
  30. #define ISN_FRAME_TYPE_ETHERNET_II 0
  31. #define ISN_FRAME_TYPE_802_3 1
  32. #define ISN_FRAME_TYPE_802_2 2
  33. #define ISN_FRAME_TYPE_SNAP 3
  34. #define ISN_FRAME_TYPE_ARCNET 4 // we ignore this
  35. #define ISN_FRAME_TYPE_MAX 4 // of the four standard ones
  36. #define ISN_FRAME_TYPE_AUTO 0xff
  37. //
  38. // OPT - Move the isnipx.h definitions over here
  39. //
  40. // Frame types. For now these mirror those in isnipx.h.
  41. //
  42. #define MISN_FRAME_TYPE_ETHERNET_II 0
  43. #define MISN_FRAME_TYPE_802_3 1
  44. #define MISN_FRAME_TYPE_802_2 2
  45. #define MISN_FRAME_TYPE_SNAP 3
  46. #define MISN_FRAME_TYPE_ARCNET 4 // we ignore this
  47. #define MISN_FRAME_TYPE_MAX 4 // of the four standard ones
  48. //+---------------------------------------------------------------------------
  49. // Steelhead
  50. //
  51. typedef void (WINAPI* PFN_MAKE_INTERFACE_INFO)(LPCWSTR pszwAdapterName,
  52. DWORD dwPacketType,
  53. LPBYTE* ppb);
  54. typedef void (WINAPI* PFN_MAKE_TRANSPORT_INFO)(LPBYTE* ppbGlobal,
  55. LPBYTE* ppbClient);
  56. struct ROUTER_MANAGER_INFO
  57. {
  58. DWORD dwTransportId;
  59. DWORD dwPacketType;
  60. LPCWSTR pszwTransportName;
  61. LPCWSTR pszwDllPath;
  62. PFN_MAKE_INTERFACE_INFO pfnMakeInterfaceInfo;
  63. PFN_MAKE_TRANSPORT_INFO pfnMakeTransportInfo;
  64. };
  65. class CSteelhead : public CRasBindObject
  66. {
  67. public:
  68. protected:
  69. HANDLE m_hMprConfig;
  70. BOOL FAdapterExistsWithMatchingBindName (LPCWSTR pszwAdapterName,
  71. INetCfgComponent** ppnccAdapter);
  72. BOOL FIpxFrameTypeInUseOnAdapter (DWORD dwwFrameType,
  73. LPCWSTR pszwAdapterName);
  74. BOOL FIpxFrameTypeInUseOnAdapter (LPCWSTR pszwFrameType,
  75. LPCWSTR pszwAdapterName);
  76. HRESULT HrEnsureRouterInterfaceForAdapter (ROUTER_INTERFACE_TYPE dwIfType,
  77. DWORD dwPacketType,
  78. LPCWSTR pszwAdapterName,
  79. LPCWSTR pszwInterfaceName,
  80. const ROUTER_MANAGER_INFO& rmi);
  81. HRESULT HrEnsureIpxRouterInterfacesForAdapter (LPCWSTR pszwAdapterName);
  82. HRESULT HrEnsureRouterInterface (ROUTER_INTERFACE_TYPE dwIfType,
  83. LPCWSTR pszwInterfaceName,
  84. HANDLE* phInterface);
  85. HRESULT HrEnsureRouterInterfaceTransport (LPCWSTR pszwAdapterName,
  86. DWORD dwPacketType,
  87. HANDLE hInterface,
  88. const ROUTER_MANAGER_INFO& rmi);
  89. HRESULT HrEnsureRouterManager (const ROUTER_MANAGER_INFO& rmi);
  90. HRESULT HrEnsureRouterManagerDeleted (const ROUTER_MANAGER_INFO& rmi);
  91. HRESULT HrPassToAddInterfaces ();
  92. HRESULT HrPassToRemoveInterfaces ();
  93. HRESULT HrPassToRemoveInterfaceTransports (MPR_INTERFACE_0* pri0,
  94. LPCWSTR pszwAdapterName,
  95. INetCfgComponent* pnccAdapter);
  96. #if (WINVER >= 0x0501)
  97. HRESULT HrRemoveIPXRouterConfiguration ();
  98. #endif
  99. public:
  100. CSteelhead ();
  101. ~CSteelhead ();
  102. HRESULT HrUpdateRouterConfiguration ();
  103. STDMETHOD (Initialize) (INetCfg* pnc);
  104. // Use these buffers to store the names for the internal
  105. // and loopback adapters.
  106. WCHAR m_swzInternal[256];
  107. WCHAR m_swzLoopback[256];
  108. };
  109. void MakeIpInterfaceInfo (
  110. LPCWSTR pszwAdapterName,
  111. DWORD dwPacketType,
  112. LPBYTE* ppBuff);
  113. void MakeIpTransportInfo (LPBYTE* ppBuffGlobal, LPBYTE* ppBuffClient);
  114. void MakeIpxInterfaceInfo (
  115. LPCWSTR pszwAdapterName,
  116. DWORD dwPacketType,
  117. LPBYTE* ppBuff);
  118. void MakeIpxTransportInfo (LPBYTE* ppBuffGlobal, LPBYTE* ppBuffClient);
  119. HRESULT
  120. HrMprConfigServerConnect(
  121. IN LPWSTR lpwsServerName,
  122. OUT HANDLE* phMprConfig
  123. );
  124. HRESULT
  125. HrMprConfigInterfaceCreate(
  126. IN HANDLE hMprConfig,
  127. IN DWORD dwLevel,
  128. IN LPBYTE lpbBuffer,
  129. OUT HANDLE* phRouterInterface
  130. );
  131. HRESULT
  132. HrMprConfigInterfaceEnum(
  133. IN HANDLE hMprConfig,
  134. IN DWORD dwLevel,
  135. IN OUT LPBYTE* lplpBuffer,
  136. IN DWORD dwPrefMaxLen,
  137. OUT LPDWORD lpdwEntriesRead,
  138. OUT LPDWORD lpdwTotalEntries,
  139. IN OUT LPDWORD lpdwResumeHandle OPTIONAL
  140. );
  141. HRESULT
  142. HrMprConfigInterfaceTransportEnum(
  143. IN HANDLE hMprConfig,
  144. IN HANDLE hRouterInterface,
  145. IN DWORD dwLevel,
  146. IN OUT LPBYTE* lplpBuffer, // MPR_IFTRANSPORT_0
  147. IN DWORD dwPrefMaxLen,
  148. OUT LPDWORD lpdwEntriesRead,
  149. OUT LPDWORD lpdwTotalEntries,
  150. IN OUT LPDWORD lpdwResumeHandle OPTIONAL
  151. );
  152. HRESULT
  153. HrMprConfigInterfaceGetHandle(
  154. IN HANDLE hMprConfig,
  155. IN LPWSTR lpwsInterfaceName,
  156. OUT HANDLE* phRouterInterface
  157. );
  158. HRESULT
  159. HrMprConfigInterfaceTransportAdd(
  160. IN HANDLE hMprConfig,
  161. IN HANDLE hRouterInterface,
  162. IN DWORD dwTransportId,
  163. IN LPWSTR lpwsTransportName OPTIONAL,
  164. IN LPBYTE pInterfaceInfo,
  165. IN DWORD dwInterfaceInfoSize,
  166. OUT HANDLE* phRouterIfTransport
  167. );
  168. HRESULT
  169. HrMprConfigInterfaceTransportRemove(
  170. IN HANDLE hMprConfig,
  171. IN HANDLE hRouterInterface,
  172. IN HANDLE hRouterIfTransport
  173. );
  174. HRESULT
  175. HrMprConfigInterfaceTransportGetHandle(
  176. IN HANDLE hMprConfig,
  177. IN HANDLE hRouterInterface,
  178. IN DWORD dwTransportId,
  179. OUT HANDLE* phRouterIfTransport
  180. );
  181. HRESULT
  182. HrMprConfigTransportCreate(
  183. IN HANDLE hMprConfig,
  184. IN DWORD dwTransportId,
  185. IN LPWSTR lpwsTransportName OPTIONAL,
  186. IN LPBYTE pGlobalInfo,
  187. IN DWORD dwGlobalInfoSize,
  188. IN LPBYTE pClientInterfaceInfo OPTIONAL,
  189. IN DWORD dwClientInterfaceInfoSize OPTIONAL,
  190. IN LPWSTR lpwsDLLPath,
  191. OUT HANDLE* phRouterTransport
  192. );
  193. HRESULT
  194. HrMprConfigTransportDelete(
  195. IN HANDLE hMprConfig,
  196. IN HANDLE hRouterTransport);
  197. HRESULT
  198. HrMprConfigTransportGetHandle(
  199. IN HANDLE hMprConfig,
  200. IN DWORD dwTransportId,
  201. OUT HANDLE* phRouterTransport
  202. );
  203. HRESULT
  204. HrMprConfigTransportGetInfo(
  205. IN HANDLE hMprConfig,
  206. IN HANDLE hRouterTransport,
  207. IN OUT LPBYTE* ppGlobalInfo OPTIONAL,
  208. OUT LPDWORD lpdwGlobalInfoSize OPTIONAL,
  209. IN OUT LPBYTE* ppClientInterfaceInfo OPTIONAL,
  210. OUT LPDWORD lpdwClientInterfaceInfoSize OPTIONAL,
  211. IN OUT LPWSTR* lplpwsDLLPath OPTIONAL
  212. );