diff options
author | Ilya Etingof <etingof@gmail.com> | 2018-10-24 10:14:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-24 10:14:33 +0200 |
commit | 0c0d054e8e949cf7645fd3fe26640ee52893f18a (patch) | |
tree | c6d3d59e10f8bb8b1b6fb0f2e2c712550837d812 /examples | |
parent | 534a5bb8108013c59706c4fb6d195aa332af5e13 (diff) | |
download | pysnmp-git-0c0d054e8e949cf7645fd3fe26640ee52893f18a.tar.gz |
Refactor MIB state machine into asynchronous operations (#210)
Convert to async MIB instrumentation API (#210)
MIB instrumentation API changed to allow for asynchronous
managed objects access. The MIB instrumentation methods
called by the state machine now return immediately and
resume once the callback is called.
The built-in SNMPv2-SMI objects are still synchronous.
This change is a prerequisite for fully asynchronous managed objects
implementation.
Diffstat (limited to 'examples')
5 files changed, 5 insertions, 5 deletions
diff --git a/examples/v3arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects.py b/examples/v3arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects.py index 878f97a9..783c1e6c 100644 --- a/examples/v3arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects.py +++ b/examples/v3arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects.py @@ -56,7 +56,7 @@ MibScalar, MibScalarInstance = mibBuilder.importSymbols( class MyStaticMibScalarInstance(MibScalarInstance): # noinspection PyUnusedLocal,PyUnusedLocal - def getValue(self, name, idx): + def getValue(self, name, idx, **context): return self.getSyntax().clone( 'Python %s running on a %s platform' % (sys.version, sys.platform) ) diff --git a/examples/v3arch/asyncore/proxy/command/ipv6-to-ipv4-conversion.py b/examples/v3arch/asyncore/proxy/command/ipv6-to-ipv4-conversion.py index 9e34fd0d..df712179 100644 --- a/examples/v3arch/asyncore/proxy/command/ipv6-to-ipv4-conversion.py +++ b/examples/v3arch/asyncore/proxy/command/ipv6-to-ipv4-conversion.py @@ -96,7 +96,7 @@ class CommandResponder(cmdrsp.CommandResponderBase): v2c.GetNextRequestPDU.tagSet: cmdgen.NextCommandGeneratorSingleRun(), v2c.GetBulkRequestPDU.tagSet: cmdgen.BulkCommandGeneratorSingleRun() } - pduTypes = cmdGenMap.keys() # This app will handle these PDUs + SUPPORTED_PDU_TYPES = cmdGenMap.keys() # This app will handle these PDUs # SNMP request relay def handleMgmtOperation(self, snmpEngine, stateReference, contextName, diff --git a/examples/v3arch/asyncore/proxy/command/v2c-to-v1-conversion.py b/examples/v3arch/asyncore/proxy/command/v2c-to-v1-conversion.py index 3dd64ddf..c676e9b5 100644 --- a/examples/v3arch/asyncore/proxy/command/v2c-to-v1-conversion.py +++ b/examples/v3arch/asyncore/proxy/command/v2c-to-v1-conversion.py @@ -95,7 +95,7 @@ class CommandResponder(cmdrsp.CommandResponderBase): v2c.GetNextRequestPDU.tagSet: cmdgen.NextCommandGeneratorSingleRun(), v2c.GetBulkRequestPDU.tagSet: cmdgen.BulkCommandGeneratorSingleRun() } - pduTypes = cmdGenMap.keys() # This app will handle these PDUs + SUPPORTED_PDU_TYPES = cmdGenMap.keys() # This app will handle these PDUs # SNMP request relay def handleMgmtOperation(self, snmpEngine, stateReference, contextName, diff --git a/examples/v3arch/asyncore/proxy/command/v2c-to-v3-conversion.py b/examples/v3arch/asyncore/proxy/command/v2c-to-v3-conversion.py index f5d6167e..83d4c453 100644 --- a/examples/v3arch/asyncore/proxy/command/v2c-to-v3-conversion.py +++ b/examples/v3arch/asyncore/proxy/command/v2c-to-v3-conversion.py @@ -95,7 +95,7 @@ class CommandResponder(cmdrsp.CommandResponderBase): v2c.GetNextRequestPDU.tagSet: cmdgen.NextCommandGeneratorSingleRun(), v2c.GetBulkRequestPDU.tagSet: cmdgen.BulkCommandGeneratorSingleRun() } - pduTypes = cmdGenMap.keys() # This app will handle these PDUs + SUPPORTED_PDU_TYPES = cmdGenMap.keys() # This app will handle these PDUs # SNMP request relay def handleMgmtOperation(self, snmpEngine, stateReference, contextName, diff --git a/examples/v3arch/asyncore/proxy/command/v3-to-v2c-conversion.py b/examples/v3arch/asyncore/proxy/command/v3-to-v2c-conversion.py index b5d64790..e0c1c4d6 100644 --- a/examples/v3arch/asyncore/proxy/command/v3-to-v2c-conversion.py +++ b/examples/v3arch/asyncore/proxy/command/v3-to-v2c-conversion.py @@ -98,7 +98,7 @@ class CommandResponder(cmdrsp.CommandResponderBase): v2c.GetNextRequestPDU.tagSet: cmdgen.NextCommandGeneratorSingleRun(), v2c.GetBulkRequestPDU.tagSet: cmdgen.BulkCommandGeneratorSingleRun() } - pduTypes = cmdGenMap.keys() # This app will handle these PDUs + SUPPORTED_PDU_TYPES = cmdGenMap.keys() # This app will handle these PDUs # SNMP request relay def handleMgmtOperation(self, snmpEngine, stateReference, contextName, |