diff options
Diffstat (limited to 'pysnmp/proto/mpmod')
-rw-r--r-- | pysnmp/proto/mpmod/rfc2576.py | 12 | ||||
-rw-r--r-- | pysnmp/proto/mpmod/rfc3412.py | 18 |
2 files changed, 14 insertions, 16 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? |