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.

253 lines
7.3 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. dataras.h
  5. Abstract:
  6. Header file for the RAS Extensible Object data definitions
  7. This file contains definitions to construct the dynamic data
  8. which is returned by the Configuration Registry. Data from
  9. various system API calls is placed into the structures shown
  10. here.
  11. Author:
  12. Russ Blake 02/24/93
  13. Thomas J. Dimitri 05/28/93
  14. Revision History:
  15. Patrick Y. Ng 08/12/93
  16. --*/
  17. #ifndef _DATARAS_H_
  18. #define _DATARAS_H_
  19. /****************************************************************************\
  20. 18 Jan 92
  21. russbl
  22. Adding a Counter to the Extensible Objects Code
  23. 1. Modify the object definition in extdata.h:
  24. a. Add a define for the offset of the counter in the
  25. data block for the given object type.
  26. b. Add a PERF_COUNTER_DEFINITION to the <object>_DATA_DEFINITION.
  27. 2. Add the Titles to the Registry in perfctrs.ini and perfhelp.ini:
  28. a. Add Text for the Counter Name and the Text for the Help.
  29. b. Add them to the bottom so we don't have to change all the
  30. numbers.
  31. c. Change the Last Counter and Last Help entries under
  32. PerfLib in software.ini.
  33. d. To do this at setup time, see section in pmintrnl.txt for
  34. protocol.
  35. 3. Now add the counter to the object definition in extdata.c.
  36. This is the initializing, constant data which will actually go
  37. into the structure you added to the <object>_DATA_DEFINITION in
  38. step 1.b. The type of the structure you are initializing is a
  39. PERF_COUNTER_DEFINITION. These are defined in winperf.h.
  40. 4. Add code in extobjct.c to collect the data.
  41. Note: adding an object is a little more work, but in all the same
  42. places. See the existing code for examples. In addition, you must
  43. increase the *NumObjectTypes parameter to Get<object>PerfomanceData
  44. on return from that routine.
  45. \****************************************************************************/
  46. //
  47. // The routines that load these structures assume that all fields
  48. // are packed and aligned on DWORD boundries. Alpha support may
  49. // change this assumption so the pack pragma is used here to insure
  50. // the DWORD packing assumption remains valid.
  51. //
  52. #include <winperf.h>
  53. #include <rasman.h>
  54. #define ALIGN8(_x) (((_x) + 7) & ~7)
  55. #pragma pack (4)
  56. //
  57. // Extensible Object definitions
  58. //
  59. // Update the following sort of define when adding an object type.
  60. #define RAS_NUM_PERF_OBJECT_TYPES 1
  61. //----------------------------------------------------------------------------
  62. //
  63. // RAS Resource object type counter definitions.
  64. //
  65. // These are used in the counter definitions to describe the relative
  66. // position of each counter in the returned data.
  67. //
  68. #define NUM_BYTESTX_OFFSET sizeof(DWORD) // The DWORD is for the
  69. // field ByteLength
  70. #define NUM_BYTESRX_OFFSET ( NUM_BYTESTX_OFFSET + sizeof(DWORD) )
  71. #define NUM_FRAMESTX_OFFSET ( NUM_BYTESRX_OFFSET + sizeof(DWORD) )
  72. #define NUM_FRAMESRX_OFFSET ( NUM_FRAMESTX_OFFSET + sizeof(DWORD) )
  73. #define NUM_PERCENTTXC_OFFSET ( NUM_FRAMESRX_OFFSET + sizeof(DWORD) )
  74. #define NUM_PERCENTRXC_OFFSET ( NUM_PERCENTTXC_OFFSET + sizeof(DWORD) )
  75. #define NUM_CRCERRORS_OFFSET ( NUM_PERCENTRXC_OFFSET + sizeof(DWORD) )
  76. #define NUM_TIMEOUTERRORS_OFFSET ( NUM_CRCERRORS_OFFSET + sizeof(DWORD) )
  77. #define NUM_SERIALOVERRUNS_OFFSET ( NUM_TIMEOUTERRORS_OFFSET + sizeof(DWORD) )
  78. #define NUM_ALIGNMENTERRORS_OFFSET ( NUM_SERIALOVERRUNS_OFFSET + sizeof(DWORD) )
  79. #define NUM_BUFFEROVERRUNS_OFFSET ( NUM_ALIGNMENTERRORS_OFFSET + sizeof(DWORD) )
  80. #define NUM_TOTALERRORS_OFFSET ( NUM_BUFFEROVERRUNS_OFFSET + sizeof(DWORD) )
  81. #define NUM_BYTESTXSEC_OFFSET ( NUM_TOTALERRORS_OFFSET + sizeof(DWORD) )
  82. #define NUM_BYTESRXSEC_OFFSET ( NUM_BYTESTXSEC_OFFSET + sizeof(DWORD) )
  83. #define NUM_FRAMESTXSEC_OFFSET ( NUM_BYTESRXSEC_OFFSET + sizeof(DWORD) )
  84. #define NUM_FRAMESRXSEC_OFFSET ( NUM_FRAMESTXSEC_OFFSET + sizeof(DWORD) )
  85. #define NUM_TOTALERRORSSEC_OFFSET ( NUM_FRAMESRXSEC_OFFSET + sizeof(DWORD) )
  86. #define SIZE_OF_RAS_PORT_PERFORMANCE_DATA ( NUM_TOTALERRORSSEC_OFFSET + sizeof(DWORD) )
  87. #define NUM_TOTALCONNECTIONS_OFFSET ( NUM_TOTALERRORSSEC_OFFSET + sizeof(DWORD) )
  88. #define SIZE_OF_RAS_TOTAL_PERFORMANCE_DATA ( NUM_TOTALCONNECTIONS_OFFSET + sizeof(DWORD) )
  89. //
  90. // This is the counter structure presently returned by RAS for
  91. // each Resource. Each Resource is an Instance, named by its number.
  92. //
  93. //
  94. // Data structure returned for RAS Port Object. Note that the instance
  95. // definitions for all port will be appended to it.
  96. //
  97. typedef struct _RAS_PORT_DATA_DEFINITION
  98. {
  99. PERF_OBJECT_TYPE RasObjectType;
  100. PERF_COUNTER_DEFINITION BytesTx;
  101. PERF_COUNTER_DEFINITION BytesRx;
  102. PERF_COUNTER_DEFINITION FramesTx;
  103. PERF_COUNTER_DEFINITION FramesRx;
  104. PERF_COUNTER_DEFINITION PercentTxC;
  105. PERF_COUNTER_DEFINITION PercentRxC;
  106. PERF_COUNTER_DEFINITION CRCErrors;
  107. PERF_COUNTER_DEFINITION TimeoutErrors;
  108. PERF_COUNTER_DEFINITION SerialOverruns;
  109. PERF_COUNTER_DEFINITION AlignmentErrors;
  110. PERF_COUNTER_DEFINITION BufferOverruns;
  111. PERF_COUNTER_DEFINITION TotalErrors;
  112. PERF_COUNTER_DEFINITION BytesTxSec;
  113. PERF_COUNTER_DEFINITION BytesRxSec;
  114. PERF_COUNTER_DEFINITION FramesTxSec;
  115. PERF_COUNTER_DEFINITION FramesRxSec;
  116. PERF_COUNTER_DEFINITION TotalErrorsSec;
  117. } RAS_PORT_DATA_DEFINITION, *PRAS_PORT_DATA_DEFINITION;
  118. //
  119. // Structure returned for each instance of object RAS Port. Note that data
  120. // for all counters will be appended to it.
  121. //
  122. typedef struct _RAS_PORT_INSTANCE_DEFINITION
  123. {
  124. PERF_INSTANCE_DEFINITION RasInstanceType;
  125. WCHAR InstanceName[ MAX_PORT_NAME ];
  126. } RAS_PORT_INSTANCE_DEFINITION, *PRAS_PORT_INSTANCE_DEFINITION;
  127. //
  128. // Data structure returned for RAS Total Object. Note that data for each
  129. // counter will be appended to it.
  130. //
  131. typedef struct _RAS_TOTAL_DATA_DEFINITION
  132. {
  133. PERF_OBJECT_TYPE RasObjectType;
  134. PERF_COUNTER_DEFINITION BytesTx;
  135. PERF_COUNTER_DEFINITION BytesRx;
  136. PERF_COUNTER_DEFINITION FramesTx;
  137. PERF_COUNTER_DEFINITION FramesRx;
  138. PERF_COUNTER_DEFINITION PercentTxC;
  139. PERF_COUNTER_DEFINITION PercentRxC;
  140. PERF_COUNTER_DEFINITION CRCErrors;
  141. PERF_COUNTER_DEFINITION TimeoutErrors;
  142. PERF_COUNTER_DEFINITION SerialOverruns;
  143. PERF_COUNTER_DEFINITION AlignmentErrors;
  144. PERF_COUNTER_DEFINITION BufferOverruns;
  145. PERF_COUNTER_DEFINITION TotalErrors;
  146. PERF_COUNTER_DEFINITION BytesTxSec;
  147. PERF_COUNTER_DEFINITION BytesRxSec;
  148. PERF_COUNTER_DEFINITION FramesTxSec;
  149. PERF_COUNTER_DEFINITION FramesRxSec;
  150. PERF_COUNTER_DEFINITION TotalErrorsSec;
  151. PERF_COUNTER_DEFINITION TotalConnections;
  152. } RAS_TOTAL_DATA_DEFINITION, *PRAS_TOTAL_DATA_DEFINITION;
  153. #pragma pack ()
  154. extern RAS_PORT_DATA_DEFINITION gRasPortDataDefinition;
  155. extern RAS_TOTAL_DATA_DEFINITION gRasTotalDataDefinition;
  156. //
  157. // External functions
  158. //
  159. VOID InitObjectCounterIndex ( DWORD dwFirstCounter, DWORD dwFirstHelp );
  160. #endif //_DATARAS_H_