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.

231 lines
5.3 KiB

  1. //============================================================================
  2. // Copyright (C) Microsoft Corporation, 1997 - 1999
  3. //
  4. // File: ipxstats.h
  5. //
  6. // History:
  7. // 07/22/97 Kenn M. Takara Created.
  8. //
  9. // IPX Statistics
  10. //
  11. //============================================================================
  12. #ifndef _IPXSTATS_H
  13. #define _IPXSTATS_H
  14. #ifndef _INFO_H
  15. #include "info.h"
  16. #endif
  17. #ifndef _STATSDLG_H
  18. #include "statsdlg.h"
  19. #endif
  20. #include "ipxrtdef.h"
  21. class IPXConnection;
  22. // Base class for IPX statistics dialogs
  23. class IPXStatisticsDialog : public StatsDialog
  24. {
  25. public:
  26. IPXStatisticsDialog(DWORD dwOptions) :
  27. StatsDialog(dwOptions),
  28. m_pIPXConn(NULL),
  29. m_dwSortSubitem(0xFFFFFFFF)
  30. {};
  31. ~IPXStatisticsDialog()
  32. {
  33. SetConnectionData(NULL);
  34. }
  35. // Override the OnInitDialog so that we can set the caption
  36. virtual BOOL OnInitDialog();
  37. // Override the PostNcDestroy to do any cleanup action
  38. virtual void PostNcDestroy();
  39. // Override the Sort to provide the ability to do sorting
  40. virtual void Sort(UINT nColumnId);
  41. // Derived classes should override this to provide sorting
  42. // function
  43. virtual PFNLVCOMPARE GetSortFunction();
  44. virtual PFNLVCOMPARE GetInverseSortFunction();
  45. void SetConnectionData(IPXConnection *pIPXConn);
  46. protected:
  47. DWORD m_dwSortSubitem;
  48. IPXConnection * m_pIPXConn;
  49. };
  50. //----------------------------------------------------------------------------
  51. // Enum: MV_ROWS
  52. //
  53. // Indices of rows in the 'IPX' view.
  54. // This list MUST be kept in sync with the list in s_rgIpxStatsColumnInfo.
  55. //----------------------------------------------------------------------------
  56. enum
  57. {
  58. MVR_IPX_STATE = 0,
  59. MVR_IPX_NETWORK,
  60. MVR_IPX_NODE,
  61. MVR_IPX_INTERFACE_COUNT,
  62. MVR_IPX_ROUTE_COUNT,
  63. MVR_IPX_SERVICE_COUNT,
  64. MVR_IPX_PACKETS_SENT,
  65. MVR_IPX_PACKETS_RCVD,
  66. MVR_IPX_PACKETS_FRWD,
  67. MVR_IPX_COUNT
  68. };
  69. class IpxInfoStatistics : public IPXStatisticsDialog
  70. {
  71. public:
  72. IpxInfoStatistics();
  73. ~IpxInfoStatistics();
  74. // Override the OnInitDialog so that we can set the caption
  75. virtual BOOL OnInitDialog();
  76. // Override the RefreshData to provide sample data
  77. virtual HRESULT RefreshData(BOOL fGrabNewData);
  78. // Override the Sort to provide the ability to do sorting
  79. // actually we don't do any sorting (this is a vertical format)
  80. virtual void Sort(UINT nColumnId);
  81. protected:
  82. void UpdateIpxData(LPBYTE pData, HRESULT hr);
  83. };
  84. enum
  85. {
  86. MVR_IPXROUTING_NETWORK = 0,
  87. MVR_IPXROUTING_NEXT_HOP_MAC,
  88. MVR_IPXROUTING_TICK_COUNT,
  89. MVR_IPXROUTING_HOP_COUNT,
  90. MVR_IPXROUTING_IF_NAME,
  91. MVR_IPXROUTING_PROTOCOL,
  92. MVR_IPXROUTING_ROUTE_NOTES,
  93. MVR_IPXROUTING_COUNT,
  94. };
  95. typedef CArray<IPX_ROUTE, IPX_ROUTE&> RouteItemInfoArray;
  96. class IpxRoutingStatistics : public IPXStatisticsDialog
  97. {
  98. friend int CALLBACK IpxRoutingStatisticsCompareProc(LPARAM, LPARAM, LPARAM);
  99. public:
  100. IpxRoutingStatistics();
  101. ~IpxRoutingStatistics();
  102. // Override the OnInitDialog so that we can set the caption
  103. virtual BOOL OnInitDialog();
  104. // Override the PostNcDestroy to do any cleanup action
  105. virtual void PostNcDestroy();
  106. // Override the RefreshData to provide sample data
  107. virtual HRESULT RefreshData(BOOL fGrabNewData);
  108. // Override the Sort to provide the ability to do sorting
  109. virtual void Sort(UINT nColumnId);
  110. // Override this so that we can free up out item data
  111. virtual void PreDeleteAllItems();
  112. void SetRouterInfo(IRouterInfo *pRouterInfo);
  113. void FixColumnAlignment();
  114. protected:
  115. DWORD m_dwSortSubitem;
  116. SPIRouterInfo m_spRouterInfo;
  117. // Holds the IPX_ROUTE information
  118. RouteItemInfoArray m_Items;
  119. // Holds the interface title (indexed by interfaceindex)
  120. CStringArray m_rgIfTitle;
  121. HRESULT GetIpxRoutingData();
  122. HRESULT FillInterfaceTable();
  123. afx_msg void OnNotifyGetDispInfo(NMHDR *, LRESULT *pResult);
  124. DECLARE_MESSAGE_MAP();
  125. };
  126. enum
  127. {
  128. MVR_IPXSERVICE_SERVICE_NAME = 0,
  129. MVR_IPXSERVICE_SERVICE_TYPE,
  130. MVR_IPXSERVICE_SERVICE_ADDRESS,
  131. MVR_IPXSERVICE_HOP_COUNT,
  132. MVR_IPXSERVICE_IF_NAME,
  133. MVR_IPXSERVICE_PROTOCOL,
  134. MVR_IPXSERVICE_COUNT,
  135. };
  136. typedef CArray<IPX_SERVICE, IPX_SERVICE&> ServiceItemInfoArray;
  137. class IpxServiceStatistics : public IPXStatisticsDialog
  138. {
  139. friend int CALLBACK IpxServiceStatisticsCompareProc(LPARAM, LPARAM, LPARAM);
  140. public:
  141. IpxServiceStatistics();
  142. ~IpxServiceStatistics();
  143. // Override the OnInitDialog so that we can set the caption
  144. virtual BOOL OnInitDialog();
  145. // Override the PostNcDestroy to do any cleanup action
  146. virtual void PostNcDestroy();
  147. // Override the RefreshData to provide sample data
  148. virtual HRESULT RefreshData(BOOL fGrabNewData);
  149. // Override the Sort to provide the ability to do sorting
  150. virtual void Sort(UINT nColumnId);
  151. // Override this so that we can free up out item data
  152. virtual void PreDeleteAllItems();
  153. void SetRouterInfo(IRouterInfo *pRouterInfo);
  154. protected:
  155. DWORD m_dwSortSubitem;
  156. SPIRouterInfo m_spRouterInfo;
  157. // Holds the IPX_SERVICE information
  158. ServiceItemInfoArray m_Items;
  159. // Holds the interface title (indexed by interfaceindex)
  160. CStringArray m_rgIfTitle;
  161. HRESULT GetIpxServiceData();
  162. HRESULT FillInterfaceTable();
  163. afx_msg void OnNotifyGetDispInfo(NMHDR *, LRESULT *pResult);
  164. DECLARE_MESSAGE_MAP();
  165. };
  166. #endif _IPXSTATS_H