From 7abf7cbafefce5483a507f90ee85cc6730373f07 Mon Sep 17 00:00:00 2001 From: elie Date: Wed, 16 Sep 2015 20:10:22 +0000 Subject: Sphinxed --- pysnmp/entity/engine.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pysnmp/entity/engine.py b/pysnmp/entity/engine.py index d663d91..a15194d 100644 --- a/pysnmp/entity/engine.py +++ b/pysnmp/entity/engine.py @@ -15,6 +15,34 @@ from pysnmp import debug from pysnmp import error class SnmpEngine: + """Creates SNMP engine object. + + SNMP engine object is central in SNMP v3 architecture. It is an umbrella + object that coordinates interactions between all parts of SNMP v3 system. + See :RFC:`3412#section-2.1` (where it is termed *The Dispatcher*). + + With PySNMP design, `SnmpEngine` is the only stateful object, all SNMP + v3 operations require an instance of SNMP engine. + + It is possible to run multiple instances of `SnmpEngine` in the + application. In a multithreaded environment, each thread that + works with SNMP must have its own `SnmpEngine` instance. + + Parameters + ---------- + snmpEngineID : :py:class:`~pysnmp.proto.rfc1902.OctetString` + Unique and unambiguous identifier of an SNMP engine. + If not given, `snmpEngineID` is autogenerated and stored on + the filesystem. See :RFC:`3411#section-3.1.1` for details. + + Examples + -------- + >>> from pysnmp.entity.engine import SnmpEngine + >>> SnmpEngine() + SnmpEngine(snmpEngineID=OctetString(hexValue='0x80004fb80567726f6d6d69742')) + >>> + + """ def __init__(self, snmpEngineID=None, maxMessageSize=65507, msgAndPduDsp=None): self.cache = {} @@ -97,6 +125,10 @@ class SnmpEngine: else: debug.logger & debug.flagApp and debug.logger('SnmpEngine: stored SNMP Engine Boots: %s' % snmpEngineBoots.syntax.prettyPrint()) + def __repr__(self): + return '%s(snmpEngineID=%r)' % \ + (self.__class__.__name__, self.snmpEngineID) + # Transport dispatcher bindings def __receiveMessageCbFun( -- cgit v1.2.1