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.

863 lines
22 KiB

  1. #include "WLBS_Provider.h"
  2. #include "WLBS_clustersetting.h"
  3. #include "ClusterWrapper.h"
  4. #include "ControlWrapper.h"
  5. #include "utils.h"
  6. #include "param.h"
  7. ////////////////////////////////////////////////////////////////////////////////
  8. //
  9. // CWLBS_ClusterSetting::CWLBS_ClusterSetting
  10. //
  11. // Purpose: Constructor
  12. //
  13. ////////////////////////////////////////////////////////////////////////////////
  14. CWLBS_ClusterSetting::CWLBS_ClusterSetting
  15. (
  16. CWbemServices* a_pNameSpace,
  17. IWbemObjectSink* a_pResponseHandler
  18. )
  19. : CWlbs_Root( a_pNameSpace, a_pResponseHandler )
  20. {
  21. }
  22. ////////////////////////////////////////////////////////////////////////////////
  23. //
  24. // CWLBS_ClusterSetting::Create
  25. //
  26. // Purpose: This instantiates this class and is invoked from an array of
  27. // function pointers.
  28. //
  29. ////////////////////////////////////////////////////////////////////////////////
  30. CWlbs_Root* CWLBS_ClusterSetting::Create
  31. (
  32. CWbemServices* a_pNameSpace,
  33. IWbemObjectSink* a_pResponseHandler
  34. )
  35. {
  36. CWlbs_Root* pRoot = new CWLBS_ClusterSetting( a_pNameSpace, a_pResponseHandler );
  37. if( !pRoot )
  38. throw _com_error( WBEM_E_OUT_OF_MEMORY );
  39. return pRoot;
  40. }
  41. ////////////////////////////////////////////////////////////////////////////////
  42. //
  43. // CWLBS_ClusterSetting::GetInstance
  44. //
  45. // Purpose:
  46. //
  47. ////////////////////////////////////////////////////////////////////////////////
  48. HRESULT CWLBS_ClusterSetting::GetInstance
  49. (
  50. const ParsedObjectPath* a_pParsedPath,
  51. long /* a_lFlags */,
  52. IWbemContext* /* a_pIContex */
  53. )
  54. {
  55. IWbemClassObject* pWlbsInstance = NULL;
  56. HRESULT hRes = 0;
  57. try {
  58. wstring wstrHostName;
  59. //get the name key property and convert to wstring
  60. //throws _com_error
  61. wstrHostName = (*a_pParsedPath->m_paKeys)->m_vValue.bstrVal;
  62. //get the cluster
  63. CWlbsClusterWrapper* pCluster = GetClusterFromHostName(g_pWlbsControl, wstrHostName);
  64. if (pCluster == NULL)
  65. {
  66. throw _com_error( WBEM_E_NOT_FOUND );
  67. }
  68. //get the Wbem class instance
  69. SpawnInstance( MOF_CLUSTERSETTING::szName, &pWlbsInstance );
  70. //Convert status to string description
  71. FillWbemInstance( pWlbsInstance, pCluster );
  72. //send the results back to WinMgMt
  73. m_pResponseHandler->Indicate( 1, &pWlbsInstance );
  74. if( pWlbsInstance ) {
  75. pWlbsInstance->Release();
  76. pWlbsInstance = NULL;
  77. }
  78. m_pResponseHandler->SetStatus( 0, WBEM_S_NO_ERROR, NULL, NULL );
  79. hRes = WBEM_S_NO_ERROR;
  80. }
  81. catch(CErrorWlbsControl Err) {
  82. IWbemClassObject* pWbemExtStat = NULL;
  83. CreateExtendedStatus( m_pNameSpace,
  84. &pWbemExtStat,
  85. Err.Error(),
  86. (PWCHAR)(Err.Description()) );
  87. m_pResponseHandler->SetStatus(0, WBEM_E_FAILED, NULL, pWbemExtStat);
  88. if( pWbemExtStat )
  89. pWbemExtStat->Release();
  90. if( pWlbsInstance )
  91. pWlbsInstance->Release();
  92. //do not return WBEM_E_FAILED, this causes a race condition
  93. hRes = WBEM_S_NO_ERROR;
  94. }
  95. catch(_com_error HResErr ) {
  96. m_pResponseHandler->SetStatus(0, HResErr.Error(), NULL, NULL);
  97. if( pWlbsInstance )
  98. pWlbsInstance->Release();
  99. hRes = HResErr.Error();
  100. //transform Win32 error to a WBEM error
  101. if( hRes == ERROR_FILE_NOT_FOUND )
  102. hRes = WBEM_E_NOT_FOUND;
  103. }
  104. catch(...) {
  105. if( pWlbsInstance )
  106. pWlbsInstance->Release();
  107. throw;
  108. }
  109. return hRes;
  110. }
  111. ////////////////////////////////////////////////////////////////////////////////
  112. //
  113. // CWLBS_ClusterSetting::EnumInstances
  114. //
  115. // Purpose: This function obtains the clustersetting data for the current host.
  116. // The node does not have to be a member of a cluster for this
  117. // to succeed. However, WLBS must be installed.
  118. //
  119. ////////////////////////////////////////////////////////////////////////////////
  120. HRESULT CWLBS_ClusterSetting::EnumInstances
  121. (
  122. BSTR /* a_bstrClass */,
  123. long /* a_lFlags */,
  124. IWbemContext* /* a_pIContex */
  125. )
  126. {
  127. IWbemClassObject* pWlbsInstance = NULL;
  128. HRESULT hRes = 0;
  129. try {
  130. DWORD dwNumClusters = 0;
  131. CWlbsClusterWrapper** ppCluster = NULL;
  132. g_pWlbsControl->EnumClusters(ppCluster, &dwNumClusters);
  133. if (dwNumClusters == 0)
  134. {
  135. throw _com_error( WBEM_E_NOT_FOUND );
  136. }
  137. for (DWORD i=0; i < dwNumClusters; i++)
  138. {
  139. //get the Wbem class instance
  140. SpawnInstance( MOF_CLUSTERSETTING::szName, &pWlbsInstance );
  141. //get the cluster configuration
  142. FillWbemInstance( pWlbsInstance , ppCluster[i]);
  143. //send the results back to WinMgMt
  144. m_pResponseHandler->Indicate( 1, &pWlbsInstance );
  145. if( pWlbsInstance ) {
  146. pWlbsInstance->Release();
  147. pWlbsInstance = NULL;
  148. }
  149. }
  150. m_pResponseHandler->SetStatus( 0, WBEM_S_NO_ERROR, NULL, NULL );
  151. hRes = WBEM_S_NO_ERROR;
  152. }
  153. catch(CErrorWlbsControl Err) {
  154. IWbemClassObject* pWbemExtStat = NULL;
  155. CreateExtendedStatus( m_pNameSpace,
  156. &pWbemExtStat,
  157. Err.Error(),
  158. (PWCHAR)(Err.Description()) );
  159. m_pResponseHandler->SetStatus(0, WBEM_E_FAILED, NULL, pWbemExtStat);
  160. if( pWbemExtStat )
  161. pWbemExtStat->Release();
  162. if( pWlbsInstance )
  163. pWlbsInstance->Release();
  164. //do not return WBEM_E_FAILED, this causes a race condition
  165. hRes = WBEM_S_NO_ERROR;
  166. }
  167. catch(_com_error HResErr ) {
  168. m_pResponseHandler->SetStatus(0, HResErr.Error(), NULL, NULL);
  169. if( pWlbsInstance )
  170. pWlbsInstance->Release();
  171. hRes = HResErr.Error();
  172. //transform Win32 error to a WBEM error
  173. if( hRes == ERROR_FILE_NOT_FOUND )
  174. hRes = WBEM_E_NOT_FOUND ;
  175. }
  176. catch(...) {
  177. if( pWlbsInstance ) {
  178. pWlbsInstance->Release();
  179. pWlbsInstance = NULL;
  180. }
  181. throw;
  182. }
  183. return hRes;
  184. }
  185. ////////////////////////////////////////////////////////////////////////////////
  186. //
  187. // CWLBS_ClusterSetting::PutInstance
  188. //
  189. // Purpose: This function updates an instance of a MOF ClusterSetting
  190. // class. The node does not have to be a member of a cluster. However,
  191. // WLBS must be installed for this function to succeed.
  192. //
  193. ////////////////////////////////////////////////////////////////////////////////
  194. HRESULT CWLBS_ClusterSetting::PutInstance
  195. (
  196. IWbemClassObject* a_pInstance,
  197. long /* a_lFlags */,
  198. IWbemContext* /* a_pIContex */
  199. )
  200. {
  201. HRESULT hRes = 0;
  202. VARIANT vHostName;
  203. try {
  204. VariantInit( &vHostName );
  205. //get the host name value
  206. hRes = a_pInstance->Get( _bstr_t( MOF_CLUSTERSETTING::pProperties[MOF_CLUSTERSETTING::NAME] ),
  207. 0,
  208. &vHostName,
  209. NULL,
  210. NULL );
  211. if( FAILED( hRes ) )
  212. throw _com_error( hRes );
  213. CWlbsClusterWrapper* pCluster = GetClusterFromHostName(g_pWlbsControl, vHostName.bstrVal);
  214. if (pCluster == NULL)
  215. {
  216. throw _com_error( WBEM_E_NOT_FOUND );
  217. }
  218. //get the cluster IP value
  219. _variant_t vClusterIp;
  220. hRes = a_pInstance->Get( _bstr_t( MOF_CLUSTERSETTING::pProperties[MOF_CLUSTERSETTING::CLUSIPADDRESS] ),
  221. 0,
  222. &vClusterIp,
  223. NULL,
  224. NULL );
  225. DWORD dwClusterIp = IpAddressFromAbcdWsz(vClusterIp.bstrVal);
  226. //
  227. // Make sure the non-zero cluster IP is unique
  228. //
  229. if (dwClusterIp != 0)
  230. {
  231. CWlbsClusterWrapper* pTmpCluster = g_pWlbsControl->GetClusterFromIpOrIndex(dwClusterIp);
  232. if (pTmpCluster && pCluster != pTmpCluster)
  233. {
  234. TRACE_ERROR1("CWLBS_ClusterSetting::PutInstance duplicate cluster IP found %ws",
  235. vClusterIp.bstrVal);
  236. throw CErrorWlbsControl( WLBS_REG_ERROR, CmdWlbsWriteReg );
  237. }
  238. }
  239. UpdateConfiguration( a_pInstance, pCluster );
  240. // CLD: Need to check return code for error
  241. if (S_OK != VariantClear( &vHostName ))
  242. throw _com_error( WBEM_E_FAILED );
  243. m_pResponseHandler->SetStatus( 0, WBEM_S_NO_ERROR, NULL, NULL );
  244. hRes = WBEM_S_NO_ERROR;
  245. }
  246. catch(CErrorWlbsControl Err) {
  247. IWbemClassObject* pWbemExtStat = NULL;
  248. CreateExtendedStatus( m_pNameSpace,
  249. &pWbemExtStat,
  250. Err.Error(),
  251. (PWCHAR)(Err.Description()) );
  252. m_pResponseHandler->SetStatus(0, WBEM_E_FAILED, NULL, pWbemExtStat);
  253. if( pWbemExtStat )
  254. pWbemExtStat->Release();
  255. // CLD: Need to check return code for error
  256. if (S_OK != VariantClear( &vHostName ))
  257. throw _com_error( WBEM_E_FAILED );
  258. //do not return WBEM_E_FAILED, this causes a race condition
  259. hRes = WBEM_S_NO_ERROR;
  260. }
  261. catch(_com_error HResErr ) {
  262. m_pResponseHandler->SetStatus(0, HResErr.Error(), NULL, NULL);
  263. // CLD: Need to check return code for error
  264. // No throw here since we are already throwing an exception.
  265. VariantClear( &vHostName );
  266. hRes = HResErr.Error();
  267. }
  268. catch (...) {
  269. // CLD: Need to check return code for error
  270. // No throw here since we are already throwing an exception.
  271. VariantClear( &vHostName );
  272. throw;
  273. }
  274. return hRes;
  275. }
  276. ////////////////////////////////////////////////////////////////////////////////
  277. //
  278. // CWLBS_ClusterSetting::ExecMethod
  279. //
  280. // Purpose:
  281. //
  282. ////////////////////////////////////////////////////////////////////////////////
  283. HRESULT CWLBS_ClusterSetting::ExecMethod
  284. (
  285. const ParsedObjectPath* a_pParsedPath,
  286. const BSTR& a_strMethodName,
  287. long /* a_lFlags */,
  288. IWbemContext* /* a_pIContex */,
  289. IWbemClassObject* a_pIInParams
  290. )
  291. {
  292. IWbemClassObject* pOutputInstance = NULL;
  293. VARIANT vValue;
  294. HRESULT hRes = 0;
  295. try {
  296. VariantInit( &vValue );
  297. CWlbsClusterWrapper* pCluster = NULL;
  298. if (a_pParsedPath->m_paKeys == NULL)
  299. {
  300. //
  301. // No cluster IP specified
  302. //
  303. throw _com_error( WBEM_E_INVALID_PARAMETER );
  304. }
  305. else
  306. {
  307. const wchar_t* wstrRequestedClusterName = (*a_pParsedPath->m_paKeys)->m_vValue.bstrVal;
  308. pCluster = GetClusterFromHostName(g_pWlbsControl, wstrRequestedClusterName);
  309. }
  310. if (pCluster == NULL)
  311. throw _com_error( WBEM_E_NOT_FOUND );
  312. //determine the method being executed
  313. if( _wcsicmp( a_strMethodName, MOF_CLUSTERSETTING::pMethods[MOF_CLUSTERSETTING::SETPASS] ) == 0 ) {
  314. //get the password
  315. hRes = a_pIInParams->Get
  316. (
  317. _bstr_t( MOF_PARAM::PASSW ),
  318. 0,
  319. &vValue,
  320. NULL,
  321. NULL
  322. );
  323. if( vValue.vt != VT_BSTR )
  324. throw _com_error ( WBEM_E_INVALID_PARAMETER );
  325. pCluster->SetPassword( vValue.bstrVal );
  326. } else if( _wcsicmp( a_strMethodName, MOF_CLUSTERSETTING::pMethods[MOF_CLUSTERSETTING::LDSETT] ) == 0 ) {
  327. //get the output object instance
  328. GetMethodOutputInstance( MOF_CLUSTERSETTING::szName,
  329. a_strMethodName,
  330. &pOutputInstance);
  331. DWORD dwReturnValue = pCluster->Commit(g_pWlbsControl);
  332. //set the return value
  333. vValue.vt = VT_I4;
  334. vValue.lVal = static_cast<long>(dwReturnValue);
  335. hRes = pOutputInstance->Put(_bstr_t(L"ReturnValue"), 0, &vValue, 0);
  336. if( FAILED( hRes ) ) {
  337. throw _com_error( hRes );
  338. }
  339. if( pOutputInstance ) {
  340. hRes = m_pResponseHandler->Indicate(1, &pOutputInstance);
  341. if( FAILED( hRes ) ) {
  342. throw _com_error( hRes );
  343. }
  344. }
  345. } else if( _wcsicmp( a_strMethodName, MOF_CLUSTERSETTING::pMethods[MOF_CLUSTERSETTING::SETDEF] ) == 0 ) {
  346. pCluster->SetClusterDefaults();
  347. } else {
  348. throw _com_error( WBEM_E_METHOD_NOT_IMPLEMENTED );
  349. }
  350. //get the parameters
  351. //call the underlying API
  352. //set the function return parameter
  353. // CLD: Need to check return code for error
  354. if (S_OK != VariantClear( &vValue ))
  355. throw _com_error( WBEM_E_FAILED );
  356. if( pOutputInstance ) {
  357. pOutputInstance->Release();
  358. pOutputInstance = NULL;
  359. }
  360. m_pResponseHandler->SetStatus( 0, WBEM_S_NO_ERROR, NULL, NULL );
  361. hRes = WBEM_S_NO_ERROR;
  362. }
  363. catch(CErrorWlbsControl Err) {
  364. IWbemClassObject* pWbemExtStat = NULL;
  365. CreateExtendedStatus( m_pNameSpace,
  366. &pWbemExtStat,
  367. Err.Error(),
  368. (PWCHAR)(Err.Description()) );
  369. m_pResponseHandler->SetStatus(0, WBEM_E_FAILED, NULL, pWbemExtStat);
  370. if( pWbemExtStat )
  371. pWbemExtStat->Release();
  372. // CLD: Need to check return code for error
  373. // No throw here since we are already throwing an exception.
  374. VariantClear( &vValue );
  375. if( pOutputInstance ) {
  376. pOutputInstance->Release();
  377. pOutputInstance = NULL;
  378. }
  379. //do not return WBEM_E_FAILED, this causes a race condition
  380. hRes = WBEM_S_NO_ERROR;
  381. }
  382. catch(_com_error HResErr ) {
  383. m_pResponseHandler->SetStatus(0, HResErr.Error(), NULL, NULL);
  384. // CLD: Need to check return code for error
  385. // No throw here since we are already throwing an exception.
  386. VariantClear( &vValue );
  387. if( pOutputInstance ) {
  388. pOutputInstance->Release();
  389. }
  390. hRes = HResErr.Error();
  391. }
  392. catch ( ... ) {
  393. // CLD: Need to check return code for error
  394. // No throw here since we are already throwing an exception.
  395. VariantClear( &vValue );
  396. if( pOutputInstance ) {
  397. pOutputInstance->Release();
  398. }
  399. throw;
  400. }
  401. return hRes;
  402. }
  403. ////////////////////////////////////////////////////////////////////////////////
  404. //
  405. // CWLBS_ClusterSetting::FillWbemInstance
  406. //
  407. // Purpose: This function copies all of the data from a cluster configuration
  408. // structure to a WBEM instance.
  409. //
  410. ////////////////////////////////////////////////////////////////////////////////
  411. void CWLBS_ClusterSetting::FillWbemInstance( IWbemClassObject* a_pWbemInstance,
  412. CWlbsClusterWrapper* pCluster)
  413. {
  414. namespace CLUSTER = MOF_CLUSTERSETTING;
  415. ASSERT( a_pWbemInstance );
  416. ASSERT(pCluster );
  417. CClusterConfiguration ClusterConfig;
  418. pCluster->GetClusterConfig( ClusterConfig );
  419. wstring wstrHostName;
  420. ConstructHostName( wstrHostName, pCluster->GetClusterIpOrIndex(g_pWlbsControl),
  421. pCluster->GetHostID() );
  422. //NAME
  423. a_pWbemInstance->Put
  424. (
  425. _bstr_t( CLUSTER::pProperties[CLUSTER::NAME] ) ,
  426. 0 ,
  427. &_variant_t(wstrHostName.c_str()),
  428. NULL
  429. );
  430. //CLUSNAME
  431. a_pWbemInstance->Put
  432. (
  433. _bstr_t( CLUSTER::pProperties[CLUSTER::CLUSNAME] ),
  434. 0 ,
  435. &_variant_t(ClusterConfig.szClusterName.c_str()),
  436. NULL
  437. );
  438. //CLUSIPADDRESS
  439. a_pWbemInstance->Put
  440. (
  441. _bstr_t( CLUSTER::pProperties[CLUSTER::CLUSIPADDRESS] ),
  442. 0 ,
  443. &_variant_t(ClusterConfig.szClusterIPAddress.c_str()),
  444. NULL
  445. );
  446. //CLUSNETMASK
  447. a_pWbemInstance->Put
  448. (
  449. _bstr_t( CLUSTER::pProperties[CLUSTER::CLUSNETMASK] ),
  450. 0 ,
  451. &_variant_t(ClusterConfig.szClusterNetworkMask.c_str()),
  452. NULL
  453. );
  454. //CLUSMAC
  455. a_pWbemInstance->Put
  456. (
  457. _bstr_t( CLUSTER::pProperties[CLUSTER::CLUSMAC] ),
  458. 0 ,
  459. &_variant_t(ClusterConfig.szClusterMACAddress.c_str()),
  460. NULL
  461. );
  462. //MULTIENABLE
  463. a_pWbemInstance->Put
  464. (
  465. _bstr_t( CLUSTER::pProperties[CLUSTER::MULTIENABLE] ),
  466. 0 ,
  467. &_variant_t(ClusterConfig.bMulticastSupportEnable),
  468. NULL
  469. );
  470. //REMCNTEN
  471. a_pWbemInstance->Put
  472. (
  473. _bstr_t( CLUSTER::pProperties[CLUSTER::REMCNTEN] ),
  474. 0 ,
  475. &_variant_t(ClusterConfig.bRemoteControlEnabled),
  476. NULL
  477. );
  478. //IGMPSUPPORT
  479. a_pWbemInstance->Put
  480. (
  481. _bstr_t( CLUSTER::pProperties[CLUSTER::IGMPSUPPORT] ),
  482. 0 ,
  483. &_variant_t(ClusterConfig.bIgmpSupport),
  484. NULL
  485. );
  486. //CLUSTERIPTOMULTICASTIP
  487. a_pWbemInstance->Put
  488. (
  489. _bstr_t( CLUSTER::pProperties[CLUSTER::CLUSTERIPTOMULTICASTIP] ),
  490. 0 ,
  491. &_variant_t(ClusterConfig.bClusterIPToMulticastIP),
  492. NULL
  493. );
  494. //MULTICASTIPADDRESS
  495. a_pWbemInstance->Put
  496. (
  497. _bstr_t( CLUSTER::pProperties[CLUSTER::MULTICASTIPADDRESS] ),
  498. 0 ,
  499. &_variant_t(ClusterConfig.szMulticastIPAddress.c_str()),
  500. NULL
  501. );
  502. //ADAPTERGUID
  503. GUID AdapterGuid = pCluster->GetAdapterGuid();
  504. WCHAR szAdapterGuid[128];
  505. StringFromGUID2(AdapterGuid, szAdapterGuid,
  506. sizeof(szAdapterGuid)/sizeof(szAdapterGuid[0]) );
  507. a_pWbemInstance->Put
  508. (
  509. _bstr_t( CLUSTER::pProperties[CLUSTER::ADAPTERGUID] ),
  510. 0 ,
  511. &_variant_t(szAdapterGuid),
  512. NULL
  513. );
  514. //BDA Team Active
  515. a_pWbemInstance->Put
  516. (
  517. _bstr_t( CLUSTER::pProperties[CLUSTER::BDATEAMACTIVE] ),
  518. 0 ,
  519. &_variant_t(ClusterConfig.bBDATeamActive),
  520. NULL
  521. );
  522. if (ClusterConfig.bBDATeamActive)
  523. {
  524. //BDA Team Id
  525. a_pWbemInstance->Put
  526. (
  527. _bstr_t( CLUSTER::pProperties[CLUSTER::BDATEAMID] ),
  528. 0 ,
  529. &_variant_t(ClusterConfig.szBDATeamId.c_str()),
  530. NULL
  531. );
  532. //BDA Team Master
  533. a_pWbemInstance->Put
  534. (
  535. _bstr_t( CLUSTER::pProperties[CLUSTER::BDATEAMMASTER] ),
  536. 0 ,
  537. &_variant_t(ClusterConfig.bBDATeamMaster),
  538. NULL
  539. );
  540. //BDA Reverse Hash
  541. a_pWbemInstance->Put
  542. (
  543. _bstr_t( CLUSTER::pProperties[CLUSTER::BDAREVERSEHASH] ),
  544. 0 ,
  545. &_variant_t(ClusterConfig.bBDAReverseHash),
  546. NULL
  547. );
  548. }
  549. }
  550. ////////////////////////////////////////////////////////////////////////////////
  551. //
  552. // CWLBS_ClusterSetting::UpdateConfiguration
  553. //
  554. // Purpose: This function updates the configuration data for a member node or a
  555. // potential WLBS cluster node.
  556. //
  557. ////////////////////////////////////////////////////////////////////////////////
  558. void CWLBS_ClusterSetting::UpdateConfiguration
  559. (
  560. IWbemClassObject* a_pInstance,
  561. CWlbsClusterWrapper* pCluster
  562. )
  563. {
  564. namespace CLUSTER = MOF_CLUSTERSETTING;
  565. CClusterConfiguration NewConfiguration;
  566. CClusterConfiguration OldConfiguration;
  567. pCluster->GetClusterConfig( OldConfiguration );
  568. //Cluster Name
  569. UpdateConfigProp
  570. (
  571. NewConfiguration.szClusterName,
  572. OldConfiguration.szClusterName,
  573. CLUSTER::pProperties[CLUSTER::CLUSNAME],
  574. a_pInstance
  575. );
  576. //Cluster IP
  577. UpdateConfigProp
  578. (
  579. NewConfiguration.szClusterIPAddress,
  580. OldConfiguration.szClusterIPAddress,
  581. CLUSTER::pProperties[CLUSTER::CLUSIPADDRESS],
  582. a_pInstance
  583. );
  584. //Cluster Network Mask
  585. UpdateConfigProp
  586. (
  587. NewConfiguration.szClusterNetworkMask,
  588. OldConfiguration.szClusterNetworkMask,
  589. CLUSTER::pProperties[CLUSTER::CLUSNETMASK],
  590. a_pInstance
  591. );
  592. //Cluster enable remote control
  593. UpdateConfigProp
  594. (
  595. NewConfiguration.bRemoteControlEnabled,
  596. OldConfiguration.bRemoteControlEnabled,
  597. CLUSTER::pProperties[CLUSTER::REMCNTEN],
  598. a_pInstance
  599. );
  600. //Cluster enable multicast support
  601. UpdateConfigProp
  602. (
  603. NewConfiguration.bMulticastSupportEnable,
  604. OldConfiguration.bMulticastSupportEnable,
  605. CLUSTER::pProperties[CLUSTER::MULTIENABLE],
  606. a_pInstance
  607. );
  608. //IGMPSUPPORT
  609. UpdateConfigProp
  610. (
  611. NewConfiguration.bIgmpSupport,
  612. OldConfiguration.bIgmpSupport,
  613. CLUSTER::pProperties[CLUSTER::IGMPSUPPORT],
  614. a_pInstance
  615. );
  616. //CLUSTERIPTOMULTICASTIP
  617. UpdateConfigProp
  618. (
  619. NewConfiguration.bClusterIPToMulticastIP,
  620. OldConfiguration.bClusterIPToMulticastIP,
  621. CLUSTER::pProperties[CLUSTER::CLUSTERIPTOMULTICASTIP],
  622. a_pInstance
  623. );
  624. //MULTICASTIPADDRESS
  625. UpdateConfigProp
  626. (
  627. NewConfiguration.szMulticastIPAddress,
  628. OldConfiguration.szMulticastIPAddress,
  629. CLUSTER::pProperties[CLUSTER::MULTICASTIPADDRESS],
  630. a_pInstance
  631. );
  632. //BDA Teaming Active ?
  633. UpdateConfigProp
  634. (
  635. NewConfiguration.bBDATeamActive,
  636. OldConfiguration.bBDATeamActive,
  637. CLUSTER::pProperties[CLUSTER::BDATEAMACTIVE],
  638. a_pInstance
  639. );
  640. // Set the other BDA properties only if the "Active" property is set
  641. if (NewConfiguration.bBDATeamActive)
  642. {
  643. //BDA Team ID
  644. UpdateConfigProp
  645. (
  646. NewConfiguration.szBDATeamId,
  647. OldConfiguration.szBDATeamId,
  648. CLUSTER::pProperties[CLUSTER::BDATEAMID],
  649. a_pInstance
  650. );
  651. //BDA Team Master
  652. UpdateConfigProp
  653. (
  654. NewConfiguration.bBDATeamMaster,
  655. OldConfiguration.bBDATeamMaster,
  656. CLUSTER::pProperties[CLUSTER::BDATEAMMASTER],
  657. a_pInstance
  658. );
  659. //BDA Team Reverse Hash
  660. UpdateConfigProp
  661. (
  662. NewConfiguration.bBDAReverseHash,
  663. OldConfiguration.bBDAReverseHash,
  664. CLUSTER::pProperties[CLUSTER::BDAREVERSEHASH],
  665. a_pInstance
  666. );
  667. }
  668. pCluster->PutClusterConfig( NewConfiguration );
  669. }