diff options
author | Ilya Etingof <etingof@gmail.com> | 2018-12-29 12:48:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-29 12:48:29 +0100 |
commit | d7534580837445553d8ffdc86fd5a161b9d57af1 (patch) | |
tree | 9f0223047bd118f00baefdaaea448d1e87890c0c /pysnmp/proto/secmod | |
parent | 6dd1d0bceb8a0d9bce603f2095a7971374e81f6f (diff) | |
download | pysnmp-git-d7534580837445553d8ffdc86fd5a161b9d57af1.tar.gz |
Redesigned SMI objects management model (#214)
The primary motivation behind this redesign is to allow asynchronous
operations between SNMP responder and the data source feeding its
MIB.
This is achieved by redesigning all `read*`, `write*`, `create*` and
`destroy*` methods of the `SNMPv2-SMI` MIB objects to return
immediately and deliver their results via a call back.
This modification brings significant and backward incompatible
changes to the low-level MIB operations.
The pysnmp MIB modules compiled for older pysnmp remain compatible.
Diffstat (limited to 'pysnmp/proto/secmod')
-rw-r--r-- | pysnmp/proto/secmod/rfc3414/service.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pysnmp/proto/secmod/rfc3414/service.py b/pysnmp/proto/secmod/rfc3414/service.py index f3324961..ad14dd63 100644 --- a/pysnmp/proto/secmod/rfc3414/service.py +++ b/pysnmp/proto/secmod/rfc3414/service.py @@ -168,9 +168,9 @@ class SnmpUSMSecurityModel(AbstractSecurityModel): tblIdx2 = usmUserEntry.getInstIdFromIndices(securityEngineID, userName) - # New row - mibInstrumController.writeVars( - (usmUserEntry.name + (13,) + tblIdx2, 4), **dict(snmpEngine=snmpEngine) + # New inactive row + mibInstrumController.writeMibObjects( + (usmUserEntry.name + (13,) + tblIdx2, 5), **dict(snmpEngine=snmpEngine) ) # Set user&securityNames @@ -184,6 +184,11 @@ class SnmpUSMSecurityModel(AbstractSecurityModel): usmUserEntry.getNode(usmUserEntry.name + (5,) + tblIdx2).syntax = usmUserAuthProtocol.syntax usmUserEntry.getNode(usmUserEntry.name + (8,) + tblIdx2).syntax = usmUserPrivProtocol.syntax + # Activate row + mibInstrumController.writeMibObjects( + (usmUserEntry.name + (13,) + tblIdx2, 1), **dict(snmpEngine=snmpEngine) + ) + # Localize and set keys pysnmpUsmKeyEntry, = mibInstrumController.mibBuilder.importSymbols( 'PYSNMP-USM-MIB', 'pysnmpUsmKeyEntry' |