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.

159 lines
4.2 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // IpAddr.h
  7. //
  8. // Abstract:
  9. // Definition of the CIpAddrParamsPage class, which implements the
  10. // Parameters page for IP Address resources.
  11. //
  12. // Implementation File:
  13. // IpAddr.cpp
  14. //
  15. // Author:
  16. // David Potter (davidp) June 28, 1996
  17. //
  18. // Revision History:
  19. //
  20. // Notes:
  21. //
  22. /////////////////////////////////////////////////////////////////////////////
  23. #ifndef _IPADDR_H_
  24. #define _IPADDR_H_
  25. /////////////////////////////////////////////////////////////////////////////
  26. // Include Files
  27. /////////////////////////////////////////////////////////////////////////////
  28. #ifndef __cluadmex_h__
  29. #include <CluAdmEx.h>
  30. #endif
  31. #ifndef _BASEPAGE_H_
  32. #include "BasePage.h" // for CBasePropertyPage
  33. #endif
  34. /////////////////////////////////////////////////////////////////////////////
  35. // Forward Class Declarations
  36. /////////////////////////////////////////////////////////////////////////////
  37. struct CNetworkObject;
  38. class CIpAddrEdit;
  39. class CIpAddrParamsPage;
  40. /////////////////////////////////////////////////////////////////////////////
  41. // External Class Declarations
  42. /////////////////////////////////////////////////////////////////////////////
  43. /////////////////////////////////////////////////////////////////////////////
  44. // class CNetworkObject
  45. /////////////////////////////////////////////////////////////////////////////
  46. struct CNetworkObject
  47. {
  48. CString m_strName;
  49. CLUSTER_NETWORK_ROLE m_nRole;
  50. CString m_strAddress;
  51. CString m_strAddressMask;
  52. DWORD m_nAddress;
  53. DWORD m_nAddressMask;
  54. }; //*** struct CNetworkObject
  55. typedef CList< CNetworkObject*, CNetworkObject* > CNetObjectList;
  56. /////////////////////////////////////////////////////////////////////////////
  57. // class CIpAddrParamsPage
  58. /////////////////////////////////////////////////////////////////////////////
  59. class CIpAddrParamsPage : public CBasePropertyPage
  60. {
  61. DECLARE_DYNCREATE(CIpAddrParamsPage)
  62. // Construction
  63. public:
  64. CIpAddrParamsPage(void);
  65. ~CIpAddrParamsPage(void);
  66. // Second phase construction.
  67. virtual HRESULT HrInit(IN OUT CExtObject * peo);
  68. // Dialog Data
  69. //{{AFX_DATA(CIpAddrParamsPage)
  70. enum { IDD = IDD_PP_IPADDR_PARAMETERS };
  71. CButton m_chkEnableNetBIOS;
  72. CComboBox m_cboxNetworks;
  73. CEdit m_editSubnetMask;
  74. CEdit m_editIPAddress;
  75. CString m_strIPAddress;
  76. CString m_strSubnetMask;
  77. CString m_strNetwork;
  78. BOOL m_bEnableNetBIOS;
  79. //}}AFX_DATA
  80. CString m_strPrevIPAddress;
  81. CString m_strPrevSubnetMask;
  82. CString m_strPrevNetwork;
  83. BOOL m_bPrevEnableNetBIOS;
  84. CNetObjectList m_lnetobjNetworks;
  85. CNetworkObject * PnoNetworkFromIpAddress(IN LPCWSTR pszAddress);
  86. void SelectNetwork(IN CNetworkObject * pno);
  87. BOOL m_bIsSubnetUpdatedManually;
  88. BOOL BIsSubnetUpdatedManually(void) const { return m_bIsSubnetUpdatedManually; }
  89. BOOL m_bIsIPAddressModified;
  90. BOOL BIsIPAddressModified(void) const { return m_bIsIPAddressModified; }
  91. protected:
  92. enum
  93. {
  94. epropNetwork,
  95. epropAddress,
  96. epropSubnetMask,
  97. epropEnableNetBIOS,
  98. epropMAX
  99. };
  100. CObjectProperty m_rgProps[epropMAX];
  101. // Overrides
  102. public:
  103. // ClassWizard generate virtual function overrides
  104. //{{AFX_VIRTUAL(CIpAddrParamsPage)
  105. public:
  106. virtual BOOL OnSetActive();
  107. protected:
  108. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  109. //}}AFX_VIRTUAL
  110. protected:
  111. virtual const CObjectProperty * Pprops(void) const { return m_rgProps; }
  112. virtual DWORD Cprops(void) const { return sizeof(m_rgProps) / sizeof(CObjectProperty); }
  113. // Implementation
  114. protected:
  115. void CollectNetworks(void);
  116. void ClearNetworkObjectList(void);
  117. BOOL BIsNetNameProvider(void);
  118. // Generated message map functions
  119. //{{AFX_MSG(CIpAddrParamsPage)
  120. virtual BOOL OnInitDialog();
  121. afx_msg void OnChangeSubnetMask();
  122. afx_msg void OnKillFocusIPAddress();
  123. afx_msg void OnChangeRequiredFields();
  124. afx_msg void OnChangeIPAddress();
  125. //}}AFX_MSG
  126. DECLARE_MESSAGE_MAP()
  127. }; //*** class CIpAddrParamsPage
  128. /////////////////////////////////////////////////////////////////////////////
  129. #endif // _IPADDR_H_