summaryrefslogtreecommitdiff
path: root/pysnmp/proto
diff options
context:
space:
mode:
Diffstat (limited to 'pysnmp/proto')
-rw-r--r--pysnmp/proto/mpmod/rfc2576.py12
-rw-r--r--pysnmp/proto/mpmod/rfc3412.py18
-rw-r--r--pysnmp/proto/rfc3412.py16
-rw-r--r--pysnmp/proto/secmod/rfc2576.py6
-rw-r--r--pysnmp/proto/secmod/rfc3414/priv/des.py2
5 files changed, 25 insertions, 29 deletions
diff --git a/pysnmp/proto/mpmod/rfc2576.py b/pysnmp/proto/mpmod/rfc2576.py
index cc8db55..a89ceb2 100644
--- a/pysnmp/proto/mpmod/rfc2576.py
+++ b/pysnmp/proto/mpmod/rfc2576.py
@@ -31,7 +31,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
expectResponse,
sendPduHandle
):
- snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineID')
+ snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')
snmpEngineID = snmpEngineID.syntax
# rfc3412: 7.1.1b
@@ -70,7 +70,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
# rfc3412: 7.1.9.a & rfc2576: 5.2.1 --> no-op
- snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
+ snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
# rfc3412: 7.1.9.b
( securityParameters,
@@ -121,7 +121,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
stateReference,
statusInformation
):
- snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineID')
+ snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')
snmpEngineID = snmpEngineID.syntax
# rfc3412: 7.1.2.b
@@ -209,7 +209,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
wholeMsg, asn1Spec=self._snmpMsgSpec
)
except PyAsn1Error:
- snmpInASNParseErrs, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMPv2-MIB', 'snmpInASNParseErrs')
+ snmpInASNParseErrs, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInASNParseErrs')
snmpInASNParseErrs.syntax = snmpInASNParseErrs.syntax + 1
raise error.StatusInformation(
errorIndication = 'parseError'
@@ -222,7 +222,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
msgID = pdu.getComponentByPosition(0)
# rfc2576: 5.2.1
- snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
+ snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
securityParameters = (
msg.getComponentByPosition(1),
(transportDomain, transportAddress),
@@ -323,7 +323,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
# rfc3412: 7.2.13
if rfc3411.confirmedClassPDUs.has_key(pduType):
# rfc3412: 7.2.13a
- snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineID')
+ snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')
if securityEngineID != snmpEngineID.syntax:
raise error.StatusInformation(
errorIndication = 'engineIDMispatch'
diff --git a/pysnmp/proto/mpmod/rfc3412.py b/pysnmp/proto/mpmod/rfc3412.py
index ea9ae4d..6690a54 100644
--- a/pysnmp/proto/mpmod/rfc3412.py
+++ b/pysnmp/proto/mpmod/rfc3412.py
@@ -74,7 +74,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
expectResponse,
sendPduHandle
):
- snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineID')
+ snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')
snmpEngineID = snmpEngineID.syntax
# 7.1.1b
@@ -115,7 +115,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
# 7.1.7b
headerData.setComponentByPosition(0, msgID)
- snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
+ snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
# 7.1.7c
headerData.setComponentByPosition(1, snmpEngineMaxMessageSize.syntax)
@@ -222,7 +222,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
stateReference,
statusInformation
):
- snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineID')
+ snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')
snmpEngineID = snmpEngineID.syntax
# 7.1.2.b
@@ -318,7 +318,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
# 7.1.7b
headerData.setComponentByPosition(0, msgID)
- snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
+ snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
# 7.1.7c
headerData.setComponentByPosition(1, snmpEngineMaxMessageSize.syntax)
@@ -390,7 +390,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
wholeMsg, asn1Spec=self._snmpMsgSpec
)
except PyAsn1Error:
- snmpInASNParseErrs, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMPv2-MIB', 'snmpInASNParseErrs')
+ snmpInASNParseErrs, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInASNParseErrs')
snmpInASNParseErrs.syntax = snmpInASNParseErrs.syntax + 1
raise error.StatusInformation(
errorIndication = 'parseError'
@@ -407,7 +407,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
# 7.2.4
if not snmpEngine.securityModels.has_key(securityModel):
- snmpUnknownSecurityModels, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMPv2-MIB', 'snmpUnknownSecurityModels')
+ snmpUnknownSecurityModels, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpUnknownSecurityModels')
snmpUnknownSecurityModels.syntax = snmpUnknownSecurityModels.syntax + 1
raise error.StatusInformation(
errorIndication = 'unsupportedSecurityModel'
@@ -421,7 +421,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
elif (msgFlags & 0x03) == 0x03:
securityLevel = 3
else:
- snmpInvalidMsgs = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMPv2-MIB', 'snmpInvalidMsgs')
+ snmpInvalidMsgs = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInvalidMsgs')
snmpInvalidMsgs.syntax = snmpInvalidMsgs.syntax + 1
raise error.StatusInformation(
errorIndication = 'invalidMsg'
@@ -517,9 +517,7 @@ class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel):
'contextName': contextName
}
- snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols(
- 'SNMP-FRAMEWORK-MIB', 'snmpEngineID'
- )
+ snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')
snmpEngineID = snmpEngineID.syntax
# 7.2.7 XXX PDU would be parsed here?
diff --git a/pysnmp/proto/rfc3412.py b/pysnmp/proto/rfc3412.py
index 97a3cdb..263812f 100644
--- a/pysnmp/proto/rfc3412.py
+++ b/pysnmp/proto/rfc3412.py
@@ -81,7 +81,7 @@ class MsgAndPduDispatcher:
# 4.3.4
if contextEngineId is None:
# Default to local snmpEngineId
- contextEngineId, = self.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineID')
+ contextEngineId, = self.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')
for pduType in pduTypes:
k = (str(contextEngineId), pduType)
@@ -234,10 +234,10 @@ class MsgAndPduDispatcher:
raise
# Handle oversized messages XXX transport constrains?
- snmpEngineMaxMessageSize, = self.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
+ snmpEngineMaxMessageSize, = self.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
if snmpEngineMaxMessageSize.syntax and \
len(outgoingMessage) > snmpEngineMaxMessageSize.syntax:
- snmpSilentDrops, = self.mibInstrumController.mibBuilder.importSymbols('SNMPv2-MIB', 'snmpSilentDrops')
+ snmpSilentDrops, = self.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpSilentDrops')
snmpSilentDrops.syntax = snmpSilentDrops.syntax + 1
raise error.MessageTooBigError()
@@ -260,7 +260,7 @@ class MsgAndPduDispatcher:
# print 'receiveMessage', time.time() #, repr(wholeMsg)
# 4.2.1.1
snmpInPkts, = self.mibInstrumController.mibBuilder.importSymbols(
- 'SNMPv2-MIB', 'snmpInPkts'
+ '__SNMPv2-MIB', 'snmpInPkts'
)
snmpInPkts.syntax = snmpInPkts.syntax + 1
@@ -269,7 +269,7 @@ class MsgAndPduDispatcher:
restOfWholeMsg = '' # XXX fix decoder non-recursive return
msgVersion = verdec.decodeMessageVersion(wholeMsg)
except PySnmpError:
- snmpInAsn1ParseErrs, = self.mibInstrumController.mibBuilder.importSymbols('SNMPv2-MIB', 'snmpInAsn1ParseErrs')
+ snmpInAsn1ParseErrs, = self.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInAsn1ParseErrs')
snmpInAsn1ParseErrs.syntax = snmpInAsn1ParseErrs.syntax + 1
return '' # n.b the whole buffer gets dropped
@@ -280,7 +280,7 @@ class MsgAndPduDispatcher:
)
if mpHandler is None:
snmpInBadVersions, = self.mibInstrumController.mibBuilder.importSymbols(
- 'SNMPv2-MIB', 'snmpInBadVersions'
+ '__SNMPv2-MIB', 'snmpInBadVersions'
)
snmpInBadVersions.syntax = snmpInBadVersions.syntax + 1
return restOfWholeMsg
@@ -329,7 +329,7 @@ class MsgAndPduDispatcher:
# 4.2.2.1.2
if processPdu is None:
# 4.2.2.1.2.a
- snmpUnknownPDUHandlers, = self.mibInstrumController.mibBuilder.importSymbols('SNMP-MPD-MIB', 'snmpUnknownPDUHandlers')
+ snmpUnknownPDUHandlers, = self.mibInstrumController.mibBuilder.importSymbols('__SNMP-MPD-MIB', 'snmpUnknownPDUHandlers')
snmpUnknownPDUHandlers.syntax = snmpUnknownPDUHandlers.syntax+1
# 4.2.2.1.2.b
@@ -397,7 +397,7 @@ class MsgAndPduDispatcher:
# 4.2.2.2.2
if cachedParams is None:
- snmpUnknownPDUHandlers, = self.mibInstrumController.mibBuilder.importSymbols('SNMP-MPD-MIB', 'snmpUnknownPDUHandlers')
+ snmpUnknownPDUHandlers, = self.mibInstrumController.mibBuilder.importSymbols('__SNMP-MPD-MIB', 'snmpUnknownPDUHandlers')
snmpUnknownPDUHandlers.syntax = snmpUnknownPDUHandlers.syntax+1
return restOfWholeMsg
diff --git a/pysnmp/proto/secmod/rfc2576.py b/pysnmp/proto/secmod/rfc2576.py
index 19c5144..59c89ec 100644
--- a/pysnmp/proto/secmod/rfc2576.py
+++ b/pysnmp/proto/secmod/rfc2576.py
@@ -135,7 +135,7 @@ class SnmpV1SecurityModel(base.AbstractSecurityModel):
continue
break
else:
- snmpInBadCommunityNames, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-COMMUNITY-MIB', 'snmpInBadCommunityNames')
+ snmpInBadCommunityNames, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-COMMUNITY-MIB', 'snmpInBadCommunityNames')
snmpInBadCommunityNames.syntax = snmpInBadCommunityNames.syntax+1
raise error.StatusInformation(
errorIndication = 'unknownCommunityName'
@@ -155,9 +155,7 @@ class SnmpV1SecurityModel(base.AbstractSecurityModel):
contextName = snmpCommunityContextName.getNode(
snmpCommunityContextName.name + instId
)
- snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols(
- 'SNMP-FRAMEWORK-MIB', 'snmpEngineID'
- )
+ snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')
stateReference = self._cachePush(
communityName=communityName.syntax
diff --git a/pysnmp/proto/secmod/rfc3414/priv/des.py b/pysnmp/proto/secmod/rfc3414/priv/des.py
index 63536e5..fd2c553 100644
--- a/pysnmp/proto/secmod/rfc3414/priv/des.py
+++ b/pysnmp/proto/secmod/rfc3414/priv/des.py
@@ -21,7 +21,7 @@ class Des(base.AbstractEncryptionService):
preIV = privKey[8:16]
snmpEngineBoots, = mibInstrumController.mibBuilder.importSymbols(
- 'SNMP-FRAMEWORK-MIB', 'snmpEngineBoots'
+ '__SNMP-FRAMEWORK-MIB', 'snmpEngineBoots'
)
securityEngineBoots = long(snmpEngineBoots.syntax)