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.

142 lines
3.7 KiB

  1. //***************************************************************************
  2. //
  3. // VIPSPAGE.H
  4. //
  5. // Module: NLB Manager EXE
  6. //
  7. // Purpose: Interface to the "Cluster IP Addresses" dialog.
  8. //
  9. // Copyright (c)2001 Microsoft Corporation, All Rights Reserved
  10. //
  11. // History:
  12. //
  13. // 09/23/01 JosephJ Created
  14. //
  15. //***************************************************************************
  16. #pragma once
  17. class VipsPage : public CPropertyPage
  18. {
  19. public:
  20. enum
  21. {
  22. IDD = IDD_DIALOG_CLUSTER_IPS
  23. };
  24. VipsPage(
  25. CPropertySheet *psh,
  26. NLB_EXTENDED_CLUSTER_CONFIGURATION *pNlbCfg,
  27. BOOL fClusterView,
  28. CWnd* parent
  29. );
  30. virtual BOOL OnInitDialog();
  31. virtual void OnOK();
  32. virtual BOOL OnSetActive();
  33. virtual BOOL OnKillActive();
  34. // overrides CDialog -- see SDK documentation on DoDataExchange.
  35. // Used to map controls in resources to corresponding objects in this class.
  36. virtual void DoDataExchange( CDataExchange* pDX );
  37. afx_msg BOOL OnHelpInfo (HELPINFO* helpInfo );
  38. afx_msg void OnContextMenu( CWnd* pWnd, CPoint point );
  39. afx_msg void OnButtonAdd();
  40. afx_msg void OnButtonRemove();
  41. afx_msg void OnButtonEdit();
  42. afx_msg void OnSelchanged(NMHDR * pNotifyStruct, LRESULT * result );
  43. afx_msg void OnDoubleClick(NMHDR * pNotifyStruct, LRESULT * result );
  44. afx_msg void OnUpdateEditAddVip();
  45. private:
  46. BOOL m_fClusterView;
  47. BOOL m_fModified; // If it's been modified since we've last saved stuff
  48. // to m_pNlbCfg;
  49. UINT m_uPrimaryClusterIp; // UINT version of cluster ip, in network order
  50. CEdit editAddVip;
  51. CListCtrl listAdditionalVips;
  52. void
  53. mfn_SaveToNlbCfg(void);
  54. void
  55. mfn_LoadFromNlbCfg(void);
  56. void
  57. mfn_InitializeListView(void);
  58. void
  59. mfn_InsertNetworkAddress(
  60. LPCWSTR szIP,
  61. LPCWSTR szSubnetMask,
  62. UINT lParam,
  63. int nItem
  64. );
  65. CPropertySheet *m_pshOwner;
  66. NLB_EXTENDED_CLUSTER_CONFIGURATION *m_pNlbCfg;
  67. static
  68. DWORD
  69. s_HelpIDs[];
  70. DECLARE_MESSAGE_MAP()
  71. };
  72. #define MAXIPSTRLEN 15 /* xxx.xxx.xxx.xxx */
  73. class CIPAddressDialog : public CDialog {
  74. public:
  75. enum { IDD = IDD_DIALOG_IP_ADDRESS };
  76. CIPAddressDialog (LPWSTR szIPAddress, LPWSTR szSubnetMask);
  77. ~CIPAddressDialog ();
  78. // overrides CDialog -- see SDK documentation on DoDataExchange.
  79. // Used to map controls in resources to corresponding objects in this class.
  80. virtual void DoDataExchange( CDataExchange* pDX );
  81. public:
  82. virtual BOOL OnInitDialog();
  83. virtual void OnOK();
  84. void OnEditSubnetMask();
  85. afx_msg BOOL OnHelpInfo (HELPINFO* helpInfo );
  86. afx_msg void OnContextMenu( CWnd* pWnd, CPoint point );
  87. LPWSTR GetIPAddress() { return _wcsdup(address.IpAddress); }
  88. LPWSTR GetSubnetMask() { return _wcsdup(address.SubnetMask); }
  89. private:
  90. DWORD WideStringToIPAddress (const WCHAR* wszIPAddress);
  91. void IPAddressToWideString (DWORD dwIPAddress, LPWSTR wszIPAddress);
  92. void GetIPAddressOctets (LPWSTR wszIPAddress, DWORD dwIPAddress[4]);
  93. BOOL IsValid (LPWSTR szIPAddress, LPWSTR szSubnetMask);
  94. BOOL IsContiguousSubnetMask (LPWSTR wszSubnetMask);
  95. BOOL CIPAddressDialog::GenerateSubnetMask (LPWSTR wszIPAddress,
  96. UINT cchSubnetMask,
  97. LPWSTR wszSubnetMask
  98. );
  99. CIPAddressCtrl IPAddress;
  100. CIPAddressCtrl SubnetMask;
  101. NLB_IP_ADDRESS_INFO address;
  102. static
  103. DWORD
  104. s_HelpIDs[];
  105. DECLARE_MESSAGE_MAP()
  106. };