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.

222 lines
4.2 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. typedef
  17. VOID
  18. (*PFN_LOGGER)(
  19. PVOID Context,
  20. const WCHAR * Text
  21. );
  22. class NLBHost
  23. {
  24. public:
  25. #if 1
  26. class NicInformation
  27. {
  28. public:
  29. _bstr_t fullNicName;
  30. _bstr_t adapterGuid;
  31. _bstr_t friendlyName;
  32. BOOL isDHCPEnabled;
  33. // vector<_bstr_t> ipsOnNic;
  34. // vector<_bstr_t> subnetMasks;
  35. BOOL isBoundToNLB;
  36. };
  37. class HostInformation
  38. {
  39. public:
  40. _bstr_t MachineName;
  41. NicInformation nicInformation[1];
  42. UINT NumNics;
  43. };
  44. #endif // 0
  45. NLBHost(
  46. const WCHAR * pBindString,
  47. const WCHAR * pFriendlyName,
  48. PFN_LOGGER pfnLogger,
  49. PVOID pLoggerContext
  50. );
  51. ~NLBHost();
  52. UINT
  53. Ping(
  54. VOID
  55. );
  56. #if 1
  57. WBEMSTATUS
  58. GetHostInformation(
  59. OUT HostInformation **ppHostInfo
  60. );
  61. #endif // 0
  62. //
  63. // Configuration operations:
  64. //
  65. WBEMSTATUS
  66. GetClusterConfiguration(
  67. IN const WCHAR * pNicGuid,
  68. OUT PNLB_EXTENDED_CLUSTER_CONFIGURATION pCfg
  69. );
  70. WBEMSTATUS
  71. SetClusterConfiguration(
  72. IN const WCHAR * pNicGuid,
  73. IN const PNLB_EXTENDED_CLUSTER_CONFIGURATION pCfg,
  74. IN UINT GenerationId,
  75. OUT UINT * pRequestId
  76. );
  77. WBEMSTATUS
  78. GetAsyncResult(
  79. IN UINT RequestId,
  80. OUT UINT * pGenerationId,
  81. OUT UINT * ResultCode,
  82. OUT _bstr_t * pResultText
  83. );
  84. //
  85. // Management operations:
  86. //
  87. //
  88. // GetClusterState(NIC-Guid, &ClusterState)
  89. // SetClusterState(NIC-Guid, ClusterState)
  90. //
  91. private:
  92. static WSADATA s_WsaData;
  93. static LONG s_InstanceCount;
  94. static BOOL s_FatalError;
  95. static BOOL s_ComInitialized;
  96. static BOOL s_WsaInitialized;
  97. static IWbemStatusCodeTextPtr s_sp_werr; //Smart pointer
  98. _bstr_t m_BindString;
  99. _bstr_t m_FriendlyName;
  100. PFN_LOGGER m_pfnLogger;
  101. PVOID m_pLoggerContext;
  102. BOOL m_fProcessing; // Already processing some method.
  103. IWbemLocatorPtr m_sp_pwl; // Smart pointer
  104. IWbemServicesPtr m_sp_pws; // Smart pointer
  105. CRITICAL_SECTION m_Lock;
  106. WBEMSTATUS
  107. mfn_connect(
  108. VOID
  109. );
  110. VOID
  111. mfn_disconnect(
  112. VOID
  113. );
  114. VOID
  115. mfn_lock(
  116. VOID
  117. );
  118. VOID
  119. mfn_unlock(
  120. VOID
  121. );
  122. VOID
  123. mfn_Log(
  124. LPCWSTR pwszMessage,
  125. ...
  126. );
  127. VOID
  128. mfn_LogHr(
  129. LPCWSTR pwszMessage,
  130. HRESULT hr
  131. );
  132. UINT
  133. mfn_ping(
  134. VOID
  135. );
  136. VOID
  137. mfn_InitializeStaticFields(
  138. VOID
  139. );
  140. VOID
  141. mfn_DeinitializeStaticFields(
  142. VOID
  143. );
  144. };
  145. WBEMSTATUS
  146. NlbHostGetConfiguration(
  147. IN LPCWSTR szMachine, // NULL or empty for local
  148. IN LPCWSTR szNicGuid,
  149. OUT PNLB_EXTENDED_CLUSTER_CONFIGURATION pCurrentCfg
  150. );
  151. WBEMSTATUS
  152. NlbHostDoUpdate(
  153. IN LPCWSTR szMachine, // NULL or empty for local
  154. IN LPCWSTR szNicGuid,
  155. IN LPCWSTR szClientDescription,
  156. IN PNLB_EXTENDED_CLUSTER_CONFIGURATION pNewState,
  157. OUT UINT *pGeneration,
  158. OUT WCHAR **ppLog // free using delete operator.
  159. );
  160. WBEMSTATUS
  161. NlbHostGetUpdateStatus(
  162. IN LPCWSTR szMachine, // NULL or empty for local
  163. IN LPCWSTR szNicGuid,
  164. IN UINT Generation,
  165. OUT WBEMSTATUS *pCompletionStatus,
  166. OUT WCHAR **ppLog // free using delete operator.
  167. );