Shortcuts to protocol implementation modules

Alpha API provides shortcuts to SNMP protocol modules by implementing a simple wrapper module over each set of protocol version-specific modules. These wrapper modules are availble through alpha.protoVersions dictionary interface. Each wrapper module simply imports all symbols from corresponding set of SNMP protocol modules (such as rfc1155&rfc1157 for SNMP v1) into its own namespace and also implements the following constants:

pduTypes

A dictionary of SNMP PDU classes indexed by SNMP PDU type IDs. This may be used for referring to SNMP PDU implementation class by SNMP PDU type ID and SNMP protocol version ID. For example:

>>> from pysnmp.proto.api.alpha import protoVersions, protoVersionId1, protoVersionId2c, trapPduType
>>> for protoVersionId in [ protoVersionId1, protoVersionId2c ]:
...     print protoVersions[protoVersionId].pduTypes[trapPduType]
pysnmp.proto.rfc1157.TrapPdu
pysnmp.proto.rfc1905.SnmpV2TrapPdu
>>>


ilya@glas.net