Leaked source code of windows server 2003
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.

83 lines
2.9 KiB

  1. /*
  2. * Filename: NLB_PortRule.h
  3. * Description:
  4. * Author: shouse, 04.10.01
  5. */
  6. #ifndef __NLB_PORTRULE_H__
  7. #define __NLB_PORTRULE_H__
  8. #include "NLB_Common.h"
  9. #include <vector>
  10. #include <string>
  11. #include <map>
  12. using namespace std;
  13. class NLB_PortRule {
  14. public:
  15. NLB_PortRule();
  16. ~NLB_PortRule();
  17. bool IsValid ();
  18. void Clear ();
  19. bool SetName (PWCHAR pName);
  20. bool GetName (PWCHAR pName, ULONG length);
  21. bool SetLabel (PWCHAR pLabel);
  22. bool GetLabel (PWCHAR pLabel, ULONG length);
  23. bool SetPortRange (ULONG start, ULONG end);
  24. bool GetPortRange (ULONG & start, ULONG & end);
  25. bool SetVirtualIPAddress (NLB_IPAddress address);
  26. bool GetVirtualIPAddress (NLB_IPAddress & address);
  27. bool SetState (NLB_PortRuleState::NLB_PortRuleStateType eState);
  28. bool GetState (NLB_PortRuleState::NLB_PortRuleStateType & eState);
  29. bool SetProtocol (NLB_PortRuleProtocol::NLB_PortRuleProtocolType eProtocol);
  30. bool GetProtocol (NLB_PortRuleProtocol::NLB_PortRuleProtocolType & eProtocol);
  31. bool SetFilteringMode (NLB_PortRuleFilteringMode::NLB_PortRuleFilteringModeType eMode);
  32. bool GetFilteringMode (NLB_PortRuleFilteringMode::NLB_PortRuleFilteringModeType & eMode);
  33. bool SetAffinity (NLB_PortRuleAffinity::NLB_PortRuleAffinityType eAffinity);
  34. bool GetAffinity (NLB_PortRuleAffinity::NLB_PortRuleAffinityType & eAffinity);
  35. bool AddSingleHostFilteringPriority (PWCHAR pHost, ULONG priority);
  36. bool ChangeSingleHostFilteringPriority (PWCHAR pHost, ULONG priority);
  37. bool GetSingleHostFilteringPriority (PWCHAR pHost, ULONG & priority);
  38. bool RemoveSingleHostFilteringPriority (PWCHAR pHost);
  39. ULONG SetSingleHostFilteringPriorityList (vector<NLB_PortRulePriority> pList);
  40. ULONG GetSingleHostFilteringPriorityList (vector<NLB_PortRulePriority> * pList);
  41. bool AddMultipleHostFilteringLoadWeight (PWCHAR pHost, ULONG weight);
  42. bool ChangeMultipleHostFilteringLoadWeight (PWCHAR pHost, ULONG weight);
  43. bool GetMultipleHostFilteringLoadWeight (PWCHAR pHost, ULONG & weight);
  44. bool RemoveMultipleHostFilteringLoadWeight (PWCHAR pHost);
  45. ULONG SetMultipleHostFilteringLoadWeightList (vector<NLB_PortRuleLoadWeight> pList);
  46. ULONG GetMultipleHostFilteringLoadWeightList (vector<NLB_PortRuleLoadWeight> * pList);
  47. private:
  48. NLB_Name Name;
  49. NLB_Label Label;
  50. NLB_PortRuleState State;
  51. NLB_IPAddress VirtualIPAddress;
  52. NLB_PortRulePortRange Range;
  53. NLB_PortRuleProtocol Protocol;
  54. NLB_PortRuleFilteringMode FilteringMode;
  55. NLB_PortRuleAffinity Affinity;
  56. NLB_SingleHostFilteringPriorityList PriorityList;
  57. NLB_MultipleHostFilteringLoadWeightList LoadWeightList;
  58. };
  59. typedef map<wstring, NLB_PortRule, less<wstring> > NLB_PortRuleList;
  60. #endif