Source code of Windows XP (NT5)
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.

113 lines
4.0 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1993 **/
  4. /**********************************************************************/
  5. /*
  6. dhcpdata.h
  7. Extensible object definitions for the DHCP Server's counter
  8. objects & counters.
  9. FILE HISTORY:
  10. Pradeepb 20-July-1993 Created.
  11. RameshV 05-Aug-1998 Adapted for DHCP
  12. */
  13. #ifndef _DHCPDATA_H_
  14. #define _DHCPDATA_H_
  15. //
  16. // This structure is used to ensure the first counter is properly
  17. // aligned. Unfortunately, since PERF_COUNTER_BLOCK consists
  18. // of just a single DWORD, any LARGE_INTEGERs that immediately
  19. // follow will not be aligned properly.
  20. //
  21. // This structure requires "natural" packing & alignment (probably
  22. // quad-word, especially on Alpha). Ergo, keep it out of the
  23. // #pragma pack(4) scope below.
  24. //
  25. typedef struct _DHCPDATA_COUNTER_BLOCK
  26. {
  27. PERF_COUNTER_BLOCK PerfCounterBlock;
  28. LARGE_INTEGER DummyEntryForAlignmentPurposesOnly;
  29. } DHCPDATA_COUNTER_BLOCK;
  30. //
  31. // The routines that load these structures assume that all fields
  32. // are DWORD packed & aligned.
  33. //
  34. #pragma pack(4)
  35. //
  36. // Offsets within a PERF_COUNTER_BLOCK.
  37. //
  38. #define DHCPDATA_PACKETS_RECEIVED_OFFSET (0*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  39. #define DHCPDATA_PACKETS_DUPLICATE_OFFSET (1*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  40. #define DHCPDATA_PACKETS_EXPIRED_OFFSET (2*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  41. #define DHCPDATA_MILLISECONDS_PER_PACKET_OFFSET (3*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  42. #define DHCPDATA_PACKETS_IN_ACTIVE_QUEUE_OFFSET (4*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  43. #define DHCPDATA_PACKETS_IN_PING_QUEUE_OFFSET (5*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  44. #define DHCPDATA_DISCOVERS_OFFSET (6*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  45. #define DHCPDATA_OFFERS_OFFSET (7*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  46. #define DHCPDATA_REQUESTS_OFFSET (8*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  47. #define DHCPDATA_INFORMS_OFFSET (9*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  48. #define DHCPDATA_ACKS_OFFSET (10*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  49. #define DHCPDATA_NACKS_OFFSET (11*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  50. #define DHCPDATA_DECLINES_OFFSET (12*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  51. #define DHCPDATA_RELEASES_OFFSET (13*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  52. #define DHCPDATA_SIZE_OF_PERFORMANCE_DATA (14*sizeof(DWORD) + sizeof(DHCPDATA_COUNTER_BLOCK))
  53. //
  54. // The counter structure returned.
  55. //
  56. typedef struct _DHCPDATA_DATA_DEFINITION
  57. {
  58. PERF_OBJECT_TYPE ObjectType;
  59. PERF_COUNTER_DEFINITION PacketsReceived;
  60. PERF_COUNTER_DEFINITION PacketsDuplicate;
  61. PERF_COUNTER_DEFINITION PacketsExpired;
  62. PERF_COUNTER_DEFINITION MilliSecondsPerPacket;
  63. PERF_COUNTER_DEFINITION ActiveQueuePackets;
  64. PERF_COUNTER_DEFINITION PingQueuePackets;
  65. PERF_COUNTER_DEFINITION Discovers;
  66. PERF_COUNTER_DEFINITION Offers;
  67. PERF_COUNTER_DEFINITION Requests;
  68. PERF_COUNTER_DEFINITION Informs;
  69. PERF_COUNTER_DEFINITION Acks;
  70. PERF_COUNTER_DEFINITION Nacks;
  71. PERF_COUNTER_DEFINITION Declines;
  72. PERF_COUNTER_DEFINITION Releases;
  73. } DHCPDATA_DATA_DEFINITION;
  74. extern DHCPDATA_DATA_DEFINITION DhcpDataDataDefinition;
  75. #define NUMBER_OF_DHCPDATA_COUNTERS ((sizeof(DHCPDATA_DATA_DEFINITION) - \
  76. sizeof(PERF_OBJECT_TYPE)) / \
  77. sizeof(PERF_COUNTER_DEFINITION))
  78. #define DHCPDATA_PERFORMANCE_KEY \
  79. TEXT("System\\CurrentControlSet\\Services\\DHCPServer\\Performance")
  80. //
  81. // Restore default packing & alignment.
  82. //
  83. #pragma pack()
  84. #endif // _DHCPDATA_H_