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.

171 lines
5.6 KiB

  1. /*++
  2. Copyright(c) 1998,99 Microsoft Corporation
  3. Module Name:
  4. CommonClusterDlg.h
  5. Abstract:
  6. Windows Load Balancing Service (WLBS)
  7. Cluster page UI. Shared by Notifier object and NLB Manager
  8. Author:
  9. kyrilf
  10. shouse
  11. --*/
  12. #pragma once
  13. #include "resource.h"
  14. #include "wlbsparm.h"
  15. #include "IpSubnetMaskControl.h"
  16. #define WLBS_MAX_PASSWORD 16
  17. //
  18. // Common port rule structure shared by wlbscfg and nlbmanager
  19. //
  20. struct NETCFG_WLBS_PORT_RULE {
  21. DWORD start_port; // Starting port number.
  22. DWORD end_port; // Ending port number.
  23. DWORD mode; // Filtering mode. WLBS_PORT_RULE_XXXX
  24. DWORD protocol; // WLBS_TCP, WLBS_UDP or WLBS_TCP_UDP
  25. union {
  26. struct {
  27. DWORD priority; // Mastership priority: 1..32 or 0 for not-specified.
  28. } single; // Data for single server mode.
  29. struct {
  30. WORD equal_load; // TRUE - Even load distribution.
  31. WORD affinity; // WLBS_AFFINITY_XXX
  32. DWORD load; // Percentage of load to handle locally 0..100.
  33. } multi; // Data for multi-server mode.
  34. } mode_data; // Data for appropriate port group mode.
  35. };
  36. //
  37. // Common properties that can be configured by wlbscfg and nlbmanager
  38. //
  39. struct NETCFG_WLBS_CONFIG {
  40. DWORD dwHostPriority; // Host priority ID.
  41. BOOL fRctEnabled; // TRUE - remote control enabled.
  42. BOOL fJoinClusterOnBoot; // TRUE - join cluster on boot.
  43. BOOL fMcastSupport; // TRUE - multicast mode, FALSE - unicast mode.
  44. BOOL fIGMPSupport; // TRUE - IGMP enabled.
  45. BOOL fIpToMCastIp; // TRUE - derive multicast IP from cluster IP.
  46. WCHAR szMCastIpAddress[CVY_MAX_CL_IP_ADDR + 1]; // The multicast IP address, if user-specified.
  47. TCHAR cl_mac_addr[CVY_MAX_NETWORK_ADDR + 1]; // Cluster MAC address.
  48. TCHAR cl_ip_addr[CVY_MAX_CL_IP_ADDR + 1]; // Cluster IP address.
  49. TCHAR cl_net_mask[CVY_MAX_CL_NET_MASK + 1]; // Netmask for cluster IP.
  50. TCHAR ded_ip_addr[CVY_MAX_DED_IP_ADDR + 1]; // Dedicated IP address or "" for none.
  51. TCHAR ded_net_mask[CVY_MAX_DED_NET_MASK + 1]; // Netmask for dedicated IP address or "" for none.
  52. TCHAR domain_name[CVY_MAX_DOMAIN_NAME + 1]; // Full Qualified Domain Name of the cluster.
  53. bool fChangePassword; // Whether to change password, valid for SetAdapterConfig only.
  54. TCHAR szPassword[CVY_MAX_RCT_CODE + 1]; // Remote control password, valid for SetAdapterConfig only.
  55. bool fConvertMac; // Whether the mac address is generated from IP.
  56. DWORD dwMaxHosts; // Maximum # hosts allowed.
  57. DWORD dwMaxRules; // Maximum # port group rules allowed.
  58. DWORD dwNumRules; // # active port group rules
  59. NETCFG_WLBS_PORT_RULE port_rules[CVY_MAX_RULES]; // Port rules
  60. };
  61. //+----------------------------------------------------------------------------
  62. //
  63. // class CCommonClusterPage
  64. //
  65. // Description: Provide a common class to display cluster property page for
  66. // notifier object and NLB Manager
  67. //
  68. // History: shouse initial code
  69. // fengsun Created Header 1/04/01
  70. //
  71. //+----------------------------------------------------------------------------
  72. class CCommonClusterPage
  73. {
  74. public:
  75. /* Constructors/Destructors. */
  76. CCommonClusterPage (HINSTANCE hInstance, NETCFG_WLBS_CONFIG * paramp,
  77. bool fDisablePassword, const DWORD * phelpIDs = NULL);
  78. ~CCommonClusterPage ();
  79. public:
  80. /* Message map functions. */
  81. LRESULT OnInitDialog (HWND hWnd);
  82. LRESULT OnContextMenu ();
  83. LRESULT OnHelp (UINT uMsg, WPARAM wParam, LPARAM lParam);
  84. BOOL Load (void);
  85. BOOL Save (void);
  86. LRESULT OnIpFieldChange (int idCtrl, LPNMHDR pnmh, BOOL & fHandled);
  87. LRESULT OnEditClIp (WORD wNotifyCode, WORD wID, HWND hWndCtl);
  88. LRESULT OnEditClMask (WORD wNotifyCode, WORD wID, HWND hWndCtl);
  89. LRESULT OnCheckRct (WORD wNotifyCode, WORD wID, HWND hWndCtl);
  90. LRESULT OnButtonHelp (WORD wNotifyCode, WORD wID, HWND hWndCtl);
  91. LRESULT OnCheckMode (WORD wNotifyCode, WORD wID, HWND hWndCtl);
  92. LRESULT OnCheckIGMP (WORD wNotifyCode, WORD wID, HWND hWndCtl);
  93. void External_UpdateInfo(void) {UpdateInfo();}
  94. private:
  95. void SetClusterMACAddress ();
  96. BOOL CheckClusterMACAddress ();
  97. void SetInfo ();
  98. void UpdateInfo ();
  99. LRESULT ValidateInfo ();
  100. NETCFG_WLBS_CONFIG * m_paramp;
  101. const DWORD * m_adwHelpIDs;
  102. BOOL m_rct_warned;
  103. BOOL m_igmp_warned;
  104. BOOL m_igmp_mcast_warned;
  105. WCHAR m_passw[CVY_MAX_RCT_CODE + 1];
  106. WCHAR m_passw2[CVY_MAX_RCT_CODE + 1];
  107. CIpSubnetMaskControl m_IpSubnetControl;
  108. HWND m_hWnd;
  109. HINSTANCE m_hInstance;
  110. bool m_fDisablePassword; // If true, always disable password editing
  111. };
  112. PCWSTR
  113. SzLoadStringPcch (
  114. IN HINSTANCE hinst,
  115. IN UINT unId,
  116. OUT int* pcch);
  117. PCWSTR
  118. SzLoadString (
  119. HINSTANCE hinst,
  120. UINT unId);
  121. INT
  122. WINAPIV
  123. NcMsgBox (
  124. IN HINSTANCE hinst,
  125. IN HWND hwnd,
  126. IN UINT unIdCaption,
  127. IN UINT unIdFormat,
  128. IN UINT unStyle,
  129. IN ...);