diff options
author | elie <elie> | 2014-04-04 15:09:40 +0000 |
---|---|---|
committer | elie <elie> | 2014-04-04 15:09:40 +0000 |
commit | 451dd2c4e8b9f405f86fbce32f2744158efbcdcc (patch) | |
tree | 2a45bd09fe7ec5e2955fe92bee8ebf4bbebc191d /pysnmp/entity | |
parent | 5e3db0c4c2a6c1230b7fde5816da7fb52b22498a (diff) | |
download | pysnmp-git-451dd2c4e8b9f405f86fbce32f2744158efbcdcc.tar.gz |
_sendRspPdu() method introduced to tap onto PDU processing
this is likely to be reworked
Diffstat (limited to 'pysnmp/entity')
-rw-r--r-- | pysnmp/entity/rfc3413/cmdrsp.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/pysnmp/entity/rfc3413/cmdrsp.py b/pysnmp/entity/rfc3413/cmdrsp.py index f0f3fbd6..0caa1f8e 100644 --- a/pysnmp/entity/rfc3413/cmdrsp.py +++ b/pysnmp/entity/rfc3413/cmdrsp.py @@ -26,9 +26,9 @@ class CommandResponderBase: self.snmpContext.contextEngineId, self.pduTypes ) self.snmpContext = self.__pendingReqs = None - + def sendRsp(self, snmpEngine, stateReference, - errorStatus, errorIndex, varBinds): + errorStatus, errorIndex, varBinds): ( messageProcessingModel, securityModel, securityName, @@ -41,12 +41,27 @@ class CommandResponderBase: maxSizeResponseScopedPDU, statusInformation ) = self.__pendingReqs[stateReference] - debug.logger & debug.flagApp and debug.logger('sendRsp: stateReference %s, errorStatus %s, errorIndex %s, varBinds %s' % (stateReference, errorStatus, errorIndex, varBinds)) - v2c.apiPDU.setErrorStatus(PDU, errorStatus) v2c.apiPDU.setErrorIndex(PDU, errorIndex) v2c.apiPDU.setVarBinds(PDU, varBinds) + debug.logger & debug.flagApp and debug.logger('sendRsp: stateReference %s, errorStatus %s, errorIndex %s, varBinds %s' % (stateReference, errorStatus, errorIndex, varBinds)) + + self._sendRspPdu(snmpEngine, stateReference, PDU) + + def _sendRspPdu(self, snmpEngine, stateReference, PDU): + ( messageProcessingModel, + securityModel, + securityName, + securityLevel, + contextEngineId, + contextName, + pduVersion, + _, + origPdu, + maxSizeResponseScopedPDU, + statusInformation ) = self.__pendingReqs[stateReference] + # Agent-side API complies with SMIv2 if messageProcessingModel == 0: PDU = rfc2576.v2ToV1(PDU, origPdu) |