summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2011-11-19 18:30:09 +0000
committerelie <elie>2011-11-19 18:30:09 +0000
commit804b4a0e15f37b5e82a1f73a2c1c9d8c500a7b22 (patch)
treef3d195007ea15fbee9d7be1ff934605bc63a130d
parenta83254d0662a6d7a03d6d3c285339b552d8dfee2 (diff)
downloadpysnmp-804b4a0e15f37b5e82a1f73a2c1c9d8c500a7b22.tar.gz
- The pyasn1 constraint and enumeration objects put into ASN1-* MIB
modules what appears to be more in-line with SMI. - Existing MIB modules as well as libsmi2pysnmp tool corrected accordingly.
-rw-r--r--CHANGES3
-rw-r--r--pysnmp/smi/mibs/ASN1-ENUMERATION.py7
-rw-r--r--pysnmp/smi/mibs/ASN1-REFINEMENT.py11
-rw-r--r--pysnmp/smi/mibs/ASN1.py20
-rw-r--r--pysnmp/smi/mibs/PYSNMP-MIB.py7
-rw-r--r--pysnmp/smi/mibs/PYSNMP-USM-MIB.py25
-rw-r--r--pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py17
-rw-r--r--pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py32
-rw-r--r--pysnmp/smi/mibs/SNMP-MPD-MIB.py7
-rw-r--r--pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py17
-rw-r--r--pysnmp/smi/mibs/SNMP-PROXY-MIB.py11
-rw-r--r--pysnmp/smi/mibs/SNMP-TARGET-MIB.py21
-rw-r--r--pysnmp/smi/mibs/SNMP-USER-BASED-SM-3DES-MIB.py5
-rw-r--r--pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.py25
-rw-r--r--pysnmp/smi/mibs/SNMP-USM-AES-MIB.py7
-rw-r--r--pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py31
-rw-r--r--pysnmp/smi/mibs/SNMPv2-MIB.py21
-rw-r--r--pysnmp/smi/mibs/SNMPv2-SMI.py15
-rw-r--r--pysnmp/smi/mibs/SNMPv2-TC.py31
-rw-r--r--pysnmp/smi/mibs/SNMPv2-TM.py20
-rw-r--r--pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py25
-rw-r--r--tools/libsmi2pysnmp35
22 files changed, 204 insertions, 189 deletions
diff --git a/CHANGES b/CHANGES
index 068a1f3..49fc0ea 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
Revision 4.2.2
--------------
+- The pyasn1 constraint and enumeration objects put into ASN1-*
+ MIB modules what appears to be more in-line with SMI. Existing
+ MIB modules as well as libsmi2pysnmp tool corrected accordingly.
- The MibBuilder.importSymbols() now takes optional kwargs and
push them into MIB modules globals(). This is to facilitate
passing user infomation, such as DB connection handler, to MIB
diff --git a/pysnmp/smi/mibs/ASN1-ENUMERATION.py b/pysnmp/smi/mibs/ASN1-ENUMERATION.py
new file mode 100644
index 0000000..34767c1
--- /dev/null
+++ b/pysnmp/smi/mibs/ASN1-ENUMERATION.py
@@ -0,0 +1,7 @@
+# ASN.1 types enumeration tools
+from pyasn1.type import namedval
+
+mibBuilder.exportSymbols(
+ 'ASN1-ENUMERATION',
+ NamedValues=namedval.NamedValues
+ )
diff --git a/pysnmp/smi/mibs/ASN1-REFINEMENT.py b/pysnmp/smi/mibs/ASN1-REFINEMENT.py
new file mode 100644
index 0000000..b0cfeaf
--- /dev/null
+++ b/pysnmp/smi/mibs/ASN1-REFINEMENT.py
@@ -0,0 +1,11 @@
+# ASN.1 types refinement tools
+from pyasn1.type import constraint
+
+mibBuilder.exportSymbols(
+ 'ASN1-REFINEMENT',
+ ConstraintsUnion=constraint.ConstraintsUnion,
+ ConstraintsIntersection=constraint.ConstraintsIntersection,
+ SingleValueConstraint=constraint.SingleValueConstraint,
+ ValueRangeConstraint=constraint.ValueRangeConstraint,
+ ValueSizeConstraint=constraint.ValueSizeConstraint
+ )
diff --git a/pysnmp/smi/mibs/ASN1.py b/pysnmp/smi/mibs/ASN1.py
index 945e094..99e2eb6 100644
--- a/pysnmp/smi/mibs/ASN1.py
+++ b/pysnmp/smi/mibs/ASN1.py
@@ -2,19 +2,11 @@
from pyasn1.type import univ
from pysnmp.proto import rfc1902
-Integer = rfc1902.Integer32
-OctetString = rfc1902.OctetString
-
-# Instead of using base ASN,1 types we use SNMPv2 SMI ones to make
-# SMI objects type-compatible with SNMP protocol values
-
-# Integer = univ.Integer
-# OctetString = univ.OctetString
-BitString = univ.BitString
-Null = univ.Null
-ObjectIdentifier = univ.ObjectIdentifier
-
mibBuilder.exportSymbols(
- 'ASN1', Integer=Integer, OctetString=OctetString,
- BitString=BitString, Null=Null, ObjectIdentifier=ObjectIdentifier
+ 'ASN1',
+ ObjectIdentifier=univ.ObjectIdentifier,
+ # Instead of using base ASN,1 types we use SNMPv2 SMI ones to make
+ # SMI objects type-compatible with SNMP protocol values
+ Integer=rfc1902.Integer32,
+ OctetString=rfc1902.OctetString
)
diff --git a/pysnmp/smi/mibs/PYSNMP-MIB.py b/pysnmp/smi/mibs/PYSNMP-MIB.py
index 8f029a8..266099c 100644
--- a/pysnmp/smi/mibs/PYSNMP-MIB.py
+++ b/pysnmp/smi/mibs/PYSNMP-MIB.py
@@ -1,13 +1,12 @@
# PySNMP SMI module. Autogenerated from smidump -f python PYSNMP-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:22:47 2011,
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 22:17:12 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( Bits, Integer32, ModuleIdentity, MibIdentifier, TimeTicks, enterprises, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "ModuleIdentity", "MibIdentifier", "TimeTicks", "enterprises")
# Objects
diff --git a/pysnmp/smi/mibs/PYSNMP-USM-MIB.py b/pysnmp/smi/mibs/PYSNMP-USM-MIB.py
index b735075..6dedb80 100644
--- a/pysnmp/smi/mibs/PYSNMP-USM-MIB.py
+++ b/pysnmp/smi/mibs/PYSNMP-USM-MIB.py
@@ -1,13 +1,12 @@
# PySNMP SMI module. Autogenerated from smidump -f python PYSNMP-USM-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:25:33 2011,
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 22:16:18 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( pysnmpModuleIDs, ) = mibBuilder.importSymbols("PYSNMP-MIB", "pysnmpModuleIDs")
( SnmpAdminString, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
( usmUserEntry, ) = mibBuilder.importSymbols("SNMP-USER-BASED-SM-MIB", "usmUserEntry")
@@ -22,32 +21,32 @@ if mibBuilder.loadTexts: pysnmpUsmMIB.setContactInfo("E-mail: ilya@glas.net\
if mibBuilder.loadTexts: pysnmpUsmMIB.setDescription("This MIB module defines objects specific to User\nSecurity Model (USM) implementation at PySNMP.")
pysnmpUsmMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1))
pysnmpUsmCfg = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 1))
-pysnmpUsmDiscoverable = MibScalar((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 1, 1), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(1,0,)).subtype(namedValues=namedval.NamedValues(("notDiscoverable", 0), ("discoverable", 1), )).clone(1)).setMaxAccess("readwrite")
+pysnmpUsmDiscoverable = MibScalar((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 1, 1), Integer().subtype(subtypeSpec=SingleValueConstraint(1,0,)).subtype(namedValues=NamedValues(("notDiscoverable", 0), ("discoverable", 1), )).clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pysnmpUsmDiscoverable.setDescription("Whether SNMP engine would support its discovery by\nresponding to unknown clients.")
-pysnmpUsmDiscovery = MibScalar((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 1, 2), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(1,0,)).subtype(namedValues=namedval.NamedValues(("doNotDiscover", 0), ("doDiscover", 1), )).clone(1)).setMaxAccess("readwrite")
+pysnmpUsmDiscovery = MibScalar((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 1, 2), Integer().subtype(subtypeSpec=SingleValueConstraint(1,0,)).subtype(namedValues=NamedValues(("doNotDiscover", 0), ("doDiscover", 1), )).clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pysnmpUsmDiscovery.setDescription("Whether SNMP engine would try to figure out the EngineIDs\nof its peers by sending discover requests.")
pysnmpUsmSecretTable = MibTable((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 2))
if mibBuilder.loadTexts: pysnmpUsmSecretTable.setDescription("The table of USM users passphrases configured in the SNMP \nengine's Local Configuration Datastore (LCD).")
pysnmpUsmSecretEntry = MibTableRow((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 2, 1)).setIndexNames((1, "PYSNMP-USM-MIB", "pysnmpUsmSecretUserName"))
if mibBuilder.loadTexts: pysnmpUsmSecretEntry.setDescription("Information about a particular USM user credentials.")
-pysnmpUsmSecretUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
+pysnmpUsmSecretUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: pysnmpUsmSecretUserName.setDescription("The username string for which a row in this table\nrepresents a configuration.")
-pysnmpUsmSecretAuthKey = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 2, 1, 2), OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(8, 65535))).setMaxAccess("noaccess")
+pysnmpUsmSecretAuthKey = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 65535))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: pysnmpUsmSecretAuthKey.setDescription("User's authentication passphrase used for localized key generation.")
-pysnmpUsmSecretPrivKey = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 2, 1, 3), OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(8, 65535))).setMaxAccess("noaccess")
+pysnmpUsmSecretPrivKey = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 2, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 65535))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: pysnmpUsmSecretPrivKey.setDescription("User's encryption passphrase used for localized key generation.")
pysnmpUsmSecretStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 2, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: pysnmpUsmSecretStatus.setDescription("Table status")
pysnmpUsmUser = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 3))
pysnmpUsmKeyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 3, 1))
if mibBuilder.loadTexts: pysnmpUsmKeyEntry.setDescription("Information about a particular USM user credentials.")
-pysnmpUsmKeyAuthLocalized = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 3, 1, 1), OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(8, 32))).setMaxAccess("noaccess")
+pysnmpUsmKeyAuthLocalized = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 3, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: pysnmpUsmKeyAuthLocalized.setDescription("User's localized key used for authentication.")
-pysnmpUsmKeyPrivLocalized = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 3, 1, 2), OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(8, 32))).setMaxAccess("noaccess")
+pysnmpUsmKeyPrivLocalized = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 3, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: pysnmpUsmKeyPrivLocalized.setDescription("User's localized key used for encryption.")
-pysnmpUsmKeyAuth = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 3, 1, 3), OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(8, 32))).setMaxAccess("noaccess")
+pysnmpUsmKeyAuth = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: pysnmpUsmKeyAuth.setDescription("User's non-localized key used for authentication.")
-pysnmpUsmKeyPriv = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 3, 1, 4), OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(8, 32))).setMaxAccess("noaccess")
+pysnmpUsmKeyPriv = MibTableColumn((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 3, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: pysnmpUsmKeyPriv.setDescription("User's non-localized key used for encryption.")
pysnmpUsmMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 2))
pysnmpUsmMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 2, 1))
diff --git a/pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py b/pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py
index 4569ca3..835fc0c 100644
--- a/pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py
+++ b/pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py
@@ -1,13 +1,12 @@
# PySNMP SMI module. Autogenerated from smidump -f python SNMP-COMMUNITY-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:26:30 2011,
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 22:05:26 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( SnmpAdminString, SnmpEngineID, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString", "SnmpEngineID")
( SnmpTagValue, snmpTargetAddrEntry, ) = mibBuilder.importSymbols("SNMP-TARGET-MIB", "SnmpTagValue", "snmpTargetAddrEntry")
( ModuleCompliance, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup")
@@ -25,15 +24,15 @@ snmpCommunityTable = MibTable((1, 3, 6, 1, 6, 3, 18, 1, 1))
if mibBuilder.loadTexts: snmpCommunityTable.setDescription("The table of community strings configured in the SNMP\nengine's Local Configuration Datastore (LCD).")
snmpCommunityEntry = MibTableRow((1, 3, 6, 1, 6, 3, 18, 1, 1, 1)).setIndexNames((1, "SNMP-COMMUNITY-MIB", "snmpCommunityIndex"))
if mibBuilder.loadTexts: snmpCommunityEntry.setDescription("Information about a particular community string.")
-snmpCommunityIndex = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
+snmpCommunityIndex = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: snmpCommunityIndex.setDescription("The unique index value of a row in this table.")
snmpCommunityName = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 2), OctetString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunityName.setDescription("The community string for which a row in this table\nrepresents a configuration.")
-snmpCommunitySecurityName = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 3), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")
+snmpCommunitySecurityName = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 3), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunitySecurityName.setDescription("A human readable string representing the corresponding\nvalue of snmpCommunityName in a Security Model\nindependent format.")
snmpCommunityContextEngineID = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 4), SnmpEngineID()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunityContextEngineID.setDescription("The contextEngineID indicating the location of the\ncontext in which management information is accessed\nwhen using the community string specified by the\ncorresponding instance of snmpCommunityName.\n\nThe default value is the snmpEngineID of the entity in\nwhich this object is instantiated.")
-snmpCommunityContextName = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 5), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate")
+snmpCommunityContextName = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 5), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunityContextName.setDescription("The context in which management information is accessed\nwhen using the community string specified by the corresponding\ninstance of snmpCommunityName.")
snmpCommunityTransportTag = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 6), SnmpTagValue().clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpCommunityTransportTag.setDescription("This object specifies a set of transport endpoints\nfrom which a command responder application will accept\nmanagement requests. If a management request containing\nthis community is received on a transport endpoint other\nthan the transport endpoints identified by this object,\nthe request is deemed unauthentic.\n\nThe transports identified by this object are specified\n\n\nin the snmpTargetAddrTable. Entries in that table\nwhose snmpTargetAddrTagList contains this tag value\nare identified.\n\nIf the value of this object has zero-length, transport\nendpoints are not checked when authenticating messages\ncontaining this community string.")
@@ -45,9 +44,9 @@ snmpTargetAddrExtTable = MibTable((1, 3, 6, 1, 6, 3, 18, 1, 2))
if mibBuilder.loadTexts: snmpTargetAddrExtTable.setDescription("The table of mask and mms values associated with the\n\n\nsnmpTargetAddrTable.\n\nThe snmpTargetAddrExtTable augments the\nsnmpTargetAddrTable with a transport address mask value\nand a maximum message size value. The transport address\nmask allows entries in the snmpTargetAddrTable to define\na set of addresses instead of just a single address.\nThe maximum message size value allows the maximum\nmessage size of another SNMP entity to be configured for\nuse in SNMPv1 (and SNMPv2c) transactions, where the\nmessage format does not specify a maximum message size.")
snmpTargetAddrExtEntry = MibTableRow((1, 3, 6, 1, 6, 3, 18, 1, 2, 1))
if mibBuilder.loadTexts: snmpTargetAddrExtEntry.setDescription("Information about a particular mask and mms value.")
-snmpTargetAddrTMask = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 2, 1, 1), OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 255)).clone('')).setMaxAccess("readcreate")
+snmpTargetAddrTMask = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 2, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 255)).clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetAddrTMask.setDescription("The mask value associated with an entry in the\nsnmpTargetAddrTable. The value of this object must\nhave the same length as the corresponding instance of\nsnmpTargetAddrTAddress, or must have length 0. An\nattempt to set it to any other value will result in\nan inconsistentValue error.\n\nThe value of this object allows an entry in the\nsnmpTargetAddrTable to specify multiple addresses.\nThe mask value is used to select which bits of\na transport address must match bits of the corresponding\ninstance of snmpTargetAddrTAddress, in order for the\ntransport address to match a particular entry in the\nsnmpTargetAddrTable. Bits which are 1 in the mask\nvalue indicate bits in the transport address which\nmust match bits in the snmpTargetAddrTAddress value.\n\n\nBits which are 0 in the mask indicate bits in the\ntransport address which need not match. If the\nlength of the mask is 0, the mask should be treated\nas if all its bits were 1 and its length were equal\nto the length of the corresponding value of\nsnmpTargetAddrTable.\n\nThis object may not be modified while the value of the\ncorresponding instance of snmpTargetAddrRowStatus is\nactive(1). An attempt to set this object in this case\nwill result in an inconsistentValue error.")
-snmpTargetAddrMMS = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=constraint.ConstraintsUnion(constraint.ValueRangeConstraint(0,0),constraint.ValueRangeConstraint(484,2147483647),)).clone(484)).setMaxAccess("readcreate")
+snmpTargetAddrMMS = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0,0),ValueRangeConstraint(484,2147483647),)).clone(484)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetAddrMMS.setDescription("The maximum message size value associated with an entry\nin the snmpTargetAddrTable.")
snmpTrapAddress = MibScalar((1, 3, 6, 1, 6, 3, 18, 1, 3), IpAddress()).setMaxAccess("notifyonly")
if mibBuilder.loadTexts: snmpTrapAddress.setDescription("The value of the agent-addr field of a Trap PDU which\nis forwarded by a proxy forwarder application using\nan SNMP version other than SNMPv1. The value of this\nobject SHOULD contain the value of the agent-addr field\nfrom the original Trap PDU as generated by an SNMPv1\nagent.")
diff --git a/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py b/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py
index bdca361..8354cf7 100644
--- a/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py
+++ b/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py
@@ -1,7 +1,6 @@
-# PySNMP SMI module. Mostly autogenerated from
-# smidump -f python SNMP-FRAMEWORK-MIB
-# by libsmi2pysnmp-0.0.8-alpha at Tue Feb 5 16:09:21 2008,
-# Python version (2, 4, 4, 'final', 0)
+# PySNMP SMI module. Autogenerated from smidump -f python SNMP-FRAMEWORK-MIB
+# by libsmi2pysnmp-0.1.2 at Sun Nov 6 01:40:23 2011,
+# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
try:
import socket
@@ -10,12 +9,11 @@ except ImportError:
pass
import time
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import univ, constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( ModuleCompliance, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup")
( Bits, Integer32, ModuleIdentity, MibIdentifier, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, snmpModules, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "ModuleIdentity", "MibIdentifier", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "snmpModules")
( TextualConvention, ) = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention")
@@ -24,10 +22,10 @@ from pyasn1.type import univ, constraint, namedval
class SnmpAdminString(TextualConvention, OctetString):
displayHint = "255t"
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(0,255)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(0,255)
class SnmpEngineID(OctetString, TextualConvention):
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(5,32)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(5,32)
defaultValue = [128, 0, 79, 184, 5]
try:
# Attempt to base engine ID on local IP address
@@ -41,7 +39,7 @@ class SnmpEngineID(OctetString, TextualConvention):
pass
# ...in any case, use pseudo-random text ID
t = int(time.time())
- defaultValue = univ.OctetString(
+ defaultValue = OctetString(
defaultValue + [ t >> 16 & 0xff, t >> 8 & 0xff, t & 0xff]
).asOctets()
@@ -52,14 +50,14 @@ class SnmpEngineTime(Integer32):
return Integer32.clone(self, value, tagSet, subtypeSpec)
class SnmpMessageProcessingModel(Integer32):
- subtypeSpec = Integer32.subtypeSpec+constraint.ValueRangeConstraint(0,2147483647)
+ subtypeSpec = Integer32.subtypeSpec+ValueRangeConstraint(0,2147483647)
class SnmpSecurityLevel(Integer):
- subtypeSpec = Integer.subtypeSpec+constraint.SingleValueConstraint(1,3,2,)
- namedValues = namedval.NamedValues(("noAuthNoPriv", 1), ("authNoPriv", 2), ("authPriv", 3), )
+ subtypeSpec = Integer.subtypeSpec+SingleValueConstraint(1,3,2,)
+ namedValues = NamedValues(("noAuthNoPriv", 1), ("authNoPriv", 2), ("authPriv", 3), )
class SnmpSecurityModel(Integer32):
- subtypeSpec = Integer32.subtypeSpec+constraint.ValueRangeConstraint(0,2147483647)
+ subtypeSpec = Integer32.subtypeSpec+ValueRangeConstraint(0,2147483647)
# Objects
@@ -76,11 +74,11 @@ snmpFrameworkMIBObjects = MibIdentifier((1, 3, 6, 1, 6, 3, 10, 2))
snmpEngine = MibIdentifier((1, 3, 6, 1, 6, 3, 10, 2, 1))
snmpEngineID = MibScalar((1, 3, 6, 1, 6, 3, 10, 2, 1, 1), SnmpEngineID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpEngineID.setDescription("An SNMP engine's administratively-unique identifier.\n\nThis information SHOULD be stored in non-volatile\nstorage so that it remains constant across\nre-initializations of the SNMP engine.")
-snmpEngineBoots = MibScalar((1, 3, 6, 1, 6, 3, 10, 2, 1, 2), Integer32().subtype(subtypeSpec=constraint.ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
+snmpEngineBoots = MibScalar((1, 3, 6, 1, 6, 3, 10, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpEngineBoots.setDescription("The number of times that the SNMP engine has\n(re-)initialized itself since snmpEngineID\nwas last configured.")
-snmpEngineTime = MibScalar((1, 3, 6, 1, 6, 3, 10, 2, 1, 3), SnmpEngineTime().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly").setUnits("seconds")
+snmpEngineTime = MibScalar((1, 3, 6, 1, 6, 3, 10, 2, 1, 3), SnmpEngineTime().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly").setUnits("seconds")
if mibBuilder.loadTexts: snmpEngineTime.setDescription("The number of seconds since the value of\nthe snmpEngineBoots object last changed.\nWhen incrementing this object's value would\ncause it to exceed its maximum,\nsnmpEngineBoots is incremented as if a\nre-initialization had occurred, and this\nobject's value consequently reverts to zero.")
-snmpEngineMaxMessageSize = MibScalar((1, 3, 6, 1, 6, 3, 10, 2, 1, 4), Integer32().subtype(subtypeSpec=constraint.ValueRangeConstraint(484, 2147483647))).setMaxAccess("readonly")
+snmpEngineMaxMessageSize = MibScalar((1, 3, 6, 1, 6, 3, 10, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(484, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpEngineMaxMessageSize.setDescription("The maximum length in octets of an SNMP message\nwhich this SNMP engine can send or receive and\nprocess, determined as the minimum of the maximum\nmessage size values supported among all of the\ntransports available to and supported by the engine.")
snmpFrameworkMIBConformance = MibIdentifier((1, 3, 6, 1, 6, 3, 10, 3))
snmpFrameworkMIBCompliances = MibIdentifier((1, 3, 6, 1, 6, 3, 10, 3, 1))
diff --git a/pysnmp/smi/mibs/SNMP-MPD-MIB.py b/pysnmp/smi/mibs/SNMP-MPD-MIB.py
index adf5e1d..7ac15e6 100644
--- a/pysnmp/smi/mibs/SNMP-MPD-MIB.py
+++ b/pysnmp/smi/mibs/SNMP-MPD-MIB.py
@@ -1,13 +1,12 @@
# PySNMP SMI module. Autogenerated from smidump -f python SNMP-MPD-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:30:16 2011,
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 22:02:20 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( ModuleCompliance, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup")
( Bits, Counter32, Integer32, ModuleIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, snmpModules, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Counter32", "Integer32", "ModuleIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "snmpModules")
diff --git a/pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py b/pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py
index 6765df8..c5d5b35 100644
--- a/pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py
+++ b/pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py
@@ -1,13 +1,12 @@
# PySNMP SMI module. Autogenerated from smidump -f python SNMP-NOTIFICATION-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:30:49 2011,
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 22:00:57 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( SnmpAdminString, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
( SnmpTagValue, snmpTargetBasicGroup, snmpTargetBasicGroup, snmpTargetBasicGroup, snmpTargetParamsMPModel, snmpTargetParamsName, snmpTargetParamsRowStatus, snmpTargetParamsSecurityLevel, snmpTargetParamsSecurityModel, snmpTargetParamsSecurityName, snmpTargetParamsStorageType, snmpTargetResponseGroup, ) = mibBuilder.importSymbols("SNMP-TARGET-MIB", "SnmpTagValue", "snmpTargetBasicGroup", "snmpTargetBasicGroup", "snmpTargetBasicGroup", "snmpTargetParamsMPModel", "snmpTargetParamsName", "snmpTargetParamsRowStatus", "snmpTargetParamsSecurityLevel", "snmpTargetParamsSecurityModel", "snmpTargetParamsSecurityName", "snmpTargetParamsStorageType", "snmpTargetResponseGroup")
( ModuleCompliance, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup")
@@ -25,11 +24,11 @@ snmpNotifyTable = MibTable((1, 3, 6, 1, 6, 3, 13, 1, 1))
if mibBuilder.loadTexts: snmpNotifyTable.setDescription("This table is used to select management targets which should\nreceive notifications, as well as the type of notification\nwhich should be sent to each selected management target.")
snmpNotifyEntry = MibTableRow((1, 3, 6, 1, 6, 3, 13, 1, 1, 1)).setIndexNames((1, "SNMP-NOTIFICATION-MIB", "snmpNotifyName"))
if mibBuilder.loadTexts: snmpNotifyEntry.setDescription("An entry in this table selects a set of management targets\nwhich should receive notifications, as well as the type of\n\n\n\nnotification which should be sent to each selected\nmanagement target.\n\nEntries in the snmpNotifyTable are created and\ndeleted using the snmpNotifyRowStatus object.")
-snmpNotifyName = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
+snmpNotifyName = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: snmpNotifyName.setDescription("The locally arbitrary, but unique identifier associated\nwith this snmpNotifyEntry.")
snmpNotifyTag = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 2), SnmpTagValue().clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpNotifyTag.setDescription("This object contains a single tag value which is used\nto select entries in the snmpTargetAddrTable. Any entry\nin the snmpTargetAddrTable which contains a tag value\nwhich is equal to the value of an instance of this\nobject is selected. If this object contains a value\nof zero length, no entries are selected.")
-snmpNotifyType = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 3), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(2,1,)).subtype(namedValues=namedval.NamedValues(("trap", 1), ("inform", 2), )).clone(1)).setMaxAccess("readcreate")
+snmpNotifyType = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 3), Integer().subtype(subtypeSpec=SingleValueConstraint(2,1,)).subtype(namedValues=NamedValues(("trap", 1), ("inform", 2), )).clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpNotifyType.setDescription("This object determines the type of notification to\n\n\n\nbe generated for entries in the snmpTargetAddrTable\nselected by the corresponding instance of\nsnmpNotifyTag. This value is only used when\ngenerating notifications, and is ignored when\nusing the snmpTargetAddrTable for other purposes.\n\nIf the value of this object is trap(1), then any\nmessages generated for selected rows will contain\nUnconfirmed-Class PDUs.\n\nIf the value of this object is inform(2), then any\nmessages generated for selected rows will contain\nConfirmed-Class PDUs.\n\nNote that if an SNMP entity only supports\ngeneration of Unconfirmed-Class PDUs (and not\nConfirmed-Class PDUs), then this object may be\nread-only.")
snmpNotifyStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 4), StorageType().clone('nonVolatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpNotifyStorageType.setDescription("The storage type for this conceptual row.\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.")
@@ -39,7 +38,7 @@ snmpNotifyFilterProfileTable = MibTable((1, 3, 6, 1, 6, 3, 13, 1, 2))
if mibBuilder.loadTexts: snmpNotifyFilterProfileTable.setDescription("This table is used to associate a notification filter\nprofile with a particular set of target parameters.")
snmpNotifyFilterProfileEntry = MibTableRow((1, 3, 6, 1, 6, 3, 13, 1, 2, 1)).setIndexNames((1, "SNMP-TARGET-MIB", "snmpTargetParamsName"))
if mibBuilder.loadTexts: snmpNotifyFilterProfileEntry.setDescription("An entry in this table indicates the name of the filter\nprofile to be used when generating notifications using\nthe corresponding entry in the snmpTargetParamsTable.\n\nEntries in the snmpNotifyFilterProfileTable are created\nand deleted using the snmpNotifyFilterProfileRowStatus\nobject.")
-snmpNotifyFilterProfileName = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")
+snmpNotifyFilterProfileName = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpNotifyFilterProfileName.setDescription("The name of the filter profile to be used when generating\nnotifications using the corresponding entry in the\nsnmpTargetAddrTable.")
snmpNotifyFilterProfileStorType = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 2, 1, 2), StorageType().clone('nonVolatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpNotifyFilterProfileStorType.setDescription("The storage type for this conceptual row.\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.")
@@ -51,9 +50,9 @@ snmpNotifyFilterEntry = MibTableRow((1, 3, 6, 1, 6, 3, 13, 1, 3, 1)).setIndexNam
if mibBuilder.loadTexts: snmpNotifyFilterEntry.setDescription("An element of a filter profile.\n\nEntries in the snmpNotifyFilterTable are created and\ndeleted using the snmpNotifyFilterRowStatus object.")
snmpNotifyFilterSubtree = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 3, 1, 1), ObjectIdentifier()).setMaxAccess("noaccess")
if mibBuilder.loadTexts: snmpNotifyFilterSubtree.setDescription("The MIB subtree which, when combined with the corresponding\ninstance of snmpNotifyFilterMask, defines a family of\nsubtrees which are included in or excluded from the\nfilter profile.")
-snmpNotifyFilterMask = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 3, 1, 2), OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 16)).clone('')).setMaxAccess("readcreate")
+snmpNotifyFilterMask = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 3, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16)).clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpNotifyFilterMask.setDescription("The bit mask which, in combination with the corresponding\ninstance of snmpNotifyFilterSubtree, defines a family of\nsubtrees which are included in or excluded from the\nfilter profile.\n\nEach bit of this bit mask corresponds to a\nsub-identifier of snmpNotifyFilterSubtree, with the\nmost significant bit of the i-th octet of this octet\nstring value (extended if necessary, see below)\ncorresponding to the (8*i - 7)-th sub-identifier, and\nthe least significant bit of the i-th octet of this\noctet string corresponding to the (8*i)-th\nsub-identifier, where i is in the range 1 through 16.\n\nEach bit of this bit mask specifies whether or not\nthe corresponding sub-identifiers must match when\ndetermining if an OBJECT IDENTIFIER matches this\nfamily of filter subtrees; a '1' indicates that an\nexact match must occur; a '0' indicates 'wild card',\ni.e., any sub-identifier value matches.\n\n\n\nThus, the OBJECT IDENTIFIER X of an object instance\nis contained in a family of filter subtrees if, for\neach sub-identifier of the value of\nsnmpNotifyFilterSubtree, either:\n\n the i-th bit of snmpNotifyFilterMask is 0, or\n\n the i-th sub-identifier of X is equal to the i-th\n sub-identifier of the value of\n snmpNotifyFilterSubtree.\n\nIf the value of this bit mask is M bits long and\nthere are more than M sub-identifiers in the\ncorresponding instance of snmpNotifyFilterSubtree,\nthen the bit mask is extended with 1's to be the\nrequired length.\n\nNote that when the value of this object is the\nzero-length string, this extension rule results in\na mask of all-1's being used (i.e., no 'wild card'),\nand the family of filter subtrees is the one\nsubtree uniquely identified by the corresponding\ninstance of snmpNotifyFilterSubtree.")
-snmpNotifyFilterType = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 3, 1, 3), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(1,2,)).subtype(namedValues=namedval.NamedValues(("included", 1), ("excluded", 2), )).clone(1)).setMaxAccess("readcreate")
+snmpNotifyFilterType = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 3, 1, 3), Integer().subtype(subtypeSpec=SingleValueConstraint(1,2,)).subtype(namedValues=NamedValues(("included", 1), ("excluded", 2), )).clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpNotifyFilterType.setDescription("This object indicates whether the family of filter subtrees\ndefined by this entry are included in or excluded from a\nfilter. A more detailed discussion of the use of this\nobject can be found in section 6. of [SNMP-APPL].")
snmpNotifyFilterStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 3, 1, 4), StorageType().clone('nonVolatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpNotifyFilterStorageType.setDescription("The storage type for this conceptual row.\nConceptual rows having the value 'permanent' need not\n\n\n\nallow write-access to any columnar objects in the row.")
diff --git a/pysnmp/smi/mibs/SNMP-PROXY-MIB.py b/pysnmp/smi/mibs/SNMP-PROXY-MIB.py
index d96531f..c2600e6 100644
--- a/pysnmp/smi/mibs/SNMP-PROXY-MIB.py
+++ b/pysnmp/smi/mibs/SNMP-PROXY-MIB.py
@@ -1,13 +1,12 @@
# PySNMP SMI module. Autogenerated from smidump -f python SNMP-PROXY-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:33:26 2011,
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 22:00:43 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( SnmpAdminString, SnmpEngineID, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString", "SnmpEngineID")
( SnmpTagValue, snmpTargetBasicGroup, snmpTargetResponseGroup, ) = mibBuilder.importSymbols("SNMP-TARGET-MIB", "SnmpTagValue", "snmpTargetBasicGroup", "snmpTargetResponseGroup")
( ModuleCompliance, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup")
@@ -25,9 +24,9 @@ snmpProxyTable = MibTable((1, 3, 6, 1, 6, 3, 14, 1, 2))
if mibBuilder.loadTexts: snmpProxyTable.setDescription("The table of translation parameters used by proxy forwarder\napplications for forwarding SNMP messages.")
snmpProxyEntry = MibTableRow((1, 3, 6, 1, 6, 3, 14, 1, 2, 1)).setIndexNames((1, "SNMP-PROXY-MIB", "snmpProxyName"))
if mibBuilder.loadTexts: snmpProxyEntry.setDescription("A set of translation parameters used by a proxy forwarder\napplication for forwarding SNMP messages.\n\nEntries in the snmpProxyTable are created and deleted\nusing the snmpProxyRowStatus object.")
-snmpProxyName = MibTableColumn((1, 3, 6, 1, 6, 3, 14, 1, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
+snmpProxyName = MibTableColumn((1, 3, 6, 1, 6, 3, 14, 1, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: snmpProxyName.setDescription("The locally arbitrary, but unique identifier associated\nwith this snmpProxyEntry.")
-snmpProxyType = MibTableColumn((1, 3, 6, 1, 6, 3, 14, 1, 2, 1, 2), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(1,2,4,3,)).subtype(namedValues=namedval.NamedValues(("read", 1), ("write", 2), ("trap", 3), ("inform", 4), ))).setMaxAccess("readcreate")
+snmpProxyType = MibTableColumn((1, 3, 6, 1, 6, 3, 14, 1, 2, 1, 2), Integer().subtype(subtypeSpec=SingleValueConstraint(1,2,4,3,)).subtype(namedValues=NamedValues(("read", 1), ("write", 2), ("trap", 3), ("inform", 4), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpProxyType.setDescription("The type of message that may be forwarded using\nthe translation parameters defined by this entry.")
snmpProxyContextEngineID = MibTableColumn((1, 3, 6, 1, 6, 3, 14, 1, 2, 1, 3), SnmpEngineID()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpProxyContextEngineID.setDescription("The contextEngineID contained in messages that\nmay be forwarded using the translation parameters\ndefined by this entry.")
diff --git a/pysnmp/smi/mibs/SNMP-TARGET-MIB.py b/pysnmp/smi/mibs/SNMP-TARGET-MIB.py
index 9ecf1c3..3212421 100644
--- a/pysnmp/smi/mibs/SNMP-TARGET-MIB.py
+++ b/pysnmp/smi/mibs/SNMP-TARGET-MIB.py
@@ -1,13 +1,12 @@
# PySNMP SMI module. Autogenerated from smidump -f python SNMP-TARGET-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:33:45 2011,
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 21:53:31 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( SnmpAdminString, SnmpMessageProcessingModel, SnmpSecurityLevel, SnmpSecurityModel, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString", "SnmpMessageProcessingModel", "SnmpSecurityLevel", "SnmpSecurityModel")
( ModuleCompliance, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup")
( Bits, Counter32, Integer32, Integer32, ModuleIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, snmpModules, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Counter32", "Integer32", "Integer32", "ModuleIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "snmpModules")
@@ -17,11 +16,11 @@ from pyasn1.type import constraint, namedval
class SnmpTagList(TextualConvention, OctetString):
displayHint = "255t"
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(0,255)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(0,255)
class SnmpTagValue(TextualConvention, OctetString):
displayHint = "255t"
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(0,255)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(0,255)
# Objects
@@ -37,7 +36,7 @@ snmpTargetAddrTable = MibTable((1, 3, 6, 1, 6, 3, 12, 1, 2))
if mibBuilder.loadTexts: snmpTargetAddrTable.setDescription("A table of transport addresses to be used in the generation\nof SNMP messages.")
snmpTargetAddrEntry = MibTableRow((1, 3, 6, 1, 6, 3, 12, 1, 2, 1)).setIndexNames((1, "SNMP-TARGET-MIB", "snmpTargetAddrName"))
if mibBuilder.loadTexts: snmpTargetAddrEntry.setDescription("A transport address to be used in the generation\nof SNMP operations.\n\nEntries in the snmpTargetAddrTable are created and\ndeleted using the snmpTargetAddrRowStatus object.")
-snmpTargetAddrName = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
+snmpTargetAddrName = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: snmpTargetAddrName.setDescription("The locally arbitrary, but unique identifier associated\nwith this snmpTargetAddrEntry.")
snmpTargetAddrTDomain = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 2), TDomain()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetAddrTDomain.setDescription("This object indicates the transport type of the address\ncontained in the snmpTargetAddrTAddress object.")
@@ -45,11 +44,11 @@ snmpTargetAddrTAddress = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 3), TAdd
if mibBuilder.loadTexts: snmpTargetAddrTAddress.setDescription("This object contains a transport address. The format of\nthis address depends on the value of the\nsnmpTargetAddrTDomain object.")
snmpTargetAddrTimeout = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 4), TimeInterval().clone('1500')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetAddrTimeout.setDescription("This object should reflect the expected maximum round\ntrip time for communicating with the transport address\ndefined by this row. When a message is sent to this\naddress, and a response (if one is expected) is not\nreceived within this time period, an implementation\nmay assume that the response will not be delivered.\n\nNote that the time interval that an application waits\nfor a response may actually be derived from the value\nof this object. The method for deriving the actual time\ninterval is implementation dependent. One such method\nis to derive the expected round trip time based on a\nparticular retransmission algorithm and on the number\nof timeouts which have occurred. The type of message may\nalso be considered when deriving expected round trip\ntimes for retransmissions. For example, if a message is\nbeing sent with a securityLevel that indicates both\n\n\n\nauthentication and privacy, the derived value may be\nincreased to compensate for extra processing time spent\nduring authentication and encryption processing.")
-snmpTargetAddrRetryCount = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 255)).clone(3)).setMaxAccess("readcreate")
+snmpTargetAddrRetryCount = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(3)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetAddrRetryCount.setDescription("This object specifies a default number of retries to be\nattempted when a response is not received for a generated\nmessage. An application may provide its own retry count,\nin which case the value of this object is ignored.")
snmpTargetAddrTagList = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 6), SnmpTagList().clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetAddrTagList.setDescription("This object contains a list of tag values which are\nused to select target addresses for a particular\noperation.")
-snmpTargetAddrParams = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 7), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")
+snmpTargetAddrParams = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 7), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetAddrParams.setDescription("The value of this object identifies an entry in the\nsnmpTargetParamsTable. The identified entry\ncontains SNMP parameters to be used when generating\nmessages to be sent to this transport address.")
snmpTargetAddrStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 8), StorageType().clone('nonVolatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetAddrStorageType.setDescription("The storage type for this conceptual row.\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.")
@@ -59,11 +58,11 @@ snmpTargetParamsTable = MibTable((1, 3, 6, 1, 6, 3, 12, 1, 3))
if mibBuilder.loadTexts: snmpTargetParamsTable.setDescription("A table of SNMP target information to be used\nin the generation of SNMP messages.")
snmpTargetParamsEntry = MibTableRow((1, 3, 6, 1, 6, 3, 12, 1, 3, 1)).setIndexNames((1, "SNMP-TARGET-MIB", "snmpTargetParamsName"))
if mibBuilder.loadTexts: snmpTargetParamsEntry.setDescription("A set of SNMP target information.\n\n\n\nEntries in the snmpTargetParamsTable are created and\ndeleted using the snmpTargetParamsRowStatus object.")
-snmpTargetParamsName = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 1), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
+snmpTargetParamsName = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: snmpTargetParamsName.setDescription("The locally arbitrary, but unique identifier associated\nwith this snmpTargetParamsEntry.")
snmpTargetParamsMPModel = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 2), SnmpMessageProcessingModel()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetParamsMPModel.setDescription("The Message Processing Model to be used when generating\nSNMP messages using this entry.")
-snmpTargetParamsSecurityModel = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 3), SnmpSecurityModel().subtype(subtypeSpec=constraint.ValueRangeConstraint(1, 2147483647))).setMaxAccess("readcreate")
+snmpTargetParamsSecurityModel = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 3), SnmpSecurityModel().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetParamsSecurityModel.setDescription("The Security Model to be used when generating SNMP\nmessages using this entry. An implementation may\nchoose to return an inconsistentValue error if an\nattempt is made to set this variable to a value\nfor a security model which the implementation does\nnot support.")
snmpTargetParamsSecurityName = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 4), SnmpAdminString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: snmpTargetParamsSecurityName.setDescription("The securityName which identifies the Principal on\nwhose behalf SNMP messages will be generated using\nthis entry.")
diff --git a/pysnmp/smi/mibs/SNMP-USER-BASED-SM-3DES-MIB.py b/pysnmp/smi/mibs/SNMP-USER-BASED-SM-3DES-MIB.py
index 05872e3..27f8b91 100644
--- a/pysnmp/smi/mibs/SNMP-USER-BASED-SM-3DES-MIB.py
+++ b/pysnmp/smi/mibs/SNMP-USER-BASED-SM-3DES-MIB.py
@@ -1,10 +1,7 @@
# PySNMP SMI module. Autogenerated from smidump -f python SNMP-USER-BASED-SM-3DES-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:37:25 2011,
+# by libsmi2pysnmp-0.1.2 at Sun Nov 6 01:37:25 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
diff --git a/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.py b/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.py
index df2831f..ae63484 100644
--- a/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.py
+++ b/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.py
@@ -1,14 +1,12 @@
-# PySNMP SMI module. Mostly autogenerated from
-# smidump -f python SNMP-USER-BASED-SM-MIB
-# by libsmi2pysnmp-0.0.8-alpha at Tue Feb 5 16:09:21 2008,
-# Python version (2, 4, 4, 'final', 0)
-
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
+# PySNMP SMI module. Autogenerated from smidump -f python SNMP-USER-BASED-SM-MIB
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 21:49:44 2011,
+# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( SnmpAdminString, SnmpEngineID, snmpAuthProtocols, snmpPrivProtocols, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString", "SnmpEngineID", "snmpAuthProtocols", "snmpPrivProtocols")
( ModuleCompliance, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup")
( Bits, Counter32, Integer32, ModuleIdentity, MibIdentifier, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, snmpModules, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Counter32", "Integer32", "ModuleIdentity", "MibIdentifier", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "snmpModules")
@@ -59,7 +57,7 @@ usmUserEntry = MibTableRow((1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1)).setIndexNames((0,
if mibBuilder.loadTexts: usmUserEntry.setDescription("A user configured in the SNMP engine's Local\nConfiguration Datastore (LCD) for the User-based\nSecurity Model.")
usmUserEngineID = MibTableColumn((1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 1), SnmpEngineID()).setMaxAccess("noaccess")
if mibBuilder.loadTexts: usmUserEngineID.setDescription("An SNMP engine's administratively-unique identifier.\n\nIn a simple agent, this value is always that agent's\nown snmpEngineID value.\n\nThe value can also take the value of the snmpEngineID\nof a remote SNMP engine with which this user can\ncommunicate.")
-usmUserName = MibTableColumn((1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 2), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
+usmUserName = MibTableColumn((1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: usmUserName.setDescription("A human readable string representing the name of\nthe user.\n\nThis is the (User-based Security) Model dependent\nsecurity ID.")
# Automatically initialize this column value from index name
class UsmUserSecurityName(MibTableColumn):
@@ -103,7 +101,7 @@ usmUserPrivKeyChange = MibTableColumn((1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 9), Key
if mibBuilder.loadTexts: usmUserPrivKeyChange.setDescription("An object, which when modified, causes the secret\nencryption key used for messages sent on behalf\nof this user to/from the SNMP engine identified by\nusmUserEngineID, to be modified via a one-way\nfunction.\n\nThe associated protocol is the usmUserPrivProtocol.\nThe associated secret key is the user's secret\nprivacy key (privKey). The associated hash\nalgorithm is the algorithm used by the user's\nusmUserAuthProtocol.\n\nWhen creating a new user, it is an 'inconsistentName'\nerror for a set operation to refer to this object\nunless it is previously or concurrently initialized\nthrough a set operation on the corresponding instance\nof usmUserCloneFrom.\n\nWhen the value of the corresponding usmUserPrivProtocol\nis usmNoPrivProtocol, then a set is successful, but\neffectively is a no-op.\n\nWhen this object is read, the zero-length (empty)\nstring is returned.\nSee the description clause of usmUserAuthKeyChange for\na recommended procedure to do a key change.")
usmUserOwnPrivKeyChange = MibTableColumn((1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 10), KeyChange().clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usmUserOwnPrivKeyChange.setDescription("Behaves exactly as usmUserPrivKeyChange, with one\nnotable difference: in order for the Set operation\nto succeed, the usmUserName of the operation\nrequester must match the usmUserName that indexes\n\n\n\nthe row which is targeted by this operation.\nIn addition, the USM security model must be\nused for this operation.\n\nThe idea here is that access to this column can be\npublic, since it will only allow a user to change\nhis own secret privacy key (privKey).\nNote that this can only be done once the row is active.\n\nWhen a set is received and the usmUserName of the\nrequester is not the same as the umsUserName that\nindexes the row which is targeted by this operation,\nthen a 'noAccess' error must be returned.\n\nWhen a set is received and the security model in use\nis not USM, then a 'noAccess' error must be returned.")
-usmUserPublic = MibTableColumn((1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 11), OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate")
+usmUserPublic = MibTableColumn((1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usmUserPublic.setDescription("A publicly-readable value which can be written as part\nof the procedure for changing a user's secret\nauthentication and/or privacy key, and later read to\ndetermine whether the change of the secret was\neffected.")
usmUserStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 12), StorageType().clone('nonVolatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usmUserStorageType.setDescription("The storage type for this conceptual row.\n\nConceptual rows having the value 'permanent' must\nallow write-access at a minimum to:\n\n- usmUserAuthKeyChange, usmUserOwnAuthKeyChange\n and usmUserPublic for a user who employs\n authentication, and\n- usmUserPrivKeyChange, usmUserOwnPrivKeyChange\n and usmUserPublic for a user who employs\n privacy.\n\n\n\nNote that any user who employs authentication or\nprivacy must allow its secret(s) to be updated and\nthus cannot be 'readOnly'.\n\nIf an initial set operation tries to set the value to\n'readOnly' for a user who employs authentication or\nprivacy, then an 'inconsistentValue' error must be\nreturned. Note that if the value has been previously\nset (implicit or explicit) to any value, then the rules\nas defined in the StorageType Textual Convention apply.\n\nIt is an implementation issue to decide if a SET for\na readOnly or permanent row is accepted at all. In some\ncontexts this may make sense, in others it may not. If\na SET for a readOnly or permanent row is not accepted\nat all, then a 'wrongValue' error must be returned.")
@@ -118,6 +116,12 @@ usmMIBGroups = MibIdentifier((1, 3, 6, 1, 6, 3, 15, 2, 2))
# Groups
usmMIBBasicGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 15, 2, 2, 1)).setObjects(("SNMP-USER-BASED-SM-MIB", "usmStatsUnknownEngineIDs"), ("SNMP-USER-BASED-SM-MIB", "usmUserOwnAuthKeyChange"), ("SNMP-USER-BASED-SM-MIB", "usmStatsNotInTimeWindows"), ("SNMP-USER-BASED-SM-MIB", "usmStatsUnknownUserNames"), ("SNMP-USER-BASED-SM-MIB", "usmUserSecurityName"), ("SNMP-USER-BASED-SM-MIB", "usmStatsUnsupportedSecLevels"), ("SNMP-USER-BASED-SM-MIB", "usmStatsDecryptionErrors"), ("SNMP-USER-BASED-SM-MIB", "usmUserStatus"), ("SNMP-USER-BASED-SM-MIB", "usmUserPrivKeyChange"), ("SNMP-USER-BASED-SM-MIB", "usmUserOwnPrivKeyChange"), ("SNMP-USER-BASED-SM-MIB", "usmUserStorageType"), ("SNMP-USER-BASED-SM-MIB", "usmUserSpinLock"), ("SNMP-USER-BASED-SM-MIB", "usmUserAuthKeyChange"), ("SNMP-USER-BASED-SM-MIB", "usmUserCloneFrom"), ("SNMP-USER-BASED-SM-MIB", "usmUserPrivProtocol"), ("SNMP-USER-BASED-SM-MIB", "usmUserAuthProtocol"), ("SNMP-USER-BASED-SM-MIB", "usmStatsWrongDigests"), ("SNMP-USER-BASED-SM-MIB", "usmUserPublic"), )
+if mibBuilder.loadTexts: usmMIBBasicGroup.setDescription("A collection of objects providing for configuration\nof an SNMP engine which implements the SNMP\nUser-based Security Model.")
+
+# Compliances
+
+usmMIBCompliance = ModuleCompliance((1, 3, 6, 1, 6, 3, 15, 2, 1, 1)).setObjects(("SNMP-USER-BASED-SM-MIB", "usmMIBBasicGroup"), )
+if mibBuilder.loadTexts: usmMIBCompliance.setDescription("The compliance statement for SNMP engines which\nimplement the SNMP-USER-BASED-SM-MIB.")
# Exports
@@ -132,3 +136,6 @@ mibBuilder.exportSymbols("SNMP-USER-BASED-SM-MIB", usmNoAuthProtocol=usmNoAuthPr
# Groups
mibBuilder.exportSymbols("SNMP-USER-BASED-SM-MIB", usmMIBBasicGroup=usmMIBBasicGroup)
+
+# Compliances
+mibBuilder.exportSymbols("SNMP-USER-BASED-SM-MIB", usmMIBCompliance=usmMIBCompliance)
diff --git a/pysnmp/smi/mibs/SNMP-USM-AES-MIB.py b/pysnmp/smi/mibs/SNMP-USM-AES-MIB.py
index 38cffb1..f5cf230 100644
--- a/pysnmp/smi/mibs/SNMP-USM-AES-MIB.py
+++ b/pysnmp/smi/mibs/SNMP-USM-AES-MIB.py
@@ -1,13 +1,12 @@
# PySNMP SMI module. Autogenerated from smidump -f python SNMP-USM-AES-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:36:16 2011,
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 21:49:12 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( snmpPrivProtocols, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "snmpPrivProtocols")
( Bits, Integer32, ModuleIdentity, MibIdentifier, ObjectIdentity, TimeTicks, snmpModules, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "ModuleIdentity", "MibIdentifier", "ObjectIdentity", "TimeTicks", "snmpModules")
diff --git a/pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py b/pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py
index 8e85907..4f3bdc4 100644
--- a/pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py
+++ b/pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py
@@ -1,13 +1,12 @@
# PySNMP SMI module. Autogenerated from smidump -f python SNMP-VIEW-BASED-ACM-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:40:23 2011,
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 21:08:57 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( SnmpAdminString, SnmpSecurityLevel, SnmpSecurityModel, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString", "SnmpSecurityLevel", "SnmpSecurityModel")
( ModuleCompliance, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup")
( Bits, Integer32, ModuleIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, snmpModules, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "ModuleIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "snmpModules")
@@ -24,17 +23,17 @@ vacmContextTable = MibTable((1, 3, 6, 1, 6, 3, 16, 1, 1))
if mibBuilder.loadTexts: vacmContextTable.setDescription("The table of locally available contexts.\n\nThis table provides information to SNMP Command\n\n\n\nGenerator applications so that they can properly\nconfigure the vacmAccessTable to control access to\nall contexts at the SNMP entity.\n\nThis table may change dynamically if the SNMP entity\nallows that contexts are added/deleted dynamically\n(for instance when its configuration changes). Such\nchanges would happen only if the management\ninstrumentation at that SNMP entity recognizes more\n(or fewer) contexts.\n\nThe presence of entries in this table and of entries\nin the vacmAccessTable are independent. That is, a\ncontext identified by an entry in this table is not\nnecessarily referenced by any entries in the\nvacmAccessTable; and the context(s) referenced by an\nentry in the vacmAccessTable does not necessarily\ncurrently exist and thus need not be identified by an\nentry in this table.\n\nThis table must be made accessible via the default\ncontext so that Command Responder applications have\na standard way of retrieving the information.\n\nThis table is read-only. It cannot be configured via\nSNMP.")
vacmContextEntry = MibTableRow((1, 3, 6, 1, 6, 3, 16, 1, 1, 1)).setIndexNames((0, "SNMP-VIEW-BASED-ACM-MIB", "vacmContextName"))
if mibBuilder.loadTexts: vacmContextEntry.setDescription("Information about a particular context.")
-vacmContextName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
+vacmContextName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: vacmContextName.setDescription("A human readable name identifying a particular\ncontext at a particular SNMP entity.\n\nThe empty contextName (zero length) represents the\ndefault context.")
vacmSecurityToGroupTable = MibTable((1, 3, 6, 1, 6, 3, 16, 1, 2))
if mibBuilder.loadTexts: vacmSecurityToGroupTable.setDescription("This table maps a combination of securityModel and\nsecurityName into a groupName which is used to define\nan access control policy for a group of principals.")
vacmSecurityToGroupEntry = MibTableRow((1, 3, 6, 1, 6, 3, 16, 1, 2, 1)).setIndexNames((0, "SNMP-VIEW-BASED-ACM-MIB", "vacmSecurityModel"), (0, "SNMP-VIEW-BASED-ACM-MIB", "vacmSecurityName"))
if mibBuilder.loadTexts: vacmSecurityToGroupEntry.setDescription("An entry in this table maps the combination of a\nsecurityModel and securityName into a groupName.")
-vacmSecurityModel = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 1), SnmpSecurityModel().subtype(subtypeSpec=constraint.ValueRangeConstraint(1, 2147483647))).setMaxAccess("noaccess")
+vacmSecurityModel = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 1), SnmpSecurityModel().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: vacmSecurityModel.setDescription("The Security Model, by which the vacmSecurityName\nreferenced by this entry is provided.\n\n\n\nNote, this object may not take the 'any' (0) value.")
-vacmSecurityName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 2), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
+vacmSecurityName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: vacmSecurityName.setDescription("The securityName for the principal, represented in a\nSecurity Model independent format, which is mapped by\nthis entry to a groupName.")
-vacmGroupName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 3), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")
+vacmGroupName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 3), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: vacmGroupName.setDescription("The name of the group to which this entry (e.g., the\ncombination of securityModel and securityName)\nbelongs.\n\nThis groupName is used as index into the\nvacmAccessTable to select an access control policy.\nHowever, a value in this table does not imply that an\ninstance with the value exists in table vacmAccesTable.")
vacmSecurityToGroupStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 4), StorageType().clone('nonVolatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: vacmSecurityToGroupStorageType.setDescription("The storage type for this conceptual row.\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.")
@@ -44,19 +43,19 @@ vacmAccessTable = MibTable((1, 3, 6, 1, 6, 3, 16, 1, 4))
if mibBuilder.loadTexts: vacmAccessTable.setDescription("The table of access rights for groups.\n\nEach entry is indexed by a groupName, a contextPrefix,\na securityModel and a securityLevel. To determine\nwhether access is allowed, one entry from this table\nneeds to be selected and the proper viewName from that\nentry must be used for access control checking.\n\nTo select the proper entry, follow these steps:\n\n1) the set of possible matches is formed by the\n intersection of the following sets of entries:\n\n the set of entries with identical vacmGroupName\n the union of these two sets:\n - the set with identical vacmAccessContextPrefix\n - the set of entries with vacmAccessContextMatch\n value of 'prefix' and matching\n vacmAccessContextPrefix\n intersected with the union of these two sets:\n - the set of entries with identical\n vacmSecurityModel\n - the set of entries with vacmSecurityModel\n value of 'any'\n intersected with the set of entries with\n vacmAccessSecurityLevel value less than or equal\n to the requested securityLevel\n\n\n\n2) if this set has only one member, we're done\n otherwise, it comes down to deciding how to weight\n the preferences between ContextPrefixes,\n SecurityModels, and SecurityLevels as follows:\n a) if the subset of entries with securityModel\n matching the securityModel in the message is\n not empty, then discard the rest.\n b) if the subset of entries with\n vacmAccessContextPrefix matching the contextName\n in the message is not empty,\n then discard the rest\n c) discard all entries with ContextPrefixes shorter\n than the longest one remaining in the set\n d) select the entry with the highest securityLevel\n\nPlease note that for securityLevel noAuthNoPriv, all\ngroups are really equivalent since the assumption that\nthe securityName has been authenticated does not hold.")
vacmAccessEntry = MibTableRow((1, 3, 6, 1, 6, 3, 16, 1, 4, 1)).setIndexNames((0, "SNMP-VIEW-BASED-ACM-MIB", "vacmGroupName"), (0, "SNMP-VIEW-BASED-ACM-MIB", "vacmAccessContextPrefix"), (0, "SNMP-VIEW-BASED-ACM-MIB", "vacmAccessSecurityModel"), (0, "SNMP-VIEW-BASED-ACM-MIB", "vacmAccessSecurityLevel"))
if mibBuilder.loadTexts: vacmAccessEntry.setDescription("An access right configured in the Local Configuration\nDatastore (LCD) authorizing access to an SNMP context.\n\nEntries in this table can use an instance value for\nobject vacmGroupName even if no entry in table\nvacmAccessSecurityToGroupTable has a corresponding\nvalue for object vacmGroupName.")
-vacmAccessContextPrefix = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 1), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 32))).setMaxAccess("noaccess")
+vacmAccessContextPrefix = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: vacmAccessContextPrefix.setDescription("In order to gain the access rights allowed by this\nconceptual row, a contextName must match exactly\n(if the value of vacmAccessContextMatch is 'exact')\nor partially (if the value of vacmAccessContextMatch\nis 'prefix') to the value of the instance of this\nobject.")
vacmAccessSecurityModel = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 2), SnmpSecurityModel()).setMaxAccess("noaccess")
if mibBuilder.loadTexts: vacmAccessSecurityModel.setDescription("In order to gain the access rights allowed by this\nconceptual row, this securityModel must be in use.")
vacmAccessSecurityLevel = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 3), SnmpSecurityLevel()).setMaxAccess("noaccess")
if mibBuilder.loadTexts: vacmAccessSecurityLevel.setDescription("The minimum level of security required in order to\ngain the access rights allowed by this conceptual\nrow. A securityLevel of noAuthNoPriv is less than\nauthNoPriv which in turn is less than authPriv.\n\nIf multiple entries are equally indexed except for\nthis vacmAccessSecurityLevel index, then the entry\nwhich has the highest value for\nvacmAccessSecurityLevel is selected.")
-vacmAccessContextMatch = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 4), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(2,1,)).subtype(namedValues=namedval.NamedValues(("exact", 1), ("prefix", 2), )).clone(1)).setMaxAccess("readcreate")
+vacmAccessContextMatch = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 4), Integer().subtype(subtypeSpec=SingleValueConstraint(2,1,)).subtype(namedValues=NamedValues(("exact", 1), ("prefix", 2), )).clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: vacmAccessContextMatch.setDescription("If the value of this object is exact(1), then all\nrows where the contextName exactly matches\nvacmAccessContextPrefix are selected.\n\nIf the value of this object is prefix(2), then all\nrows where the contextName whose starting octets\nexactly match vacmAccessContextPrefix are selected.\nThis allows for a simple form of wildcarding.")
-vacmAccessReadViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 5), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate")
+vacmAccessReadViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 5), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: vacmAccessReadViewName.setDescription("The value of an instance of this object identifies\nthe MIB view of the SNMP context to which this\nconceptual row authorizes read access.\n\nThe identified MIB view is that one for which the\nvacmViewTreeFamilyViewName has the same value as the\ninstance of this object; if the value is the empty\nstring or if there is no active MIB view having this\nvalue of vacmViewTreeFamilyViewName, then no access\nis granted.")
-vacmAccessWriteViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 6), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate")
+vacmAccessWriteViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 6), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: vacmAccessWriteViewName.setDescription("The value of an instance of this object identifies\nthe MIB view of the SNMP context to which this\nconceptual row authorizes write access.\n\nThe identified MIB view is that one for which the\nvacmViewTreeFamilyViewName has the same value as the\ninstance of this object; if the value is the empty\nstring or if there is no active MIB view having this\nvalue of vacmViewTreeFamilyViewName, then no access\nis granted.")
-vacmAccessNotifyViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 7), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate")
+vacmAccessNotifyViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 7), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: vacmAccessNotifyViewName.setDescription("The value of an instance of this object identifies\nthe MIB view of the SNMP context to which this\nconceptual row authorizes access for notifications.\n\nThe identified MIB view is that one for which the\nvacmViewTreeFamilyViewName has the same value as the\ninstance of this object; if the value is the empty\nstring or if there is no active MIB view having this\nvalue of vacmViewTreeFamilyViewName, then no access\nis granted.")
vacmAccessStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 8), StorageType().clone('nonVolatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: vacmAccessStorageType.setDescription("The storage type for this conceptual row.\n\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.")
@@ -69,13 +68,13 @@ vacmViewTreeFamilyTable = MibTable((1, 3, 6, 1, 6, 3, 16, 1, 5, 2))
if mibBuilder.loadTexts: vacmViewTreeFamilyTable.setDescription("Locally held information about families of subtrees\nwithin MIB views.\n\nEach MIB view is defined by two sets of view subtrees:\n - the included view subtrees, and\n - the excluded view subtrees.\nEvery such view subtree, both the included and the\n\n\n\nexcluded ones, is defined in this table.\n\nTo determine if a particular object instance is in\na particular MIB view, compare the object instance's\nOBJECT IDENTIFIER with each of the MIB view's active\nentries in this table. If none match, then the\nobject instance is not in the MIB view. If one or\nmore match, then the object instance is included in,\nor excluded from, the MIB view according to the\nvalue of vacmViewTreeFamilyType in the entry whose\nvalue of vacmViewTreeFamilySubtree has the most\nsub-identifiers. If multiple entries match and have\nthe same number of sub-identifiers (when wildcarding\nis specified with the value of vacmViewTreeFamilyMask),\nthen the lexicographically greatest instance of\nvacmViewTreeFamilyType determines the inclusion or\nexclusion.\n\nAn object instance's OBJECT IDENTIFIER X matches an\nactive entry in this table when the number of\nsub-identifiers in X is at least as many as in the\nvalue of vacmViewTreeFamilySubtree for the entry,\nand each sub-identifier in the value of\nvacmViewTreeFamilySubtree matches its corresponding\nsub-identifier in X. Two sub-identifiers match\neither if the corresponding bit of the value of\nvacmViewTreeFamilyMask for the entry is zero (the\n'wild card' value), or if they are equal.\n\nA 'family' of subtrees is the set of subtrees defined\nby a particular combination of values of\nvacmViewTreeFamilySubtree and vacmViewTreeFamilyMask.\n\nIn the case where no 'wild card' is defined in the\nvacmViewTreeFamilyMask, the family of subtrees reduces\nto a single subtree.\n\nWhen creating or changing MIB views, an SNMP Command\nGenerator application should utilize the\nvacmViewSpinLock to try to avoid collisions. See\nDESCRIPTION clause of vacmViewSpinLock.\n\nWhen creating MIB views, it is strongly advised that\nfirst the 'excluded' vacmViewTreeFamilyEntries are\ncreated and then the 'included' entries.\n\nWhen deleting MIB views, it is strongly advised that\nfirst the 'included' vacmViewTreeFamilyEntries are\n\n\n\ndeleted and then the 'excluded' entries.\n\nIf a create for an entry for instance-level access\ncontrol is received and the implementation does not\nsupport instance-level granularity, then an\ninconsistentName error must be returned.")
vacmViewTreeFamilyEntry = MibTableRow((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1)).setIndexNames((0, "SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilyViewName"), (0, "SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilySubtree"))
if mibBuilder.loadTexts: vacmViewTreeFamilyEntry.setDescription("Information on a particular family of view subtrees\nincluded in or excluded from a particular SNMP\ncontext's MIB view.\n\nImplementations must not restrict the number of\nfamilies of view subtrees for a given MIB view,\nexcept as dictated by resource constraints on the\noverall number of entries in the\nvacmViewTreeFamilyTable.\n\nIf no conceptual rows exist in this table for a given\nMIB view (viewName), that view may be thought of as\nconsisting of the empty set of view subtrees.")
-vacmViewTreeFamilyViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
+vacmViewTreeFamilyViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: vacmViewTreeFamilyViewName.setDescription("The human readable name for a family of view subtrees.")
vacmViewTreeFamilySubtree = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 2), ObjectIdentifier()).setMaxAccess("noaccess")
if mibBuilder.loadTexts: vacmViewTreeFamilySubtree.setDescription("The MIB subtree which when combined with the\ncorresponding instance of vacmViewTreeFamilyMask\ndefines a family of view subtrees.")
-vacmViewTreeFamilyMask = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 3), OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 16)).clone('')).setMaxAccess("readcreate")
+vacmViewTreeFamilyMask = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16)).clone('')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: vacmViewTreeFamilyMask.setDescription("The bit mask which, in combination with the\ncorresponding instance of vacmViewTreeFamilySubtree,\ndefines a family of view subtrees.\n\nEach bit of this bit mask corresponds to a\nsub-identifier of vacmViewTreeFamilySubtree, with the\nmost significant bit of the i-th octet of this octet\nstring value (extended if necessary, see below)\ncorresponding to the (8*i - 7)-th sub-identifier, and\nthe least significant bit of the i-th octet of this\noctet string corresponding to the (8*i)-th\nsub-identifier, where i is in the range 1 through 16.\n\nEach bit of this bit mask specifies whether or not\nthe corresponding sub-identifiers must match when\ndetermining if an OBJECT IDENTIFIER is in this\nfamily of view subtrees; a '1' indicates that an\nexact match must occur; a '0' indicates 'wild card',\ni.e., any sub-identifier value matches.\n\nThus, the OBJECT IDENTIFIER X of an object instance\nis contained in a family of view subtrees if, for\neach sub-identifier of the value of\nvacmViewTreeFamilySubtree, either:\n\n the i-th bit of vacmViewTreeFamilyMask is 0, or\n\n the i-th sub-identifier of X is equal to the i-th\n sub-identifier of the value of\n vacmViewTreeFamilySubtree.\n\nIf the value of this bit mask is M bits long and\n\n\n\nthere are more than M sub-identifiers in the\ncorresponding instance of vacmViewTreeFamilySubtree,\nthen the bit mask is extended with 1's to be the\nrequired length.\n\nNote that when the value of this object is the\nzero-length string, this extension rule results in\na mask of all-1's being used (i.e., no 'wild card'),\nand the family of view subtrees is the one view\nsubtree uniquely identified by the corresponding\ninstance of vacmViewTreeFamilySubtree.\n\nNote that masks of length greater than zero length\ndo not need to be supported. In this case this\nobject is made read-only.")
-vacmViewTreeFamilyType = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 4), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(1,2,)).subtype(namedValues=namedval.NamedValues(("included", 1), ("excluded", 2), )).clone(1)).setMaxAccess("readcreate")
+vacmViewTreeFamilyType = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 4), Integer().subtype(subtypeSpec=SingleValueConstraint(1,2,)).subtype(namedValues=NamedValues(("included", 1), ("excluded", 2), )).clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: vacmViewTreeFamilyType.setDescription("Indicates whether the corresponding instances of\nvacmViewTreeFamilySubtree and vacmViewTreeFamilyMask\ndefine a family of view subtrees which is included in\nor excluded from the MIB view.")
vacmViewTreeFamilyStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 5), StorageType().clone('nonVolatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: vacmViewTreeFamilyStorageType.setDescription("The storage type for this conceptual row.\n\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.")
diff --git a/pysnmp/smi/mibs/SNMPv2-MIB.py b/pysnmp/smi/mibs/SNMPv2-MIB.py
index 28889da..45bcde2 100644
--- a/pysnmp/smi/mibs/SNMPv2-MIB.py
+++ b/pysnmp/smi/mibs/SNMPv2-MIB.py
@@ -1,13 +1,12 @@
# PySNMP SMI module. Autogenerated from smidump -f python SNMPv2-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:38:28 2011,
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 21:47:49 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
-
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( ModuleCompliance, NotificationGroup, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup")
( Bits, Counter32, Integer32, ModuleIdentity, MibIdentifier, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, TimeTicks, mib_2, snmpModules, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Counter32", "Integer32", "ModuleIdentity", "MibIdentifier", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "TimeTicks", "mib-2", "snmpModules")
( DisplayString, TestAndIncr, TimeStamp, ) = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TestAndIncr", "TimeStamp")
@@ -15,19 +14,19 @@ from pyasn1.type import constraint, namedval
# Objects
system = MibIdentifier((1, 3, 6, 1, 2, 1, 1))
-sysDescr = MibScalar((1, 3, 6, 1, 2, 1, 1, 1), DisplayString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 255))).setMaxAccess("readonly")
+sysDescr = MibScalar((1, 3, 6, 1, 2, 1, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sysDescr.setDescription("A textual description of the entity. This value should\ninclude the full name and version identification of\nthe system's hardware type, software operating-system,\nand networking software.")
sysObjectID = MibScalar((1, 3, 6, 1, 2, 1, 1, 2), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sysObjectID.setDescription("The vendor's authoritative identification of the\nnetwork management subsystem contained in the entity.\nThis value is allocated within the SMI enterprises\nsubtree (1.3.6.1.4.1) and provides an easy and\nunambiguous means for determining `what kind of box' is\nbeing managed. For example, if vendor `Flintstones,\nInc.' was assigned the subtree 1.3.6.1.4.1.424242,\nit could assign the identifier 1.3.6.1.4.1.424242.1.1\nto its `Fred Router'.")
sysUpTime = MibScalar((1, 3, 6, 1, 2, 1, 1, 3), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sysUpTime.setDescription("The time (in hundredths of a second) since the\nnetwork management portion of the system was last\nre-initialized.")
-sysContact = MibScalar((1, 3, 6, 1, 2, 1, 1, 4), DisplayString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 255))).setMaxAccess("readwrite")
+sysContact = MibScalar((1, 3, 6, 1, 2, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sysContact.setDescription("The textual identification of the contact person for\nthis managed node, together with information on how\nto contact this person. If no contact information is\nknown, the value is the zero-length string.")
-sysName = MibScalar((1, 3, 6, 1, 2, 1, 1, 5), DisplayString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 255))).setMaxAccess("readwrite")
+sysName = MibScalar((1, 3, 6, 1, 2, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sysName.setDescription("An administratively-assigned name for this managed\nnode. By convention, this is the node's fully-qualified\ndomain name. If the name is unknown, the value is\nthe zero-length string.")
-sysLocation = MibScalar((1, 3, 6, 1, 2, 1, 1, 6), DisplayString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 255))).setMaxAccess("readwrite")
+sysLocation = MibScalar((1, 3, 6, 1, 2, 1, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sysLocation.setDescription("The physical location of this node (e.g., 'telephone\ncloset, 3rd floor'). If the location is unknown, the\nvalue is the zero-length string.")
-sysServices = MibScalar((1, 3, 6, 1, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 127))).setMaxAccess("readonly")
+sysServices = MibScalar((1, 3, 6, 1, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 127))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sysServices.setDescription("A value which indicates the set of services that this\nentity may potentially offer. The value is a sum.\n\n\n\nThis sum initially takes the value zero. Then, for\neach layer, L, in the range 1 through 7, that this node\nperforms transactions for, 2 raised to (L - 1) is added\nto the sum. For example, a node which performs only\nrouting functions would have a value of 4 (2^(3-1)).\nIn contrast, a node which is a host offering application\nservices would have a value of 72 (2^(4-1) + 2^(7-1)).\nNote that in the context of the Internet suite of\nprotocols, values should be calculated accordingly:\n\n layer functionality\n 1 physical (e.g., repeaters)\n 2 datalink/subnetwork (e.g., bridges)\n 3 internet (e.g., supports the IP)\n 4 end-to-end (e.g., supports the TCP)\n 7 applications (e.g., supports the SMTP)\n\nFor systems including OSI protocols, layers 5 and 6\nmay also be counted.")
sysORLastChange = MibScalar((1, 3, 6, 1, 2, 1, 1, 8), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sysORLastChange.setDescription("The value of sysUpTime at the time of the most recent\nchange in state or value of any instance of sysORID.")
@@ -35,7 +34,7 @@ sysORTable = MibTable((1, 3, 6, 1, 2, 1, 1, 9))
if mibBuilder.loadTexts: sysORTable.setDescription("The (conceptual) table listing the capabilities of\nthe local SNMP application acting as a command\nresponder with respect to various MIB modules.\nSNMP entities having dynamically-configurable support\nof MIB modules will have a dynamically-varying number\nof conceptual rows.")
sysOREntry = MibTableRow((1, 3, 6, 1, 2, 1, 1, 9, 1)).setIndexNames((0, "SNMPv2-MIB", "sysORIndex"))
if mibBuilder.loadTexts: sysOREntry.setDescription("An entry (conceptual row) in the sysORTable.")
-sysORIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 1, 9, 1, 1), Integer32().subtype(subtypeSpec=constraint.ValueRangeConstraint(1, 2147483647))).setMaxAccess("noaccess")
+sysORIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 1, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("noaccess")
if mibBuilder.loadTexts: sysORIndex.setDescription("The auxiliary variable used for identifying instances\nof the columnar objects in the sysORTable.")
sysORID = MibTableColumn((1, 3, 6, 1, 2, 1, 1, 9, 1, 2), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sysORID.setDescription("An authoritative identification of a capabilities\nstatement with respect to various MIB modules supported\nby the local SNMP application acting as a command\nresponder.")
@@ -98,7 +97,7 @@ snmpOutGetResponses = MibScalar((1, 3, 6, 1, 2, 1, 11, 28), Counter32()).setMaxA
if mibBuilder.loadTexts: snmpOutGetResponses.setDescription("The total number of SNMP Get-Response PDUs which\nhave been generated by the SNMP protocol entity.")
snmpOutTraps = MibScalar((1, 3, 6, 1, 2, 1, 11, 29), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpOutTraps.setDescription("The total number of SNMP Trap PDUs which have\nbeen generated by the SNMP protocol entity.")
-snmpEnableAuthenTraps = MibScalar((1, 3, 6, 1, 2, 1, 11, 30), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(2,1,)).subtype(namedValues=namedval.NamedValues(("enabled", 1), ("disabled", 2), ))).setMaxAccess("readwrite")
+snmpEnableAuthenTraps = MibScalar((1, 3, 6, 1, 2, 1, 11, 30), Integer().subtype(subtypeSpec=SingleValueConstraint(2,1,)).subtype(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpEnableAuthenTraps.setDescription("Indicates whether the SNMP entity is permitted to\ngenerate authenticationFailure traps. The value of this\nobject overrides any configuration information; as such,\nit provides a means whereby all authenticationFailure\ntraps may be disabled.\n\nNote that it is strongly recommended that this object\nbe stored in non-volatile memory so that it remains\nconstant across re-initializations of the network\nmanagement system.")
snmpSilentDrops = MibScalar((1, 3, 6, 1, 2, 1, 11, 31), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpSilentDrops.setDescription("The total number of Confirmed Class PDUs (such as\nGetRequest-PDUs, GetNextRequest-PDUs,\nGetBulkRequest-PDUs, SetRequest-PDUs, and\nInformRequest-PDUs) delivered to the SNMP entity which\nwere silently dropped because the size of a reply\ncontaining an alternate Response Class PDU (such as a\nResponse-PDU) with an empty variable-bindings field\nwas greater than either a local constraint or the\nmaximum message size associated with the originator of\nthe request.")
diff --git a/pysnmp/smi/mibs/SNMPv2-SMI.py b/pysnmp/smi/mibs/SNMPv2-SMI.py
index 3d6dbbe..31e2796 100644
--- a/pysnmp/smi/mibs/SNMPv2-SMI.py
+++ b/pysnmp/smi/mibs/SNMPv2-SMI.py
@@ -1,12 +1,17 @@
from pysnmp.smi.indices import OidOrderedDict
from pysnmp.smi import mibdata, exval, error
from pysnmp.proto import rfc1902
-from pyasn1.type import constraint
-from pyasn1.error import ValueConstraintError, PyAsn1Error
from pysnmp import cache, debug
+from pyasn1.error import PyAsn1Error
-( Integer, ObjectIdentifier, Null ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "Null")
-
+( Integer, ObjectIdentifier ) = mibBuilder.importSymbols(
+ "ASN1", "Integer", "ObjectIdentifier"
+ )
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint,
+ ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols(
+ "ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion",
+ "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint"
+ )
# syntax of objects
OctetString = rfc1902.OctetString
@@ -21,7 +26,7 @@ Opaque = rfc1902.Opaque
Counter64 = rfc1902.Counter64
class ExtUTCTime(OctetString):
- subtypeSpec = OctetString.subtypeSpec+constraint.ConstraintsUnion(constraint.ValueSizeConstraint(11,11), constraint.ValueSizeConstraint(13,13))
+ subtypeSpec = OctetString.subtypeSpec+ConstraintsUnion(ValueSizeConstraint(11,11), ValueSizeConstraint(13,13))
# definitions for information modules
diff --git a/pysnmp/smi/mibs/SNMPv2-TC.py b/pysnmp/smi/mibs/SNMPv2-TC.py
index b775535..9e721e8 100644
--- a/pysnmp/smi/mibs/SNMPv2-TC.py
+++ b/pysnmp/smi/mibs/SNMPv2-TC.py
@@ -1,11 +1,16 @@
import sys
from pysnmp.smi import error
-from pyasn1.type import constraint, namedval
from pysnmp import debug
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols(
'ASN1', 'OctetString', 'Integer', 'ObjectIdentifier'
)
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint,
+ ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols(
+ "ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion",
+ "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint"
+ )
Counter32, Unsigned32, TimeTicks, Counter64 = mibBuilder.importSymbols(
'SNMPv2-SMI', 'Counter32', 'Unsigned32', 'TimeTicks', 'Counter64'
)
@@ -167,23 +172,23 @@ class TextualConvention:
# return str(value)
class DisplayString(TextualConvention, OctetString):
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(0,255)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(0,255)
displayHint = "255a"
class PhysAddress(TextualConvention, OctetString):
displayHint = "1x:"
class MacAddress(TextualConvention, OctetString):
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(6,6)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(6,6)
displayHint = "1x:"
fixedLength = 6
class TruthValue(Integer, TextualConvention):
- subtypeSpec = Integer.subtypeSpec+constraint.SingleValueConstraint(1, 2)
- namedValues = namedval.NamedValues(('true', 1), ('false', 2))
+ subtypeSpec = Integer.subtypeSpec+SingleValueConstraint(1, 2)
+ namedValues = NamedValues(('true', 1), ('false', 2))
class TestAndIncr(Integer, TextualConvention):
- subtypeSpec = Integer.subtypeSpec+constraint.ValueRangeConstraint(0, 2147483647)
+ subtypeSpec = Integer.subtypeSpec+ValueRangeConstraint(0, 2147483647)
defaultValue = 0
def smiWrite(self, name, value, idx):
if value != self:
@@ -203,8 +208,8 @@ class RowStatus(Integer, TextualConvention):
"""A special kind of scalar MIB variable responsible for
MIB table row creation/destruction.
"""
- subtypeSpec = Integer.subtypeSpec+constraint.SingleValueConstraint(0, 1, 2, 3, 4, 5, 6)
- namedValues = namedval.NamedValues(
+ subtypeSpec = Integer.subtypeSpec+SingleValueConstraint(0, 1, 2, 3, 4, 5, 6)
+ namedValues = NamedValues(
('notExists', 0), ('active', 1), ('notInService', 2), ('notReady', 3),
('createAndGo', 4), ('createAndWait', 5), ('destroy', 6)
)
@@ -317,15 +322,15 @@ class RowStatus(Integer, TextualConvention):
class TimeStamp(TimeTicks, TextualConvention): pass
class TimeInterval(Integer, TextualConvention):
- subtypeSpec = Integer.subtypeSpec+constraint.ValueRangeConstraint(0, 2147483647)
+ subtypeSpec = Integer.subtypeSpec+ValueRangeConstraint(0, 2147483647)
class DateAndTime(TextualConvention, OctetString):
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(8, 11)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(8, 11)
displayHint = "2d-1d-1d,1d:1d:1d.1d,1a1d:1d"
class StorageType(Integer, TextualConvention):
- subtypeSpec = Integer.subtypeSpec+constraint.SingleValueConstraint(1, 2, 3, 4, 5)
- namedValues = namedval.NamedValues(
+ subtypeSpec = Integer.subtypeSpec+SingleValueConstraint(1, 2, 3, 4, 5)
+ namedValues = NamedValues(
('other', 1), ('volatile', 2), ('nonVolatile', 3),
('permanent', 4), ('readOnly', 5)
)
@@ -333,7 +338,7 @@ class StorageType(Integer, TextualConvention):
class TDomain(ObjectIdentifier, TextualConvention): pass
class TAddress(OctetString, TextualConvention):
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(1, 255)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(1, 255)
mibBuilder.exportSymbols(
'SNMPv2-TC', TextualConvention=TextualConvention, DisplayString=DisplayString,
diff --git a/pysnmp/smi/mibs/SNMPv2-TM.py b/pysnmp/smi/mibs/SNMPv2-TM.py
index 8a5dada..d437dec 100644
--- a/pysnmp/smi/mibs/SNMPv2-TM.py
+++ b/pysnmp/smi/mibs/SNMPv2-TM.py
@@ -1,19 +1,15 @@
-from pyasn1.type import constraint
-OctetString, = mibBuilder.importSymbols('ASN1', 'OctetString')
-( ModuleIdentity, MibIdentifier, ObjectIdentity, snmpModules,
- snmpDomains, snmpProxys ) = mibBuilder.importSymbols(
- 'SNMPv2-SMI', 'ModuleIdentity', 'MibIdentifier', 'ObjectIdentity',
- 'snmpModules', 'snmpDomains', 'snmpProxys'
- )
-TextualConvention, = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention')
+( OctetString, ) = mibBuilder.importSymbols('ASN1', 'OctetString')
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
+( ModuleIdentity, MibIdentifier, ObjectIdentity, snmpModules, snmpDomains, snmpProxys ) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'MibIdentifier', 'ObjectIdentity', 'snmpModules', 'snmpDomains', 'snmpProxys')
+( TextualConvention, ) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention')
snmpv2tm = ModuleIdentity(snmpModules.name + (19,)).setRevisions(("2002-10-16 00:00",))
snmpUDPDomain = ObjectIdentity(snmpDomains.name + (1,))
class SnmpUDPAddress(TextualConvention, OctetString):
- subtypeSpec = OctetString.subtypeSpec + constraint.ValueSizeConstraint(6, 6)
+ subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(6, 6)
displayHint = "1d.1d.1d.1d/2d"
def prettyIn(self, value):
@@ -36,18 +32,18 @@ snmpCLNSDomain = ObjectIdentity(snmpDomains.name + (2,))
snmpCONSDomain = ObjectIdentity(snmpDomains.name + (3,))
class SnmpOSIAddress(TextualConvention, OctetString):
- subtypeSpec = OctetString.subtypeSpec + constraint.ValueSizeConstraint(1, 85)
+ subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(1, 85)
displayHint = "*1x:/1x:"
snmpDDPDomain = ObjectIdentity(snmpDomains.name + (4,))
class SnmpNBPAddress(OctetString, TextualConvention):
- subtypeSpec = OctetString.subtypeSpec + constraint.ValueSizeConstraint(3, 99)
+ subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(3, 99)
snmpIPXDomain = ObjectIdentity(snmpDomains.name + (5,))
class SnmpIPXAddress(TextualConvention, OctetString):
- subtypeSpec = OctetString.subtypeSpec + constraint.ValueSizeConstraint(12, 12)
+ subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(12, 12)
displayHint = "4x.1x:1x:1x:1x:1x:1x.2d"
rfc1157Proxy = MibIdentifier(snmpProxys.name + (1,))
diff --git a/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py b/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py
index 2f09075..81503e4 100644
--- a/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py
+++ b/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py
@@ -1,28 +1,29 @@
# PySNMP SMI module. Autogenerated from smidump -f python TRANSPORT-ADDRESS-MIB
-# by libsmi2pysnmp-0.1.1 at Sun Nov 6 01:40:56 2011,
+# by libsmi2pysnmp-0.1.2 at Sat Nov 19 21:06:33 2011,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
-# Imported just in case new ASN.1 types would be created
-from pyasn1.type import constraint, namedval
+import socket
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
+( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
+( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
( Bits, Integer32, ModuleIdentity, MibIdentifier, ObjectIdentity, TimeTicks, mib_2, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "ModuleIdentity", "MibIdentifier", "ObjectIdentity", "TimeTicks", "mib-2")
( TextualConvention, ) = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention")
# Types
class TransportAddress(OctetString):
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(0,255)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(0,255)
class TransportAddressDns(TextualConvention, OctetString):
displayHint = "1a"
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(1,255)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(1,255)
class TransportAddressIPv4(TextualConvention, OctetString):
displayHint = "1d.1d.1d.1d:2d"
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(6,6)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(6,6)
fixedLength = 6
def prettyIn(self, value):
@@ -43,12 +44,12 @@ class TransportAddressIPv4(TextualConvention, OctetString):
class TransportAddressIPv4z(TextualConvention, OctetString):
displayHint = "1d.1d.1d.1d%4d:2d"
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(10,10)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(10,10)
fixedLength = 10
class TransportAddressIPv6(TextualConvention, OctetString):
displayHint = "0a[2x:2x:2x:2x:2x:2x:2x:2x]0a:2d"
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(18,18)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(18,18)
fixedLength = 18
def prettyIn(self, value):
@@ -69,16 +70,16 @@ class TransportAddressIPv6(TextualConvention, OctetString):
class TransportAddressIPv6z(TextualConvention, OctetString):
displayHint = "0a[2x:2x:2x:2x:2x:2x:2x:2x%4d]0a:2d"
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(22,22)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(22,22)
fixedLength = 22
class TransportAddressLocal(TextualConvention, OctetString):
displayHint = "1a"
- subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(1,255)
+ subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(1,255)
class TransportAddressType(Integer):
- subtypeSpec = Integer.subtypeSpec+constraint.SingleValueConstraint(12,9,14,2,7,8,0,11,1,15,16,3,4,10,6,5,13,)
- namedValues = namedval.NamedValues(("unknown", 0), ("udpIpv4", 1), ("sctpIpv6", 10), ("sctpIpv4z", 11), ("sctpIpv6z", 12), ("local", 13), ("udpDns", 14), ("tcpDns", 15), ("sctpDns", 16), ("udpIpv6", 2), ("udpIpv4z", 3), ("udpIpv6z", 4), ("tcpIpv4", 5), ("tcpIpv6", 6), ("tcpIpv4z", 7), ("tcpIpv6z", 8), ("sctpIpv4", 9), )
+ subtypeSpec = Integer.subtypeSpec+SingleValueConstraint(12,9,14,2,7,8,0,11,1,15,16,3,4,10,6,5,13,)
+ namedValues = NamedValues(("unknown", 0), ("udpIpv4", 1), ("sctpIpv6", 10), ("sctpIpv4z", 11), ("sctpIpv6z", 12), ("local", 13), ("udpDns", 14), ("tcpDns", 15), ("sctpDns", 16), ("udpIpv6", 2), ("udpIpv4z", 3), ("udpIpv6z", 4), ("tcpIpv4", 5), ("tcpIpv6", 6), ("tcpIpv4z", 7), ("tcpIpv6z", 8), ("sctpIpv4", 9), )
class TransportDomain(ObjectIdentifier):
pass
diff --git a/tools/libsmi2pysnmp b/tools/libsmi2pysnmp
index 22b2dc7..d79aa2e 100644
--- a/tools/libsmi2pysnmp
+++ b/tools/libsmi2pysnmp
@@ -3,7 +3,7 @@
# compliant module
import sys, time
-version = '0.1.1'
+version = '0.1.2'
genTextLoader = 1
class Error(Exception): pass
@@ -179,15 +179,15 @@ def __genTypeDef(symName, symDef, classMode=0):
r = r + '.subtype(subtypeSpec='
# Python has certain limit on the number of func params
if len(typeDef) > 127:
- r = r + 'constraint.ConstraintsUnion('
- r = r + 'constraint.SingleValueConstraint('
+ r = r + 'ConstraintsUnion('
+ r = r + 'SingleValueConstraint('
cnt = 1
for e, v in typeDef.items():
if isinstance(v, dict) and 'nodetype' in v and \
v['nodetype'] == 'namednumber':
r = r + '%s,' % v['number']
if cnt % 127 == 0:
- r = r + '), constraint.SingleValueConstraint('
+ r = r + '), SingleValueConstraint('
cnt = cnt + 1
if len(typeDef) > 127:
r = r + ')'
@@ -197,9 +197,9 @@ def __genTypeDef(symName, symDef, classMode=0):
else:
r = r + '))'
if classMode:
- r = r + 'namedValues = namedval.NamedValues('
+ r = r + 'namedValues = NamedValues('
else:
- r = r + '.subtype(namedValues=namedval.NamedValues('
+ r = r + '.subtype(namedValues=NamedValues('
typedesc = list(typeDef.items())
typedesc.sort(key=lambda x: str(x[1]))
cnt = 1
@@ -208,7 +208,7 @@ def __genTypeDef(symName, symDef, classMode=0):
v['nodetype'] == 'namednumber':
r = r + '(\"%s\", %s), ' % (e, v['number'])
if cnt % 127 == 0:
- r = r + ') + namedval.NamedValues('
+ r = r + ') + NamedValues('
cnt = cnt + 1
if classMode:
r = r + ')\n'
@@ -227,9 +227,9 @@ def __genTypeDef(symName, symDef, classMode=0):
r = r + 'displayHint = \"%s\"\n' % typeDef['format']
r = r + identFiller*identValue
if baseType in __kludgyStringTypes:
- __subtypeSpec = 'constraint.ValueSizeConstraint'
+ __subtypeSpec = 'ValueSizeConstraint'
else:
- __subtypeSpec = 'constraint.ValueRangeConstraint'
+ __subtypeSpec = 'ValueRangeConstraint'
single_range = 0
if 'range' in typeDef:
@@ -239,13 +239,13 @@ def __genTypeDef(symName, symDef, classMode=0):
# http://www.glas.net/~ilya/download/tools/pysnmp/libsmi-0.4.5-perl_python_range_union.patch
if 'ranges' in typeDef:
# if more than one size/range is given, then we need to
- # create a ContraintsUnion to hold all of them.
+ # create a ConstraintsUnion to hold all of them.
if len(typeDef['ranges']) > 1:
single_range = 0
if classMode:
- r = r + 'subtypeSpec = %s.subtypeSpec+constraint.ConstraintsUnion(' % parentType
+ r = r + 'subtypeSpec = %s.subtypeSpec+ConstraintsUnion(' % parentType
else:
- r = r + '.subtype(subtypeSpec=constraint.ConstraintsUnion('
+ r = r + '.subtype(subtypeSpec=ConstraintsUnion('
for range in typeDef['ranges']:
r = r + '%s(%s,%s),' % (__subtypeSpec, __reprIntVal(range['min']), __reprIntVal(range['max']))
if classMode:
@@ -253,7 +253,7 @@ def __genTypeDef(symName, symDef, classMode=0):
r = r + identFiller*identValue
else:
r = r + '))'
- # only one size/range contraint was given
+ # only one size/range constraint was given
if single_range:
if classMode:
r = r + 'subtypeSpec = %s.subtypeSpec+%s(%s,%s)\n' % (parentType, __subtypeSpec, __reprIntVal(typeDef['range']['min']), __reprIntVal(typeDef['range']['max']))
@@ -295,9 +295,6 @@ out.write(
)
out.write("# Python version %s\n\n" % str(sys.version_info))
-out.write('# Imported just in case new ASN.1 types would be created\n')
-out.write('from pyasn1.type import constraint, namedval\n\n')
-
out.write('# Imports\n\n')
imports = {}
@@ -305,6 +302,12 @@ for imp in (
{ 'module': 'ASN1', 'name': 'Integer' },
{ 'module': 'ASN1', 'name': 'OctetString' },
{ 'module': 'ASN1', 'name': 'ObjectIdentifier' },
+ { 'module': 'ASN1-ENUMERATION', 'name': 'NamedValues' },
+ { 'module': 'ASN1-REFINEMENT', 'name': 'ConstraintsUnion' },
+ { 'module': 'ASN1-REFINEMENT', 'name': 'ConstraintsIntersection' },
+ { 'module': 'ASN1-REFINEMENT', 'name': 'SingleValueConstraint' },
+ { 'module': 'ASN1-REFINEMENT', 'name': 'ValueRangeConstraint' },
+ { 'module': 'ASN1-REFINEMENT', 'name': 'ValueSizeConstraint' },
{ 'module': 'SNMPv2-SMI', 'name': 'Bits' }, # XXX
{ 'module': 'SNMPv2-SMI', 'name': 'Integer32' }, # libsmi bug
{ 'module': 'SNMPv2-SMI', 'name': 'TimeTicks' }, # bug in some IETF MIB