Listen for SNMP traps. Timeout after default or user specified timeout set in new method and return '0'. If trap is received before timeout, return is defined. Return is not defined if error encountered.

Process a received SNMP trap. Decodes the received (get_trap()) PDU. Varbinds are extracted and decoded. If PDU is SNMPv2 InformRequest, the Response PDU is generated and sent to IP address and UDP port found in the original datagram header (get_trap() methods remoteaddr() and remoteport()).

Called with one argument, interpreted as the datagram to process. Valid options are:

Return varbinds from a received and processed (process_trap()) SNMP trap. This returns a pointer to an array containing a hash as each array element. The key/value pairs of each hash are the OID/value pairs for each varbind in the received trap.

This does not use any of the Net::SNMPTrapd ASN.1 structures; rather, it uses the Convert::ASN1 module debug routines (asn_dump and asn_hexdump) to attempt a decode and hex dump of the supplied datagram. This is helpful to eliminate the entire Net::SNMPTrapd module code when troubleshooting issues with decoding and focus solely on the ASN.1 decode of the given datagram.

Called as a method, operates on the value returned from the datagram() method. Called as a subroutine, operates on the value passed.

Output is printed directly to STDERR. Return is defined unless there is an error encountered in getting the datagram to operate on.