summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2015-09-16 20:10:22 +0000
committerelie <elie>2015-09-16 20:10:22 +0000
commit7abf7cbafefce5483a507f90ee85cc6730373f07 (patch)
tree4d259d268a6175b98a1ba67f9e1e31d425abc018
parent52fe51a7559ff468fda947156be2fa6c76dd1b7b (diff)
downloadpysnmp-7abf7cbafefce5483a507f90ee85cc6730373f07.tar.gz
Sphinxed
-rw-r--r--pysnmp/entity/engine.py32
1 files changed, 32 insertions, 0 deletions
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(