diff options
author | elie <elie> | 2015-09-16 20:10:22 +0000 |
---|---|---|
committer | elie <elie> | 2015-09-16 20:10:22 +0000 |
commit | b1d6493e6bba7ea09d5ca0101d57f59f8c689c89 (patch) | |
tree | 3b2ebedb7b437f5a0e96ad466764b798088061a8 /pysnmp/entity | |
parent | 8091501c2469af437b583962d4fe6bfd9b96d605 (diff) | |
download | pysnmp-git-b1d6493e6bba7ea09d5ca0101d57f59f8c689c89.tar.gz |
Sphinxed
Diffstat (limited to 'pysnmp/entity')
-rw-r--r-- | pysnmp/entity/engine.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/pysnmp/entity/engine.py b/pysnmp/entity/engine.py index d663d915..a15194de 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( |