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.

235 lines
4.0 KiB

  1. /*++
  2. Copyright(c) 2001 Microsoft Corporation
  3. Module Name:
  4. NLB Manager
  5. File Name:
  6. nlbhost.h
  7. Abstract:
  8. Header file for class NLBHost
  9. NLBHost is responsible for connecting to an NLB host and getting/setting
  10. its NLB-related configuration.
  11. History:
  12. 03/31/01 JosephJ Created
  13. --*/
  14. // #include <vector>
  15. // using namespace std;
  16. #if 0
  17. class MgrHostInformation
  18. {
  19. public:
  20. HostInformation();
  21. Get
  22. };
  23. #endif // 0
  24. typedef
  25. VOID
  26. (*PFN_LOGGER)(
  27. PVOID Context,
  28. const WCHAR * Text
  29. );
  30. typedef struct
  31. {
  32. WLBS_REG_PARAMS wlbsRegParams; // Use wlbs APIs (wlbsconfig.h)
  33. } MGR_RAW_CLUSTER_CONFIGURATION, *PMGR_RAW_CLUSTER_CONFIGURATION;
  34. class NLBHost
  35. {
  36. public:
  37. #if 1
  38. class NicInformation
  39. {
  40. public:
  41. _bstr_t fullNicName;
  42. _bstr_t adapterGuid;
  43. _bstr_t friendlyName;
  44. BOOL isDHCPEnabled;
  45. vector<_bstr_t> ipsOnNic;
  46. vector<_bstr_t> subnetMasks;
  47. BOOL isBoundToNLB;
  48. };
  49. class HostInformation
  50. {
  51. public:
  52. _bstr_t MachineName;
  53. vector<NicInformation> nicInformation;
  54. };
  55. #endif // 0
  56. NLBHost(
  57. const WCHAR * pBindString,
  58. const WCHAR * pFriendlyName,
  59. PFN_LOGGER pfnLogger,
  60. PVOID pLoggerContext
  61. );
  62. ~NLBHost();
  63. UINT
  64. Ping(
  65. VOID
  66. );
  67. #if 1
  68. UINT GetHostInformation(
  69. OUT HostInformation **ppHostInfo
  70. );
  71. #endif // 0
  72. //
  73. // Configuration operations:
  74. //
  75. UINT
  76. GetClusterConfiguration(
  77. IN const WCHAR * pNicGuid,
  78. OUT PMGR_RAW_CLUSTER_CONFIGURATION pClusterConfig,
  79. OUT UINT * pGenerationId
  80. );
  81. UINT
  82. SetClusterConfiguration(
  83. IN const WCHAR * pNicGuid,
  84. IN const PMGR_RAW_CLUSTER_CONFIGURATION pClusterConfig,
  85. IN UINT GenerationId,
  86. OUT UINT * pRequestId
  87. );
  88. UINT
  89. GetAsyncResult(
  90. IN UINT RequestId,
  91. OUT UINT * pGenerationId,
  92. OUT UINT * ResultCode,
  93. OUT _bstr_t * pResultText
  94. );
  95. #if 0
  96. VOID
  97. CancelOperation(
  98. VOID
  99. );
  100. #endif // 0
  101. //
  102. // Management operations:
  103. //
  104. //
  105. // GetClusterState(NIC-Guid, &ClusterState)
  106. // SetClusterState(NIC-Guid, ClusterState)
  107. //
  108. private:
  109. static WSADATA s_WsaData;
  110. static LONG s_InstanceCount;
  111. static BOOL s_FatalError;
  112. static BOOL s_ComInitialized;
  113. static BOOL s_WsaInitialized;
  114. static IWbemStatusCodeTextPtr s_sp_werr; //Smart pointer
  115. _bstr_t m_BindString;
  116. _bstr_t m_FriendlyName;
  117. PFN_LOGGER m_pfnLogger;
  118. PVOID m_pLoggerContext;
  119. BOOL m_fProcessing; // Already processing some method.
  120. IWbemLocatorPtr m_sp_pwl; // Smart pointer
  121. IWbemServicesPtr m_sp_pws; // Smart pointer
  122. CRITICAL_SECTION m_Lock;
  123. UINT
  124. mfn_connect(
  125. VOID
  126. );
  127. VOID
  128. mfn_disconnect(
  129. VOID
  130. );
  131. VOID
  132. mfn_lock(
  133. VOID
  134. );
  135. VOID
  136. mfn_unlock(
  137. VOID
  138. );
  139. VOID
  140. mfn_Log(
  141. UINT ID,
  142. ...
  143. );
  144. VOID
  145. mfn_Log(
  146. LPCWSTR pwszMessage,
  147. ...
  148. );
  149. VOID
  150. mfn_LogHr(
  151. LPCWSTR pwszMessage,
  152. HRESULT hr
  153. );
  154. UINT
  155. mfn_ping(
  156. VOID
  157. );
  158. VOID
  159. mfn_InitializeStaticFields(
  160. VOID
  161. );
  162. VOID
  163. mfn_DeinitializeStaticFields(
  164. VOID
  165. );
  166. };
  167. //
  168. // NLBH_SUCCESS takes a UINT return value of an NLBHost method and
  169. // returns TRUE if the result is sucessful and FALSE otherwise
  170. #define NLBH_SUCCESS(_retval) \
  171. ((_retval)==0)
  172. #define NLBH_PENDING(_retval) \
  173. ((_retval)==STATUS_PENDING)