snmp 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (295) hide show
  1. data/README.rdoc +179 -0
  2. data/Rakefile +34 -39
  3. data/data/ruby/snmp/mibs/ACCOUNTING-CONTROL-MIB.yaml +33 -32
  4. data/data/ruby/snmp/mibs/ADSL-LINE-EXT-MIB.yaml +57 -56
  5. data/data/ruby/snmp/mibs/ADSL-LINE-MIB.yaml +224 -223
  6. data/data/ruby/snmp/mibs/ADSL-TC-MIB.yaml +1 -0
  7. data/data/ruby/snmp/mibs/ADSL2-LINE-MIB.yaml +321 -0
  8. data/data/ruby/snmp/mibs/ADSL2-LINE-TC-MIB.yaml +3 -0
  9. data/data/ruby/snmp/mibs/AGENTX-MIB.yaml +25 -24
  10. data/data/ruby/snmp/mibs/AGGREGATE-MIB.yaml +28 -0
  11. data/data/ruby/snmp/mibs/ALARM-MIB.yaml +77 -0
  12. data/data/ruby/snmp/mibs/APM-MIB.yaml +75 -74
  13. data/data/ruby/snmp/mibs/APPC-MIB.yaml +261 -260
  14. data/data/ruby/snmp/mibs/APPLETALK-MIB.yaml +255 -254
  15. data/data/ruby/snmp/mibs/APPLICATION-MIB.yaml +138 -137
  16. data/data/ruby/snmp/mibs/APPN-DLUR-MIB.yaml +30 -29
  17. data/data/ruby/snmp/mibs/APPN-MIB.yaml +325 -324
  18. data/data/ruby/snmp/mibs/APPN-TRAP-MIB.yaml +10 -9
  19. data/data/ruby/snmp/mibs/APS-MIB.yaml +50 -49
  20. data/data/ruby/snmp/mibs/ARC-MIB.yaml +19 -0
  21. data/data/ruby/snmp/mibs/ATM-ACCOUNTING-INFORMATION-MIB.yaml +22 -21
  22. data/data/ruby/snmp/mibs/ATM-MIB.yaml +94 -93
  23. data/data/ruby/snmp/mibs/ATM-TC-MIB.yaml +12 -11
  24. data/data/ruby/snmp/mibs/ATM2-MIB.yaml +156 -155
  25. data/data/ruby/snmp/mibs/BGP4-MIB.yaml +48 -41
  26. data/data/ruby/snmp/mibs/BLDG-HVAC-MIB.yaml +25 -24
  27. data/data/ruby/snmp/mibs/BRIDGE-MIB.yaml +50 -44
  28. data/data/ruby/snmp/mibs/CHARACTER-MIB.yaml +35 -34
  29. data/data/ruby/snmp/mibs/CIRCUIT-IF-MIB.yaml +13 -12
  30. data/data/ruby/snmp/mibs/CLNS-MIB.yaml +98 -97
  31. data/data/ruby/snmp/mibs/COFFEE-POT-MIB.yaml +8 -7
  32. data/data/ruby/snmp/mibs/COPS-CLIENT-MIB.yaml +38 -37
  33. data/data/ruby/snmp/mibs/DECNET-PHIV-MIB.yaml +209 -208
  34. data/data/ruby/snmp/mibs/DIAL-CONTROL-MIB.yaml +72 -71
  35. data/data/ruby/snmp/mibs/DIFFSERV-CONFIG-MIB.yaml +11 -10
  36. data/data/ruby/snmp/mibs/DIFFSERV-DSCP-TC.yaml +1 -0
  37. data/data/ruby/snmp/mibs/DIFFSERV-MIB.yaml +151 -150
  38. data/data/ruby/snmp/mibs/DIRECTORY-SERVER-MIB.yaml +35 -34
  39. data/data/ruby/snmp/mibs/DISMAN-EVENT-MIB.yaml +95 -94
  40. data/data/ruby/snmp/mibs/DISMAN-EXPRESSION-MIB.yaml +37 -36
  41. data/data/ruby/snmp/mibs/DISMAN-NSLOOKUP-MIB.yaml +15 -14
  42. data/data/ruby/snmp/mibs/DISMAN-PING-MIB.yaml +43 -42
  43. data/data/ruby/snmp/mibs/DISMAN-SCHEDULE-MIB.yaml +22 -21
  44. data/data/ruby/snmp/mibs/DISMAN-SCRIPT-MIB.yaml +64 -63
  45. data/data/ruby/snmp/mibs/DISMAN-TRACEROUTE-MIB.yaml +59 -58
  46. data/data/ruby/snmp/mibs/DLSW-MIB.yaml +172 -171
  47. data/data/ruby/snmp/mibs/DNS-RESOLVER-MIB.yaml +70 -69
  48. data/data/ruby/snmp/mibs/DNS-SERVER-MIB.yaml +57 -56
  49. data/data/ruby/snmp/mibs/DOCS-BPI-MIB.yaml +81 -80
  50. data/data/ruby/snmp/mibs/DOCS-CABLE-DEVICE-MIB.yaml +114 -89
  51. data/data/ruby/snmp/mibs/DOCS-IETF-BPI2-MIB.yaml +187 -0
  52. data/data/ruby/snmp/mibs/DOCS-IETF-CABLE-DEVICE-NOTIFICATION-MIB.yaml +39 -0
  53. data/data/ruby/snmp/mibs/DOCS-IETF-QOS-MIB.yaml +166 -0
  54. data/data/ruby/snmp/mibs/DOCS-IETF-SUBMGT-MIB.yaml +32 -0
  55. data/data/ruby/snmp/mibs/DOCS-IF-MIB.yaml +208 -119
  56. data/data/ruby/snmp/mibs/DOT12-IF-MIB.yaml +21 -20
  57. data/data/ruby/snmp/mibs/DOT3-EPON-MIB.yaml +101 -0
  58. data/data/ruby/snmp/mibs/DOT3-OAM-MIB.yaml +82 -0
  59. data/data/ruby/snmp/mibs/DS0-MIB.yaml +11 -10
  60. data/data/ruby/snmp/mibs/DS0BUNDLE-MIB.yaml +9 -8
  61. data/data/ruby/snmp/mibs/DS1-MIB.yaml +102 -98
  62. data/data/ruby/snmp/mibs/DS3-MIB.yaml +84 -83
  63. data/data/ruby/snmp/mibs/DSA-MIB.yaml +31 -30
  64. data/data/ruby/snmp/mibs/DSMON-MIB.yaml +193 -192
  65. data/data/ruby/snmp/mibs/EBN-MIB.yaml +32 -31
  66. data/data/ruby/snmp/mibs/EFM-CU-MIB.yaml +113 -0
  67. data/data/ruby/snmp/mibs/ENTITY-MIB.yaml +41 -38
  68. data/data/ruby/snmp/mibs/ENTITY-SENSOR-MIB.yaml +8 -7
  69. data/data/ruby/snmp/mibs/ENTITY-STATE-MIB.yaml +18 -0
  70. data/data/ruby/snmp/mibs/ENTITY-STATE-TC-MIB.yaml +3 -0
  71. data/data/ruby/snmp/mibs/ETHER-CHIPSET-MIB.yaml +61 -60
  72. data/data/ruby/snmp/mibs/ETHER-WIS.yaml +16 -15
  73. data/data/ruby/snmp/mibs/EtherLike-MIB.yaml +43 -42
  74. data/data/ruby/snmp/mibs/FC-MGMT-MIB.yaml +154 -0
  75. data/data/ruby/snmp/mibs/FCIP-MGMT-MIB.yaml +68 -0
  76. data/data/ruby/snmp/mibs/FDDI-SMT73-MIB.yaml +107 -106
  77. data/data/ruby/snmp/mibs/FIBRE-CHANNEL-FE-MIB.yaml +100 -99
  78. data/data/ruby/snmp/mibs/FLOW-METER-MIB.yaml +92 -91
  79. data/data/ruby/snmp/mibs/FR-ATM-PVC-SERVICE-IWF-MIB.yaml +33 -32
  80. data/data/ruby/snmp/mibs/FR-MFR-MIB.yaml +38 -37
  81. data/data/ruby/snmp/mibs/FRAME-RELAY-DTE-MIB.yaml +41 -40
  82. data/data/ruby/snmp/mibs/FRNETSERV-MIB.yaml +92 -91
  83. data/data/ruby/snmp/mibs/FRSLD-MIB.yaml +66 -65
  84. data/data/ruby/snmp/mibs/Finisher-MIB.yaml +38 -37
  85. data/data/ruby/snmp/mibs/GMPLS-LABEL-STD-MIB.yaml +27 -0
  86. data/data/ruby/snmp/mibs/GMPLS-LSR-STD-MIB.yaml +20 -0
  87. data/data/ruby/snmp/mibs/GMPLS-TC-STD-MIB.yaml +3 -0
  88. data/data/ruby/snmp/mibs/GMPLS-TE-STD-MIB.yaml +72 -0
  89. data/data/ruby/snmp/mibs/GSMP-MIB.yaml +75 -74
  90. data/data/ruby/snmp/mibs/HC-ALARM-MIB.yaml +26 -25
  91. data/data/ruby/snmp/mibs/HC-PerfHist-TC-MIB.yaml +1 -0
  92. data/data/ruby/snmp/mibs/HC-RMON-MIB.yaml +164 -163
  93. data/data/ruby/snmp/mibs/HCNUM-TC.yaml +1 -0
  94. data/data/ruby/snmp/mibs/HDSL2-SHDSL-LINE-MIB.yaml +117 -112
  95. data/data/ruby/snmp/mibs/HOST-RESOURCES-MIB.yaml +82 -81
  96. data/data/ruby/snmp/mibs/HOST-RESOURCES-TYPES.yaml +40 -39
  97. data/data/ruby/snmp/mibs/HPR-IP-MIB.yaml +17 -16
  98. data/data/ruby/snmp/mibs/HPR-MIB.yaml +64 -63
  99. data/data/ruby/snmp/mibs/IANA-ITU-ALARM-TC-MIB.yaml +3 -0
  100. data/data/ruby/snmp/mibs/IF-CAP-STACK-MIB.yaml +13 -0
  101. data/data/ruby/snmp/mibs/IF-INVERTED-STACK-MIB.yaml +6 -5
  102. data/data/ruby/snmp/mibs/IF-MIB.yaml +57 -56
  103. data/data/ruby/snmp/mibs/IFCP-MGMT-MIB.yaml +65 -0
  104. data/data/ruby/snmp/mibs/IGMP-STD-MIB.yaml +24 -23
  105. data/data/ruby/snmp/mibs/INET-ADDRESS-MIB.yaml +1 -0
  106. data/data/ruby/snmp/mibs/INTEGRATED-SERVICES-GUARANTEED-MIB.yaml +6 -5
  107. data/data/ruby/snmp/mibs/INTEGRATED-SERVICES-MIB.yaml +29 -28
  108. data/data/ruby/snmp/mibs/INTERFACETOPN-MIB.yaml +21 -20
  109. data/data/ruby/snmp/mibs/IP-FORWARD-MIB.yaml +49 -27
  110. data/data/ruby/snmp/mibs/IP-MIB.yaml +243 -40
  111. data/data/ruby/snmp/mibs/IPATM-IPMC-MIB.yaml +179 -178
  112. data/data/ruby/snmp/mibs/IPMCAST-MIB.yaml +105 -0
  113. data/data/ruby/snmp/mibs/IPMROUTE-STD-MIB.yaml +49 -48
  114. data/data/ruby/snmp/mibs/IPOA-MIB.yaml +74 -73
  115. data/data/ruby/snmp/mibs/IPS-AUTH-MIB.yaml +68 -0
  116. data/data/ruby/snmp/mibs/IPSEC-SPD-MIB.yaml +121 -0
  117. data/data/ruby/snmp/mibs/IPV6-FLOW-LABEL-MIB.yaml +1 -0
  118. data/data/ruby/snmp/mibs/IPV6-ICMP-MIB.yaml +27 -26
  119. data/data/ruby/snmp/mibs/IPV6-MIB.yaml +70 -69
  120. data/data/ruby/snmp/mibs/IPV6-MLD-MIB.yaml +18 -17
  121. data/data/ruby/snmp/mibs/IPV6-TCP-MIB.yaml +7 -6
  122. data/data/ruby/snmp/mibs/IPV6-UDP-MIB.yaml +6 -5
  123. data/data/ruby/snmp/mibs/ISCSI-MIB.yaml +199 -0
  124. data/data/ruby/snmp/mibs/ISDN-MIB.yaml +57 -56
  125. data/data/ruby/snmp/mibs/ISIS-MIB.yaml +247 -0
  126. data/data/ruby/snmp/mibs/ISNS-MIB.yaml +179 -0
  127. data/data/ruby/snmp/mibs/ITU-ALARM-MIB.yaml +34 -0
  128. data/data/ruby/snmp/mibs/ITU-ALARM-TC-MIB.yaml +3 -0
  129. data/data/ruby/snmp/mibs/Job-Monitoring-MIB.yaml +26 -27
  130. data/data/ruby/snmp/mibs/L2TP-MIB.yaml +138 -137
  131. data/data/ruby/snmp/mibs/LANGTAG-TC-MIB.yaml +3 -0
  132. data/data/ruby/snmp/mibs/LMP-MIB.yaml +202 -0
  133. data/data/ruby/snmp/mibs/MALLOC-MIB.yaml +66 -65
  134. data/data/ruby/snmp/mibs/MAU-MIB.yaml +55 -95
  135. data/data/ruby/snmp/mibs/MIDCOM-MIB.yaml +83 -0
  136. data/data/ruby/snmp/mibs/MIOX25-MIB.yaml +28 -27
  137. data/data/ruby/snmp/mibs/MIP-MIB.yaml +157 -156
  138. data/data/ruby/snmp/mibs/MOBILEIPV6-MIB.yaml +189 -0
  139. data/data/ruby/snmp/mibs/MPLS-FTN-STD-MIB.yaml +29 -28
  140. data/data/ruby/snmp/mibs/MPLS-L3VPN-STD-MIB.yaml +88 -0
  141. data/data/ruby/snmp/mibs/MPLS-LC-ATM-STD-MIB.yaml +19 -0
  142. data/data/ruby/snmp/mibs/MPLS-LC-FR-STD-MIB.yaml +16 -0
  143. data/data/ruby/snmp/mibs/MPLS-LDP-ATM-STD-MIB.yaml +23 -22
  144. data/data/ruby/snmp/mibs/MPLS-LDP-FRAME-RELAY-STD-MIB.yaml +17 -16
  145. data/data/ruby/snmp/mibs/MPLS-LDP-GENERIC-STD-MIB.yaml +9 -8
  146. data/data/ruby/snmp/mibs/MPLS-LDP-STD-MIB.yaml +103 -102
  147. data/data/ruby/snmp/mibs/MPLS-LSR-STD-MIB.yaml +85 -84
  148. data/data/ruby/snmp/mibs/MPLS-TC-STD-MIB.yaml +1 -0
  149. data/data/ruby/snmp/mibs/MPLS-TE-STD-MIB.yaml +106 -105
  150. data/data/ruby/snmp/mibs/MSDP-MIB.yaml +71 -0
  151. data/data/ruby/snmp/mibs/MTA-MIB.yaml +42 -41
  152. data/data/ruby/snmp/mibs/Modem-MIB.yaml +87 -86
  153. data/data/ruby/snmp/mibs/NAT-MIB.yaml +116 -0
  154. data/data/ruby/snmp/mibs/NETWORK-SERVICES-MIB.yaml +18 -17
  155. data/data/ruby/snmp/mibs/NHRP-MIB.yaml +140 -139
  156. data/data/ruby/snmp/mibs/NOTIFICATION-LOG-MIB.yaml +37 -36
  157. data/data/ruby/snmp/mibs/OPT-IF-MIB.yaml +394 -393
  158. data/data/ruby/snmp/mibs/OSPF-MIB.yaml +192 -123
  159. data/data/ruby/snmp/mibs/OSPF-TRAP-MIB.yaml +24 -19
  160. data/data/ruby/snmp/mibs/P-BRIDGE-MIB.yaml +37 -35
  161. data/data/ruby/snmp/mibs/PARALLEL-MIB.yaml +16 -15
  162. data/data/ruby/snmp/mibs/PIM-MIB.yaml +47 -46
  163. data/data/ruby/snmp/mibs/PIM-STD-MIB.yaml +235 -0
  164. data/data/ruby/snmp/mibs/PINT-MIB.yaml +38 -37
  165. data/data/ruby/snmp/mibs/PKTC-IETF-MTA-MIB.yaml +81 -0
  166. data/data/ruby/snmp/mibs/PKTC-IETF-SIG-MIB.yaml +128 -0
  167. data/data/ruby/snmp/mibs/POLICY-BASED-MANAGEMENT-MIB.yaml +94 -0
  168. data/data/ruby/snmp/mibs/POWER-ETHERNET-MIB.yaml +27 -26
  169. data/data/ruby/snmp/mibs/PPP-BRIDGE-NCP-MIB.yaml +16 -15
  170. data/data/ruby/snmp/mibs/PPP-IP-NCP-MIB.yaml +7 -6
  171. data/data/ruby/snmp/mibs/PPP-LCP-MIB.yaml +33 -32
  172. data/data/ruby/snmp/mibs/PPP-SEC-MIB.yaml +13 -12
  173. data/data/ruby/snmp/mibs/PTOPO-MIB.yaml +29 -28
  174. data/data/ruby/snmp/mibs/PerfHist-TC-MIB.yaml +1 -0
  175. data/data/ruby/snmp/mibs/Printer-MIB.yaml +185 -184
  176. data/data/ruby/snmp/mibs/Q-BRIDGE-MIB.yaml +96 -82
  177. data/data/ruby/snmp/mibs/RADIUS-ACC-CLIENT-MIB.yaml +34 -16
  178. data/data/ruby/snmp/mibs/RADIUS-ACC-SERVER-MIB.yaml +40 -24
  179. data/data/ruby/snmp/mibs/RADIUS-AUTH-CLIENT-MIB.yaml +38 -18
  180. data/data/ruby/snmp/mibs/RADIUS-AUTH-SERVER-MIB.yaml +40 -23
  181. data/data/ruby/snmp/mibs/RADIUS-DYNAUTH-CLIENT-MIB.yaml +44 -0
  182. data/data/ruby/snmp/mibs/RADIUS-DYNAUTH-SERVER-MIB.yaml +40 -0
  183. data/data/ruby/snmp/mibs/RAQMON-MIB.yaml +90 -0
  184. data/data/ruby/snmp/mibs/RDBMS-MIB.yaml +69 -68
  185. data/data/ruby/snmp/mibs/RFC1065-SMI.yaml +4 -5
  186. data/data/ruby/snmp/mibs/RFC1155-SMI.yaml +4 -5
  187. data/data/ruby/snmp/mibs/RFC1158-MIB.yaml +174 -173
  188. data/data/ruby/snmp/mibs/RFC1213-MIB.yaml +173 -172
  189. data/data/ruby/snmp/mibs/RFC1269-MIB.yaml +20 -19
  190. data/data/ruby/snmp/mibs/RFC1271-MIB.yaml +185 -184
  191. data/data/ruby/snmp/mibs/RFC1285-MIB.yaml +85 -84
  192. data/data/ruby/snmp/mibs/RFC1316-MIB.yaml +30 -29
  193. data/data/ruby/snmp/mibs/RFC1381-MIB.yaml +40 -39
  194. data/data/ruby/snmp/mibs/RFC1382-MIB.yaml +149 -148
  195. data/data/ruby/snmp/mibs/RFC1414-MIB.yaml +4 -3
  196. data/data/ruby/snmp/mibs/RIPv2-MIB.yaml +25 -24
  197. data/data/ruby/snmp/mibs/RMON-MIB.yaml +192 -191
  198. data/data/ruby/snmp/mibs/RMON2-MIB.yaml +253 -252
  199. data/data/ruby/snmp/mibs/ROHC-MIB.yaml +49 -48
  200. data/data/ruby/snmp/mibs/ROHC-RTP-MIB.yaml +19 -18
  201. data/data/ruby/snmp/mibs/ROHC-UNCOMPRESSED-MIB.yaml +6 -5
  202. data/data/ruby/snmp/mibs/RS-232-MIB.yaml +36 -35
  203. data/data/ruby/snmp/mibs/RSTP-MIB.yaml +18 -0
  204. data/data/ruby/snmp/mibs/RSVP-MIB.yaml +137 -136
  205. data/data/ruby/snmp/mibs/RTP-MIB.yaml +42 -41
  206. data/data/ruby/snmp/mibs/SCSI-MIB.yaml +160 -0
  207. data/data/ruby/snmp/mibs/SCTP-MIB.yaml +83 -0
  208. data/data/ruby/snmp/mibs/SFLOW-MIB.yaml +15 -14
  209. data/data/ruby/snmp/mibs/SIP-COMMON-MIB.yaml +112 -0
  210. data/data/ruby/snmp/mibs/SIP-MIB.yaml +56 -55
  211. data/data/ruby/snmp/mibs/SIP-SERVER-MIB.yaml +52 -0
  212. data/data/ruby/snmp/mibs/SIP-TC-MIB.yaml +3 -0
  213. data/data/ruby/snmp/mibs/SIP-UA-MIB.yaml +14 -0
  214. data/data/ruby/snmp/mibs/SLAPM-MIB.yaml +134 -133
  215. data/data/ruby/snmp/mibs/SMON-MIB.yaml +47 -46
  216. data/data/ruby/snmp/mibs/SNA-NAU-MIB.yaml +117 -116
  217. data/data/ruby/snmp/mibs/SNA-SDLC-MIB.yaml +126 -125
  218. data/data/ruby/snmp/mibs/SNMP-COMMUNITY-MIB.yaml +12 -11
  219. data/data/ruby/snmp/mibs/SNMP-FRAMEWORK-MIB.yaml +8 -7
  220. data/data/ruby/snmp/mibs/SNMP-MPD-MIB.yaml +6 -5
  221. data/data/ruby/snmp/mibs/SNMP-NOTIFICATION-MIB.yaml +16 -15
  222. data/data/ruby/snmp/mibs/SNMP-PROXY-MIB.yaml +10 -9
  223. data/data/ruby/snmp/mibs/SNMP-REPEATER-MIB.yaml +120 -119
  224. data/data/ruby/snmp/mibs/SNMP-TARGET-MIB.yaml +19 -18
  225. data/data/ruby/snmp/mibs/SNMP-USER-BASED-SM-MIB.yaml +26 -25
  226. data/data/ruby/snmp/mibs/SNMP-USM-AES-MIB.yaml +4 -0
  227. data/data/ruby/snmp/mibs/SNMP-USM-DH-OBJECTS-MIB.yaml +10 -9
  228. data/data/ruby/snmp/mibs/SNMP-VIEW-BASED-ACM-MIB.yaml +26 -25
  229. data/data/ruby/snmp/mibs/SNMPv2-MIB.yaml +46 -45
  230. data/data/ruby/snmp/mibs/SNMPv2-SMI.yaml +12 -11
  231. data/data/ruby/snmp/mibs/SNMPv2-TM.yaml +5 -4
  232. data/data/ruby/snmp/mibs/SNMPv2-USEC-MIB.yaml +10 -9
  233. data/data/ruby/snmp/mibs/SONET-MIB.yaml +110 -109
  234. data/data/ruby/snmp/mibs/SOURCE-ROUTING-MIB.yaml +18 -17
  235. data/data/ruby/snmp/mibs/SSPM-MIB.yaml +67 -0
  236. data/data/ruby/snmp/mibs/SYSAPPL-MIB.yaml +65 -64
  237. data/data/ruby/snmp/mibs/T11-FC-FABRIC-ADDR-MGR-MIB.yaml +63 -0
  238. data/data/ruby/snmp/mibs/T11-FC-FABRIC-CONFIG-SERVER-MIB.yaml +100 -0
  239. data/data/ruby/snmp/mibs/T11-FC-FABRIC-LOCK-MIB.yaml +22 -0
  240. data/data/ruby/snmp/mibs/T11-FC-FSPF-MIB.yaml +70 -0
  241. data/data/ruby/snmp/mibs/T11-FC-NAME-SERVER-MIB.yaml +56 -0
  242. data/data/ruby/snmp/mibs/T11-FC-ROUTE-MIB.yaml +27 -0
  243. data/data/ruby/snmp/mibs/T11-FC-RSCN-MIB.yaml +47 -0
  244. data/data/ruby/snmp/mibs/T11-FC-VIRTUAL-FABRIC-MIB.yaml +31 -0
  245. data/data/ruby/snmp/mibs/T11-FC-ZONE-SERVER-MIB.yaml +124 -0
  246. data/data/ruby/snmp/mibs/T11-TC-MIB.yaml +3 -0
  247. data/data/ruby/snmp/mibs/TCP-ESTATS-MIB.yaml +167 -0
  248. data/data/ruby/snmp/mibs/TCP-MIB.yaml +37 -18
  249. data/data/ruby/snmp/mibs/TCPIPX-MIB.yaml +16 -15
  250. data/data/ruby/snmp/mibs/TE-LINK-STD-MIB.yaml +82 -0
  251. data/data/ruby/snmp/mibs/TE-MIB.yaml +81 -0
  252. data/data/ruby/snmp/mibs/TIME-AGGREGATE-MIB.yaml +22 -0
  253. data/data/ruby/snmp/mibs/TN3270E-MIB.yaml +85 -84
  254. data/data/ruby/snmp/mibs/TN3270E-RT-MIB.yaml +33 -32
  255. data/data/ruby/snmp/mibs/TOKEN-RING-RMON-MIB.yaml +159 -158
  256. data/data/ruby/snmp/mibs/TOKENRING-MIB.yaml +42 -41
  257. data/data/ruby/snmp/mibs/TOKENRING-STATION-SR-MIB.yaml +8 -7
  258. data/data/ruby/snmp/mibs/TRANSPORT-ADDRESS-MIB.yaml +13 -12
  259. data/data/ruby/snmp/mibs/TRIP-MIB.yaml +118 -0
  260. data/data/ruby/snmp/mibs/TRIP-TC-MIB.yaml +3 -0
  261. data/data/ruby/snmp/mibs/TUNNEL-MIB.yaml +29 -13
  262. data/data/ruby/snmp/mibs/UDP-MIB.yaml +19 -6
  263. data/data/ruby/snmp/mibs/UDPLITE-MIB.yaml +26 -0
  264. data/data/ruby/snmp/mibs/UPS-MIB.yaml +100 -99
  265. data/data/ruby/snmp/mibs/URI-TC-MIB.yaml +3 -0
  266. data/data/ruby/snmp/mibs/VDSL-LINE-EXT-MCM-MIB.yaml +42 -0
  267. data/data/ruby/snmp/mibs/VDSL-LINE-EXT-SCM-MIB.yaml +27 -0
  268. data/data/ruby/snmp/mibs/VDSL-LINE-MIB.yaml +162 -161
  269. data/data/ruby/snmp/mibs/VPN-TC-STD-MIB.yaml +3 -0
  270. data/data/ruby/snmp/mibs/VRRP-MIB.yaml +39 -38
  271. data/data/ruby/snmp/mibs/WWW-MIB.yaml +75 -74
  272. data/examples/dump.rb +5 -5
  273. data/examples/iftable.rb +4 -4
  274. data/examples/link_down.rb +18 -18
  275. data/examples/log_traps.rb +9 -9
  276. data/examples/walk.rb +4 -4
  277. data/lib/snmp/agent.rb +42 -43
  278. data/lib/snmp/ber.rb +155 -156
  279. data/lib/snmp/manager.rb +412 -372
  280. data/lib/snmp/mib.rb +172 -182
  281. data/lib/snmp/options.rb +64 -0
  282. data/lib/snmp/pdu.rb +245 -245
  283. data/lib/snmp/varbind.rb +346 -341
  284. data/lib/snmp/version.rb +3 -0
  285. data/test/test_ber.rb +232 -233
  286. data/test/test_manager.rb +277 -238
  287. data/test/test_mib.rb +57 -57
  288. data/test/test_pdu.rb +172 -172
  289. data/test/test_retry.rb +54 -54
  290. data/test/test_smi.rb +10 -10
  291. data/test/test_varbind.rb +342 -331
  292. data/test/test_walk.rb +150 -150
  293. metadata +103 -45
  294. data/README +0 -252
  295. data/setup.rb +0 -1360
@@ -3,79 +3,79 @@ require 'test/unit'
3
3
 
4
4
  module SNMP
5
5
 
6
- class TestMib < Test::Unit::TestCase
6
+ class TestMib < Test::Unit::TestCase
7
7
 
8
8
  def setup
9
- @mib = MIB.new
10
- @mib.load_module("SNMPv2-MIB")
11
- @mib.load_module("IF-MIB")
9
+ @mib = MIB.new
10
+ @mib.load_module("SNMPv2-MIB")
11
+ @mib.load_module("IF-MIB")
12
12
  end
13
-
13
+
14
14
  def test_name_to_oid
15
- oid = @mib.oid("1.2.3.4")
16
- assert_equal("1.2.3.4", oid.to_s)
17
-
18
- oid = @mib.oid("ifTable")
19
- assert_equal("1.3.6.1.2.1.2.2", oid.to_s)
20
-
21
- oid = @mib.oid("sysDescr.0")
22
- assert_equal("1.3.6.1.2.1.1.1.0", oid.to_s)
23
-
24
- oid = @mib.oid("ifTable.1.23")
25
- assert_equal("1.3.6.1.2.1.2.2.1.23", oid.to_s)
26
-
27
- oid = @mib.oid("IF-MIB::ifTable.1.23")
28
- assert_equal("1.3.6.1.2.1.2.2.1.23", oid.to_s)
29
-
30
- assert_raise(MIB::ModuleNotLoadedError) {
31
- @mib.oid("IFMIB::ifTable.1.23")
32
- }
33
-
34
- assert_raise(ArgumentError) {
35
- @mib.oid("IF-MIB::")
36
- }
37
-
38
- assert_raise(ArgumentError) {
39
- MIB.new.oid("sysDescr.0")
40
- }
41
-
42
- assert_equal("1.2.3.4", MIB.new.oid("1.2.3.4").to_s)
15
+ oid = @mib.oid("1.2.3.4")
16
+ assert_equal("1.2.3.4", oid.to_s)
17
+
18
+ oid = @mib.oid("ifTable")
19
+ assert_equal("1.3.6.1.2.1.2.2", oid.to_s)
20
+
21
+ oid = @mib.oid("sysDescr.0")
22
+ assert_equal("1.3.6.1.2.1.1.1.0", oid.to_s)
23
+
24
+ oid = @mib.oid("ifTable.1.23")
25
+ assert_equal("1.3.6.1.2.1.2.2.1.23", oid.to_s)
26
+
27
+ oid = @mib.oid("IF-MIB::ifTable.1.23")
28
+ assert_equal("1.3.6.1.2.1.2.2.1.23", oid.to_s)
29
+
30
+ assert_raise(MIB::ModuleNotLoadedError) {
31
+ @mib.oid("IFMIB::ifTable.1.23")
32
+ }
33
+
34
+ assert_raise(ArgumentError) {
35
+ @mib.oid("IF-MIB::")
36
+ }
37
+
38
+ assert_raise(ArgumentError) {
39
+ MIB.new.oid("sysDescr.0")
40
+ }
41
+
42
+ assert_equal("1.2.3.4", MIB.new.oid("1.2.3.4").to_s)
43
43
  end
44
-
44
+
45
45
  def test_varbind_list
46
- vb_list = @mib.varbind_list("1.2.3.4")
47
- assert_equal(1, vb_list.length)
48
- assert_equal("1.2.3.4", vb_list.first.name.to_s)
46
+ vb_list = @mib.varbind_list("1.2.3.4")
47
+ assert_equal(1, vb_list.length)
48
+ assert_equal("1.2.3.4", vb_list.first.name.to_s)
49
49
 
50
- vb_list = @mib.varbind_list(["1.2.3.4"])
51
- assert_equal(1, vb_list.length)
52
- assert_equal("1.2.3.4", vb_list.first.name.to_s)
50
+ vb_list = @mib.varbind_list(["1.2.3.4"])
51
+ assert_equal(1, vb_list.length)
52
+ assert_equal("1.2.3.4", vb_list.first.name.to_s)
53
53
 
54
- vb_list = @mib.varbind_list(["IF-MIB::ifTable.1.23", "1.2.3.4"])
55
- assert_equal(2, vb_list.length)
56
- assert_equal("1.3.6.1.2.1.2.2.1.23", vb_list.first.name.to_s)
54
+ vb_list = @mib.varbind_list(["IF-MIB::ifTable.1.23", "1.2.3.4"])
55
+ assert_equal(2, vb_list.length)
56
+ assert_equal("1.3.6.1.2.1.2.2.1.23", vb_list.first.name.to_s)
57
57
  end
58
-
58
+
59
59
  def test_varbind
60
- vb = @mib.varbind("1.2.3.4", Null)
61
- assert_equal("1.2.3.4", vb.name.to_s)
62
- assert_equal(Null, vb.value)
63
-
64
- vb = @mib.varbind("IF-MIB::ifTable.3.45", Integer.new(2))
65
- assert_equal("1.3.6.1.2.1.2.2.3.45", vb.name.to_s)
66
- assert_equal(2, vb.value)
60
+ vb = @mib.varbind("1.2.3.4", Null)
61
+ assert_equal("1.2.3.4", vb.name.to_s)
62
+ assert_equal(Null, vb.value)
63
+
64
+ vb = @mib.varbind("IF-MIB::ifTable.3.45", Integer.new(2))
65
+ assert_equal("1.3.6.1.2.1.2.2.3.45", vb.name.to_s)
66
+ assert_equal(2, vb.value)
67
67
  end
68
-
68
+
69
69
  def test_list
70
- list = MIB.list_imported(/SNMPv2/)
71
- assert_equal(4, list.length)
70
+ list = MIB.list_imported(/SNMPv2/)
71
+ assert_equal(4, list.length)
72
72
  end
73
-
73
+
74
74
  # def test_import
75
75
  # module_name = MIB.import_module('SNMPv2-MIB')
76
76
  # assert_equal('SNMPv2-MIB', module_name)
77
77
  # end
78
-
79
- end
78
+
79
+ end
80
80
 
81
81
  end
@@ -3,183 +3,183 @@ require 'test/unit'
3
3
 
4
4
  class TestProtocol < Test::Unit::TestCase
5
5
 
6
- include SNMP
7
-
8
- def test_message_decode_v1
9
- message = SNMP::Message.decode("0'\002\001\000\004\006public\240\032\002\002\003\350\002\001\000\002\001\0000\0160\f\006\010+\006\001\002\001\001\001\000\005\000")
10
- assert_equal(:SNMPv1, message.version)
11
- assert_equal("public", message.community)
12
- assert_equal(SNMP::GetRequest, message.pdu.class)
13
- varbind_list = message.pdu.vb_list;
14
- assert_equal(1, varbind_list.length)
15
- assert_equal([1,3,6,1,2,1,1,1,0], varbind_list.first.name)
16
- assert_equal(SNMP::Null, varbind_list.first.value)
17
- end
6
+ include SNMP
18
7
 
19
- def test_message_decode_v2c
20
- message = SNMP::Message.decode("0)\002\001\001\004\006public\240\034\002\0040\265\020\202\002\001\000\002\001\0000\0160\f\006\010+\006\001\002\001\001\001\000\005\000")
21
- assert_equal(:SNMPv2c, message.version)
22
- assert_equal("public", message.community)
23
- varbind_list = message.pdu.vb_list;
24
- assert_equal(1, varbind_list.length)
25
- assert_equal([1,3,6,1,2,1,1,1,0], varbind_list.first.name)
26
- assert_equal(SNMP::Null, varbind_list.first.value)
27
- end
28
-
29
- def test_message_decoder_v3
30
- assert_raise(SNMP::UnsupportedVersion) do
31
- message = SNMP::Message.decode("0>\002\001\0030\021\002\004&\266\342\314\002\003\000\377\343\004\001\004\002\001\003\004\0200\016\004\000\002\001\000\002\001\000\004\000\004\000\004\0000\024\004\000\004\000\240\016\002\004\v\3623\233\002\001\000\002\001\0000\000")
32
- end
33
- end
34
-
35
- def test_encode_message
36
- varbind = SNMP::VarBind.new([1,3,6,1234], SNMP::OctetString.new("value"))
37
- list = SNMP::VarBindList.new
38
- list << varbind << varbind;
39
- pdu = SNMP::Response.new(12345, list)
40
- message = SNMP::Message.new(:SNMPv2c, "public", pdu)
41
- assert_equal("07\002\001\001\004\006public\242*\002\00209\002\001\000\002\001\0000\0360\r\006\004+\006\211R\004\005value0\r\006\004+\006\211R\004\005value", message.encode)
42
- end
43
-
44
- def test_get_request_from_single_string
45
- request = SNMP::GetRequest.new(42, VarBindList.new(["1.3.6.1"]))
46
- assert_equal(42, request.request_id)
47
- assert_equal(1, request.varbind_list.length)
48
- assert_equal([1,3,6,1], request.varbind_list.first.name)
49
- assert_equal(SNMP::Null, request.varbind_list.first.value)
50
- end
51
-
52
- def test_get_request_from_multi_string
53
- request = SNMP::GetRequest.new(42, VarBindList.new(["1.3.6.1", "1.3.6.2"]))
54
- assert_equal(2, request.varbind_list.length)
55
- assert_equal([1,3,6,1], request.varbind_list.first.name)
56
- end
8
+ def test_message_decode_v1
9
+ message = SNMP::Message.decode("0'\002\001\000\004\006public\240\032\002\002\003\350\002\001\000\002\001\0000\0160\f\006\010+\006\001\002\001\001\001\000\005\000")
10
+ assert_equal(:SNMPv1, message.version)
11
+ assert_equal("public", message.community)
12
+ assert_equal(SNMP::GetRequest, message.pdu.class)
13
+ varbind_list = message.pdu.vb_list;
14
+ assert_equal(1, varbind_list.length)
15
+ assert_equal([1,3,6,1,2,1,1,1,0], varbind_list.first.name)
16
+ assert_equal(SNMP::Null, varbind_list.first.value)
17
+ end
57
18
 
58
- def test_get_request_from_varbind
59
- request = GetRequest.new(42, VarBindList.new(VarBind.new([1,3,6,1], Null)))
60
- assert_equal(1, request.varbind_list.length)
61
- assert_equal([1,3,6,1], request.varbind_list.first.name)
62
- end
63
-
64
- def test_get_next_from_single_string
65
- request = SNMP::GetNextRequest.new(42, VarBindList.new("1.3.5.1"))
66
- assert_equal(42, request.request_id)
67
- assert_equal(1, request.varbind_list.length)
68
- assert_equal([1,3,5,1], request.varbind_list.first.name)
69
- end
19
+ def test_message_decode_v2c
20
+ message = SNMP::Message.decode("0)\002\001\001\004\006public\240\034\002\0040\265\020\202\002\001\000\002\001\0000\0160\f\006\010+\006\001\002\001\001\001\000\005\000")
21
+ assert_equal(:SNMPv2c, message.version)
22
+ assert_equal("public", message.community)
23
+ varbind_list = message.pdu.vb_list;
24
+ assert_equal(1, varbind_list.length)
25
+ assert_equal([1,3,6,1,2,1,1,1,0], varbind_list.first.name)
26
+ assert_equal(SNMP::Null, varbind_list.first.value)
27
+ end
70
28
 
71
- def test_get_next_from_single_object_id
72
- request = SNMP::GetNextRequest.new(42, VarBindList.new([ObjectId.new("1.3.5.1")]))
73
- assert_equal(42, request.request_id)
74
- assert_equal(1, request.varbind_list.length)
75
- assert_equal([1,3,5,1], request.varbind_list.first.name)
76
- end
77
-
78
- def test_each_varbind
79
- request = SNMP::GetRequest.new(42, VarBindList.new(["1.3.6.1", "1.3.6.2"]))
80
- count = 0
81
- request.each_varbind do |v|
82
- case count
83
- when 0
84
- assert_equal(ObjectName.new("1.3.6.1"), v.name)
85
- when 1
86
- assert_equal(ObjectName.new("1.3.6.2"), v.name)
87
- else
88
- fail "Unexpected count"
89
- end
90
- count +=1
91
- end
29
+ def test_message_decoder_v3
30
+ assert_raise(SNMP::UnsupportedVersion) do
31
+ message = SNMP::Message.decode("0>\002\001\0030\021\002\004&\266\342\314\002\003\000\377\343\004\001\004\002\001\003\004\0200\016\004\000\002\001\000\002\001\000\004\000\004\000\004\0000\024\004\000\004\000\240\016\002\004\v\3623\233\002\001\000\002\001\0000\000")
92
32
  end
33
+ end
93
34
 
94
- def test_get_bulk_create
95
- request = SNMP::GetBulkRequest.new(1234, VarBindList.new("1.3.6.2"), 0, 10)
96
- assert_equal(1234, request.request_id)
97
- assert_equal(0, request.non_repeaters)
98
- assert_equal(10, request.max_repetitions)
99
- assert_equal(1, request.varbind_list.length)
100
- assert_equal("1.3.6.2", request.varbind_list.first.name.to_s)
101
- end
35
+ def test_encode_message
36
+ varbind = SNMP::VarBind.new([1,3,6,1234], SNMP::OctetString.new("value"))
37
+ list = SNMP::VarBindList.new
38
+ list << varbind << varbind;
39
+ pdu = SNMP::Response.new(12345, list)
40
+ message = SNMP::Message.new(:SNMPv2c, "public", pdu)
41
+ assert_equal("07\002\001\001\004\006public\242*\002\00209\002\001\000\002\001\0000\0360\r\006\004+\006\211R\004\005value0\r\006\004+\006\211R\004\005value", message.encode)
42
+ end
102
43
 
103
- def test_get_bulk_encode
104
- request = SNMP::GetBulkRequest.new(1234, VarBindList.new, 0, 10)
105
- assert_equal("\245\f\002\002\004\322\002\001\000\002\001\n0\000", request.encode)
106
- end
44
+ def test_get_request_from_single_string
45
+ request = SNMP::GetRequest.new(42, VarBindList.new(["1.3.6.1"]))
46
+ assert_equal(42, request.request_id)
47
+ assert_equal(1, request.varbind_list.length)
48
+ assert_equal([1,3,6,1], request.varbind_list.first.name)
49
+ assert_equal(SNMP::Null, request.varbind_list.first.value)
50
+ end
51
+
52
+ def test_get_request_from_multi_string
53
+ request = SNMP::GetRequest.new(42, VarBindList.new(["1.3.6.1", "1.3.6.2"]))
54
+ assert_equal(2, request.varbind_list.length)
55
+ assert_equal([1,3,6,1], request.varbind_list.first.name)
56
+ end
57
+
58
+ def test_get_request_from_varbind
59
+ request = GetRequest.new(42, VarBindList.new(VarBind.new([1,3,6,1], Null)))
60
+ assert_equal(1, request.varbind_list.length)
61
+ assert_equal([1,3,6,1], request.varbind_list.first.name)
62
+ end
63
+
64
+ def test_get_next_from_single_string
65
+ request = SNMP::GetNextRequest.new(42, VarBindList.new("1.3.5.1"))
66
+ assert_equal(42, request.request_id)
67
+ assert_equal(1, request.varbind_list.length)
68
+ assert_equal([1,3,5,1], request.varbind_list.first.name)
69
+ end
70
+
71
+ def test_get_next_from_single_object_id
72
+ request = SNMP::GetNextRequest.new(42, VarBindList.new([ObjectId.new("1.3.5.1")]))
73
+ assert_equal(42, request.request_id)
74
+ assert_equal(1, request.varbind_list.length)
75
+ assert_equal([1,3,5,1], request.varbind_list.first.name)
76
+ end
77
+
78
+ def test_each_varbind
79
+ request = SNMP::GetRequest.new(42, VarBindList.new(["1.3.6.1", "1.3.6.2"]))
80
+ count = 0
81
+ request.each_varbind do |v|
82
+ case count
83
+ when 0
84
+ assert_equal(ObjectName.new("1.3.6.1"), v.name)
85
+ when 1
86
+ assert_equal(ObjectName.new("1.3.6.2"), v.name)
87
+ else
88
+ fail "Unexpected count"
89
+ end
90
+ count +=1
91
+ end
92
+ end
93
+
94
+ def test_get_bulk_create
95
+ request = SNMP::GetBulkRequest.new(1234, VarBindList.new("1.3.6.2"), 0, 10)
96
+ assert_equal(1234, request.request_id)
97
+ assert_equal(0, request.non_repeaters)
98
+ assert_equal(10, request.max_repetitions)
99
+ assert_equal(1, request.varbind_list.length)
100
+ assert_equal("1.3.6.2", request.varbind_list.first.name.to_s)
101
+ end
102
+
103
+ def test_get_bulk_encode
104
+ request = SNMP::GetBulkRequest.new(1234, VarBindList.new, 0, 10)
105
+ assert_equal("\245\f\002\002\004\322\002\001\000\002\001\n0\000", request.encode)
106
+ end
107
+
108
+ def test_error_status
109
+ request = GetRequest.new(42, VarBindList.new("1.3.12.23.4"))
110
+ assert_equal(:noError, request.error_status)
111
+
112
+ request.error_status = :noCreation
113
+ assert_equal(:noCreation, request.error_status)
114
+
115
+ request.error_status = 2
116
+ assert_equal(:noSuchName, request.error_status)
117
+
118
+ assert_raise(InvalidErrorStatus) {request.error_status = 42}
119
+ end
120
+
121
+ def test_snmpv2_trap
122
+ sys_up_varbind = VarBind.new(ObjectId.new("1.3.6.1.2.1.1.3.0"),
123
+ TimeTicks.new(1234))
124
+ trap_oid_varbind = VarBind.new(ObjectId.new("1.3.6.1.6.3.1.1.4.1.0"),
125
+ ObjectId.new("1.2.3"))
126
+ trap = SNMPv2_Trap.new(42, VarBindList.new([sys_up_varbind, trap_oid_varbind]))
127
+ assert_equal("\247-\002\001*\002\001\000\002\001\0000\"0\016\006\010+\006\001\002\001\001\003\000C\002\004\3220\020\006\n+\006\001\006\003\001\001\004\001\000\006\002*\003", trap.encode)
128
+ assert_equal(1234, trap.sys_up_time.to_i)
129
+ assert_equal("1.2.3", trap.trap_oid.to_s)
130
+ end
131
+
132
+ def test_snmpv2_invalid_trap
133
+ trap = SNMPv2_Trap.new(42, VarBindList.new([]))
134
+ assert_raise(InvalidTrapVarbind) { trap.sys_up_time }
135
+ assert_raise(InvalidTrapVarbind) { trap.trap_oid }
136
+ end
137
+
138
+ def test_snmpv1_generic_trap
139
+ trap = SNMPv1_Trap.new(nil, nil, 0, nil, nil, nil)
140
+ assert_equal(:coldStart, trap.generic_trap)
141
+
142
+ trap.generic_trap = :warmStart
143
+ assert_equal(:warmStart, trap.generic_trap)
144
+
145
+ trap.generic_trap = 6
146
+ assert_equal(:enterpriseSpecific, trap.generic_trap)
147
+
148
+ assert_raise(InvalidGenericTrap) { trap.generic_trap = -1 }
149
+ assert_raise(InvalidGenericTrap) { trap.generic_trap = 7 }
150
+ end
151
+
152
+ def test_snmpv1_trap_encode
153
+ enterprise = ObjectId.new("1.3.6.1.123")
154
+ agent_addr = IpAddress.new("1.2.3.4")
155
+ generic_trap = :linkDown
156
+ specific_trap = 0
157
+ timestamp = TimeTicks.new(2176117721)
158
+ varbinds = VarBindList.new([VarBind.new("1.3.6.2", Integer.new(1))])
159
+ trap = SNMPv1_Trap.new(enterprise, agent_addr, generic_trap, specific_trap, timestamp, varbinds)
160
+ assert_equal("\244%\006\004+\006\001{@\004\001\002\003\004\002\001\002\002\001\000C\005\000\201\264\353\3310\n0\010\006\003+\006\002\002\001\001", trap.encode)
161
+
162
+ encoded = Message.new(:SNMPv1, "public", trap).encode
163
+ trap = Message.decode(encoded).pdu
164
+ assert_equal(enterprise, trap.enterprise)
165
+ assert_equal(agent_addr, trap.agent_addr)
166
+ assert_equal(:linkDown, trap.generic_trap)
167
+ assert_equal(0, trap.specific_trap)
168
+ assert_equal(2176117721, trap.timestamp.to_i)
169
+ assert_equal(1, trap.varbind_list.length)
170
+ assert_equal(ObjectId.new("1.3.6.2"), trap.varbind_list.first.name)
171
+ end
172
+
173
+ def test_response_pdu
174
+ pdu = Response.new(2147483647, VarBindList.new, :noError, 0)
175
+ assert_equal("\242\016\002\004\177\377\377\377\002\001\000\002\001\0000\000", pdu.encode)
176
+
177
+ encoded = Message.new(:SNMPv2c, "public", pdu).encode
178
+ pdu = Message.decode(encoded).pdu
179
+ assert_equal(2147483647, pdu.request_id)
180
+ assert_equal(:noError, pdu.error_status)
181
+ assert_equal(0, pdu.error_index)
182
+ assert_equal(0, pdu.varbind_list.length)
183
+ end
107
184
 
108
- def test_error_status
109
- request = GetRequest.new(42, VarBindList.new("1.3.12.23.4"))
110
- assert_equal(:noError, request.error_status)
111
-
112
- request.error_status = :noCreation
113
- assert_equal(:noCreation, request.error_status)
114
-
115
- request.error_status = 2
116
- assert_equal(:noSuchName, request.error_status)
117
-
118
- assert_raise(InvalidErrorStatus) {request.error_status = 42}
119
- end
120
-
121
- def test_snmpv2_trap
122
- sys_up_varbind = VarBind.new(ObjectId.new("1.3.6.1.2.1.1.3.0"),
123
- TimeTicks.new(1234))
124
- trap_oid_varbind = VarBind.new(ObjectId.new("1.3.6.1.6.3.1.1.4.1.0"),
125
- ObjectId.new("1.2.3"))
126
- trap = SNMPv2_Trap.new(42, VarBindList.new([sys_up_varbind, trap_oid_varbind]))
127
- assert_equal("\247-\002\001*\002\001\000\002\001\0000\"0\016\006\010+\006\001\002\001\001\003\000C\002\004\3220\020\006\n+\006\001\006\003\001\001\004\001\000\006\002*\003", trap.encode)
128
- assert_equal(1234, trap.sys_up_time.to_i)
129
- assert_equal("1.2.3", trap.trap_oid.to_s)
130
- end
131
-
132
- def test_snmpv2_invalid_trap
133
- trap = SNMPv2_Trap.new(42, VarBindList.new([]))
134
- assert_raise(InvalidTrapVarbind) { trap.sys_up_time }
135
- assert_raise(InvalidTrapVarbind) { trap.trap_oid }
136
- end
137
-
138
- def test_snmpv1_generic_trap
139
- trap = SNMPv1_Trap.new(nil, nil, 0, nil, nil, nil)
140
- assert_equal(:coldStart, trap.generic_trap)
141
-
142
- trap.generic_trap = :warmStart
143
- assert_equal(:warmStart, trap.generic_trap)
144
-
145
- trap.generic_trap = 6
146
- assert_equal(:enterpriseSpecific, trap.generic_trap)
147
-
148
- assert_raise(InvalidGenericTrap) { trap.generic_trap = -1 }
149
- assert_raise(InvalidGenericTrap) { trap.generic_trap = 7 }
150
- end
151
-
152
- def test_snmpv1_trap_encode
153
- enterprise = ObjectId.new("1.3.6.1.123")
154
- agent_addr = IpAddress.new("1.2.3.4")
155
- generic_trap = :linkDown
156
- specific_trap = 0
157
- timestamp = TimeTicks.new(2176117721)
158
- varbinds = VarBindList.new([VarBind.new("1.3.6.2", Integer.new(1))])
159
- trap = SNMPv1_Trap.new(enterprise, agent_addr, generic_trap, specific_trap, timestamp, varbinds)
160
- assert_equal("\244%\006\004+\006\001{@\004\001\002\003\004\002\001\002\002\001\000C\005\000\201\264\353\3310\n0\010\006\003+\006\002\002\001\001", trap.encode)
161
-
162
- encoded = Message.new(:SNMPv1, "public", trap).encode
163
- trap = Message.decode(encoded).pdu
164
- assert_equal(enterprise, trap.enterprise)
165
- assert_equal(agent_addr, trap.agent_addr)
166
- assert_equal(:linkDown, trap.generic_trap)
167
- assert_equal(0, trap.specific_trap)
168
- assert_equal(2176117721, trap.timestamp.to_i)
169
- assert_equal(1, trap.varbind_list.length)
170
- assert_equal(ObjectId.new("1.3.6.2"), trap.varbind_list.first.name)
171
- end
172
-
173
- def test_response_pdu
174
- pdu = Response.new(2147483647, VarBindList.new, :noError, 0)
175
- assert_equal("\242\016\002\004\177\377\377\377\002\001\000\002\001\0000\000", pdu.encode)
176
-
177
- encoded = Message.new(:SNMPv2c, "public", pdu).encode
178
- pdu = Message.decode(encoded).pdu
179
- assert_equal(2147483647, pdu.request_id)
180
- assert_equal(:noError, pdu.error_status)
181
- assert_equal(0, pdu.error_index)
182
- assert_equal(0, pdu.varbind_list.length)
183
- end
184
-
185
185
  end