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.

357 lines
23 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. PschdPrf.h
  5. Abstract:
  6. Header file for the PSched Extensible Object data definitions
  7. This file contains definitions to construct the dynamic data
  8. which is returned by the Configuration Registry.
  9. --*/
  10. #ifndef _PSCHDPRF_H_
  11. #define _PSCHDPRF_H_
  12. #include <winperf.h>
  13. #include <qos.h>
  14. #include <objbase.h>
  15. #include <tcguid.h>
  16. #include <traffic.h>
  17. #include <ntddpsch.h>
  18. #include "pschdcnt.h"
  19. // Useful Macros
  20. // Necessary data structures
  21. #define PS_FRIENDLY_NAME_LENGTH 128
  22. typedef struct _FLOW_INFO
  23. {
  24. WCHAR InstanceName[MAX_STRING_LENGTH+1];
  25. WCHAR FriendlyName[PS_FRIENDLY_NAME_LENGTH+1];
  26. } FLOW_INFO, *PFLOW_INFO;
  27. typedef struct _PIPE_INFO
  28. {
  29. HANDLE hIfc; // (open) HANDLE to the interface
  30. LPTSTR IfcName; // Interface name
  31. ULONG numFlows; // Flow counter for this pipe
  32. PFLOW_INFO pFlowInfo; // Pointer to array of FLOW_INFOs
  33. } PIPE_INFO, *PPIPE_INFO;
  34. typedef struct _PS_PERF_COUNTER_BLOCK
  35. {
  36. PERF_COUNTER_BLOCK pcb;
  37. DWORD pad;
  38. } PS_PERF_COUNTER_BLOCK, *PPS_PERF_COUNTER_BLOCK;
  39. //
  40. // The routines that load these structures assume that all fields
  41. // are packed and aligned on DWORD boundaries. Alpha support may
  42. // change this assumption so the pack pragma is used here to insure
  43. // the DWORD packing assumption remains valid.
  44. //
  45. #pragma pack (4)
  46. //
  47. // Extensible Object definitions
  48. //
  49. // Update the following sort of define when adding an object type.
  50. //
  51. // PSched Flow Resource object type counter definitions.
  52. //
  53. // These are used in the counter definitions to describe the relative
  54. // position of each counter in the returned data.
  55. // Interface specific counters
  56. // Pipe counters
  57. #define PIPE_OUT_OF_PACKETS_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  58. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  59. FIELD_OFFSET(PS_ADAPTER_STATS, OutOfPackets))
  60. #define PIPE_FLOWS_OPENED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  61. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  62. FIELD_OFFSET(PS_ADAPTER_STATS, FlowsOpened))
  63. #define PIPE_FLOWS_CLOSED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  64. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  65. FIELD_OFFSET(PS_ADAPTER_STATS, FlowsClosed))
  66. #define PIPE_FLOWS_REJECTED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  67. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  68. FIELD_OFFSET(PS_ADAPTER_STATS, FlowsRejected))
  69. #define PIPE_FLOWS_MODIFIED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  70. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  71. FIELD_OFFSET(PS_ADAPTER_STATS, FlowsModified))
  72. #define PIPE_FLOW_MODS_REJECTED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  73. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  74. FIELD_OFFSET(PS_ADAPTER_STATS, FlowModsRejected))
  75. #define PIPE_MAX_SIMULTANEOUS_FLOWS_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  76. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  77. FIELD_OFFSET(PS_ADAPTER_STATS, MaxSimultaneousFlows))
  78. #define PIPE_NONCONF_PACKETS_SCHEDULED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  79. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  80. sizeof(PS_ADAPTER_STATS) + \
  81. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  82. FIELD_OFFSET(PS_CONFORMER_STATS, NonconformingPacketsScheduled))
  83. #define PIPE_AVE_PACKETS_IN_SHAPER_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  84. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  85. sizeof(PS_ADAPTER_STATS) + \
  86. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  87. sizeof(PS_CONFORMER_STATS) + \
  88. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  89. FIELD_OFFSET(PS_SHAPER_STATS, AveragePacketsInShaper))
  90. #define PIPE_MAX_PACKETS_IN_SHAPER_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  91. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  92. sizeof(PS_ADAPTER_STATS) + \
  93. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  94. sizeof(PS_CONFORMER_STATS) + \
  95. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  96. FIELD_OFFSET(PS_SHAPER_STATS, MaxPacketsInShaper))
  97. #define PIPE_AVE_PACKETS_IN_SEQ_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  98. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  99. sizeof(PS_ADAPTER_STATS) + \
  100. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  101. sizeof(PS_CONFORMER_STATS) + \
  102. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  103. sizeof(PS_SHAPER_STATS) + \
  104. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  105. FIELD_OFFSET(PS_DRRSEQ_STATS, AveragePacketsInSequencer))
  106. #define PIPE_MAX_PACKETS_IN_SEQ_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  107. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  108. sizeof(PS_ADAPTER_STATS) + \
  109. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  110. sizeof(PS_CONFORMER_STATS) + \
  111. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  112. sizeof(PS_SHAPER_STATS) + \
  113. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  114. FIELD_OFFSET(PS_DRRSEQ_STATS, MaxPacketsInSequencer))
  115. #define PIPE_MAX_PACKETS_IN_NETCARD_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  116. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  117. sizeof(PS_ADAPTER_STATS) + \
  118. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  119. sizeof(PS_CONFORMER_STATS) + \
  120. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  121. sizeof(PS_SHAPER_STATS) + \
  122. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  123. FIELD_OFFSET(PS_DRRSEQ_STATS, MaxPacketsInNetcard))
  124. #define PIPE_AVE_PACKETS_IN_NETCARD_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  125. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  126. sizeof(PS_ADAPTER_STATS) + \
  127. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  128. sizeof(PS_CONFORMER_STATS) + \
  129. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  130. sizeof(PS_SHAPER_STATS) + \
  131. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  132. FIELD_OFFSET(PS_DRRSEQ_STATS, AveragePacketsInNetcard))
  133. #define PIPE_NONCONF_PACKETS_TRANSMITTED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  134. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  135. sizeof(PS_ADAPTER_STATS) + \
  136. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  137. sizeof(PS_CONFORMER_STATS) + \
  138. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  139. sizeof(PS_SHAPER_STATS) + \
  140. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  141. FIELD_OFFSET(PS_DRRSEQ_STATS, NonconformingPacketsTransmitted))
  142. #define PIPE_PIPE_NUM_STATS (7)
  143. typedef struct _PS_PIPE_PIPE_STAT_DEF
  144. {
  145. PERF_COUNTER_DEFINITION OutOfPackets;
  146. PERF_COUNTER_DEFINITION FlowsOpened;
  147. PERF_COUNTER_DEFINITION FlowsClosed;
  148. PERF_COUNTER_DEFINITION FlowsRejected;
  149. PERF_COUNTER_DEFINITION FlowsModified;
  150. PERF_COUNTER_DEFINITION FlowModsRejected;
  151. PERF_COUNTER_DEFINITION MaxSimultaneousFlows;
  152. } PS_PIPE_PIPE_STAT_DEF, *PPS_PIPE_PIPE_STAT_DEF;
  153. #define PIPE_CONFORMER_NUM_STATS (2)
  154. typedef struct _PS_PIPE_CONFORMER_STAT_DEF
  155. {
  156. PERF_COUNTER_DEFINITION NonconfPacketsScheduled;
  157. PERF_COUNTER_DEFINITION NonconfPacketsScheduledPerSec;
  158. } PS_PIPE_CONFORMER_STAT_DEF, *PPS_PIPE_CONFORMER_STAT_DEF;
  159. #define PIPE_SHAPER_NUM_STATS (2)
  160. typedef struct _PS_PIPE_SHAPER_STAT_DEF
  161. {
  162. PERF_COUNTER_DEFINITION AvePacketsInShaper;
  163. PERF_COUNTER_DEFINITION MaxPacketsInShaper;
  164. } PS_PIPE_SHAPER_STAT_DEF, *PPS_PIPE_SHAPER_STAT_DEF;
  165. #define PIPE_SEQUENCER_NUM_STATS (6)
  166. typedef struct _PS_PIPE_SEQUENCER_STAT_DEF
  167. {
  168. PERF_COUNTER_DEFINITION AvePacketsInSeq;
  169. PERF_COUNTER_DEFINITION MaxPacketsInSeq;
  170. PERF_COUNTER_DEFINITION MaxPacketsInNetcard;
  171. PERF_COUNTER_DEFINITION AvePacketsInNetcard;
  172. PERF_COUNTER_DEFINITION NonconfPacketsTransmitted;
  173. PERF_COUNTER_DEFINITION NonconfPacketsTransmittedPerSec;
  174. } PS_PIPE_SEQUENCER_STAT_DEF, *PPS_PIPE_SEQUENCER_STAT_DEF;
  175. // Flow counters
  176. #define FLOW_PACKETS_DROPPED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  177. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  178. FIELD_OFFSET(PS_FLOW_STATS, DroppedPackets))
  179. #define FLOW_PACKETS_SCHEDULED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  180. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  181. FIELD_OFFSET(PS_FLOW_STATS, PacketsScheduled))
  182. #define FLOW_PACKETS_TRANSMITTED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  183. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  184. FIELD_OFFSET(PS_FLOW_STATS, PacketsTransmitted))
  185. #define FLOW_BYTES_SCHEDULED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  186. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  187. FIELD_OFFSET(PS_FLOW_STATS, BytesScheduled))
  188. #define FLOW_BYTES_TRANSMITTED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  189. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  190. FIELD_OFFSET(PS_FLOW_STATS, BytesTransmitted))
  191. #define FLOW_NONCONF_PACKETS_SCHEDULED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  192. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  193. sizeof(PS_FLOW_STATS) + \
  194. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  195. FIELD_OFFSET(PS_CONFORMER_STATS, NonconformingPacketsScheduled))
  196. #define FLOW_AVE_PACKETS_IN_SHAPER_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  197. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  198. sizeof(PS_FLOW_STATS) + \
  199. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  200. sizeof(PS_CONFORMER_STATS) + \
  201. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  202. FIELD_OFFSET(PS_SHAPER_STATS, AveragePacketsInShaper))
  203. #define FLOW_MAX_PACKETS_IN_SHAPER_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  204. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  205. sizeof(PS_FLOW_STATS) + \
  206. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  207. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  208. sizeof(PS_CONFORMER_STATS) + \
  209. FIELD_OFFSET(PS_SHAPER_STATS, MaxPacketsInShaper))
  210. #define FLOW_AVE_PACKETS_IN_SEQ_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  211. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  212. sizeof(PS_FLOW_STATS) + \
  213. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  214. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  215. sizeof(PS_CONFORMER_STATS) + \
  216. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  217. sizeof(PS_SHAPER_STATS) + \
  218. FIELD_OFFSET(PS_DRRSEQ_STATS, AveragePacketsInSequencer))
  219. #define FLOW_MAX_PACKETS_IN_SEQ_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  220. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  221. sizeof(PS_FLOW_STATS) + \
  222. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  223. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  224. sizeof(PS_CONFORMER_STATS) + \
  225. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  226. sizeof(PS_SHAPER_STATS) + \
  227. FIELD_OFFSET(PS_DRRSEQ_STATS, MaxPacketsInSequencer))
  228. #define FLOW_MAX_PACKETS_IN_NETCARD_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  229. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  230. sizeof(PS_FLOW_STATS) + \
  231. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  232. sizeof(PS_CONFORMER_STATS) + \
  233. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  234. sizeof(PS_SHAPER_STATS) + \
  235. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  236. FIELD_OFFSET(PS_DRRSEQ_STATS, MaxPacketsInNetcard))
  237. #define FLOW_AVE_PACKETS_IN_NETCARD_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  238. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  239. sizeof(PS_FLOW_STATS) + \
  240. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  241. sizeof(PS_CONFORMER_STATS) + \
  242. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  243. sizeof(PS_SHAPER_STATS) + \
  244. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  245. FIELD_OFFSET(PS_DRRSEQ_STATS, AveragePacketsInNetcard))
  246. #define FLOW_NONCONF_PACKETS_TRANSMITTED_OFFSET (sizeof(PS_PERF_COUNTER_BLOCK) + \
  247. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  248. sizeof(PS_FLOW_STATS) + \
  249. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  250. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  251. sizeof(PS_CONFORMER_STATS) + \
  252. FIELD_OFFSET(PS_COMPONENT_STATS, Stats) + \
  253. sizeof(PS_SHAPER_STATS) + \
  254. FIELD_OFFSET(PS_DRRSEQ_STATS, NonconformingPacketsTransmitted))
  255. #define FLOW_FLOW_NUM_STATS (10)
  256. typedef struct _PS_FLOW_FLOW_STAT_DEF
  257. {
  258. PERF_COUNTER_DEFINITION PacketsDropped;
  259. PERF_COUNTER_DEFINITION PacketsScheduled;
  260. PERF_COUNTER_DEFINITION PacketsTransmitted;
  261. PERF_COUNTER_DEFINITION BytesScheduled;
  262. PERF_COUNTER_DEFINITION BytesTransmitted;
  263. PERF_COUNTER_DEFINITION BytesTransmittedPerSec;
  264. PERF_COUNTER_DEFINITION BytesScheduledPerSec;
  265. PERF_COUNTER_DEFINITION PacketsTransmittedPerSec;
  266. PERF_COUNTER_DEFINITION PacketsScheduledPerSec;
  267. PERF_COUNTER_DEFINITION PacketsDroppedPerSec;
  268. } PS_FLOW_FLOW_STAT_DEF, *PPS_FLOW_FLOW_STAT_DEF;
  269. #define FLOW_CONFORMER_NUM_STATS (2)
  270. typedef struct _PS_FLOW_CONFORMER_STAT_DEF
  271. {
  272. PERF_COUNTER_DEFINITION NonconfPacketsScheduled;
  273. PERF_COUNTER_DEFINITION NonconfPacketsScheduledPerSec;
  274. } PS_FLOW_CONFORMER_STAT_DEF, *PPS_FLOW_CONFORMER_STAT_DEF;
  275. #define FLOW_SHAPER_NUM_STATS (2)
  276. typedef struct _PS_FLOW_SHAPER_STAT_DEF
  277. {
  278. PERF_COUNTER_DEFINITION AvePacketsInShaper;
  279. PERF_COUNTER_DEFINITION MaxPacketsInShaper;
  280. } PS_FLOW_SHAPER_STAT_DEF, *PPS_FLOW_SHAPER_STAT_DEF;
  281. #define FLOW_SEQUENCER_NUM_STATS (6)
  282. typedef struct _PS_FLOW_SEQUENCER_STAT_DEF
  283. {
  284. PERF_COUNTER_DEFINITION AvePacketsInSeq;
  285. PERF_COUNTER_DEFINITION MaxPacketsInSeq;
  286. PERF_COUNTER_DEFINITION MaxPacketsInNetcard;
  287. PERF_COUNTER_DEFINITION AvePacketsInNetcard;
  288. PERF_COUNTER_DEFINITION NonconfPacketsTransmitted;
  289. PERF_COUNTER_DEFINITION NonconfPacketsTransmittedPerSec;
  290. } PS_FLOW_SEQUENCER_STAT_DEF, *PPS_FLOW_SEQUENCER_STAT_DEF;
  291. #pragma pack ()
  292. #endif //_PSCHDPRF_H_