summaryrefslogtreecommitdiff
path: root/pysnmp/proto/mpmod
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2017-02-14 10:42:22 +0100
committerIlya Etingof <etingof@gmail.com>2017-02-14 10:42:22 +0100
commit8eb880295475a1a48fcf660b4c21d46b8cf25043 (patch)
tree23acd96cc89f12682b0bbf1bf7234eac0e71ed14 /pysnmp/proto/mpmod
parent3d26f4e8fd6c799f3c537f31f4a6a75b7e78c1e4 (diff)
downloadpysnmp-git-8eb880295475a1a48fcf660b4c21d46b8cf25043.tar.gz
required pyasn1 version is now 0.2.3
added matchTags, matchConstraints flags to .setComponentBy() call
Diffstat (limited to 'pysnmp/proto/mpmod')
-rw-r--r--pysnmp/proto/mpmod/rfc2576.py4
-rw-r--r--pysnmp/proto/mpmod/rfc3412.py31
2 files changed, 18 insertions, 17 deletions
diff --git a/pysnmp/proto/mpmod/rfc2576.py b/pysnmp/proto/mpmod/rfc2576.py
index 7211e5a5..668eade2 100644
--- a/pysnmp/proto/mpmod/rfc2576.py
+++ b/pysnmp/proto/mpmod/rfc2576.py
@@ -63,7 +63,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
msg.setComponentByPosition(0, self.messageProcessingModelID)
msg.setComponentByPosition(2)
msg.getComponentByPosition(2).setComponentByType(
- pdu.tagSet, pdu, verifyConstraints=False
+ pdu.tagSet, pdu, verifyConstraints=False, matchTags=False, matchConstraints=False
)
# rfc3412: 7.1.7
@@ -193,7 +193,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
msg.setComponentByPosition(0, messageProcessingModel)
msg.setComponentByPosition(2)
msg.getComponentByPosition(2).setComponentByType(
- pdu.tagSet, pdu, verifyConstraints=False
+ pdu.tagSet, pdu, verifyConstraints=False, matchTags=False, matchConstraints=False
)
# att: msgId not set back to PDU as it's up to responder app
diff --git a/pysnmp/proto/mpmod/rfc3412.py b/pysnmp/proto/mpmod/rfc3412.py
index 7a53b4b1..8ea6d4a1 100644
--- a/pysnmp/proto/mpmod/rfc3412.py
+++ b/pysnmp/proto/mpmod/rfc3412.py
@@ -140,7 +140,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
scopedPDU.setComponentByPosition(1, contextName)
scopedPDU.setComponentByPosition(2)
scopedPDU.getComponentByPosition(2).setComponentByType(
- pdu.tagSet, pdu, verifyConstraints=False
+ pdu.tagSet, pdu, verifyConstraints=False, matchTags=False, matchConstraints=False
)
# 7.1.7
@@ -148,12 +148,12 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
# 7.1.7a
msg.setComponentByPosition(
- 0, self.messageProcessingModelID, verifyConstraints=False
+ 0, self.messageProcessingModelID, verifyConstraints=False, matchTags=False, matchConstraints=False
)
headerData = msg.setComponentByPosition(1).getComponentByPosition(1)
# 7.1.7b
- headerData.setComponentByPosition(0, msgID, verifyConstraints=False)
+ headerData.setComponentByPosition(0, msgID, verifyConstraints=False, matchTags=False, matchConstraints=False)
snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols(
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
@@ -161,7 +161,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
# 7.1.7c
# XXX need to coerce MIB value as it has incompatible constraints set
headerData.setComponentByPosition(
- 1, snmpEngineMaxMessageSize.syntax, verifyConstraints=False
+ 1, snmpEngineMaxMessageSize.syntax, verifyConstraints=False, matchTags=False, matchConstraints=False
)
# 7.1.7d
@@ -181,7 +181,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
msgFlags |= 0x04
headerData.setComponentByPosition(
- 2, self._msgFlags[msgFlags], verifyConstraints=False
+ 2, self._msgFlags[msgFlags], verifyConstraints=False, matchTags=False, matchConstraints=False
)
# 7.1.7e
@@ -207,12 +207,12 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
securityLevel = 1
# Clear possible auth&priv flags
headerData.setComponentByPosition(
- 2, self._msgFlags[msgFlags & 0xfc], verifyConstraints=False
+ 2, self._msgFlags[msgFlags & 0xfc], verifyConstraints=False, matchTags=False, matchConstraints=False
)
# XXX
scopedPDU = self.__scopedPDU
scopedPDU.setComponentByPosition(
- 0, self._emptyStr, verifyConstraints=False
+ 0, self._emptyStr, verifyConstraints=False, matchTags=False, matchConstraints=False
)
scopedPDU.setComponentByPosition(1, contextName)
scopedPDU.setComponentByPosition(2)
@@ -222,7 +222,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
pMod.apiPDU.setDefaults(emptyPdu)
scopedPDU.getComponentByPosition(2).setComponentByType(
- emptyPdu.tagSet, emptyPdu, verifyConstraints=False
+ emptyPdu.tagSet, emptyPdu, verifyConstraints=False, matchTags=False, matchConstraints=False
)
debug.logger & debug.flagMP and debug.logger('prepareOutgoingMessage: force engineID discovery')
else:
@@ -367,20 +367,21 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
scopedPDU.setComponentByPosition(1, contextName)
scopedPDU.setComponentByPosition(2)
scopedPDU.getComponentByPosition(2).setComponentByType(
- pdu.tagSet, pdu, verifyConstraints=False
+ pdu.tagSet, pdu, verifyConstraints=False, matchTags=False, matchConstraints=False
)
# 7.1.7
msg = self._snmpMsgSpec
# 7.1.7a
- msg.setComponentByPosition(0, self.messageProcessingModelID,
- verifyConstraints=False)
+ msg.setComponentByPosition(
+ 0, self.messageProcessingModelID, verifyConstraints=False, matchTags=False, matchConstraints=False
+ )
headerData = msg.setComponentByPosition(1).getComponentByPosition(1)
# 7.1.7b
- headerData.setComponentByPosition(0, msgID, verifyConstraints=False)
+ headerData.setComponentByPosition(0, msgID, verifyConstraints=False, matchTags=False, matchConstraints=False)
snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols(
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
@@ -388,7 +389,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
# 7.1.7c
# XXX need to coerce MIB value as it has incompatible constraints set
headerData.setComponentByPosition(
- 1, snmpEngineMaxMessageSize.syntax, verifyConstraints=False
+ 1, snmpEngineMaxMessageSize.syntax, verifyConstraints=False, matchTags=False, matchConstraints=False
)
# 7.1.7d
@@ -406,12 +407,12 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
msgFlags |= 0x04
headerData.setComponentByPosition(
- 2, self._msgFlags[msgFlags], verifyConstraints=False
+ 2, self._msgFlags[msgFlags], verifyConstraints=False, matchTags=False, matchConstraints=False
)
# 7.1.7e
headerData.setComponentByPosition(
- 3, securityModel, verifyConstraints=False
+ 3, securityModel, verifyConstraints=False, matchTags=False, matchConstraints=False
)
debug.logger & debug.flagMP and debug.logger('prepareResponseMessage: %s' % (msg.prettyPrint(),))