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.

97 lines
1.9 KiB

  1. #ifndef _MNLBNETCFG_H
  2. #define _MNLBNETCFG_H
  3. //
  4. // Copyright (c) Microsoft. All Rights Reserved
  5. //
  6. // THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF Microsoft.
  7. // The copyright notice above does not evidence any
  8. // actual or intended publication of such source code.
  9. //
  10. // OneLiner : MNLBNetCfg interface.
  11. // DevUnit : wlbstest
  12. // Author : Murtaza Hakim
  13. //
  14. // Description:
  15. // -----------
  16. #include "MIPAddressAdmin.h"
  17. #include "Common.h"
  18. #include "MNLBUIData.h"
  19. #include <comdef.h>
  20. #include <iostream>
  21. using namespace std;
  22. // Include Files
  23. class MNLBNetCfg
  24. {
  25. public:
  26. enum MNLBNetCfg_Error
  27. {
  28. MNLBNetCfg_SUCCESS = 0,
  29. BOUND = 4,
  30. UNBOUND = 5,
  31. NO_SUCH_NIC = 6,
  32. NO_NLB = 7,
  33. };
  34. // constructor
  35. // for remote machine.
  36. MNLBNetCfg( const _bstr_t& iP,
  37. const _bstr_t& fullNicName );
  38. // for local
  39. MNLBNetCfg( const _bstr_t& fullNicName );
  40. // bindAndConfigure
  41. MNLBNetCfg_Error
  42. bindAndConfigure( const ClusterData* p_clusterData,
  43. const _bstr_t& machineName
  44. );
  45. // modifyClusterProperties
  46. MNLBNetCfg_Error
  47. modifyClusterProperties(const ClusterProperties* p_clusterProperties);
  48. // bind
  49. MNLBNetCfg_Error
  50. bind();
  51. // unbind nlb
  52. MNLBNetCfg_Error
  53. unbind();
  54. // is nlb bound?
  55. MNLBNetCfg_Error
  56. isBound();
  57. // add cluster ip
  58. MNLBNetCfg_Error
  59. addClusterIP( const _bstr_t& clusterIP,
  60. const _bstr_t& subnet );
  61. // remove cluster ip
  62. MNLBNetCfg_Error
  63. removeClusterIP( const _bstr_t& clusterIP );
  64. private:
  65. _bstr_t m_ip;
  66. _bstr_t m_fullNicName;
  67. void
  68. getPortRules( const ClusterData* p_clusterData,
  69. const _bstr_t& myMachine,
  70. vector<_bstr_t>& myPortRules );
  71. };
  72. // ensure type safety
  73. typedef class MNLBNetCfg MNLBNetCfg;
  74. #endif