summaryrefslogtreecommitdiff
path: root/pysnmp/proto/mpmod/rfc2576.py
diff options
context:
space:
mode:
authorelie <elie>2011-11-06 20:37:09 +0000
committerelie <elie>2011-11-06 20:37:09 +0000
commitf0406dd01c46230ebbcd4f8c4a47fdbc270e64ef (patch)
treecae924c26bc40e6caafde18e657ab7fbb8794bbe /pysnmp/proto/mpmod/rfc2576.py
parent6781949a085961ff2eb6f4603a52249e99c4ce7d (diff)
downloadpysnmp-git-f0406dd01c46230ebbcd4f8c4a47fdbc270e64ef.tar.gz
major overhawl aimed at Python 2.4 through 3.2 compatibility
Diffstat (limited to 'pysnmp/proto/mpmod/rfc2576.py')
-rw-r--r--pysnmp/proto/mpmod/rfc2576.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/pysnmp/proto/mpmod/rfc2576.py b/pysnmp/proto/mpmod/rfc2576.py
index aa346035..d374747b 100644
--- a/pysnmp/proto/mpmod/rfc2576.py
+++ b/pysnmp/proto/mpmod/rfc2576.py
@@ -1,11 +1,12 @@
# SNMP v1 & v2c message processing models implementation
from pyasn1.codec.ber import decoder
+from pyasn1.type import univ
+from pyasn1.compat.octets import null
+from pyasn1.error import PyAsn1Error
from pysnmp.proto.mpmod.base import AbstractMessageProcessingModel
from pysnmp.proto.secmod import rfc2576
from pysnmp.proto import rfc3411, errind, error
from pysnmp.proto.api import v1, v2c
-from pyasn1.type import univ
-from pyasn1.error import PyAsn1Error
from pysnmp import debug
# Since I have not found a detailed reference to v1MP/v2cMP
@@ -48,7 +49,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
# rfc3412: 7.1.5
if not contextName:
- contextName = ''
+ contextName = null
debug.logger & debug.flagMP and debug.logger('prepareOutgoingMessage: using contextEngineId %s contextName %s' % (repr(contextEngineId), contextName))
@@ -95,7 +96,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
if pdu.tagSet in rfc3411.confirmedClassPDUs:
# XXX rfc bug? why stateReference should be created?
self._cache.pushByMsgId(
- long(msgID),
+ int(msgID),
sendPduHandle=sendPduHandle,
msgID=msgID,
snmpEngineID=snmpEngineID,
@@ -161,7 +162,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
# rfc3412: 7.1.5
if not contextName:
- contextName = ''
+ contextName = null
# rfc3412: 7.1.6
scopedPDU = ( contextEngineId, contextName, pdu )
@@ -294,7 +295,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
# 7.2.10a
try:
- cachedReqParams = self._cache.popByMsgId(long(msgID))
+ cachedReqParams = self._cache.popByMsgId(int(msgID))
except error.ProtocolError:
smHandler.releaseStateInformation(securityStateReference)
raise error.StatusInformation(