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.

287 lines
14 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. Author:
  6. Revision History:
  7. --*/
  8. #ifndef __INDICES_H__
  9. #define __INDICES_H__
  10. //
  11. // A bunch of defines to set up the indices for the mib variables
  12. //
  13. #define mi_sysDescr 0
  14. #define mi_sysObjectID mi_sysDescr + 1
  15. #define mi_sysUpTime mi_sysObjectID + 1
  16. #define mi_sysContact mi_sysUpTime + 1
  17. #define mi_sysName mi_sysContact + 1
  18. #define mi_sysLocation mi_sysName + 1
  19. #define mi_sysServices mi_sysLocation + 1
  20. #define mi_ifNumber 0
  21. #define mi_ifTable mi_ifNumber + 1
  22. #define mi_ifEntry mi_ifTable + 1
  23. #define mi_ifIndex mi_ifEntry + 1
  24. #define mi_ifDescr mi_ifIndex + 1
  25. #define mi_ifType mi_ifDescr + 1
  26. #define mi_ifMtu mi_ifType + 1
  27. #define mi_ifSpeed mi_ifMtu + 1
  28. #define mi_ifPhysAddress mi_ifSpeed + 1
  29. #define mi_ifAdminStatus mi_ifPhysAddress + 1
  30. #define mi_ifOperStatus mi_ifAdminStatus + 1
  31. #define mi_ifLastChange mi_ifOperStatus + 1
  32. #define mi_ifInOctets mi_ifLastChange + 1
  33. #define mi_ifInUcastPkts mi_ifInOctets + 1
  34. #define mi_ifInNUcastPkts mi_ifInUcastPkts + 1
  35. #define mi_ifInDiscards mi_ifInNUcastPkts + 1
  36. #define mi_ifInErrors mi_ifInDiscards + 1
  37. #define mi_ifInUnknownProtos mi_ifInErrors + 1
  38. #define mi_ifOutOctets mi_ifInUnknownProtos + 1
  39. #define mi_ifOutUcastPkts mi_ifOutOctets + 1
  40. #define mi_ifOutNUcastPkts mi_ifOutUcastPkts + 1
  41. #define mi_ifOutDiscards mi_ifOutNUcastPkts + 1
  42. #define mi_ifOutErrors mi_ifOutDiscards + 1
  43. #define mi_ifOutQLen mi_ifOutErrors + 1
  44. #define mi_ifSpecific mi_ifOutQLen + 1
  45. #define mi_ipForwarding 0
  46. #define mi_ipDefaultTTL mi_ipForwarding + 1
  47. #define mi_ipInReceives mi_ipDefaultTTL + 1
  48. #define mi_ipInHdrErrors mi_ipInReceives + 1
  49. #define mi_ipInAddrErrors mi_ipInHdrErrors + 1
  50. #define mi_ipForwDatagrams mi_ipInAddrErrors + 1
  51. #define mi_ipInUnknownProtos mi_ipForwDatagrams + 1
  52. #define mi_ipInDiscards mi_ipInUnknownProtos + 1
  53. #define mi_ipInDelivers mi_ipInDiscards + 1
  54. #define mi_ipOutRequests mi_ipInDelivers + 1
  55. #define mi_ipOutDiscards mi_ipOutRequests + 1
  56. #define mi_ipOutNoRoutes mi_ipOutDiscards + 1
  57. #define mi_ipReasmTimeout mi_ipOutNoRoutes + 1
  58. #define mi_ipReasmReqds mi_ipReasmTimeout + 1
  59. #define mi_ipReasmOKs mi_ipReasmReqds + 1
  60. #define mi_ipReasmFails mi_ipReasmOKs + 1
  61. #define mi_ipFragOKs mi_ipReasmFails + 1
  62. #define mi_ipFragFails mi_ipFragOKs + 1
  63. #define mi_ipFragCreates mi_ipFragFails + 1
  64. #define mi_ipAddrTable mi_ipFragCreates + 1
  65. #define mi_ipAddrEntry mi_ipAddrTable + 1
  66. #define mi_ipAdEntAddr mi_ipAddrEntry + 1
  67. #define mi_ipAdEntIfIndex mi_ipAdEntAddr + 1
  68. #define mi_ipAdEntNetMask mi_ipAdEntIfIndex + 1
  69. #define mi_ipAdEntBcastAddr mi_ipAdEntNetMask + 1
  70. #define mi_ipAdEntReasmMaxSize mi_ipAdEntBcastAddr + 1
  71. #define mi_ipRouteTable mi_ipAdEntReasmMaxSize + 1
  72. #define mi_ipRouteEntry mi_ipRouteTable + 1
  73. #define mi_ipRouteDest mi_ipRouteEntry + 1
  74. #define mi_ipRouteIfIndex mi_ipRouteDest + 1
  75. #define mi_ipRouteMetric1 mi_ipRouteIfIndex + 1
  76. #define mi_ipRouteMetric2 mi_ipRouteMetric1 + 1
  77. #define mi_ipRouteMetric3 mi_ipRouteMetric2 + 1
  78. #define mi_ipRouteMetric4 mi_ipRouteMetric3 + 1
  79. #define mi_ipRouteNextHop mi_ipRouteMetric4 + 1
  80. #define mi_ipRouteType mi_ipRouteNextHop + 1
  81. #define mi_ipRouteProto mi_ipRouteType + 1
  82. #define mi_ipRouteAge mi_ipRouteProto + 1
  83. #define mi_ipRouteMask mi_ipRouteAge + 1
  84. #define mi_ipRouteMetric5 mi_ipRouteMask + 1
  85. #define mi_ipRouteInfo mi_ipRouteMetric5 + 1
  86. #define mi_ipNetToMediaTable mi_ipRouteInfo + 1
  87. #define mi_ipNetToMediaEntry mi_ipNetToMediaTable + 1
  88. #define mi_ipNetToMediaIfIndex mi_ipNetToMediaEntry + 1
  89. #define mi_ipNetToMediaPhysAddress mi_ipNetToMediaIfIndex + 1
  90. #define mi_ipNetToMediaNetAddress mi_ipNetToMediaPhysAddress + 1
  91. #define mi_ipNetToMediaType mi_ipNetToMediaNetAddress + 1
  92. #define mi_ipRoutingDiscards mi_ipNetToMediaType + 1
  93. #define mi_ipForwardGroup mi_ipRoutingDiscards + 1
  94. #define mi_ipForwardNumber mi_ipForwardGroup + 1
  95. #define mi_ipForwardTable mi_ipForwardNumber + 1
  96. #define mi_ipForwardEntry mi_ipForwardTable + 1
  97. #define mi_ipForwardDest mi_ipForwardEntry + 1
  98. #define mi_ipForwardMask mi_ipForwardDest + 1
  99. #define mi_ipForwardPolicy mi_ipForwardMask + 1
  100. #define mi_ipForwardNextHop mi_ipForwardPolicy + 1
  101. #define mi_ipForwardIfIndex mi_ipForwardNextHop + 1
  102. #define mi_ipForwardType mi_ipForwardIfIndex + 1
  103. #define mi_ipForwardProto mi_ipForwardType + 1
  104. #define mi_ipForwardAge mi_ipForwardProto + 1
  105. #define mi_ipForwardInfo mi_ipForwardAge + 1
  106. #define mi_ipForwardNextHopAS mi_ipForwardInfo + 1
  107. #define mi_ipForwardMetric1 mi_ipForwardNextHopAS + 1
  108. #define mi_ipForwardMetric2 mi_ipForwardMetric1 + 1
  109. #define mi_ipForwardMetric3 mi_ipForwardMetric2 + 1
  110. #define mi_ipForwardMetric4 mi_ipForwardMetric3 + 1
  111. #define mi_ipForwardMetric5 mi_ipForwardMetric4 + 1
  112. #define mi_icmpInMsgs 0
  113. #define mi_icmpInErrors mi_icmpInMsgs + 1
  114. #define mi_icmpInDestUnreachs mi_icmpInErrors + 1
  115. #define mi_icmpInTimeExcds mi_icmpInDestUnreachs + 1
  116. #define mi_icmpInParmProbs mi_icmpInTimeExcds + 1
  117. #define mi_icmpInSrcQuenchs mi_icmpInParmProbs + 1
  118. #define mi_icmpInRedirects mi_icmpInSrcQuenchs + 1
  119. #define mi_icmpInEchos mi_icmpInRedirects + 1
  120. #define mi_icmpInEchoReps mi_icmpInEchos + 1
  121. #define mi_icmpInTimestamps mi_icmpInEchoReps + 1
  122. #define mi_icmpInTimestampReps mi_icmpInTimestamps + 1
  123. #define mi_icmpInAddrMasks mi_icmpInTimestampReps + 1
  124. #define mi_icmpInAddrMaskReps mi_icmpInAddrMasks + 1
  125. #define mi_icmpOutMsgs mi_icmpInAddrMaskReps + 1
  126. #define mi_icmpOutErrors mi_icmpOutMsgs + 1
  127. #define mi_icmpOutDestUnreachs mi_icmpOutErrors + 1
  128. #define mi_icmpOutTimeExcds mi_icmpOutDestUnreachs + 1
  129. #define mi_icmpOutParmProbs mi_icmpOutTimeExcds + 1
  130. #define mi_icmpOutSrcQuenchs mi_icmpOutParmProbs + 1
  131. #define mi_icmpOutRedirects mi_icmpOutSrcQuenchs + 1
  132. #define mi_icmpOutEchos mi_icmpOutRedirects + 1
  133. #define mi_icmpOutEchoReps mi_icmpOutEchos + 1
  134. #define mi_icmpOutTimestamps mi_icmpOutEchoReps + 1
  135. #define mi_icmpOutTimestampReps mi_icmpOutTimestamps + 1
  136. #define mi_icmpOutAddrMasks mi_icmpOutTimestampReps + 1
  137. #define mi_icmpOutAddrMaskReps mi_icmpOutAddrMasks + 1
  138. //
  139. // These values should match the order of entries in mib_tcpGroup[]
  140. //
  141. #define mi_tcpRtoAlgorithm 0
  142. #define mi_tcpRtoMin mi_tcpRtoAlgorithm + 1
  143. #define mi_tcpRtoMax mi_tcpRtoMin + 1
  144. #define mi_tcpMaxConn mi_tcpRtoMax + 1
  145. #define mi_tcpActiveOpens mi_tcpMaxConn + 1
  146. #define mi_tcpPassiveOpens mi_tcpActiveOpens + 1
  147. #define mi_tcpAttemptFails mi_tcpPassiveOpens + 1
  148. #define mi_tcpEstabResets mi_tcpAttemptFails + 1
  149. #define mi_tcpCurrEstab mi_tcpEstabResets + 1
  150. #define mi_tcpInSegs mi_tcpCurrEstab + 1
  151. #define mi_tcpOutSegs mi_tcpInSegs + 1
  152. #define mi_tcpRetransSegs mi_tcpOutSegs + 1
  153. #define mi_tcpConnTable mi_tcpRetransSegs + 1
  154. #define mi_tcpConnEntry mi_tcpConnTable + 1
  155. #define mi_tcpConnState mi_tcpConnEntry + 1
  156. #define mi_tcpConnLocalAddress mi_tcpConnState + 1
  157. #define mi_tcpConnLocalPort mi_tcpConnLocalAddress + 1
  158. #define mi_tcpConnRemAddress mi_tcpConnLocalPort + 1
  159. #define mi_tcpConnRemPort mi_tcpConnRemAddress + 1
  160. #define mi_tcpInErrs mi_tcpConnRemPort + 1
  161. #define mi_tcpOutRsts mi_tcpInErrs + 1
  162. #define mi_tcpNewConnTable mi_tcpOutRsts + 1
  163. #define mi_tcpNewConnEntry mi_tcpNewConnTable + 1
  164. #define mi_tcpNewConnLocalAddressType mi_tcpNewConnEntry + 1
  165. #define mi_tcpNewConnLocalAddress mi_tcpNewConnLocalAddressType + 1
  166. #define mi_tcpNewConnLocalPort mi_tcpNewConnLocalAddress + 1
  167. #define mi_tcpNewConnRemAddressType mi_tcpNewConnLocalPort + 1
  168. #define mi_tcpNewConnRemAddress mi_tcpNewConnRemAddressType + 1
  169. #define mi_tcpNewConnRemPort mi_tcpNewConnRemAddress + 1
  170. #define mi_tcpNewConnState mi_tcpNewConnRemPort + 1
  171. //
  172. // These values should match the order of entries in mib_udpGroup[]
  173. //
  174. #define mi_udpInDatagrams 0
  175. #define mi_udpNoPorts mi_udpInDatagrams + 1
  176. #define mi_udpInErrors mi_udpNoPorts + 1
  177. #define mi_udpOutDatagrams mi_udpInErrors + 1
  178. #define mi_udpTable mi_udpOutDatagrams + 1
  179. #define mi_udpEntry mi_udpTable + 1
  180. #define mi_udpLocalAddress mi_udpEntry + 1
  181. #define mi_udpLocalPort mi_udpLocalAddress + 1
  182. #define mi_udpListenerTable mi_udpLocalPort + 1
  183. #define mi_udpListenerEntry mi_udpListenerTable + 1
  184. #define mi_udpListenerLocalAddressType mi_udpListenerEntry + 1
  185. #define mi_udpListenerLocalAddress mi_udpListenerLocalAddressType + 1
  186. #define mi_udpListenerLocalPort mi_udpListenerLocalAddress + 1
  187. //
  188. // Now we have to set up defines to tell the Master agent the number of
  189. // rows in each table and the number of rows that are indices for these table.
  190. // The Agent expects the indices to be contiguous and in the beginning
  191. //
  192. //
  193. // IF Table
  194. //
  195. #define ne_ifEntry 22
  196. #define ni_ifEntry 1
  197. //
  198. // IP Address table
  199. //
  200. #define ne_ipAddrEntry 5
  201. #define ni_ipAddrEntry 1
  202. //
  203. // IP Route Table
  204. //
  205. #define ne_ipRouteEntry 13
  206. #define ni_ipRouteEntry 1
  207. //
  208. // IP Net To Media Table
  209. //
  210. #define ne_ipNetToMediaEntry 4
  211. #define ni_ipNetToMediaEntry 2
  212. //
  213. // IP Forwarding table
  214. //
  215. #define ne_ipForwardEntry 15
  216. #define ni_ipForwardEntry 4
  217. //
  218. // TCP (IPv4 only) Connection Table
  219. //
  220. #define ne_tcpConnEntry 5
  221. #define ni_tcpConnEntry 4
  222. //
  223. // New TCP (both IPv4 and IPv6) Connection Table
  224. //
  225. #define ne_tcpNewConnEntry 7
  226. #define ni_tcpNewConnEntry 6
  227. //
  228. // Old UDP (IPv4-only) Listener Table
  229. //
  230. #define ne_udpEntry 2
  231. #define ni_udpEntry 2
  232. //
  233. // UDP Listener (both IPv4 and IPv6) Table
  234. //
  235. #define ne_udpListenerEntry 3
  236. #define ni_udpListenerEntry 3
  237. //
  238. // Declaration of the mib view
  239. //
  240. #define NUM_VIEWS 6 // sysGroup
  241. // ifGroup
  242. // ipGroup
  243. // icmpGroup
  244. // tcpGroup
  245. // udpGroup
  246. extern SnmpMibView v_mib2[NUM_VIEWS];
  247. #endif