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.

145 lines
2.9 KiB

  1. #ifndef _MNLBUIDATA_H
  2. #define _MNLBUIDATA_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 : muidata interface file.
  11. // DevUnit : wlbstest
  12. // Author : Murtaza Hakim
  13. //
  14. // Description:
  15. // -----------
  16. // This data structure is as follows
  17. //
  18. // ClusterData has inforamtion about
  19. // cluster
  20. // portrules
  21. // and hosts.
  22. //
  23. // The portRules are map structures with the start port mapping to the detailed port rule.
  24. //
  25. // the portrules unequal load balanced have a map which maps the host id and the
  26. // load weight for that particular host.
  27. //
  28. // the portrules failover have a map which maps the host id and the
  29. // priority for that particular host.
  30. //
  31. //
  32. #include "Common.h"
  33. #include "MNLBPortRule.h"
  34. #include <wbemidl.h>
  35. #include <comdef.h>
  36. #include <set>
  37. #include <map>
  38. using namespace std;
  39. struct PortDataULB : public MNLBPortRuleLoadBalanced
  40. {
  41. map< _bstr_t, long > machineMapToLoadWeight;
  42. // default constructor
  43. PortDataULB();
  44. // constructor
  45. PortDataULB( long startPort,
  46. long endPort,
  47. Protocol traficToHandle,
  48. Affinity affinity );
  49. };
  50. struct PortDataELB : public MNLBPortRuleLoadBalanced
  51. {
  52. // default constructor
  53. PortDataELB();
  54. // constructor
  55. PortDataELB( long startPort,
  56. long endPort,
  57. Protocol traficToHandle,
  58. Affinity affinity );
  59. // equality operator
  60. bool
  61. operator==( const PortDataELB& objToCompare );
  62. // inequality
  63. bool
  64. operator!=( const PortDataELB& objToCompare );
  65. };
  66. struct PortDataD : public MNLBPortRuleDisabled
  67. {
  68. // default constructor
  69. PortDataD();
  70. // constructor
  71. PortDataD( long startPort,
  72. long endPort,
  73. Protocol traficToHandle );
  74. // equality operator
  75. bool
  76. operator==( const PortDataD& objToCompare );
  77. // inequality
  78. bool
  79. operator!=( const PortDataD& objToCompare );
  80. };
  81. struct PortDataF : public MNLBPortRuleFailover
  82. {
  83. map< _bstr_t, long > machineMapToPriority;
  84. set<long>
  85. getAvailablePriorities();
  86. // default constructor
  87. PortDataF();
  88. PortDataF( long startPort,
  89. long endPort,
  90. Protocol traficToHandle );
  91. };
  92. struct HostData
  93. {
  94. HostProperties hp;
  95. _bstr_t connectionIP;
  96. };
  97. struct ClusterData
  98. {
  99. vector<_bstr_t> virtualIPs;
  100. vector<_bstr_t> virtualSubnets;
  101. ClusterProperties cp;
  102. map< long, PortDataELB> portELB;
  103. map< long, PortDataULB> portULB;
  104. map< long, PortDataD> portD;
  105. map< long, PortDataF> portF;
  106. map< _bstr_t, HostData> hosts;
  107. set<int>
  108. getAvailableHostIDS();
  109. bool connectedDirect;
  110. void
  111. dump();
  112. };
  113. #endif