summaryrefslogtreecommitdiff
path: root/pysnmp/proto
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2018-06-30 20:14:57 +0200
committerGitHub <noreply@github.com>2018-06-30 20:14:57 +0200
commitda4539e34cacdc0bd6ecfba98dc48caecc12b104 (patch)
tree22fdd82dae7dc971a8998d7679d9d6698105116c /pysnmp/proto
parentdf6d6a6efd7ec6810feb9edddf369264512612b2 (diff)
downloadpysnmp-git-da4539e34cacdc0bd6ecfba98dc48caecc12b104.tar.gz
Overhaul SMI/MIB instrumentation API (#161)
Overhaul SMI/MIB instrumentation API SMI/MIB managed objects API overhauled for simplicity and flexibility breaking backward compatibility. This change would allow way more control over custom MIB managed objects and also is the prerequisite for asynchronous MIB instrumentation.
Diffstat (limited to 'pysnmp/proto')
-rw-r--r--pysnmp/proto/secmod/rfc3414/service.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pysnmp/proto/secmod/rfc3414/service.py b/pysnmp/proto/secmod/rfc3414/service.py
index b7760e4b..f3324961 100644
--- a/pysnmp/proto/secmod/rfc3414/service.py
+++ b/pysnmp/proto/secmod/rfc3414/service.py
@@ -138,8 +138,9 @@ class SnmpUSMSecurityModel(AbstractSecurityModel):
pysnmpUsmKeyAuthLocalized, usmUserPrivProtocol,
pysnmpUsmKeyPrivLocalized)
- def __cloneUserInfo(self, mibInstrumController, securityEngineID,
- userName):
+ def __cloneUserInfo(self, snmpEngine, securityEngineID, userName):
+ mibInstrumController = snmpEngine.msgAndPduDsp.mibInstrumController
+
snmpEngineID, = mibInstrumController.mibBuilder.importSymbols(
'__SNMP-FRAMEWORK-MIB', 'snmpEngineID'
)
@@ -169,7 +170,7 @@ class SnmpUSMSecurityModel(AbstractSecurityModel):
# New row
mibInstrumController.writeVars(
- ((usmUserEntry.name + (13,) + tblIdx2, 4),)
+ (usmUserEntry.name + (13,) + tblIdx2, 4), **dict(snmpEngine=snmpEngine)
)
# Set user&securityNames
@@ -273,7 +274,7 @@ class SnmpUSMSecurityModel(AbstractSecurityModel):
usmUserAuthProtocol, usmUserAuthKeyLocalized,
usmUserPrivProtocol,
usmUserPrivKeyLocalized) = self.__cloneUserInfo(
- snmpEngine.msgAndPduDsp.mibInstrumController,
+ snmpEngine,
securityEngineID,
self.__sec2usr(snmpEngine, securityName)
)