Class: PacketGen::Header::SNMP
- Defined in:
- lib/packetgen/header/snmp.rb
Overview
Simple Network Management Protocol (SNMP)
Defined Under Namespace
Classes: Bulk, GetNextRequest, GetRequest, GetResponse, InformRequest, PDUs, Report, SetRequest, Trapv1, Trapv2, VarBind, VariableBindings
Constant Summary collapse
- UDP_PORT1 =
Agents listen to this port
161- UDP_PORT2 =
Configuration sinks listen to this port
162- PDU_GET =
0- PDU_NEXT =
1- PDU_RESPONSE =
2- PDU_SET =
3- PDU_TRAPv1 =
4- PDU_BULK =
5- PDU_INFORM =
6- PDU_TRAPv2 =
7- PDU_REPORT =
8- ERRORS =
{ 'no_error' => 0, 'too_big' => 1, 'no_such_name' => 2, 'bad_value' => 3, 'read_only' => 4, 'generic_error' => 5, 'no_access' => 6, 'wrong_type' => 7, 'wrong_length' => 8, 'wrong_encoding' => 9, 'wrong_value' => 10, 'no_creation' => 11, 'inconsistent_value' => 12, 'ressource_unavailable' => 13, 'commit_failed' => 14, 'undo_failed' => 15, 'authorization_error' => 16, 'not_writable' => 17, 'inconsistent_name' => 18 }
Instance Attribute Summary
Attributes inherited from ASN1Base
Instance Method Summary collapse
-
#data ⇒ GetRequest
accessor to data payload.
- #inspect ⇒ Object
Methods inherited from ASN1Base
define_attributes, #method_name, #parse?, protocol_name, #protocol_name, #read
Instance Method Details
#data ⇒ GetRequest
accessor to data payload
262 263 264 |
# File 'lib/packetgen/header/snmp.rb', line 262 def data @elements[:data] end |
#inspect ⇒ Object
266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/packetgen/header/snmp.rb', line 266 def inspect str = super str << Inspect.shift_level(2) if self[:data].chosen.nil? str << Inspect::FMT_ATTR % [self[:data].type, :data, ''] else data = self[:data] str << Inspect::FMT_ATTR % [data.type, :data, data.chosen_value.type] str << data.chosen_value.inspect end end |