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.

240 lines
8.3 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. public:
  97. CSteelhead ();
  98. ~CSteelhead ();
  99. HRESULT HrUpdateRouterConfiguration ();
  100. STDMETHOD (Initialize) (INetCfg* pnc);
  101. // Use these buffers to store the names for the internal
  102. // and loopback adapters.
  103. WCHAR m_swzInternal[256];
  104. WCHAR m_swzLoopback[256];
  105. };
  106. void MakeIpInterfaceInfo (
  107. LPCWSTR pszwAdapterName,
  108. DWORD dwPacketType,
  109. LPBYTE* ppBuff);
  110. void MakeIpTransportInfo (LPBYTE* ppBuffGlobal, LPBYTE* ppBuffClient);
  111. void MakeIpxInterfaceInfo (
  112. LPCWSTR pszwAdapterName,
  113. DWORD dwPacketType,
  114. LPBYTE* ppBuff);
  115. void MakeIpxTransportInfo (LPBYTE* ppBuffGlobal, LPBYTE* ppBuffClient);
  116. HRESULT
  117. HrMprConfigServerConnect(
  118. IN LPWSTR lpwsServerName,
  119. OUT HANDLE* phMprConfig
  120. );
  121. HRESULT
  122. HrMprConfigInterfaceCreate(
  123. IN HANDLE hMprConfig,
  124. IN DWORD dwLevel,
  125. IN LPBYTE lpbBuffer,
  126. OUT HANDLE* phRouterInterface
  127. );
  128. HRESULT
  129. HrMprConfigInterfaceEnum(
  130. IN HANDLE hMprConfig,
  131. IN DWORD dwLevel,
  132. IN OUT LPBYTE* lplpBuffer,
  133. IN DWORD dwPrefMaxLen,
  134. OUT LPDWORD lpdwEntriesRead,
  135. OUT LPDWORD lpdwTotalEntries,
  136. IN OUT LPDWORD lpdwResumeHandle OPTIONAL
  137. );
  138. HRESULT
  139. HrMprConfigInterfaceTransportEnum(
  140. IN HANDLE hMprConfig,
  141. IN HANDLE hRouterInterface,
  142. IN DWORD dwLevel,
  143. IN OUT LPBYTE* lplpBuffer, // MPR_IFTRANSPORT_0
  144. IN DWORD dwPrefMaxLen,
  145. OUT LPDWORD lpdwEntriesRead,
  146. OUT LPDWORD lpdwTotalEntries,
  147. IN OUT LPDWORD lpdwResumeHandle OPTIONAL
  148. );
  149. HRESULT
  150. HrMprConfigInterfaceGetHandle(
  151. IN HANDLE hMprConfig,
  152. IN LPWSTR lpwsInterfaceName,
  153. OUT HANDLE* phRouterInterface
  154. );
  155. HRESULT
  156. HrMprConfigInterfaceTransportAdd(
  157. IN HANDLE hMprConfig,
  158. IN HANDLE hRouterInterface,
  159. IN DWORD dwTransportId,
  160. IN LPWSTR lpwsTransportName OPTIONAL,
  161. IN LPBYTE pInterfaceInfo,
  162. IN DWORD dwInterfaceInfoSize,
  163. OUT HANDLE* phRouterIfTransport
  164. );
  165. HRESULT
  166. HrMprConfigInterfaceTransportGetHandle(
  167. IN HANDLE hMprConfig,
  168. IN HANDLE hRouterInterface,
  169. IN DWORD dwTransportId,
  170. OUT HANDLE* phRouterIfTransport
  171. );
  172. HRESULT
  173. HrMprConfigTransportCreate(
  174. IN HANDLE hMprConfig,
  175. IN DWORD dwTransportId,
  176. IN LPWSTR lpwsTransportName OPTIONAL,
  177. IN LPBYTE pGlobalInfo,
  178. IN DWORD dwGlobalInfoSize,
  179. IN LPBYTE pClientInterfaceInfo OPTIONAL,
  180. IN DWORD dwClientInterfaceInfoSize OPTIONAL,
  181. IN LPWSTR lpwsDLLPath,
  182. OUT HANDLE* phRouterTransport
  183. );
  184. HRESULT
  185. HrMprConfigTransportDelete(
  186. IN HANDLE hMprConfig,
  187. IN HANDLE hRouterTransport);
  188. HRESULT
  189. HrMprConfigTransportGetHandle(
  190. IN HANDLE hMprConfig,
  191. IN DWORD dwTransportId,
  192. OUT HANDLE* phRouterTransport
  193. );
  194. HRESULT
  195. HrMprConfigTransportGetInfo(
  196. IN HANDLE hMprConfig,
  197. IN HANDLE hRouterTransport,
  198. IN OUT LPBYTE* ppGlobalInfo OPTIONAL,
  199. OUT LPDWORD lpdwGlobalInfoSize OPTIONAL,
  200. IN OUT LPBYTE* ppClientInterfaceInfo OPTIONAL,
  201. OUT LPDWORD lpdwClientInterfaceInfoSize OPTIONAL,
  202. IN OUT LPWSTR* lplpwsDLLPath OPTIONAL
  203. );