PySNMP: Protocol: RFC 1157

### Structure and Identification of Management Information for TCP/IP-based Internets (RFC 1157)

The pysnmp.proto.rfc1157 module implements data structures and operations on them as defined by the RFC 1157.

class Version([value])

  Instances of this class represent SNMP message version object. This is a subclass of rfc1155.Integer class, with the following deviations from the base class:

  - Single value constraint set to 0 (for v.1)

  The default value for Version object is 0.

class Community([value])

  Instances of this class represent SNMP message community name object. This is a subclass of rfc1155.OctetString.

  The default value for Community object is "public".

class RequestId([value])

  Instances of this class represent SNMP PDU request ID object. This is a subclass of rfc1155.Integer class, with the following deviations from the base class:

  - The initial value is initialized to a auto-incrementing value on every class instaniation.

class ErrorStatus([value])

  Instances of this class represent SNMP PDU error status object. This is a subclass of rfc1155.Integer class, with additional methods (see below) and the following deviations from the base class:

  - Value range constraint set to (0, 5)

  The default value for ErrorStatus object is 0.

class ErrorIndex([value])

  Instances of this class represent SNMP PDU error index object. This is a subclass of rfc1155.Integer class.

  The default value for ErrorIndex object is 0.

class VarBind([**kwargs])

  Instances of this class represent SNMP PDU variable binding object. This is a subclass of rfc1155.Sequence class, with the following deviations from the base class:

  - Embedded components names are fixed to 'name', 'value' and types to rfc1155.ObjectName, rfc1155.ObjectSyntax objects respectively.

class VarBindList([args])

  Instances of this class represent SNMP PDU variable bindings object. This is a subclass of rfc1155.SequenceOf class, with the following deviations from the base class:

  - The embedded component type is set to VarBind.

class GetRequestPdu([**kwargs])

  Instances of this class represent SNMP Get request PDU object. This is a subclass of rfc1155.Sequence class, with the following deviations from the base class:

  - Embedded components names are fixed to 'request_id', 'error_status', 'error_index', 'variable_bindings' and types to RequestId, ErrorStatus, ErrorIndex, VarBindList objects respectively.
  - The GetRequestPdu ASN.1 type is defined by IMPLICIT tagging the rfc1155.Sequence type.

class GetNextRequestPdu([**kwargs])

  Instances of this class represent SNMP GetNext request PDU object. This class only differs from the GetRequestPdu class by its ASN.1 tag.

class SetRequestPdu([**kwargs])

  Instances of this class represent SNMP Set request PDU object. This class only differs from the GetRequestPdu class by its ASN.1 tag.

class GetResponsePdu([**kwargs])

  Instances of this class represent SNMP Get response PDU object. This class only differs from the GetRequestPdu class by its ASN.1 tag.

class Pdus([**kwargs])

  Instances of this class represent a variety of allowed SNMP PDU types. This is a subclass of rfc1155.Choice class, with the following deviations from the base class:

  - Embedded component name is restricted to either of 'get_request', 'get_next_request', 'get_response', 'set_request', 'trap' and type restricted to either of GetRequestPdu, GetNextRequestPdu, GetResponsePdu, SetRequestPdu, TrapPdu objects respectively.

class Message([**kwargs])

  Instances of this class represent SNMP message object. This is a subclass of rfc1155.Sequence class, with the following deviations from the base class:

  - Embedded components names are fixed to 'version', 'community', 'pdu' and types to Version, Community, Pdus objects respectively.

The following classes implement SNMP Trap-specific items

class Enterprise([value])

  Instances of this class represent SNMP Trap PDU enterprise Object ID object. This is a subclass of rfc1155.ObjectIdentifier class.

  The default value for Enterprise object is '1.3.6.1.1.2.3.4.1'.

class AgentAddr([value])

  Instances of this class represent SNMP Trap PDU agent address object. This is a subclass of rfc1155.NetworkAddress class.

class GenericTrap([value])

  Instances of this class represent SNMP Trap PDU generic trap object. This is a subclass of rfc1155.Integer class, with additional methods (see below) and the following deviations from the base class:

  - Value range constraint set to (0, 6)

  The default value for GenericTrap object is 0.

class SpecificTrap([value])

  Instances of this class represent SNMP Trap PDU specific trap object. This is a subclass of rfc1155.Integer class.

  The default value for SpecificTrap object is 0.

class TimeStamp([value])

  Instances of this class represent SNMP Trap PDU time stamp object. This is a subclass of rfc1155.TimeTicks class.

  The default value for TimeStamp object is time.time()*100.

class TrapPdu([**kwargs])

  Instances of this class represent SNMP Trap PDU object. This is a subclass of rfc1155.Sequence class, with the following deviations from the base class:

  - Embedded components names are fixed to 'enterprise', 'agent_addr', 'generic_trap', 'specific_trap', 'time_stamp', 'variable_bindings' and types to Enterprise, AgentAddr, GenericTrap, SpecificTrap, TimeStamp, VarBindList objects respectively.
  - The TrapPdu ASN.1 type is defined by IMPLICIT tagging the rfc1155.Sequence type.

Subsections

- Additional methods of ErrorStatus objects
- Additional methods of GenericTrap objects