PySNMP: Protocol: RFC 1905

### Protocol Operations for Version 2 of the Simple Network Management Protocol (RFC 1905)

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

class Version([value])

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

  - Single value constraint set to 1 (for v.2c

  The default value for Version object is 1.

class Community([value])

  Instances of this class represent SNMP message community name object. This is a subclass of rfc1902.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 rfc1902.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 rfc1902.Integer class, with additional methods (see below) and the following deviations from the base class:

  - Value range constraint set to (0, 18)

  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 rfc1902.Integer class, with the following deviations from the base class:

  - Value range constraint set to (0, max_bindings)

  The default value for ErrorIndex object is 0.

class NoSuchObject([value])

  Instances of this class represent SNMP PDU noSuchObject error. This is a subclass of rfc1902.Null class, with the following deviations from the base class:

  - ASN.1 tag class set to 'CONTEXT'
  - ASN.1 tag ID set to 0x00

class NoSuchInstance([value])

  Instances of this class represent SNMP PDU noSuchInstance error. This is a subclass of rfc1902.Null class, with the following deviations from the base class:

  - ASN.1 tag class set to 'CONTEXT'
  - ASN.1 tag ID set to 0x01

class EndOfMibView([value])

  Instances of this class represent SNMP PDU endOfMibView error. This is a subclass of rfc1902.Null class, with the following deviations from the base class:

  - ASN.1 tag class set to 'CONTEXT'
  - ASN.1 tag ID set to 0x02

class BindValue([**kwargs])

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

  - Embedded components names are fixed to 'value', 'unspecified', 'noSuchObject', 'noSuchInstance', 'endOfMibView' and types to rfc1902.ObjectSyntax, rfc1902.Null, NoSuchObject, NoSuchInstance, EndOfMibView objects respectively.
  - Initial value is set to rfc1902.Null component

class VarBind([**kwargs])

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

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

class VarBindList([args])

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

  - The embedded component type is set to VarBind.
  - Size constraint is set to (0, max_bindings)

class GetRequestPdu([**kwargs])

  Instances of this class represent SNMP Get request PDU object. This is a subclass of rfc1902.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 rfc1902.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 InformRequestPdu([**kwargs])

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

class SnmpV2TrapPdu([**kwargs])

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

class ReportPdu([**kwargs])

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

class ResponsePdu([**kwargs])

  Instances of this class represent SNMP 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 rfc1902.Choice class, with the following deviations from the base class:

  - Embedded component name is restricted to either of 'get_request', 'get_next_request', 'get_bulk_request', 'response', 'set_request', 'inform_request', 'snmpV2_trap', 'report' and type restricted to either of GetRequestPdu, GetNextRequestPdu, GetBulkRequestPdu, ResponsePdu, SetRequestPdu, InformRequestPdu, SnmpV2TrapPdu, ReportPdu objects respectively.

class Message([**kwargs])

  Instances of this class represent SNMP message object. This is a subclass of rfc1902.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 GetBulk request-specific items

class NonRepeaters([value])

  Instances of this class represent SNMP PDU non-repeaters object. This is a subclass of rfc1902.Integer class, with the following deviations from the base class:

  - Value range constraint set to (0, max_bindings)

class MaxRepetitions([value])

  Instances of this class represent SNMP PDU max-repetitions object. This is a subclass of rfc1902.Integer class, with the following deviations from the base class:

  - Value range constraint set to (0, max_bindings)

class GetBulkRequestPdu([**kwargs])

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

  - Embedded components names are fixed to 'request_id', 'non_repeaters', 'max_repetitions', 'variable_bindings' and types to RequestId, NonRepeaters, MaxRepetitions, VarBindList objects respectively.
  - The GetRequestPdu ASN.1 type is defined by IMPLICIT tagging the rfc1902.Sequence type.

The rfc1905 module defines the following public variable:

max_bindings

  This constant is defined by RFC 1905 and represents the maximum number of variable-bindings (VarBind) allowed in variables-bindings list (VarBindList).

Subsections

- Additional methods of ErrorStatus objects