Class: SNMP::SNMPv2_Trap

Class | SNMP::SNMPv2_Trap
In: | lib/snmp/pdu.rb
Parent: | PDU

The PDU class for traps in SNMPv2c. Methods are provided for retrieving the values of the mandatory varbinds: the system uptime and the OID of the trap. The complete varbind list is available through the usual varbind_list method. The first two varbinds in this list will always be the uptime and trap OID varbinds.

### Methods

encode sys_up_time trap_oid

### Attributes

source_ip | [RW] | Returns the source IP address for the trap, usually derived from the source IP address of the packet that delivered the trap.

### Public Instance methods

encode()
sys_up_time()

Returns the value of the mandatory sysUpTime varbind for this trap.

Throws InvalidTrapVarbind if the sysUpTime varbind is not present.

trap_oid()

Returns the value of the mandatory snmpTrapOID varbind for this trap.

Throws InvalidTrapVarbind if the snmpTrapOID varbind is not present.

[Validate]