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.

460 lines
18 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. //
  113. // These values should match the order of entries in mib_icmpGroup[]
  114. //
  115. typedef enum {
  116. mi_icmpInMsgs = 0,
  117. mi_icmpInErrors,
  118. mi_icmpInDestUnreachs,
  119. mi_icmpInTimeExcds,
  120. mi_icmpInParmProbs,
  121. mi_icmpInSrcQuenchs,
  122. mi_icmpInRedirects,
  123. mi_icmpInEchos,
  124. mi_icmpInEchoReps,
  125. mi_icmpInTimestamps,
  126. mi_icmpInTimestampReps,
  127. mi_icmpInAddrMasks,
  128. mi_icmpInAddrMaskReps,
  129. mi_icmpOutMsgs,
  130. mi_icmpOutErrors,
  131. mi_icmpOutDestUnreachs,
  132. mi_icmpOutTimeExcds,
  133. mi_icmpOutParmProbs,
  134. mi_icmpOutSrcQuenchs,
  135. mi_icmpOutRedirects,
  136. mi_icmpOutEchos,
  137. mi_icmpOutEchoReps,
  138. mi_icmpOutTimestamps,
  139. mi_icmpOutTimestampReps,
  140. mi_icmpOutAddrMasks,
  141. mi_icmpOutAddrMaskReps,
  142. mi_inetIcmpTable,
  143. mi_inetIcmpEntry,
  144. mi_inetIcmpAFType,
  145. mi_inetIcmpIfIndex,
  146. mi_inetIcmpInMsgs,
  147. mi_inetIcmpInErrors,
  148. mi_inetIcmpOutMsgs,
  149. mi_inetIcmpOutErrors,
  150. mi_inetIcmpMsgTable,
  151. mi_inetIcmpMsgEntry,
  152. mi_inetIcmpMsgAFType,
  153. mi_inetIcmpMsgIfIndex,
  154. mi_inetIcmpMsgType,
  155. mi_inetIcmpMsgCode,
  156. mi_inetIcmpMsgInPkts,
  157. mi_inetIcmpMsgOutPkts,
  158. } MI_ICMPGROUP;
  159. //
  160. // These values should match the order of entries in mib_tcpGroup[]
  161. //
  162. #define mi_tcpRtoAlgorithm 0
  163. #define mi_tcpRtoMin mi_tcpRtoAlgorithm + 1
  164. #define mi_tcpRtoMax mi_tcpRtoMin + 1
  165. #define mi_tcpMaxConn mi_tcpRtoMax + 1
  166. #define mi_tcpActiveOpens mi_tcpMaxConn + 1
  167. #define mi_tcpPassiveOpens mi_tcpActiveOpens + 1
  168. #define mi_tcpAttemptFails mi_tcpPassiveOpens + 1
  169. #define mi_tcpEstabResets mi_tcpAttemptFails + 1
  170. #define mi_tcpCurrEstab mi_tcpEstabResets + 1
  171. #define mi_tcpInSegs mi_tcpCurrEstab + 1
  172. #define mi_tcpOutSegs mi_tcpInSegs + 1
  173. #define mi_tcpRetransSegs mi_tcpOutSegs + 1
  174. #define mi_tcpConnTable mi_tcpRetransSegs + 1
  175. #define mi_tcpConnEntry mi_tcpConnTable + 1
  176. #define mi_tcpConnState mi_tcpConnEntry + 1
  177. #define mi_tcpConnLocalAddress mi_tcpConnState + 1
  178. #define mi_tcpConnLocalPort mi_tcpConnLocalAddress + 1
  179. #define mi_tcpConnRemAddress mi_tcpConnLocalPort + 1
  180. #define mi_tcpConnRemPort mi_tcpConnRemAddress + 1
  181. #define mi_tcpInErrs mi_tcpConnRemPort + 1
  182. #define mi_tcpOutRsts mi_tcpInErrs + 1
  183. #define mi_tcpNewConnTable mi_tcpOutRsts + 1
  184. #define mi_tcpNewConnEntry mi_tcpNewConnTable + 1
  185. #define mi_tcpNewConnLocalAddressType mi_tcpNewConnEntry + 1
  186. #define mi_tcpNewConnLocalAddress mi_tcpNewConnLocalAddressType + 1
  187. #define mi_tcpNewConnLocalPort mi_tcpNewConnLocalAddress + 1
  188. #define mi_tcpNewConnRemAddressType mi_tcpNewConnLocalPort + 1
  189. #define mi_tcpNewConnRemAddress mi_tcpNewConnRemAddressType + 1
  190. #define mi_tcpNewConnRemPort mi_tcpNewConnRemAddress + 1
  191. #define mi_tcpNewConnState mi_tcpNewConnRemPort + 1
  192. //
  193. // These values should match the order of entries in mib_udpGroup[]
  194. //
  195. #define mi_udpInDatagrams 0
  196. #define mi_udpNoPorts mi_udpInDatagrams + 1
  197. #define mi_udpInErrors mi_udpNoPorts + 1
  198. #define mi_udpOutDatagrams mi_udpInErrors + 1
  199. #define mi_udpTable mi_udpOutDatagrams + 1
  200. #define mi_udpEntry mi_udpTable + 1
  201. #define mi_udpLocalAddress mi_udpEntry + 1
  202. #define mi_udpLocalPort mi_udpLocalAddress + 1
  203. #define mi_udpListenerTable mi_udpLocalPort + 1
  204. #define mi_udpListenerEntry mi_udpListenerTable + 1
  205. #define mi_udpListenerLocalAddressType mi_udpListenerEntry + 1
  206. #define mi_udpListenerLocalAddress mi_udpListenerLocalAddressType + 1
  207. #define mi_udpListenerLocalPort mi_udpListenerLocalAddress + 1
  208. //
  209. // These values should match the order of entries in mib_ipv6Group[]
  210. //
  211. typedef enum {
  212. mi_ipv6Forwarding = 0,
  213. mi_ipv6DefaultHopLimit,
  214. mi_ipv6Interfaces,
  215. mi_ipv6IfTableLastChange,
  216. mi_ipv6IfTable,
  217. mi_ipv6IfEntry,
  218. mi_ipv6IfIndex,
  219. mi_ipv6IfDescr,
  220. mi_ipv6IfLowerLayer,
  221. mi_ipv6IfEffectiveMtu,
  222. mi_ipv6IfReasmMaxSize,
  223. mi_ipv6IfIdentifier,
  224. mi_ipv6IfIdentifierLength,
  225. mi_ipv6IfPhysicalAddress,
  226. mi_ipv6IfAdminStatus,
  227. mi_ipv6IfOperStatus,
  228. mi_ipv6IfLastChange,
  229. mi_ipv6IfStatsTable,
  230. mi_ipv6IfStatsEntry,
  231. mi_ipv6IfStatsIfIndex,
  232. mi_ipv6IfStatsInReceives,
  233. mi_ipv6IfStatsInHdrErrors,
  234. mi_ipv6IfStatsInTooBigErrors,
  235. mi_ipv6IfStatsInNoRoutes,
  236. mi_ipv6IfStatsInAddrErrors,
  237. mi_ipv6IfStatsInUnknownProtos,
  238. mi_ipv6IfStatsInTruncatedPkts,
  239. mi_ipv6IfStatsInDiscards,
  240. mi_ipv6IfStatsInDelivers,
  241. mi_ipv6IfStatsOutForwDatagrams,
  242. mi_ipv6IfStatsOutRequests,
  243. mi_ipv6IfStatsOutDiscards,
  244. mi_ipv6IfStatsOutFragOKs,
  245. mi_ipv6IfStatsOutFragFails,
  246. mi_ipv6IfStatsOutFragCreates,
  247. mi_ipv6IfStatsReasmReqds,
  248. mi_ipv6IfStatsReasmOKs,
  249. mi_ipv6IfStatsReasmFails,
  250. mi_ipv6IfStatsInMcastPkts,
  251. mi_ipv6IfStatsOutMcastPkts,
  252. mi_ipv6AddrPrefixTable,
  253. mi_ipv6AddrPrefixEntry,
  254. mi_ipv6AddrPrefixIfIndex,
  255. mi_ipv6AddrPrefix,
  256. mi_ipv6AddrPrefixLength,
  257. mi_ipv6AddrPrefixOnLinkFlag,
  258. mi_ipv6AddrPrefixAutonomousFlag,
  259. mi_ipv6AddrPrefixAdvPreferredLifetime,
  260. mi_ipv6AddrPrefixAdvValidLifetime,
  261. mi_ipv6AddrTable,
  262. mi_ipv6AddrEntry,
  263. mi_ipv6AddrIfIndex,
  264. mi_ipv6AddrAddress,
  265. mi_ipv6AddrPfxLength,
  266. mi_ipv6AddrType,
  267. mi_ipv6AddrAnycastFlag,
  268. mi_ipv6AddrStatus,
  269. mi_ipv6RouteNumber,
  270. mi_ipv6DiscardedRoutes,
  271. mi_ipv6RouteTable,
  272. mi_ipv6RouteEntry,
  273. mi_ipv6RouteDest,
  274. mi_ipv6RoutePfxLength,
  275. mi_ipv6RouteIndex,
  276. mi_ipv6RouteIfIndex,
  277. mi_ipv6RouteNextHop,
  278. mi_ipv6RouteType,
  279. mi_ipv6RouteProtocol,
  280. mi_ipv6RoutePolicy,
  281. mi_ipv6RouteAge,
  282. mi_ipv6RouteNextHopRDI,
  283. mi_ipv6RouteMetric,
  284. mi_ipv6RouteWeight,
  285. mi_ipv6RouteInfo,
  286. mi_ipv6RouteValid,
  287. mi_ipv6NetToMediaTable,
  288. mi_ipv6NetToMediaEntry,
  289. mi_ipv6NetToMediaIfIndex,
  290. mi_ipv6NetToMediaNetAddress,
  291. mi_ipv6NetToMediaPhysAddress,
  292. mi_ipv6NetToMediaType,
  293. mi_ipv6NetToMediaState,
  294. mi_ipv6NetToMediaLastUpdated,
  295. mi_ipv6NetToMediaValid,
  296. } MI_IPV6GROUP;
  297. //
  298. // Now we have to set up defines to tell the Master agent the number of
  299. // rows in each table and the number of rows that are indices for the table.
  300. // The Agent expects the indices to be contiguous and in the beginning.
  301. // In cases where an index includes objects that are not in the table
  302. // themselves, the counts include such objects. That is, they count
  303. // the number of fields in the structures in mibfuncs.h, which need
  304. // not match the number of entries in the mib_* structures in oid.h
  305. // in this case.
  306. //
  307. //
  308. // IF Table
  309. //
  310. #define ne_ifEntry 22
  311. #define ni_ifEntry 1
  312. //
  313. // IP Address table
  314. //
  315. #define ne_ipAddrEntry 5
  316. #define ni_ipAddrEntry 1
  317. //
  318. // IP Route Table
  319. //
  320. #define ne_ipRouteEntry 13
  321. #define ni_ipRouteEntry 1
  322. //
  323. // IP Net To Media Table
  324. //
  325. #define ne_ipNetToMediaEntry 4
  326. #define ni_ipNetToMediaEntry 2
  327. //
  328. // IP Forwarding table
  329. //
  330. #define ne_ipForwardEntry 15
  331. #define ni_ipForwardEntry 4
  332. //
  333. // ICMP table
  334. //
  335. #define ne_inetIcmpEntry 6
  336. #define ni_inetIcmpEntry 2
  337. //
  338. // ICMP Message Table
  339. //
  340. #define ne_inetIcmpMsgEntry 6
  341. #define ni_inetIcmpMsgEntry 4
  342. //
  343. // TCP (IPv4 only) Connection Table
  344. //
  345. #define ne_tcpConnEntry 5
  346. #define ni_tcpConnEntry 4
  347. //
  348. // New TCP (both IPv4 and IPv6) Connection Table
  349. //
  350. #define ne_tcpNewConnEntry 7
  351. #define ni_tcpNewConnEntry 6
  352. //
  353. // Old UDP (IPv4-only) Listener Table
  354. //
  355. #define ne_udpEntry 2
  356. #define ni_udpEntry 2
  357. //
  358. // UDP Listener (both IPv4 and IPv6) Table
  359. //
  360. #define ne_udpListenerEntry 3
  361. #define ni_udpListenerEntry 3
  362. //
  363. // IPv6 Interface Table
  364. //
  365. #define ne_ipv6IfEntry 11
  366. #define ni_ipv6IfEntry 1
  367. //
  368. // IPv6 Stats Table
  369. //
  370. #define ne_ipv6IfStatsEntry 21
  371. #define ni_ipv6IfStatsEntry 1 /* inc. IfIndex */
  372. //
  373. // IPv6 Address Prefix Table
  374. //
  375. #define ne_ipv6AddrPrefixEntry 7
  376. #define ni_ipv6AddrPrefixEntry 3 /* inc. IfIndex */
  377. //
  378. // IPv6 Address Table
  379. //
  380. #define ne_ipv6AddrEntry 6
  381. #define ni_ipv6AddrEntry 2 /* inc. IfIndex */
  382. //
  383. // IPv6 Route Table
  384. //
  385. #define ne_ipv6RouteEntry 14
  386. #define ni_ipv6RouteEntry 3
  387. //
  388. // IPv6 Net To Media Table
  389. //
  390. #define ne_ipv6NetToMediaEntry 7
  391. #define ni_ipv6NetToMediaEntry 2 /* inc. IfIndex */
  392. //
  393. // Declaration of the mib view
  394. //
  395. #define NUM_VIEWS 7 // sysGroup
  396. // ifGroup
  397. // ipGroup
  398. // icmpGroup
  399. // tcpGroup
  400. // udpGroup
  401. // ipv6Group
  402. extern SnmpMibView v_mib2[NUM_VIEWS];
  403. #endif