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.

236 lines
6.9 KiB

  1. #ifndef COMMONNLB_H
  2. #define COMMONNLB_H
  3. #include "stdafx.h"
  4. #include "DataSinkI.h"
  5. #include "LeftView.h"
  6. #include "MNLBUIData.h"
  7. #include "MNLBNetCfg.h"
  8. #include "Common.h"
  9. class CommonNLB
  10. {
  11. public:
  12. enum CommonNLB_Error
  13. {
  14. CommonNLB_SUCCESS = 0,
  15. };
  16. #if 0
  17. class NicNLBBound
  18. {
  19. public:
  20. _bstr_t fullNicName;
  21. _bstr_t adapterGuid;
  22. _bstr_t friendlyName;
  23. bool isDHCPEnabled;
  24. vector<_bstr_t> ipsOnNic;
  25. vector<_bstr_t> subnetMasks;
  26. bool isBoundToNLB;
  27. };
  28. #endif
  29. class NicNLBBound : public NicInfo
  30. {
  31. public:
  32. bool isBoundToNLB;
  33. };
  34. static
  35. CommonNLB_Error
  36. connectToClusterDirectOld( const _bstr_t& clusterIP,
  37. ClusterData* clusterData,
  38. DataSinkI* dataSinkObj );
  39. static
  40. CommonNLB_Error
  41. connectToClusterDirect( const _bstr_t& clusterIP,
  42. const _bstr_t& hostMember,
  43. ClusterData* p_clusterData,
  44. DataSinkI* dataSinkObj );
  45. static
  46. CommonNLB_Error
  47. connectToClusterIndirect( const _bstr_t& clusterIP,
  48. const vector<_bstr_t>& connectionIPS,
  49. ClusterData* clusterData,
  50. DataSinkI* dataSinkObj );
  51. static
  52. CommonNLB_Error
  53. connectToClusterIndirectNew( const _bstr_t& clusterIP,
  54. const vector<_bstr_t>& connectionIPS,
  55. vector< ClusterData>* clusterDataStore,
  56. bool& clusterPropertiesMatched,
  57. DataSinkI* dataSinkObj );
  58. static
  59. CommonNLB_Error
  60. connectToMachine( const _bstr_t& machineToConnect,
  61. _bstr_t& machineServerName,
  62. vector< NicNLBBound >& nicList,
  63. DataSinkI* dataSinkObj );
  64. static
  65. CommonNLB_Error
  66. changeNLBHostSettings( const ClusterData* oldSettings,
  67. const ClusterData* newSettings,
  68. const _bstr_t& machineName,
  69. DataSinkI* dataSinkObj );
  70. static
  71. CommonNLB_Error
  72. addHostToClusterOld( const ClusterData* clusterToAddTo,
  73. const _bstr_t& machineName,
  74. DataSinkI* dataSinkObj );
  75. static
  76. CommonNLB_Error
  77. addHostToCluster( const ClusterData* clusterToAddTo,
  78. const _bstr_t& machineName,
  79. DataSinkI* dataSinkObj );
  80. static
  81. CommonNLB_Error
  82. changeNLBClusterSettings( const ClusterData* oldSettings,
  83. const ClusterData* newSettings,
  84. DataSinkI* dataSinkObj );
  85. static
  86. CommonNLB_Error
  87. changeNLBHostPortSettings( const ClusterData* oldSettings,
  88. const ClusterData* newSettings,
  89. const _bstr_t& machineName,
  90. DataSinkI* dataSinkObj );
  91. static
  92. CommonNLB_Error
  93. changeNLBClusterAndPortSettings( const ClusterData* oldSettings,
  94. const ClusterData* newSettings,
  95. DataSinkI* dataSinkObj,
  96. bool* pbClusterIpChanged);
  97. static
  98. CommonNLB_Error
  99. removeCluster( const ClusterData* clusterSettings,
  100. DataSinkI* dataSinkObj );
  101. static
  102. CommonNLB_Error
  103. removeHost( const ClusterData* clusterSettings,
  104. const _bstr_t& machineName,
  105. DataSinkI* dataSinkObj );
  106. static
  107. CommonNLB_Error
  108. runControlMethodOnCluster( const ClusterData* clusterSettings,
  109. DataSinkI* dataSinkObj,
  110. const _bstr_t& methodToRun,
  111. unsigned long portToAffect = Common::ALL_PORTS
  112. );
  113. static
  114. CommonNLB_Error
  115. runControlMethodOnHost( const ClusterData* clusterSettings,
  116. const _bstr_t& machineName,
  117. DataSinkI* dataSinkObj,
  118. const _bstr_t& methodToRun,
  119. unsigned long portToAffect = Common::ALL_PORTS
  120. );
  121. static
  122. CommonNLB_Error
  123. getWLBSErrorString( unsigned long retVal,
  124. _bstr_t& errString );
  125. private:
  126. static
  127. UINT
  128. DummyThread( LPVOID pParam );
  129. static
  130. UINT
  131. UnbindThread( LPVOID pParam );
  132. static
  133. UINT
  134. BindAndConfigureThread( LPVOID pParam );
  135. static
  136. UINT
  137. ModifyClusterPropertiesThread( LPVOID pParam );
  138. static
  139. CommonNLB_Error
  140. findPortRulesAddedUnchangedRemovedELB(
  141. const ClusterData* oldSettings,
  142. const ClusterData* newSettings,
  143. DataSinkI* dataSinkObj,
  144. vector<long>& rulesAdded,
  145. vector<long>& rulesUnchanged,
  146. vector<long>& rulesRemoved );
  147. static
  148. CommonNLB_Error
  149. findPortRulesAddedUnchangedRemovedULB(
  150. const ClusterData* oldSettings,
  151. const ClusterData* newSettings,
  152. DataSinkI* dataSinkObj,
  153. vector<long>& rulesAdded,
  154. vector<long>& rulesUnchanged,
  155. vector<long>& rulesRemoved );
  156. static
  157. CommonNLB_Error
  158. findPortRulesAddedUnchangedRemovedD(
  159. const ClusterData* oldSettings,
  160. const ClusterData* newSettings,
  161. DataSinkI* dataSinkObj,
  162. vector<long>& rulesAdded,
  163. vector<long>& rulesUnchanged,
  164. vector<long>& rulesRemoved );
  165. static
  166. CommonNLB_Error
  167. findPortRulesAddedUnchangedRemovedF(
  168. const ClusterData* oldSettings,
  169. const ClusterData* newSettings,
  170. DataSinkI* dataSinkObj,
  171. vector<long>& rulesAdded,
  172. vector<long>& rulesUnchanged,
  173. vector<long>& rulesRemoved );
  174. struct BindAndConfigureParameters
  175. {
  176. MNLBNetCfg* nlbNetCfg;
  177. ClusterData* clusterData;
  178. _bstr_t* machineName;
  179. };
  180. typedef struct BindAndConfigureParameters ModifyClusterPropertiesParameters;
  181. };
  182. #endif