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.

205 lines
6.6 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1997 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // NetIFace.h
  7. //
  8. // Abstract:
  9. // Definition of the CNetInterface class.
  10. //
  11. // Implementation File:
  12. // NetIFace.cpp
  13. //
  14. // Author:
  15. // David Potter (davidp) May 28, 1997
  16. //
  17. // Revision History:
  18. //
  19. // Notes:
  20. //
  21. /////////////////////////////////////////////////////////////////////////////
  22. #ifndef _NETIFACE_H_
  23. #define _NETIFACE_H_
  24. /////////////////////////////////////////////////////////////////////////////
  25. // Forward Class Declarations
  26. /////////////////////////////////////////////////////////////////////////////
  27. class CNetInterface;
  28. class CNetInterfaceList;
  29. /////////////////////////////////////////////////////////////////////////////
  30. // External Class Declarations
  31. /////////////////////////////////////////////////////////////////////////////
  32. class CClusterNode;
  33. class CNetwork;
  34. /////////////////////////////////////////////////////////////////////////////
  35. // Type Definitions
  36. /////////////////////////////////////////////////////////////////////////////
  37. /////////////////////////////////////////////////////////////////////////////
  38. // Include Files
  39. /////////////////////////////////////////////////////////////////////////////
  40. #ifndef _CLUSITEM_H_
  41. #include "ClusItem.h" // for CClusterItem
  42. #endif
  43. #ifndef _PROPLIST_H_
  44. #include "PropList.h" // for CObjectProperty, CClusPropList
  45. #endif
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CNetInterface command target
  48. /////////////////////////////////////////////////////////////////////////////
  49. class CNetInterface : public CClusterItem
  50. {
  51. DECLARE_DYNCREATE(CNetInterface)
  52. // Construction
  53. public:
  54. CNetInterface(void); // protected constructor used by dynamic creation
  55. void Init(IN OUT CClusterDoc * pdoc, IN LPCTSTR lpszName);
  56. protected:
  57. void CommonConstruct(void);
  58. // Attributes
  59. protected:
  60. HNETINTERFACE m_hnetiface;
  61. CLUSTER_NETINTERFACE_STATE m_cnis;
  62. CString m_strNode;
  63. CClusterNode * m_pciNode;
  64. CString m_strNetwork;
  65. CNetwork * m_pciNetwork;
  66. CString m_strAdapter;
  67. CString m_strAddress;
  68. DWORD m_dwCharacteristics;
  69. DWORD m_dwFlags;
  70. enum
  71. {
  72. epropName = 0,
  73. epropNode,
  74. epropNetwork,
  75. epropAdapter,
  76. epropAddress,
  77. epropDescription,
  78. epropMAX
  79. };
  80. CObjectProperty m_rgProps[epropMAX];
  81. public:
  82. HNETINTERFACE Hnetiface(void) const { return m_hnetiface; }
  83. CLUSTER_NETINTERFACE_STATE Cnis(void) const { return m_cnis; }
  84. const CString & StrNode(void) const { return m_strNode; }
  85. CClusterNode * PciNode(void) const { return m_pciNode; }
  86. const CString & StrNetwork(void) const { return m_strNetwork; }
  87. CNetwork * PciNetwork(void) const { return m_pciNetwork; }
  88. const CString & StrAdapter(void) const { return m_strAdapter; }
  89. const CString & StrAddress(void) const { return m_strAddress; }
  90. DWORD DwCharacteristics(void) const { return m_dwCharacteristics; }
  91. DWORD DwFlags(void) const { return m_dwFlags; }
  92. void GetStateName(OUT CString & rstrState) const;
  93. // Operations
  94. public:
  95. void ReadExtensions(void);
  96. void SetCommonProperties(
  97. IN const CString & rstrDesc,
  98. IN BOOL bValidateOnly
  99. );
  100. void SetCommonProperties(
  101. IN const CString & rstrDesc
  102. )
  103. {
  104. SetCommonProperties(rstrDesc, FALSE /*bValidateOnly*/);
  105. }
  106. void ValidateCommonProperties(
  107. IN const CString & rstrDesc
  108. )
  109. {
  110. SetCommonProperties(rstrDesc, TRUE /*bValidateOnly*/);
  111. }
  112. // Overrides
  113. public:
  114. virtual void Cleanup(void);
  115. virtual void ReadItem(void);
  116. virtual void UpdateState(void);
  117. virtual BOOL BGetColumnData(IN COLID colid, OUT CString & rstrText);
  118. virtual BOOL BDisplayProperties(IN BOOL bReadOnly = FALSE);
  119. virtual const CStringList * PlstrExtensions(void) const;
  120. #ifdef _DISPLAY_STATE_TEXT_IN_TREE
  121. virtual void GetTreeName(OUT CString & rstrName) const;
  122. #endif
  123. // ClassWizard generated virtual function overrides
  124. //{{AFX_VIRTUAL(CNetInterface)
  125. //}}AFX_VIRTUAL
  126. virtual LRESULT OnClusterNotify(IN OUT CClusterNotify * pnotify);
  127. protected:
  128. virtual const CObjectProperty * Pprops(void) const { return m_rgProps; }
  129. virtual DWORD Cprops(void) const { return sizeof(m_rgProps) / sizeof(m_rgProps[0]); }
  130. virtual DWORD DwSetCommonProperties(IN const CClusPropList & rcpl, IN BOOL bValidateOnly = FALSE);
  131. // Implementation
  132. public:
  133. virtual ~CNetInterface(void);
  134. public:
  135. // Generated message map functions
  136. //{{AFX_MSG(CNetInterface)
  137. afx_msg void OnUpdateProperties(CCmdUI* pCmdUI);
  138. //}}AFX_MSG
  139. DECLARE_MESSAGE_MAP()
  140. }; //*** class CNetInterface
  141. /////////////////////////////////////////////////////////////////////////////
  142. // CNetInterfaceList
  143. /////////////////////////////////////////////////////////////////////////////
  144. class CNetInterfaceList : public CClusterItemList
  145. {
  146. public:
  147. CNetInterface * PciNetInterfaceFromName(
  148. IN LPCTSTR pszName,
  149. OUT POSITION * ppos = NULL
  150. )
  151. {
  152. return (CNetInterface *) PciFromName(pszName, ppos);
  153. }
  154. }; //*** class CNetInterfaceList
  155. /////////////////////////////////////////////////////////////////////////////
  156. // Global Functions
  157. /////////////////////////////////////////////////////////////////////////////
  158. //void DeleteAllItemData(IN OUT CNetInterfaceList & rlp);
  159. #ifdef _DEBUG
  160. class CTraceTag;
  161. extern CTraceTag g_tagNetIFace;
  162. extern CTraceTag g_tagNetIFaceNotify;
  163. #endif
  164. /////////////////////////////////////////////////////////////////////////////
  165. #endif // _NETIFACE_H_