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.

176 lines
6.5 KiB

  1. /*
  2. * File HRDEVENT.H
  3. *
  4. * Facility:
  5. *
  6. * Windows NT SNMP Extension Agent
  7. *
  8. * Abstract:
  9. *
  10. * This module is contains definitions pertaining to the HostMIB
  11. * hrDevice table... definitions needed by the "sub-tables" within
  12. * the hrDevice table and the functions that deal with these tables.
  13. *
  14. * Author:
  15. *
  16. * D. D. Burns @ WebEnable, Inc.
  17. *
  18. *
  19. * Revision History:
  20. *
  21. * V1.0 - 04/28/97 D. D. Burns Original Creation
  22. */
  23. #ifndef hrdevent_h
  24. #define hrdevent_h
  25. /*
  26. |==============================================================================
  27. | hrDevice Attribute Defines
  28. |
  29. | Each attribute defined for this table is associated with one of the
  30. | #defines below (with the exception of "hrDeviceID" which is never cached
  31. | and handled exclusively by the GetHrDeviceID() function).
  32. |
  33. | One special define is used in the same manner as the defines for the
  34. | real attributes to access a "hidden attribute" value which is never
  35. | returned as a consequence of an SNMP request, but is stored in the cache
  36. | to allow "computed" values to be obtained for some of the real attributes.
  37. |
  38. | An example of a value in the HIDDEN_CTX attribute might be the string
  39. | needed to look up a value of hrDeviceStatus for this device or another
  40. | "computed" value in another associated table (such as hrPrintertable).
  41. |
  42. | These symbols are used as C indices into the array of attributes within a
  43. | cached-row of the hrDevice Table.
  44. |
  45. */
  46. #define HRDV_INDEX 0 // hrDeviceIndex
  47. #define HRDV_TYPE 1 // hrDeviceType
  48. #define HRDV_DESCR 2 // hrDeviceDescr
  49. // (hrDeviceID omitted)
  50. #define HRDV_STATUS 3 // hrDeviceStatus
  51. #define HRDV_ERRORS 4 // hrDeviceErrors
  52. #define HIDDEN_CTX 5 // (Hidden Context Information).
  53. //-->Add more here, change count below!
  54. #define HRDV_ATTRIB_COUNT 6
  55. /*
  56. |==============================================================================
  57. | hrPartition Attribute Defines
  58. |
  59. | Each attribute defined for this table is associated with one of the
  60. | #defines below. These symbols are used as C indices into the array of
  61. | attributes within a cached-row.
  62. |
  63. | These symbols appear in this file so that code in HRDISKST.C can
  64. | properly initialize rows in the HrPartition table while code in
  65. | HRPARTIT.C can reference them.
  66. */
  67. #define HRPT_INDEX 0 // hrPartitionIndex
  68. #define HRPT_LABEL 1 // hrPartitionLabel
  69. #define HRPT_ID 2 // hrPartitionID
  70. #define HRPT_SIZE 3 // hrPartitionSize
  71. #define HRPT_FSINDEX 4 // hrPartitionFSIndex
  72. //-->Add more here, change count below!
  73. #define HRPT_ATTRIB_COUNT 5
  74. /*
  75. |==============================================================================
  76. | hrDiskStorage Attribute Defines
  77. |
  78. | Each attribute defined for this table is associated with one of the
  79. | #defines below. These symbols are used as C indices into the array of
  80. | attributes within a cached-row.
  81. |
  82. */
  83. #define HRDS_ACCESS 0 // hrDiskStorageAccess
  84. #define HRDS_MEDIA 1 // hrDiskStorageMedia
  85. #define HRDS_REMOVABLE 2 // hrDiskStorageRemovable
  86. #define HRDS_CAPACITY 3 // hrDiskStorageCapacity
  87. //-->Add more here, change count below!
  88. #define HRDS_ATTRIB_COUNT 4
  89. /*
  90. |==============================================================================
  91. | hrDevice Type OID Ending Arcs
  92. |
  93. | RFC1514 specifies an object identifier "{ hrDeviceTypes }" to be used
  94. | as a prefix to the full OID that specifies a device's type in the
  95. | hrDevice table. The symbols below specify the final arc "x" as in
  96. | "{ hrDeviceTypes x }" to be used for each device type.
  97. |
  98. | You can't change these symbol values... we're just trying to be
  99. | mnemonic here.
  100. */
  101. #define HRDV_TYPE_LASTARC_OTHER 1
  102. #define HRDV_TYPE_LASTARC_UNKNOWN 2
  103. #define HRDV_TYPE_LASTARC_PROCESSOR 3
  104. #define HRDV_TYPE_LASTARC_NETWORK 4
  105. #define HRDV_TYPE_LASTARC_PRINTER 5
  106. #define HRDV_TYPE_LASTARC_DISKSTORAGE 6
  107. #define HRDV_TYPE_LASTARC_VIDEO 10
  108. #define HRDV_TYPE_LASTARC_AUDIO 11
  109. #define HRDV_TYPE_LASTARC_COPROCESSOR 12
  110. #define HRDV_TYPE_LASTARC_KEYBOARD 13
  111. #define HRDV_TYPE_LASTARC_MODEM 14
  112. #define HRDV_TYPE_LASTARC_PARALLELPORT 15
  113. #define HRDV_TYPE_LASTARC_POINTING 16
  114. #define HRDV_TYPE_LASTARC_SERIALPORT 17
  115. #define HRDV_TYPE_LASTARC_TAPE 18
  116. #define HRDV_TYPE_LASTARC_CLOCK 19
  117. #define HRDV_TYPE_LASTARC_VOLMEMORY 20
  118. #define HRDV_TYPE_LASTARC_NONVOLMEMORY 21
  119. /*
  120. |==============================================================================
  121. | HRDEVICE-Related Function Prototypes
  122. */
  123. /* Gen_HrPrinter_Cache - Generate a initial cache for HrDevice PRINTER Table */
  124. BOOL Gen_HrPrinter_Cache( ULONG type_arc ); /* "HRPRINTE.C" */
  125. /* COMPUTE_hrPrinter_status - Compute "hrDeviceStatus" for a Printer device */
  126. BOOL COMPUTE_hrPrinter_status(
  127. CACHEROW *row,
  128. UINT *outvalue
  129. ); /* "HRPRINTE.C" */
  130. /* COMPUTE_hrPrinter_errors - Compute "hrDeviceErrors" for a Printer device */
  131. BOOL COMPUTE_hrPrinter_errors(
  132. CACHEROW *row,
  133. UINT *outvalue
  134. ); /* "HRPRINTE.C" */
  135. /* Gen_HrProcessor_Cache - Gen. a initial cache for HrDevice PROCESSOR Table */
  136. BOOL Gen_HrProcessor_Cache( ULONG type_arc ); /* "HRPROCES.C" */
  137. /* Gen_HrNetwork_Cache - Gen. a initial cache for HrDevice NETWORK Table */
  138. BOOL Gen_HrNetwork_Cache( ULONG type_arc ); /* "HRNETWOR.C" */
  139. /* Gen_HrDiskStorage_Cache - Generate a initial cache for HrDiskStorage Table */
  140. BOOL Gen_HrDiskStorage_Cache( ULONG type_arc ); /* "HRDISKST.C" */
  141. extern CACHEHEAD hrDiskStorage_cache; /* This cache is globally accessible */
  142. /* AddrHrDeviceRow - Generate another Row Entry in HrDevice Table
  143. |
  144. | Special purpose cache-row function just for hrDevice and related sub-tables.
  145. |
  146. | Source is in "HRDEVENT.C".
  147. */
  148. CACHEROW *
  149. AddHrDeviceRow(
  150. ULONG type_arc, /* Last Arc value for OID for Type */
  151. LPSTR descr, /* Description string */
  152. void *hidden_ctx, /* If non-NULL: Hidden-context value */
  153. ATTRIB_TYPE hc_type /* Type of "hidden_ctx" */
  154. );
  155. #endif /* hrdevent_h */