PKAq>GEGG-INFO/top_level.txtpysnmp PKAq>Ԛ*  EGG-INFO/SOURCES.txtCHANGES LICENSE MANIFEST.in README THANKS TODO setup.cfg setup.py docs/pysnmp-arch.gif docs/pysnmp-tutorial.html docs/mibs/PYSNMP-MIB.txt docs/mibs/PYSNMP-USM-MIB.txt examples/smi/backend.py examples/smi/instrum.py examples/smi/view.py examples/v1arch/agent/cmdrsp.py examples/v1arch/agent/ntforg.py examples/v1arch/manager/getgen.py examples/v1arch/manager/nextgen.py examples/v1arch/manager/ntfrcv.py examples/v1arch/manager/setgen.py examples/v3arch/agent/cmdrsp.py examples/v3arch/agent/ntforg.py examples/v3arch/manager/bulkgen.py examples/v3arch/manager/getgen.py examples/v3arch/manager/nextgen.py examples/v3arch/manager/ntfrcv.py examples/v3arch/manager/setgen.py examples/v3arch/oneliner/agent/ntforg.py examples/v3arch/oneliner/manager/bulkgen.py examples/v3arch/oneliner/manager/getgen.py examples/v3arch/oneliner/manager/nextgen.py examples/v3arch/oneliner/manager/setgen.py examples/v3arch/oneliner/manager/async/nextgen.py examples/v3arch/oneliner/manager/withmib/nextgen.py examples/v3arch/oneliner/manager/withmib/setgen.py examples/v3arch/proxy/cmdproxy.py examples/v3arch/twisted/agent/cmdrsp.py examples/v3arch/twisted/agent/ntforg.py examples/v3arch/twisted/manager/bulkgen.py examples/v3arch/twisted/manager/getgen.py examples/v3arch/twisted/manager/nextgen.py examples/v3arch/twisted/manager/ntfrcv.py examples/v3arch/twisted/manager/setgen.py pysnmp/__init__.py pysnmp/cache.py pysnmp/debug.py pysnmp/error.py pysnmp/nextid.py pysnmp.egg-info/PKG-INFO pysnmp.egg-info/SOURCES.txt pysnmp.egg-info/dependency_links.txt pysnmp.egg-info/requires.txt pysnmp.egg-info/top_level.txt pysnmp.egg-info/zip-safe pysnmp/carrier/__init__.py pysnmp/carrier/base.py pysnmp/carrier/error.py pysnmp/carrier/asynsock/__init__.py pysnmp/carrier/asynsock/base.py pysnmp/carrier/asynsock/dispatch.py pysnmp/carrier/asynsock/dgram/__init__.py pysnmp/carrier/asynsock/dgram/base.py pysnmp/carrier/asynsock/dgram/udp.py pysnmp/carrier/asynsock/dgram/udp6.py pysnmp/carrier/asynsock/dgram/unix.py pysnmp/carrier/twisted/__init__.py pysnmp/carrier/twisted/base.py pysnmp/carrier/twisted/dispatch.py pysnmp/carrier/twisted/dgram/__init__.py pysnmp/carrier/twisted/dgram/base.py pysnmp/carrier/twisted/dgram/udp.py pysnmp/carrier/twisted/dgram/unix.py pysnmp/entity/__init__.py pysnmp/entity/config.py pysnmp/entity/engine.py pysnmp/entity/rfc3413/__init__.py pysnmp/entity/rfc3413/cmdgen.py pysnmp/entity/rfc3413/cmdrsp.py pysnmp/entity/rfc3413/config.py pysnmp/entity/rfc3413/context.py pysnmp/entity/rfc3413/mibvar.py pysnmp/entity/rfc3413/ntforg.py pysnmp/entity/rfc3413/ntfrcv.py pysnmp/entity/rfc3413/oneliner/__init__.py pysnmp/entity/rfc3413/oneliner/cmdgen.py pysnmp/entity/rfc3413/oneliner/ntforg.py pysnmp/entity/rfc3413/twisted/__init__.py pysnmp/entity/rfc3413/twisted/cmdgen.py pysnmp/entity/rfc3413/twisted/ntforg.py pysnmp/proto/__init__.py pysnmp/proto/cache.py pysnmp/proto/errind.py pysnmp/proto/error.py pysnmp/proto/rfc1155.py pysnmp/proto/rfc1157.py pysnmp/proto/rfc1902.py pysnmp/proto/rfc1905.py pysnmp/proto/rfc3411.py pysnmp/proto/rfc3412.py pysnmp/proto/acmod/__init__.py pysnmp/proto/acmod/rfc3415.py pysnmp/proto/acmod/void.py pysnmp/proto/api/__init__.py pysnmp/proto/api/v1.py pysnmp/proto/api/v2c.py pysnmp/proto/api/verdec.py pysnmp/proto/mpmod/__init__.py pysnmp/proto/mpmod/base.py pysnmp/proto/mpmod/cache.py pysnmp/proto/mpmod/rfc2576.py pysnmp/proto/mpmod/rfc3412.py pysnmp/proto/proxy/__init__.py pysnmp/proto/proxy/rfc2576.py pysnmp/proto/secmod/__init__.py pysnmp/proto/secmod/base.py pysnmp/proto/secmod/cache.py pysnmp/proto/secmod/rfc2576.py pysnmp/proto/secmod/eso/__init__.py pysnmp/proto/secmod/eso/priv/__init__.py pysnmp/proto/secmod/eso/priv/aes192.py pysnmp/proto/secmod/eso/priv/aes256.py pysnmp/proto/secmod/eso/priv/des3.py pysnmp/proto/secmod/rfc3414/__init__.py pysnmp/proto/secmod/rfc3414/localkey.py pysnmp/proto/secmod/rfc3414/service.py pysnmp/proto/secmod/rfc3414/auth/__init__.py pysnmp/proto/secmod/rfc3414/auth/base.py pysnmp/proto/secmod/rfc3414/auth/hmacmd5.py pysnmp/proto/secmod/rfc3414/auth/hmacsha.py pysnmp/proto/secmod/rfc3414/auth/noauth.py pysnmp/proto/secmod/rfc3414/priv/__init__.py pysnmp/proto/secmod/rfc3414/priv/base.py pysnmp/proto/secmod/rfc3414/priv/des.py pysnmp/proto/secmod/rfc3414/priv/nopriv.py pysnmp/proto/secmod/rfc3826/__init__.py pysnmp/proto/secmod/rfc3826/priv/__init__.py pysnmp/proto/secmod/rfc3826/priv/aes.py pysnmp/smi/__init__.py pysnmp/smi/builder.py pysnmp/smi/error.py pysnmp/smi/exval.py pysnmp/smi/indices.py pysnmp/smi/instrum.py pysnmp/smi/view.py pysnmp/smi/mibs/ASN1.py pysnmp/smi/mibs/PYSNMP-MIB.py pysnmp/smi/mibs/PYSNMP-USM-MIB.py pysnmp/smi/mibs/RFC1155-SMI.py pysnmp/smi/mibs/RFC1213-MIB.py pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py pysnmp/smi/mibs/SNMP-MPD-MIB.py pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py pysnmp/smi/mibs/SNMP-TARGET-MIB.py pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.py pysnmp/smi/mibs/SNMP-USM-AES-MIB.py pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py pysnmp/smi/mibs/SNMPv2-CONF.py pysnmp/smi/mibs/SNMPv2-MIB.py pysnmp/smi/mibs/SNMPv2-SMI.py pysnmp/smi/mibs/SNMPv2-TC.py pysnmp/smi/mibs/SNMPv2-TM.py pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py pysnmp/smi/mibs/__init__.py pysnmp/smi/mibs/instances/__PYSNMP-USM-MIB.py pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py pysnmp/smi/mibs/instances/__SNMP-MPD-MIB.py pysnmp/smi/mibs/instances/__SNMP-TARGET-MIB.py pysnmp/smi/mibs/instances/__SNMP-USER-BASED-SM-MIB.py pysnmp/smi/mibs/instances/__SNMP-VIEW-BASED-ACM-MIB.py pysnmp/smi/mibs/instances/__SNMPv2-MIB.py pysnmp/smi/mibs/instances/__init__.py tools/build-pysnmp-mib tools/libsmi2pysnmpPKAq>cEGG-INFO/PKG-INFOMetadata-Version: 1.0 Name: pysnmp Version: 4.1.16a Summary: SNMP framework Home-page: http://sourceforge.net/projects/pysnmp/ Author: Ilya Etingof Author-email: ilya@glas.net License: BSD Description: UNKNOWN Platform: UNKNOWN PKAq>?qEGG-INFO/requires.txtpyasn1>=0.0.13a pycryptoPK=2EGG-INFO/zip-safe PKAq>2EGG-INFO/dependency_links.txt PK)f}=Vz6))!EGG-INFO/scripts/build-pysnmp-mib#!/bin/sh # # Convert MIB text into PySNMP-compilant MIB/managed objects module. # See http://pysnmp.sf.net for more information. # basedir=$(dirname "$0") libsmi2pysnmp=$basedir/libsmi2pysnmp # part of pysnmp distro smidump=smidump # part of libsmi distro while getopts o: o do case "$o" in o) outFile=$OPTARG ;; [?]) echo >&2 "\ Convert MIB text file into PySNMP-compliant module, see http://pysnmp.sf.net. Usage: $0 [-o pysnmp-mib-file ] [ mib-text-file ]\ " exit 1;; esac done [ -n "$outFile" ] && { exec 5>"$outFile" 1>&5 || { echo >&2 "Redirection failed"; exit 1; } } shift $((OPTIND-1)) [ $# -gt 1 ] && { echo >&2 "Extra arguments given"; exit 1; } [ -z $1 ] && { mibFile="-"; } || { mibFile=$1; export SMIPATH="$SMIPATH:$(echo $mibFile | sed -e 's,[^/]*$,.,')"; } egrep -q 'FROM *RFC' $mibFile 2> /dev/null && ! egrep -q 'FROM *SNMPv2-' $mibFile 2> /dev/null && { oldMib='yes'; } || { [ $? -eq 1 ] && { oldMib='no'; } || { echo >&2 "cant open $mibFile"; exit 1; } } [ $oldMib = 'yes' ] && { # pysnmp SMI is SMIv2 [ -x "$(which mktemp)" ] && tmpFile=$(mktemp -t buildmibs.XXXXXXX) || tmpFile=/tmp/buildmibs.$$ $smidump -k -f smiv2 $mibFile > $tmpFile 2> /dev/null || { [ -f $tmpFile ] && rm -f $tmpFile; echo >&2 "$smidump -k -f smiv2 $mibFile fails"; echo >&2 "make sure you are using libsmi version > 0.4.5 (or svn)"; exit ; } $smidump -k -f python $tmpFile 2> /dev/null | $libsmi2pysnmp || { [ -f $tmpFile ] && rm -f $tmpFile; [ -n "$outFile" ] && rm -f $outFile; echo >&2 "$smidump -k -f python $mibFile | $libsmi2pysnmp fails"; echo >&2 "make sure you are using libsmi version > 0.4.5 (or svn)"; exit } rm -f $tmpFile } || { $smidump -k -f python $mibFile 2> /dev/null | $libsmi2pysnmp || { [ -n "$outFile" ] && rm -f $outFile; echo >&2 "$smidump -k -f python $mibFile | $libsmi2pysnmp fails"; echo >&2 "make sure you are using libsmi version > 0.4.5 (or svn)"; exit } } exit PKAq>|ccEGG-INFO/scripts/libsmi2pysnmp#!/usr/local/bin/python2.3 # Walk libsmi-generated tree of MIB symbols and build pysnmp.smi # compliant module from exceptions import StandardError from string import split, join, replace, find, atol, atoi from types import StringType, DictType import sys, time version = '0.0.10-beta' genTextLoader = 1 class Error(StandardError): pass if len(sys.argv) > 1: if sys.argv[1] == '--no-text': genTextLoader = 0 else: sys.stderr.write('SNMP MIB to pysnmp objects converter, version %s.\n\ Usage:\n\ %s [--no-text]\n\ Takes:\n\ smidump -f python \n\ program output on stdin, generates python code on stdout.\n\ The smidump tool is available at http://www.ibr.cs.tu-bs.de/projects/libsmi/\n\ The --no-text option disables code generation for MIB text comments.\n' % (version, sys.argv[0])) sys.exit(-1) inputText = '' while 1: c = sys.stdin.read() if not c: break inputText = inputText + c if not inputText: sys.stderr.write('Empty input\n') sys.exit(-1) codeObj = compile(inputText, '', 'exec') g = {} try: eval(codeObj, g) except StandardError, why: raise Error( 'MIB module load error: %s' % why ) mib = g['MIB'] dstModName = mib['moduleName'] out = sys.stdout __symsTable = { 'MODULE-IDENTITY': ('ModuleIdentity',), 'OBJECT-TYPE': ('MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn'), 'NOTIFICATION-TYPE': ('NotificationType',), 'TEXTUAL-CONVENTION': ('TextualConvention',), 'MODULE-COMPLIANCE': ('ModuleCompliance',), 'OBJECT-GROUP': ('ObjectGroup',), 'NOTIFICATION-GROUP': ('NotificationGroup',), 'AGENT-CAPABILITIES': ('AgentCapabilities',), 'OBJECT-IDENTITY': ('ObjectIdentity',), 'TRAP-TYPE': ('NotificationType',), # smidump always uses NotificationType 'NOTIFICATION-TYPE': ('NotificationType',) } def symTrans(symbol): if __symsTable.has_key(symbol): return __symsTable[symbol] return symbol, def transOpers(symbol): return replace(symbol, '-', '_') def addLabelForSymbol(symbol): if find(symbol, '-') != -1: return '.setLabel(\"%s\")' % symbol return '' __oidToTuple = lambda x: str(tuple(map(lambda y: int(y), split(x, '.')))) def __reprIntVal(value): try: intVal = atoi(value) except ValueError: try: intVal = atol(value) except ValueError: return repr(value) if -2147483647 < intVal < 2147483647: return repr(intVal) else: return repr(long(intVal)) def __genDefVal(baseType, symDef): if baseType == 'OctetString': if symDef['default'][:2] == '0x': defVal = '' for i in range(2, len(symDef['default']), 2): defVal = defVal + chr( atoi(symDef['default'][i:i+2], 16) ) else: defVal = symDef['default'] return '%s' % repr(defVal) elif baseType == 'Integer': return '%s' % __reprIntVal(symDef['default']) elif baseType == 'Integer32': return '%s' % __reprIntVal(symDef['default']) elif baseType == 'ObjectIdentifier': return '%s' % __oidToTuple(symDef['default']) elif baseType == 'IpAddress': defVal = '' for i in range(2, len(symDef['default']), 2): if defVal: defVal = defVal + '.' defVal = defVal + str( atoi(symDef['default'][i:i+2], 16) ) return '\"%s\"' % defVal elif baseType == 'Bits': defVal = '(' for bit in split(replace( replace(replace(symDef['default'], ',', ''), '(', ''), ')', '' )): defVal = defVal + '\"%s\",' % bit defVal = defVal + ')' return defVal elif baseType == 'Enumeration': if symDef['syntax']['type'].has_key(symDef['default']): return '%s' % \ symDef['syntax']['type'][symDef['default']]['number'] else: return '\"%s\"' % symDef['default'] else: sys.stderr.write('WARNING: guessing DEFVAL type \'%s\' for %s\n' % (symDef['default'], baseType)) if symDef['default'][:2] == '0x': defVal = '' for i in range(2, len(symDef['default']), 2): defVal = defVal + chr( atoi(symDef['default'][i:i+2], 16) ) else: defVal = symDef['default'] try: atol(defVal) except ValueError: pass else: return defVal return '%s' % repr(defVal) # Ugly kludge against smidump bug which does not distinguish # size/range constraints __kludgyStringTypes = { 'OctetString': 1 } __buggySmiTypes = { 'NetworkAddress': 'IpAddress' # this is up to smidump, but it does not care } def __genTypeDef((symName, symDef), classMode=0): r = '' if classMode: typeDef = symDef identFiller = ' '; identValue = 0 else: typeDef = symDef['syntax']['type'] if typeDef.has_key('name'): baseType = typeDef['name'] if typeDef.has_key('basetype'): baseType = typeDef['basetype'] if typeDef.has_key('parent module'): parentType = typeDef['parent module']['type'] else: parentType = baseType # Ugly hack to overcome smidump bug in smiv1->smiv2 convertion if __buggySmiTypes.has_key(baseType): baseType = __buggySmiTypes[baseType] if __buggySmiTypes.has_key(parentType): parentType = __buggySmiTypes[parentType] if classMode: r = r + 'class %s(' % symName if typeDef.has_key('format'): r = r + '%s, ' % symTrans('TEXTUAL-CONVENTION')[0] identValue = identValue + 1 if baseType in ('Enumeration', 'Bits'): if baseType == 'Enumeration': parentType = 'Integer' if classMode: r = r + '%s):\n' % parentType r = r + identFiller*identValue else: r = r + ', %s()' % parentType if baseType == 'Enumeration': if classMode: r = r + 'subtypeSpec = %s.subtypeSpec+' % parentType else: 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(' cnt = 1 for e, v in typeDef.items(): if type(v) == DictType and v.has_key('nodetype') \ and v['nodetype'] == 'namednumber': r = r + '%s,' % v['number'] if cnt % 127 == 0: r = r + '), constraint.SingleValueConstraint(' cnt = cnt + 1 if len(typeDef) > 127: r = r + ')' if classMode: r = r + ')\n' r = r + identFiller*identValue else: r = r + '))' if classMode: r = r + 'namedValues = namedval.NamedValues(' else: r = r + '.subtype(namedValues=namedval.NamedValues(' typedesc = typeDef.items() typedesc.sort(lambda x,y: cmp(x[1],y[1])) cnt = 1 for e, v in typedesc: if type(v) == DictType and v.has_key('nodetype') \ and v['nodetype'] == 'namednumber': r = r + '(\"%s\", %s), ' % (e, v['number']) if cnt % 127 == 0: r = r + ') + namedval.NamedValues(' cnt = cnt + 1 if classMode: r = r + ')\n' r = r + identFiller*identValue else: r = r + '))' else: if classMode: r = r + '%s):\n' % parentType r = r + identFiller*identValue else: r = r + ', %s()' % parentType if classMode: if typeDef.has_key('format'): r = r + 'displayHint = \"%s\"\n' % typeDef['format'] r = r + identFiller*identValue if __kludgyStringTypes.has_key(baseType): __subtypeSpec = 'constraint.ValueSizeConstraint' else: __subtypeSpec = 'constraint.ValueRangeConstraint' single_range = 0 if typeDef.has_key('range'): single_range = 1 # ATTENTION: libsmi-0.4.5 does not support "ranges". Use libsmi # SVN version or an older patch from Randy Couey: # http://www.glas.net/~ilya/download/tools/pysnmp/libsmi-0.4.5-perl_python_range_union.patch if typeDef.has_key('ranges'): # if more than one size/range is given, then we need to # create a ContraintsUnion to hold all of them. if len(typeDef['ranges']) > 1: single_range = 0 if classMode: r = r + 'subtypeSpec = %s.subtypeSpec+constraint.ConstraintsUnion(' % parentType else: r = r + '.subtype(subtypeSpec=constraint.ConstraintsUnion(' for range in typeDef['ranges']: r = r + '%s(%s,%s),' % (__subtypeSpec, __reprIntVal(range['min']), __reprIntVal(range['max'])) if classMode: r = r + ')\n' r = r + identFiller*identValue else: r = r + '))' # only one size/range contraint 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'])) r = r + identFiller*identValue if __kludgyStringTypes.has_key(baseType) and \ typeDef['range']['min'] == typeDef['range']['max']: r = r + 'fixedLength = %s\n' % typeDef['range']['min'] r = r + identFiller*identValue else: r = r + '.subtype(subtypeSpec=%s(%s, %s))' % (__subtypeSpec, __reprIntVal(typeDef['range']['min']), __reprIntVal(typeDef['range']['max'])) if __kludgyStringTypes.has_key(baseType) and \ typeDef['range']['min'] == typeDef['range']['max']: r = r + '.setFixedLength(%s)' % typeDef['range']['min'] if symDef.has_key('default') and not symDef.has_key('basetype'): defVal = __genDefVal(baseType, symDef) if classMode: if defVal is not None: r = r + 'defaultValue = %s\n' % defVal else: if defVal is not None: r = r + '.clone(%s)' % defVal if classMode: r = r + 'pass\n\n' return r out.write( "# PySNMP SMI module. Autogenerated from smidump -f python %s\n" % dstModName ) out.write( "# by libsmi2pysnmp-%s at %s,\n" % (version, time.asctime(time.localtime())) ) 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 = {} for imp in ( { 'module': 'ASN1', 'name': 'Integer' }, { 'module': 'ASN1', 'name': 'OctetString' }, { 'module': 'ASN1', 'name': 'ObjectIdentifier' }, { 'module': 'SNMPv2-SMI', 'name': 'Bits' }, # XXX { 'module': 'SNMPv2-SMI', 'name': 'Integer32' }, # libsmi bug { 'module': 'SNMPv2-SMI', 'name': 'TimeTicks' }, # bug in some IETF MIB { 'module': 'SNMPv2-SMI', 'name': 'MibIdentifier' }, # OBJECT IDENTIFIER ) + mib.get('imports', ()): if not imports.has_key(imp['module']): imports[imp['module']] = [] if not imp['module']: sys.stderr.write('WARNING: empty MIB module name seen in smidump output at %s\n' % dstModName) imports[imp['module']].append(imp['name']) map(lambda x:x.sort(), imports.values()) modNames = imports.keys(); modNames.sort() for modName in modNames: out.write('( ') for symName in imports[modName]: for s in symTrans(symName): out.write('%s, ' % transOpers(s)) out.write(') = mibBuilder.importSymbols(\"%s\"' % modName) for symName in imports[modName]: for s in symTrans(symName): out.write(', \"%s\"' % s) out.write(')\n') if mib.has_key('typedefs'): typedefs = mib['typedefs'].items(); typedefs.sort() else: typedefs = () if typedefs: out.write('\n# Types\n\n') for symName, symDef in typedefs: out.write('%s' % __genTypeDef((symName, symDef), 1)) if mib.has_key(dstModName) and mib[dstModName].has_key('identity node'): moduleIdentityNode = mib[dstModName]['identity node'] else: moduleIdentityNode = '' if mib.has_key('nodes'): nodes = mib['nodes'].items() __oid2num = lambda o: map(lambda x: atol(x), split(o, '.')) nodes.sort(lambda x,y,f=__oid2num: cmp( f(x[1].get('oid')), f(y[1].get('oid')) )) else: nodes = () if nodes: out.write('\n# Objects\n\n') row_create = {} for symName, symDef in nodes: if symDef['nodetype'] == 'node': out.write('%s = ' % transOpers(symName)) if symName == moduleIdentityNode: out.write('ModuleIdentity(%s)' % __oidToTuple(symDef['oid'])) if mib.has_key(dstModName): m = mib[dstModName] if m.has_key("revisions"): out.write('.setRevisions((') for r in m["revisions"]: out.write('\"%s\",' % r["date"]) out.write('))') out.write('%s' % addLabelForSymbol(symName)) if genTextLoader: if m.has_key('organization'): out.write('\nif mibBuilder.loadTexts: %s.setOrganization("%s")' % (transOpers(symName), replace(m['organization'], '\n', '\\n'))) if m.has_key('contact'): out.write('\nif mibBuilder.loadTexts: %s.setContactInfo("%s")' % (transOpers(symName), replace(m['contact'], '\n', '\\n'))) if m.has_key('description'): out.write('\nif mibBuilder.loadTexts: %s.setDescription("%s")' % (transOpers(symName), replace(m['description'], '\n', '\\n'))) out.write('\n') continue elif symDef.has_key("description"): out.write('ObjectIdentity(%s)' % __oidToTuple(symDef['oid'])) else: out.write('MibIdentifier(%s)' % __oidToTuple(symDef['oid'])) elif symDef['nodetype'] == 'scalar': out.write('%s = ' % transOpers(symName)) out.write('MibScalar(%s' % __oidToTuple(symDef['oid'])) out.write('%s)' % __genTypeDef((symName, symDef))) out.write('.setMaxAccess(\"%s\")' % symDef['access']) if symDef.has_key('units'): out.write('.setUnits(\"%s\")' % symDef['units']) elif symDef['nodetype'] == 'table': out.write('%s = ' % transOpers(symName)) out.write('MibTable(%s)' % __oidToTuple(symDef['oid'])) elif symDef['nodetype'] == 'row': out.write('%s = ' % transOpers(symName)) # determine if row creation is permitted, and store # status for later inspection by column nodes. if symDef.has_key('create'): row_create[symDef['oid']] = symDef['create'] else: row_create[symDef['oid']] = 'false' out.write('MibTableRow(%s)' % __oidToTuple(symDef['oid'])) if symDef['linkage'] and type(symDef['linkage'][0]) == StringType: out.write('.setIndexNames(') cnt = 0 for idx in symDef['linkage']: if cnt: out.write(', ') else: cnt = cnt + 1 # smidump does not distinguish outer/inner indices for _modName, _symNames in imports.items(): for _symName in _symNames: if _symName == idx: modName = _modName break else: continue break else: modName = dstModName if idx == symDef['linkage'][-1] and \ symDef.has_key("implied") and \ symDef["implied"] == "true": impliedFlag = 1 else: impliedFlag = 0 out.write('(%d, \"%s\", \"%s\")' % ( impliedFlag, modName, idx )) out.write(')') elif symDef['nodetype'] == 'column': out.write('%s = ' % transOpers(symName)) out.write('MibTableColumn(%s' % __oidToTuple(symDef['oid'])) out.write('%s)' % __genTypeDef((symName, symDef))) # smidump does not tag columns as read-create. # we must check the parent row object to determine if column is # createable parent = join(split(symDef['oid'], '.')[:-1], '.') if row_create[parent] == 'true' and symDef['access']=='readwrite': out.write('.setMaxAccess(\"%s\")' % 'readcreate') else: out.write('.setMaxAccess(\"%s\")' % symDef['access']) elif symDef['nodetype'] == 'capabilities': out.write('%s = ' % transOpers(symName)) out.write('AgentCapabilities(%s)' % __oidToTuple(symDef['oid'])) else: sys.stderr.write('Warning: skipping unknown node type %s, oid %s\n' % (symDef['nodetype'], symName)) continue out.write('%s' % addLabelForSymbol(symName)) if genTextLoader: if symDef.has_key("description"): out.write('\nif mibBuilder.loadTexts: %s.setDescription("%s")' % (transOpers(symName), replace(symDef['description'], '\n', '\\n'))) out.write('\n') out.write('\n# Augmentions\n') for symName, symDef in mib['nodes'].items(): if symDef['nodetype'] == 'row': if symDef['linkage'] and type(symDef['linkage'][0]) == DictType: for idx in symDef['linkage']: for m, indices in idx.items(): if m != dstModName: out.write( '%s, = mibBuilder.importSymbols(\"%s\", \"%s\")\n'%( transOpers(indices['relatedNode']), m, indices['relatedNode'] )) out.write( '%s.registerAugmentions((\"%s\", \"%s\"))\n' % ( indices['relatedNode'], dstModName, symName )) out.write( 'apply(%s.setIndexNames, %s.getIndexNames())\n' % ( symName, transOpers(indices['relatedNode']) )) if mib.has_key('notifications'): notifications = mib['notifications'].items() __oid2num = lambda o: map(lambda x: atol(x), split(o, '.')) notifications.sort(lambda x,y,f=__oid2num: cmp( f(x[1].get('oid')), f(y[1].get('oid')) )) else: notifications = () if notifications: out.write('\n# Notifications\n\n') for symName, symDef in notifications: out.write('%s = ' % transOpers(symName)) if symDef['nodetype'] == 'notification': out.write('NotificationType(%s)' % __oidToTuple(symDef['oid'])) out.write('.setObjects(') for objName, objDef in symDef['objects'].items(): out.write('(\"%s\", \"%s\"), ' % (objDef['module'], objName)) out.write(')') out.write('%s' % addLabelForSymbol(symName)) if genTextLoader: if symDef.has_key("description"): out.write('\nif mibBuilder.loadTexts: %s.setDescription("%s")' % (transOpers(symName), replace(symDef['description'], '\n', '\\n'))) out.write('\n') if mib.has_key('groups'): groups = mib['groups'].items() __oid2num = lambda o: map(lambda x: atol(x), split(o, '.')) groups.sort(lambda x,y,f=__oid2num: cmp( f(x[1].get('oid')), f(y[1].get('oid')) )) else: groups = () if groups: out.write('\n# Groups\n\n') for symName, symDef in groups: out.write('%s = ' % transOpers(symName)) if symDef['nodetype'] == 'group': if find(symName, 'otification') < 0: # hackerish out.write('ObjectGroup(') else: out.write('NotificationGroup(') out.write('%s)' % __oidToTuple(symDef['oid'])) out.write('.setObjects(') for objName, objDef in symDef['members'].items(): out.write('(\"%s\", \"%s\"), ' % (objDef['module'], objName)) out.write(')') out.write('%s' % addLabelForSymbol(symName)) if genTextLoader: if symDef.has_key("description"): out.write('\nif mibBuilder.loadTexts: %s.setDescription("%s")' % (transOpers(symName), replace(symDef['description'], '\n', '\\n'))) out.write('\n') if mib.has_key('compliances'): compliances = mib['compliances'].items() __oid2num = lambda o: map(lambda x: atol(x), split(o, '.')) compliances.sort(lambda x,y,f=__oid2num: cmp( f(x[1].get('oid')), f(y[1].get('oid')) )) else: compliances = () if compliances: out.write('\n# Compliances\n\n') for symName, symDef in compliances: out.write('%s = ' % transOpers(symName)) if symDef['nodetype'] == 'compliance': out.write('ModuleCompliance(') out.write('%s)' % __oidToTuple(symDef['oid'])) if symDef.has_key('requires'): out.write('.setObjects(') for objName, objDef in symDef['requires'].items(): # XXX nodetype not stored out.write('(\"%s\", \"%s\"), ' % (objDef['module'], objName)) out.write(')') # XXX refinements not stored out.write('%s' % addLabelForSymbol(symName)) if genTextLoader: if symDef.has_key("description"): out.write('\nif mibBuilder.loadTexts: %s.setDescription("%s")' % (transOpers(symName), replace(symDef['description'], '\n', '\\n'))) out.write('\n') out.write('\n# Exports\n\n') if moduleIdentityNode: out.write('# Module identity\n') out.write('mibBuilder.exportSymbols(\"%s\"' % dstModName) out.write(', PYSNMP_MODULE_ID=%s' % transOpers(moduleIdentityNode)) out.write(')\n\n') if typedefs: out.write('# Types\n') out.write('mibBuilder.exportSymbols(\"%s\"' % dstModName) idx = 1L for symName, symObj in typedefs: if idx % 127 == 0: out.write(')\n') out.write('mibBuilder.exportSymbols(\"%s\"' % dstModName) out.write(', %s=%s' % (symName, symName)) idx = idx + 1 out.write(')\n\n') if nodes: out.write('# Objects\n') out.write('mibBuilder.exportSymbols(\"%s\"' % dstModName) idx = 1L for symName, symObj in nodes: if idx % 127 == 0: out.write(')\n') out.write('mibBuilder.exportSymbols(\"%s\"' % dstModName) out.write(', %s=%s' % ((transOpers(symTrans(symName)[0]),)*2)) idx = idx + 1 out.write(')\n\n') if notifications: out.write('# Notifications\n') out.write('mibBuilder.exportSymbols(\"%s\"' % dstModName) idx = 1L for symName, symObj in notifications: if idx % 127 == 0: out.write(')\n') out.write('mibBuilder.exportSymbols(\"%s\"' % dstModName) out.write(', %s=%s' % ((transOpers(symName),)*2)) idx = idx + 1 out.write(')\n\n') if groups: out.write('# Groups\n') out.write('mibBuilder.exportSymbols(\"%s\"' % dstModName) idx = 1L for symName, symObj in groups: if idx % 127 == 0: out.write(')\n') out.write('mibBuilder.exportSymbols(\"%s\"' % dstModName) out.write(', %s=%s' % ((transOpers(symName),)*2)) idx = idx + 1 out.write(')\n\n') if compliances: out.write('# Compliances\n') out.write('mibBuilder.exportSymbols(\"%s\"' % dstModName) idx = 1L for symName, symObj in compliances: if idx % 127 == 0: out.write(')\n') out.write('mibBuilder.exportSymbols(\"%s\"' % dstModName) out.write(', %s=%s' % ((transOpers(symName),)*2)) idx = idx + 1 out.write(')\n') # XXX # implement API version checking PKAq>Cw_ _ pysnmp/cache.pyc; J;Mc@sdfdYZdS(sCachecBsAtZddZdZdZdZdZdZRS(NicCsR||_d|_|d|_|io|ipd|_h|_h|_dS(Nii i(smaxSizesselfs_Cache__maxSizes _Cache__sizes_Cache__chopSizes _Cache__caches _Cache__usage(sselfsmaxSize((s*build/bdist.linux-i686/egg/pysnmp/cache.pys__init__s     cCs||ijSdS(N(sksselfs _Cache__cache(sselfsk((s*build/bdist.linux-i686/egg/pysnmp/cache.pys __contains__ scCs'|i|d|i|<|i|SdS(Ni(sselfs _Cache__usagesks _Cache__cache(sselfsk((s*build/bdist.linux-i686/egg/pysnmp/cache.pys __getitem__scCs |iSdS(N(sselfs _Cache__size(sself((s*build/bdist.linux-i686/egg/pysnmp/cache.pys__len__scCs|i|ijot|ii}|i|id||i GHx)||i D]}|i|=|i|=qRW|i|i|_n||ijo!|id|_d|i|sil( sselfs _Cache__sizes_Cache__maxSizes _Cache__usageskeysssorts_Cache__chopSizes_ks _Cache__cachesksv(sselfsksvskeyss_k((s*build/bdist.linux-i686/egg/pysnmp/cache.pys __setitem__s  cCs(|i|=|i|=|id|_dS(Ni(sselfs _Cache__cachesks _Cache__usages _Cache__size(sselfsk((s*build/bdist.linux-i686/egg/pysnmp/cache.pys __delitem__"s  (s__name__s __module__s__init__s __contains__s __getitem__s__len__s __setitem__s __delitem__(((s*build/bdist.linux-i686/egg/pysnmp/cache.pysCaches      N(sCache(sCache((s*build/bdist.linux-i686/egg/pysnmp/cache.pys?sPKx4>Y>>pysnmp/__init__.py# PySNMP, version 4 majorVersionId = '4' version = (4, 1, 16) PKAq>Hpppysnmp/error.pyc; Bc@sdefdYZdS(s PySnmpErrorcBstZRS(N(s__name__s __module__(((s*build/bdist.linux-i686/egg/pysnmp/error.pys PySnmpErrorsN(s StandardErrors PySnmpError(s PySnmpError((s*build/bdist.linux-i686/egg/pysnmp/error.pys?sPK4>ttpysnmp/debug.pyimport sys from pysnmp import error flagNone = 0x0000 flagIO = 0x0001 flagDsp = 0x0002 flagMP = 0x0004 flagSM = 0x0008 flagBld = 0x0010 flagMIB = 0x0020 flagIns = 0x0040 flagACL = 0x0080 flagPrx = 0x0100 flagApp = 0x0200 flagAll = 0xffff flagMap = { 'io': flagIO, 'dsp': flagDsp, 'msgproc': flagMP, 'secmod': flagSM, 'mibbuild': flagBld, 'mibview': flagMIB, 'mibinstrum': flagIns, 'acl': flagACL, 'proxy': flagPrx, 'app': flagApp, 'all': flagAll } class Debug: defaultPrinter = sys.stderr.write def __init__(self, *flags): self._flags = flagNone self._printer = self.defaultPrinter for f in flags: if f not in flagMap: raise error.PySnmpError('bad debug flag %s' % f) self._flags = self._flags | flagMap[f] self('debug category %s enabled' % f) def __str__(self): return 'logger %s, flags %x' % (self._printer, self._flags) def __call__(self, msg): self._printer('DBG: %s\n' % msg) def __and__(self, flag): return self._flags & flag def __rand__(self, flag): return flag & self._flags # This will yield false from bitwise and with a flag, and save # on unnecessary calls logger = 0 def setLogger(l): global logger logger = l PKi2g''pysnmp/error.pyclass PySnmpError(StandardError): pass PKAq>s| pysnmp/debug.pyc; |8Mc@sdkZdklZdZdZdZdZdZdZdZ d Z d Z d Z d Z d Zhde<de<de<de<de<de <de <de <de <de <de1D"pysnmp/cache.py# Limited-size dictionary class to use for caches class Cache: def __init__(self, maxSize=256): self.__maxSize = maxSize self.__size = 0 self.__chopSize = maxSize/10 self.__chopSize = self.__chopSize and self.__chopSize or 1 self.__cache = {} self.__usage = {} def __contains__(self, k): return k in self.__cache def __getitem__(self, k): self.__usage[k] = self.__usage[k] + 1 return self.__cache[k] def __len__(self): return self.__size def __setitem__(self, k, v): if self.__size >= self.__maxSize: keys = self.__usage.keys() keys.sort(lambda x,y,d=self.__usage: cmp(d[x],d[y])) print keys[:self.__chopSize] for _k in keys[:self.__chopSize]: del self.__cache[_k] del self.__usage[_k] self.__size = self.__size - self.__chopSize if k not in self.__cache: self.__size = self.__size + 1 self.__usage[k] = 0L self.__cache[k] = v def __delitem__(self, k): del self.__cache[k] del self.__usage[k] self.__size = self.__size - 1 PKL>'pysnmp/nextid.py# Return a next value in a reasonably MT-safe manner import random random.seed() class Integer: def __init__(self, maximum, increment=256): self.__maximum = maximum if increment >= maximum: increment = maximum self.__increment = increment self.__threshold = increment/2 e = random.randrange(self.__maximum - self.__increment) self.__bank = range(e, e+self.__increment) def __repr__(self): return '%s(%d, %d)' % ( self.__class__.__name__, self.__maximum, self.__increment ) def __call__(self): v = self.__bank.pop(0) if v % self.__threshold: return v else: # this is MT-safe unless too many (~ increment/2) threads # bump into this code simultaneously e = self.__bank[-1]+1 if e > self.__maximum: e = 0 self.__bank.extend(range(e, e+self.__threshold)) return v PKAq>²pysnmp/__init__.pyc; ur8Mc@sdZdddfZdS(s4iiiN(smajorVersionIdsversion(smajorVersionIdsversion((s-build/bdist.linux-i686/egg/pysnmp/__init__.pys?sPKAq>G2//pysnmp/nextid.pyc; UMc@s*dkZeidfdYZdS(NsIntegercBs&tZddZdZdZRS(NicCsl||_||jo |}n||_|d|_ti|i|i}t |||i|_ dS(Ni( smaximumsselfs_Integer__maximums increments_Integer__increments_Integer__thresholdsrandoms randrangesesranges_Integer__bank(sselfsmaximums incrementse((s+build/bdist.linux-i686/egg/pysnmp/nextid.pys__init__s     cCs!d|ii|i|ifSdS(Ns %s(%d, %d)(sselfs __class__s__name__s_Integer__maximums_Integer__increment(sself((s+build/bdist.linux-i686/egg/pysnmp/nextid.pys__repr__scCs{|iid}||io|SnP|idd}||ijo d}n|iit|||i|SdS(Niii( sselfs_Integer__bankspopsvs_Integer__thresholdses_Integer__maximumsextendsrange(sselfsesv((s+build/bdist.linux-i686/egg/pysnmp/nextid.pys__call__s  (s__name__s __module__s__init__s__repr__s__call__(((s+build/bdist.linux-i686/egg/pysnmp/nextid.pysIntegers (srandomsseedsInteger(sIntegersrandom((s+build/bdist.linux-i686/egg/pysnmp/nextid.pys?s  PKAq>}=2zzpysnmp/proto/cache.pyc; cUMc@s$dklZdfdYZdS((serrorsCachecBs5tZdZdZdZdZdZRS(NcCs h|_dS(N(sselfs_Cache__cacheRepository(sself((s0build/bdist.linux-i686/egg/pysnmp/proto/cache.pys__init__scKs||i|<|SdS(N(skwargssselfs_Cache__cacheRepositorysindex(sselfsindexskwargs((s0build/bdist.linux-i686/egg/pysnmp/proto/cache.pysadds cCs7||ijo|i|}ndS|i|=|SdS(N(sindexsselfs_Cache__cacheRepositorys cachedParams(sselfsindexs cachedParams((s0build/bdist.linux-i686/egg/pysnmp/proto/cache.pyspop s  cKs?||ijotid|n|i|i|dS(NsCache miss on update for %s(sindexsselfs_Cache__cacheRepositoryserrors ProtocolErrorskwargssupdate(sselfsindexskwargs((s0build/bdist.linux-i686/egg/pysnmp/proto/cache.pysupdatescCsPxI|iiD]8\}}|o%||||o|i|=qHqqWdS(N(sselfs_Cache__cacheRepositorysitemssindexs cachedParamsscbFunscbCtx(sselfscbFunscbCtxsindexs cachedParams((s0build/bdist.linux-i686/egg/pysnmp/proto/cache.pysexpires  (s__name__s __module__s__init__saddspopsupdatesexpire(((s0build/bdist.linux-i686/egg/pysnmp/proto/cache.pysCaches     N(s pysnmp.protoserrorsCache(sCacheserror((s0build/bdist.linux-i686/egg/pysnmp/proto/cache.pys?s PKl1Lpysnmp/proto/__init__.py""" SNMP framework for Python. The pysnmp.proto sub-package implements various SNMP protocols. Copyright 1999-2004 by Ilya Etingof . See LICENSE for details. """ PKAq>z pysnmp/proto/error.pyc; M8Mc@sdklZdklZdklZdeefdYZdefdYZdefdYZd efd YZ d efd YZ d efdYZ defdYZ dS((s PyAsn1Error(s PySnmpError(sdebugs ProtocolErrorcBstZRS(N(s__name__s __module__(((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pys ProtocolErrorss SnmpV3ErrorcBstZRS(N(s__name__s __module__(((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pys SnmpV3Error ssStatusInformationcBs8tZdZdZdZdZedZRS(NcKsQti|||_tititiBti Bti B@otid|dS(NsStatusInformation: %s( s SnmpV3Errors__init__sselfskwargss#_StatusInformation__errorIndicationsdebugsloggersflagDspsflagMPsflagSMsflagACL(sselfskwargs((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pys__init__ s  cCst|iSdS(N(sstrsselfs#_StatusInformation__errorIndication(sself((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pys__str__scCs|i|SdS(N(sselfs#_StatusInformation__errorIndicationskey(sselfskey((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pys __getitem__scCs||ijSdS(N(skeysselfs#_StatusInformation__errorIndication(sselfskey((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pys __contains__scCs|ii||SdS(N(sselfs#_StatusInformation__errorIndicationsgetskeysdefVal(sselfskeysdefVal((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pysgets(s__name__s __module__s__init__s__str__s __getitem__s __contains__sNonesget(((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pysStatusInformation s     sCacheExpiredErrorcBstZRS(N(s__name__s __module__(((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pysCacheExpiredErrorss InternalErrorcBstZRS(N(s__name__s __module__(((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pys InternalErrorssMessageProcessingErrorcBstZRS(N(s__name__s __module__(((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pysMessageProcessingErrorssRequestTimeoutcBstZRS(N(s__name__s __module__(((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pysRequestTimeoutsN( s pyasn1.errors PyAsn1Errors pysnmp.errors PySnmpErrorspysnmpsdebugs ProtocolErrors SnmpV3ErrorsStatusInformationsCacheExpiredErrors InternalErrorsMessageProcessingErrorsRequestTimeout( sCacheExpiredErrors PySnmpErrors InternalErrorsStatusInformationsMessageProcessingErrors PyAsn1Errorsdebugs SnmpV3Errors ProtocolErrorsRequestTimeout((s0build/bdist.linux-i686/egg/pysnmp/proto/error.pys?s    PK [>y/pysnmp/proto/rfc1902.pyimport types import string from pyasn1.type import univ, tag, constraint, namedtype, namedval from pysnmp.proto import rfc1155, error class Integer(univ.Integer): subtypeSpec = univ.Integer.subtypeSpec+constraint.ValueRangeConstraint( -2147483648L, 2147483647L ) class Integer32(univ.Integer): subtypeSpec = univ.Integer.subtypeSpec+constraint.ValueRangeConstraint( -2147483648L, 2147483647L ) class OctetString(univ.OctetString): subtypeSpec = univ.Integer.subtypeSpec+constraint.ValueSizeConstraint( 0, 65535 ) # rfc1902 uses a notion of "fixed length string" what might mean # having zero-range size constraint applied. The following is # supposed to be used for setting and querying this property. fixedLength = None def setFixedLength(self, value): self.fixedLength = value return self def isFixedLength(self): return self.fixedLength is not None def getFixedLength(self): return self.fixedLength class IpAddress(univ.OctetString): tagSet = univ.OctetString.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x00) ) subtypeSpec = univ.OctetString.subtypeSpec+constraint.ValueSizeConstraint( 4, 4 ) fixedLength = 4 def prettyIn(self, value): return rfc1155.ipAddressPrettyIn(value) def prettyOut(self, value): return rfc1155.ipAddressPrettyOut(value) class Counter32(univ.Integer): tagSet = univ.Integer.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x01) ) subtypeSpec = univ.Integer.subtypeSpec+constraint.ValueRangeConstraint( 0, 4294967295L ) class Gauge32(univ.Integer): tagSet = univ.Integer.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x02) ) subtypeSpec = univ.Integer.subtypeSpec+constraint.ValueRangeConstraint( 0, 4294967295L ) class Unsigned32(univ.Integer): tagSet = univ.Integer.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x02) ) subtypeSpec = univ.Integer.subtypeSpec+constraint.ValueRangeConstraint( 0, 4294967295L ) class TimeTicks(univ.Integer): tagSet = univ.Integer.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x03) ) subtypeSpec = univ.Integer.subtypeSpec+constraint.ValueRangeConstraint( 0, 4294967295L ) class Opaque(univ.OctetString): tagSet = univ.OctetString.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x04) ) class Counter64(univ.Integer): tagSet = univ.Integer.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x06) ) subtypeSpec = univ.Integer.subtypeSpec+constraint.ValueRangeConstraint( 0, 18446744073709551615L ) class Bits(univ.OctetString): namedValues = namedval.NamedValues() def __init__(self, value=None, tagSet=None, subtypeSpec=None, namedValues=None): if namedValues is None: self.__namedValues = self.namedValues else: self.__namedValues = namedValues univ.OctetString.__init__( self, value, tagSet, subtypeSpec ) def prettyIn(self, bits): if type(bits) not in (types.TupleType, types.ListType): return str(bits) # raw bitstring octets = [] for bit in bits: # tuple of named bits v = self.__namedValues.getValue(bit) if v is None: raise error.ProtocolError( 'Unknown named bit %s' % bit ) d, m = divmod(v, 8) if d >= len(octets): octets.extend([0] * (d - len(octets) + 1)) octets[d] = octets[d] | 0x01 << (7-m) return string.join(map(lambda x: chr(x), octets), '') def prettyOut(self, value): names = [] octets = tuple(map(None, str(value))) i = 0 while i < len(octets): v = ord(octets[i]) j = 7 while j >= 0: if v & (0x01<Zpysnmp/proto/rfc3411.pyc; BIGc@sdklZlZheiid<eiid<eiid<eiid<eiid=ǵpysnmp/proto/error.pyfrom pyasn1.error import PyAsn1Error from pysnmp.error import PySnmpError from pysnmp import debug class ProtocolError(PySnmpError, PyAsn1Error): pass # SNMP v3 exceptions class SnmpV3Error(ProtocolError): pass class StatusInformation(SnmpV3Error): def __init__(self, **kwargs): SnmpV3Error.__init__(self) self.__errorIndication = kwargs debug.logger & (debug.flagDsp|debug.flagMP|debug.flagSM|debug.flagACL) and debug.logger('StatusInformation: %s' % kwargs) def __str__(self): return str(self.__errorIndication) def __getitem__(self, key): return self.__errorIndication[key] def __contains__(self, key): return key in self.__errorIndication def get(self, key, defVal=None): return self.__errorIndication.get(key, defVal) class CacheExpiredError(SnmpV3Error): pass class InternalError(SnmpV3Error): pass class MessageProcessingError(SnmpV3Error): pass class RequestTimeout(SnmpV3Error): pass PKAq>&&pysnmp/proto/rfc1905.pyc; G6Mc@sdklZlZlZlZlZdklZeidZ dei fdYZ e Z dei fdYZ e Zdei fdYZeZd eifd YZd eifd YZd eifdYZdeifdYZdeifdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefd YZd!efd"YZ d#eifd$YZ!d%S(&(sunivstags constraints namedtypesnamedval(srfc1902ls NoSuchObjectcBs>tZeiiieieiei dZddZ RS(NicCsdSdS(Ns+No Such Object currently exists at this OID((sselfsscope((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys prettyPrint s( s__name__s __module__sunivsNullstagSets tagImplicitlystagsTagstagClassContextstagFormatSimples prettyPrint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys NoSuchObject s*sNoSuchInstancecBs>tZeiiieieiei dZddZ RS(NiicCsdSdS(Ns-No Such Instance currently exists at this OID((sselfsscope((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys prettyPrints( s__name__s __module__sunivsNullstagSets tagImplicitlystagsTagstagClassContextstagFormatSimples prettyPrint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pysNoSuchInstances*s EndOfMibViewcBs>tZeiiieieiei dZddZ RS(NiicCsdSdS(Ns'No more variables left in this MIB View((sselfsscope((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys prettyPrints( s__name__s __module__sunivsNullstagSets tagImplicitlystagsTagstagClassContextstagFormatSimples prettyPrint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys EndOfMibViews*s _BindValuecBsktZeieideieideieide eide eide Z RS(Nsvalues unSpecifieds noSuchObjectsnoSuchInstances endOfMibView( s__name__s __module__s namedtypes NamedTypess NamedTypesrfc1902s ObjectSyntaxsunivsNulls noSuchObjectsnoSuchInstances endOfMibViews componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys _BindValue"s sVarBindcBs;tZeieideieideZRS(Nsnames( s__name__s __module__s namedtypes NamedTypess NamedTypesrfc1902s ObjectNames _BindValues componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pysVarBind+ss VarBindListcBs-tZeZeiieide ZRS(Ni( s__name__s __module__sVarBinds componentTypesunivs SequenceOfs subtypeSpecs constraintsValueSizeConstraints max_bindings(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys VarBindList1s sPDUcBs4tZeieideieideide i ddfddfdd fd d fd d fddfddfddfddfddfddfddfddfddfd d!fd"d#fd$d%fd&d'fd(d)feid*eii d+e i deeid,eZRS(-Ns request-ids error-statuss namedValuessnoErroristooBigis noSuchNameisbadValueisreadOnlyisgenErrisnoAccessis wrongTypeis wrongLengthis wrongEncodingi s wrongValuei s noCreationi sinconsistentValuei sresourceUnavailablei s commitFailedis undoFailedisauthorizationErroris notWritableisinconsistentNameis error-indexs subtypeSpecsvariable-bindings(s__name__s __module__s namedtypes NamedTypess NamedTypesrfc1902s Integer32sunivsIntegersnamedvals NamedValuesssubtypes constraintsValueRangeConstraints max_bindingss VarBindLists componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pysPDU8s-sBulkPDUc BstZeieideieideii de i de eideii de i de eide ZRS(Ns request-ids non-repeaterss subtypeSpecismax-repetitionssvariable-bindings(s__name__s __module__s namedtypes NamedTypess NamedTypesrfc1902s Integer32sunivsIntegerssubtypes constraintsValueRangeConstraints max_bindingss VarBindLists componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pysBulkPDUAs--s GetRequestPDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__sPDUstagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys GetRequestPDUIssGetNextRequestPDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__sPDUstagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pysGetNextRequestPDUNss ResponsePDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__sPDUstagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys ResponsePDUSss SetRequestPDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__sPDUstagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys SetRequestPDUXssGetBulkRequestPDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__sPDUstagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pysGetBulkRequestPDU]ssInformRequestPDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__sPDUstagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pysInformRequestPDUbss SNMPv2TrapPDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__sPDUstagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys SNMPv2TrapPDUgss ReportPDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__sPDUstagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys ReportPDUlssPDUsc BstZeieideeideeideeideeide eide eide eide Z RS( Ns get-requestsget-next-requestsget-bulk-requestsresponses set-requestsinform-requests snmpV2-trapsreport(s__name__s __module__s namedtypes NamedTypess NamedTypes GetRequestPDUsGetNextRequestPDUsGetBulkRequestPDUs ResponsePDUs SetRequestPDUsInformRequestPDUs SNMPv2TrapPDUs ReportPDUs componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pysPDUsqsN("s pyasn1.typesunivstags constraints namedtypesnamedvals pysnmp.protosrfc1902sIntegers max_bindingssNulls NoSuchObjects noSuchObjectsNoSuchInstancesnoSuchInstances EndOfMibViews endOfMibViewsChoices _BindValuesSequencesVarBinds SequenceOfs VarBindListsPDUsBulkPDUs GetRequestPDUsGetNextRequestPDUs ResponsePDUs SetRequestPDUsGetBulkRequestPDUsInformRequestPDUs SNMPv2TrapPDUs ReportPDUsPDUs(sPDUsstags namedtypes EndOfMibViewsunivs _BindValues ReportPDUsBulkPDUs SNMPv2TrapPDUs GetRequestPDUsnamedvals NoSuchObjectsGetNextRequestPDUs VarBindListsPDUsGetBulkRequestPDUsVarBinds noSuchObjectsNoSuchInstances max_bindingss ResponsePDUs constraintsrfc1902sInformRequestPDUs endOfMibViews SetRequestPDUsnoSuchInstance((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1905.pys?s,%      PK]QL>GGpysnmp/proto/rfc3412.py"""SNMP v3 Message Processing and Dispatching (RFC3412)""" import time from pysnmp.smi import builder, instrum from pysnmp.proto import errind, error, cache from pysnmp.proto.api import verdec # XXX from pysnmp.error import PySnmpError from pysnmp import nextid, debug class MsgAndPduDispatcher: """SNMP engine PDU & message dispatcher. Exchanges SNMP PDU's with applications and serialized messages with transport level. """ def __init__(self, mibInstrumController=None): if mibInstrumController is None: self.mibInstrumController = instrum.MibInstrumController( builder.MibBuilder() ) else: self.mibInstrumController = mibInstrumController self.mibInstrumController.mibBuilder.loadModules( 'SNMPv2-MIB', 'SNMP-MPD-MIB', 'SNMP-COMMUNITY-MIB', 'SNMP-TARGET-MIB', 'SNMP-USER-BASED-SM-MIB' ) # Requests cache self.__cache = cache.Cache() # Registered context engine IDs self.__appsRegistration = {} # Source of sendPduHandle and cache of requesting apps self.__sendPduHandle = nextid.Integer(0xffffff) # To pass transport info to app self.__transportInfo = {} def getTransportInfo(self, stateReference): if stateReference in self.__transportInfo: return self.__transportInfo[stateReference] else: raise error.ProtocolError( 'No data for stateReference %s' % stateReference ) # Application registration with dispatcher # 4.3.1 def registerContextEngineId(self, contextEngineId, pduTypes, processPdu): """Register application with dispatcher""" # 4.3.2 -> noop # 4.3.3 for pduType in pduTypes: k = (str(contextEngineId), pduType) if k in self.__appsRegistration: raise error.ProtocolError( 'Duplicate registration %s/%s' % (contextEngineId, pduType) ) # 4.3.4 self.__appsRegistration[k] = processPdu debug.logger & debug.flagDsp and debug.logger('registerContextEngineId: contextEngineId %s pduTypes %s' % (repr(contextEngineId), pduTypes)) # 4.4.1 def unregisterContextEngineId(self, contextEngineId, pduTypes): """Unregister application with dispatcher""" # 4.3.4 if contextEngineId is None: # Default to local snmpEngineId contextEngineId, = self.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') for pduType in pduTypes: k = (str(contextEngineId), pduType) if k in self.__appsRegistration: del self.__appsRegistration[k] debug.logger & debug.flagDsp and debug.logger('unregisterContextEngineId: contextEngineId %s pduTypes %s' % (repr(contextEngineId), pduTypes)) def getRegisteredApp(self, contextEngineId, pduType): k = ( str(contextEngineId), pduType ) if k in self.__appsRegistration: return self.__appsRegistration[k] k = ( '', pduType ) if k in self.__appsRegistration: return self.__appsRegistration[k] # wildcard # Dispatcher <-> application API # 4.1.1 def sendPdu( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, expectResponse, timeout=0, # response items cbFun=None, cbCtx=None ): """PDU dispatcher -- prepare and serialize a request or notification""" # 4.1.1.2 k = int(messageProcessingModel) if k in snmpEngine.messageProcessingSubsystems: mpHandler = snmpEngine.messageProcessingSubsystems[k] else: raise error.StatusInformation( errorIndication=errind.unsupportedMsgProcessingModel ) debug.logger & debug.flagDsp and debug.logger('sendPdu: securityName %s, PDU\n%s' % (securityName, PDU.prettyPrint())) # 4.1.1.3 sendPduHandle = self.__sendPduHandle() if expectResponse: self.__cache.add( sendPduHandle, messageProcessingModel=messageProcessingModel, sendPduHandle=sendPduHandle, timeout=timeout, cbFun=cbFun, cbCtx=cbCtx ) debug.logger & debug.flagDsp and debug.logger('sendPdu: new sendPduHandle %s, timeout %s, cbFun %s' % (sendPduHandle, timeout, cbFun)) # 4.1.1.4 & 4.1.1.5 try: ( destTransportDomain, destTransportAddress, outgoingMessage ) = mpHandler.prepareOutgoingMessage( snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, expectResponse, sendPduHandle ) debug.logger & debug.flagDsp and debug.logger('sendPdu: MP succeeded') except error.StatusInformation, statusInformation: # XXX is it still needed here? # self.releaseStateInformation(snmpEngine, sendPduHandle, messageProcessingModel) raise # 4.1.1.6 if snmpEngine.transportDispatcher is None: raise error.PySnmpError('Transport dispatcher not set') snmpEngine.transportDispatcher.sendMessage( outgoingMessage, destTransportDomain, destTransportAddress ) # Update cache with orignal req params (used for retrying) if expectResponse: self.__cache.update( sendPduHandle, transportDomain=transportDomain, transportAddress=transportAddress, securityModel=securityModel, securityName=securityName, securityLevel=securityLevel, contextEngineId=contextEngineId, contextName=contextName, pduVersion=pduVersion, PDU=PDU ) return sendPduHandle # 4.1.2.1 def returnResponsePdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference, statusInformation ): """PDU dispatcher -- prepare and serialize a response""" # Extract input values and initialize defaults k = int(messageProcessingModel) if k in snmpEngine.messageProcessingSubsystems: mpHandler = snmpEngine.messageProcessingSubsystems[k] else: raise error.StatusInformation( errorIndication=errind.unsupportedMsgProcessingModel ) debug.logger & debug.flagDsp and debug.logger('returnResponsePdu: PDU %s' % (PDU and PDU.prettyPrint() or "",)) # 4.1.2.2 try: ( destTransportDomain, destTransportAddress, outgoingMessage ) = mpHandler.prepareResponseMessage( snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference, statusInformation ) debug.logger & debug.flagDsp and debug.logger('returnResponsePdu: MP suceeded') except error.StatusInformation, statusInformation: # 4.1.2.3 raise # Handle oversized messages XXX transport constrains? snmpEngineMaxMessageSize, = self.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize') if snmpEngineMaxMessageSize.syntax and \ len(outgoingMessage) > snmpEngineMaxMessageSize.syntax: snmpSilentDrops, = self.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpSilentDrops') snmpSilentDrops.syntax = snmpSilentDrops.syntax + 1 raise error.MessageTooBigError() # 4.1.2.4 snmpEngine.transportDispatcher.sendMessage( outgoingMessage, destTransportDomain, destTransportAddress ) # 4.2.1 def receiveMessage( self, snmpEngine, transportDomain, transportAddress, wholeMsg ): """Message dispatcher -- de-serialize message into PDU""" # 4.2.1.1 snmpInPkts, = self.mibInstrumController.mibBuilder.importSymbols( '__SNMPv2-MIB', 'snmpInPkts' ) snmpInPkts.syntax = snmpInPkts.syntax + 1 # 4.2.1.2 try: restOfWholeMsg = '' # XXX fix decoder non-recursive return msgVersion = verdec.decodeMessageVersion(wholeMsg) except PySnmpError: snmpInAsn1ParseErrs, = self.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInAsn1ParseErrs') snmpInAsn1ParseErrs.syntax = snmpInAsn1ParseErrs.syntax + 1 return '' # n.b the whole buffer gets dropped debug.logger & debug.flagDsp and debug.logger('receiveMessage: msgVersion %s, msg decoded' % msgVersion) messageProcessingModel = msgVersion k = int(messageProcessingModel) if k in snmpEngine.messageProcessingSubsystems: mpHandler = snmpEngine.messageProcessingSubsystems[k] else: snmpInBadVersions, = self.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInBadVersions') snmpInBadVersions.syntax = snmpInBadVersions.syntax + 1 return restOfWholeMsg # 4.2.1.3 -- no-op # 4.2.1.4 try: ( messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, pduType, sendPduHandle, maxSizeResponseScopedPDU, statusInformation, stateReference ) = mpHandler.prepareDataElements( snmpEngine, transportDomain, transportAddress, wholeMsg ) debug.logger & debug.flagDsp and debug.logger('receiveMessage: MP succeded') except error.StatusInformation, statusInformation: if 'sendPduHandle' in statusInformation: # Dropped REPORT -- re-run pending reqs queue as some # of them may be waiting for this REPORT debug.logger & debug.flagDsp and debug.logger('receiveMessage: MP failed, statusInformation %s' % statusInformation) self.__expireRequest( statusInformation['sendPduHandle'], self.__cache.pop(statusInformation['sendPduHandle']), snmpEngine, statusInformation ) return restOfWholeMsg debug.logger & debug.flagDsp and debug.logger('receiveMessage: PDU %s' % PDU.prettyPrint()) # 4.2.2 if sendPduHandle is None: # 4.2.2.1 (request or notification) debug.logger & debug.flagDsp and debug.logger('receiveMessage: pduType %s' % pduType) # 4.2.2.1.1 processPdu = self.getRegisteredApp(contextEngineId, pduType) # 4.2.2.1.2 if processPdu is None: # 4.2.2.1.2.a snmpUnknownPDUHandlers, = self.mibInstrumController.mibBuilder.importSymbols('__SNMP-MPD-MIB', 'snmpUnknownPDUHandlers') snmpUnknownPDUHandlers.syntax = snmpUnknownPDUHandlers.syntax+1 # 4.2.2.1.2.b statusInformation = { 'errorIndication': errind.unknownPDUHandler, 'oid': snmpUnknownPDUHandlers.name, 'val': snmpUnknownPDUHandlers.syntax } debug.logger & debug.flagDsp and debug.logger('receiveMessage: unhandled PDU type') # XXX fails on unknown PDU try: ( destTransportDomain, destTransportAddress, outgoingMessage ) = mpHandler.prepareResponseMessage( snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference, statusInformation ) except error.StatusInformation, statusInformation: debug.logger & debug.flagDsp and debug.logger('receiveMessage: report failed, statusInformation %s' % statusInformation) return restOfWholeMsg # 4.2.2.1.2.c try: snmpEngine.transportDispatcher.sendMessage( outgoingMessage, destTransportDomain, destTransportAddress ) except PySnmpError: # XXX pass debug.logger & debug.flagDsp and debug.logger('receiveMessage: reporting succeeded') # 4.2.2.1.2.d return restOfWholeMsg else: # Pass transport info to app if stateReference is not None: self.__transportInfo[stateReference] = ( transportDomain, transportAddress ) # 4.2.2.1.3 processPdu( snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ) if stateReference is not None: del self.__transportInfo[stateReference] debug.logger & debug.flagDsp and debug.logger('receiveMessage: processPdu succeeded') return restOfWholeMsg else: # 4.2.2.2 (response) # 4.2.2.2.1 cachedParams = self.__cache.pop(sendPduHandle) # 4.2.2.2.2 if cachedParams is None: snmpUnknownPDUHandlers, = self.mibInstrumController.mibBuilder.importSymbols('__SNMP-MPD-MIB', 'snmpUnknownPDUHandlers') snmpUnknownPDUHandlers.syntax = snmpUnknownPDUHandlers.syntax+1 return restOfWholeMsg debug.logger & debug.flagDsp and debug.logger('receiveMessage: cache read by sendPduHandle %s' % sendPduHandle) # 4.2.2.2.3 # no-op ? XXX # 4.2.2.2.4 processResponsePdu = cachedParams['cbFun'] processResponsePdu( snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, statusInformation, cachedParams['sendPduHandle'], cachedParams['cbCtx'] ) debug.logger & debug.flagDsp and debug.logger('receiveMessage: processResponsePdu succeeded') return restOfWholeMsg def releaseStateInformation( self, snmpEngine, sendPduHandle, messageProcessingModel ): k = int(messageProcessingModel) if k in snmpEngine.messageProcessingSubsystems: mpHandler = snmpEngine.messageProcessingSubsystems[k] mpHandler.releaseStateInformation(sendPduHandle) # Cache expiration stuff def __expireRequest(self, cacheKey, cachedParams, snmpEngine, statusInformation=None): timeoutAt = cachedParams['timeout'] if statusInformation is None and time.time() < timeoutAt: return processResponsePdu = cachedParams['cbFun'] debug.logger & debug.flagDsp and debug.logger('__expireRequest: req cachedParams %s' % cachedParams) # Fail timed-out requests if not statusInformation: statusInformation = error.StatusInformation( errorIndication=errind.requestTimedOut ) self.releaseStateInformation( snmpEngine, cachedParams['sendPduHandle'], cachedParams['messageProcessingModel'] ) processResponsePdu( snmpEngine, None, None, None, None, None, None, None, None, statusInformation, cachedParams['sendPduHandle'], cachedParams['cbCtx'] ) return 1 def receiveTimerTick(self, snmpEngine, timeNow): self.__cache.expire(self.__expireRequest, snmpEngine) PKy78rpysnmp/proto/rfc3411.py# SNMP PDU taxonomy from pysnmp.proto import rfc1157, rfc1905 readClassPDUs = { rfc1157.GetRequestPDU.tagSet: 1, rfc1157.GetNextRequestPDU.tagSet: 1, rfc1905.GetRequestPDU.tagSet: 1, rfc1905.GetNextRequestPDU.tagSet: 1, rfc1905.GetBulkRequestPDU.tagSet: 1 } writeClassPDUs = { rfc1157.SetRequestPDU.tagSet: 1, rfc1905.SetRequestPDU.tagSet: 1 } responseClassPDUs = { rfc1157.GetResponsePDU.tagSet: 1, rfc1905.ResponsePDU.tagSet: 1, rfc1905.ReportPDU.tagSet: 1 } notificationClassPDUs = { rfc1157.TrapPDU.tagSet: 1, rfc1905.SNMPv2TrapPDU.tagSet: 1, rfc1905.InformRequestPDU.tagSet: 1 } internalClassPDUs = { rfc1905.ReportPDU.tagSet: 1 } confirmedClassPDUs = { rfc1157.GetRequestPDU.tagSet: 1, rfc1157.GetNextRequestPDU.tagSet: 1, rfc1157.SetRequestPDU.tagSet: 1, rfc1905.GetRequestPDU.tagSet: 1, rfc1905.GetNextRequestPDU.tagSet: 1, rfc1905.GetBulkRequestPDU.tagSet: 1, rfc1905.SetRequestPDU.tagSet: 1, rfc1905.InformRequestPDU.tagSet: 1 } unconfirmedClassPDUs = { rfc1157.GetResponsePDU.tagSet: 1, rfc1905.ResponsePDU.tagSet: 1, rfc1157.TrapPDU.tagSet: 1, rfc1905.ReportPDU.tagSet: 1, rfc1905.SNMPv2TrapPDU.tagSet: 1 } PKAq>ya.pysnmp/proto/rfc1157.pyc; 17Mc@sdklZlZlZlZdklZdeifdYZdei fdYZ deifdYZ de fd YZ d e fd YZ d e fd YZde fdYZdeifdYZdeifdYZdeifdYZdS((sunivstags namedtypesnamedval(srfc1155sVarBindcBs>tZeieideieideiZRS(Nsnamesvalue( s__name__s __module__s namedtypes NamedTypess NamedTypesrfc1155s ObjectNames ObjectSyntaxs componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1157.pysVarBindss VarBindListcBstZeZRS(N(s__name__s __module__sVarBinds componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1157.pys VarBindList ss _RequestBasecBstZeieideieideideiddfddfdd fd d fd d fddfeideieide Z RS(Ns request-ids error-statuss namedValuessnoErroristooBigis noSuchNameisbadValueisreadOnlyisgenErris error-indexsvariable-bindings( s__name__s __module__s namedtypes NamedTypess NamedTypesunivsIntegersnamedvals NamedValuess VarBindLists componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1157.pys _RequestBase sWs GetRequestPDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__s _RequestBasestagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1157.pys GetRequestPDUssGetNextRequestPDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__s _RequestBasestagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1157.pysGetNextRequestPDUssGetResponsePDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__s _RequestBasestagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1157.pysGetResponsePDUss SetRequestPDUcBs/tZeiieieieidZRS(Ni( s__name__s __module__s _RequestBasestagSets tagImplicitlystagsTagstagClassContextstagFormatConstructed(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1157.pys SetRequestPDU ssTrapPDUcBs tZeiiieieiei dZe i e i dei e i deie i deiideiddfdd fd d fd d fddfddfddfe i deie i deie i deZRS(Nis enterprises agent-addrs generic-traps namedValuess coldStartis warmStartislinkDownislinkUpisauthenticationFailuresegpNeighborLossisenterpriseSpecificis specific-traps time-stampsvariable-bindings(s__name__s __module__sunivsSequencestagSets tagImplicitlystagsTagstagClassContextstagFormatConstructeds namedtypes NamedTypess NamedTypesObjectIdentifiersrfc1155sNetworkAddresssIntegersclonesnamedvals NamedValuess TimeTickss VarBindLists componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1157.pysTrapPDU%s*fsPDUscBsntZeieideeideeideeideeide Z RS(Ns get-requestsget-next-requests get-responses set-requeststrap( s__name__s __module__s namedtypes NamedTypess NamedTypes GetRequestPDUsGetNextRequestPDUsGetResponsePDUs SetRequestPDUsTrapPDUs componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1157.pysPDUs2s sMessagecBsetZeieideideiddfeidei eide Z RS(Nsversions namedValuess version-1is communitysdata( s__name__s __module__s namedtypes NamedTypess NamedTypesunivsIntegersnamedvals NamedValuess OctetStringsPDUss componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1157.pysMessage;s0N(s pyasn1.typesunivstags namedtypesnamedvals pysnmp.protosrfc1155sSequencesVarBinds SequenceOfs VarBindLists _RequestBases GetRequestPDUsGetNextRequestPDUsGetResponsePDUs SetRequestPDUsTrapPDUsChoicesPDUssMessage(s _RequestBasesGetNextRequestPDUsGetResponsePDUsunivsPDUss GetRequestPDUstagsTrapPDUs namedtypes VarBindListsrfc1155sVarBindsMessagesnamedvals SetRequestPDU((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1157.pys?s   PK=3>UQ~~pysnmp/proto/rfc1905.pyfrom pyasn1.type import univ, tag, constraint, namedtype, namedval from pysnmp.proto import rfc1902 # Value reference -- max bindings in VarBindList max_bindings = rfc1902.Integer(2147483647L) # Take SNMP exception values out of BindValue structure for convenience class NoSuchObject(univ.Null): tagSet = univ.Null.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0x00) ) def prettyPrint(self, scope=0): return 'No Such Object currently exists at this OID' noSuchObject = NoSuchObject() class NoSuchInstance(univ.Null): tagSet = univ.Null.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0x01) ) def prettyPrint(self, scope=0): return 'No Such Instance currently exists at this OID' noSuchInstance = NoSuchInstance() class EndOfMibView(univ.Null): tagSet = univ.Null.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0x02) ) def prettyPrint(self, scope=0): return 'No more variables left in this MIB View' endOfMibView = EndOfMibView() # Made a separate class for better readability class _BindValue(univ.Choice): componentType = namedtype.NamedTypes( namedtype.NamedType('value', rfc1902.ObjectSyntax()), namedtype.NamedType('unSpecified', univ.Null()), namedtype.NamedType('noSuchObject', noSuchObject), namedtype.NamedType('noSuchInstance', noSuchInstance), namedtype.NamedType('endOfMibView', endOfMibView) ) class VarBind(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('name', rfc1902.ObjectName()), namedtype.NamedType('', _BindValue()) ) class VarBindList(univ.SequenceOf): componentType = VarBind() subtypeSpec = univ.SequenceOf.subtypeSpec + constraint.ValueSizeConstraint( 0, max_bindings ) # Base class for a non-bulk PDU class PDU(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('request-id', rfc1902.Integer32()), namedtype.NamedType('error-status', univ.Integer(namedValues=namedval.NamedValues(('noError', 0), ('tooBig', 1), ('noSuchName', 2), ('badValue', 3), ('readOnly', 4), ('genErr', 5), ('noAccess', 6), ('wrongType', 7), ('wrongLength', 8), ('wrongEncoding', 9), ('wrongValue', 10), ('noCreation', 11), ('inconsistentValue', 12), ('resourceUnavailable', 13), ('commitFailed', 14), ('undoFailed', 15), ('authorizationError', 16), ('notWritable', 17), ('inconsistentName', 18)))), namedtype.NamedType('error-index', univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, max_bindings))), namedtype.NamedType('variable-bindings', VarBindList()) ) # Base class for bulk PDU class BulkPDU(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('request-id', rfc1902.Integer32()), namedtype.NamedType('non-repeaters', univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, max_bindings))), namedtype.NamedType('max-repetitions', univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, max_bindings))), namedtype.NamedType('variable-bindings', VarBindList()) ) class GetRequestPDU(PDU): tagSet = PDU.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0) ) class GetNextRequestPDU(PDU): tagSet = PDU.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1) ) class ResponsePDU(PDU): tagSet = PDU.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 2) ) class SetRequestPDU(PDU): tagSet = PDU.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 3) ) class GetBulkRequestPDU(BulkPDU): tagSet = PDU.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 5) ) class InformRequestPDU(PDU): tagSet = PDU.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 6) ) class SNMPv2TrapPDU(PDU): tagSet = PDU.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 7) ) class ReportPDU(PDU): tagSet = PDU.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 8) ) class PDUs(univ.Choice): componentType = namedtype.NamedTypes( namedtype.NamedType('get-request', GetRequestPDU()), namedtype.NamedType('get-next-request', GetNextRequestPDU()), namedtype.NamedType('get-bulk-request', GetBulkRequestPDU()), namedtype.NamedType('response', ResponsePDU()), namedtype.NamedType('set-request', SetRequestPDU()), namedtype.NamedType('inform-request', InformRequestPDU()), namedtype.NamedType('snmpV2-trap', SNMPv2TrapPDU()), namedtype.NamedType('report', ReportPDU()) ) PKAq>۶R8R8pysnmp/proto/rfc3412.pyc; 2VMc@sdZdkZdklZlZdklZlZlZdk l Z dk l Z dk lZlZdfdYZdS( s4SNMP v3 Message Processing and Dispatching (RFC3412)N(sbuildersinstrum(serrindserrorscache(sverdec(s PySnmpError(snextidsdebugsMsgAndPduDispatchercBstZdZedZdZdZdZdZdeedZ dZ d Z d Z ed Z d ZRS( sSNMP engine PDU & message dispatcher. Exchanges SNMP PDU's with applications and serialized messages with transport level. cCs|tjotiti|_n ||_|iiidddddt i |_ h|_ t id|_h|_dS(Ns SNMPv2-MIBs SNMP-MPD-MIBsSNMP-COMMUNITY-MIBsSNMP-TARGET-MIBsSNMP-USER-BASED-SM-MIBi(smibInstrumControllersNonesinstrumsMibInstrumControllersbuilders MibBuildersselfs mibBuilders loadModulesscachesCaches_MsgAndPduDispatcher__caches&_MsgAndPduDispatcher__appsRegistrationsnextidsIntegers#_MsgAndPduDispatcher__sendPduHandles#_MsgAndPduDispatcher__transportInfo(sselfsmibInstrumController((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc3412.pys__init__ s    cCs6||ijo|i|Sntid|dS(NsNo data for stateReference %s(sstateReferencesselfs#_MsgAndPduDispatcher__transportInfoserrors ProtocolError(sselfsstateReference((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc3412.pysgetTransportInfo&scCsxZ|D]R}t||f}||ijotid||fn||i||D]6}t||f}||i jo|i |=q3q3Wt i t i @ot i dt||fdS(s&Unregister application with dispatchers__SNMP-FRAMEWORK-MIBs snmpEngineIDs9unregisterContextEngineId: contextEngineId %s pduTypes %sN(scontextEngineIdsNonesselfsmibInstrumControllers mibBuilders importSymbolsspduTypesspduTypesstrsks&_MsgAndPduDispatcher__appsRegistrationsdebugsloggersflagDspsrepr(sselfscontextEngineIdspduTypesspduTypesk((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc3412.pysunregisterContextEngineIdBs cCs`t||f}||ijo|i|Snd|f}||ijo|i|SndS(Ns(sstrscontextEngineIdspduTypesksselfs&_MsgAndPduDispatcher__appsRegistration(sselfscontextEngineIdspduTypesk((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc3412.pysgetRegisteredAppPs  icCst|}||ijo|i|}ntidti t i t i @ot i d|| if|i}| o2|ii|d|d|d| d|d|nt i t i @ot i d|| |fy^|i||||||||| | | | | \}}}t i t i @o t i d Wntij o }nX|i%t&joti'd n|i%i(|||| oJ|ii)|d |d |d |d|d|d|d| d| d|  n|SdS(sAPDU dispatcher -- prepare and serialize a request or notificationserrorIndications sendPdu: securityName %s, PDU %ssmessageProcessingModels sendPduHandlestimeoutscbFunscbCtxs3sendPdu: new sendPduHandle %s, timeout %s, cbFun %sssendPdu: MP succeededsTransport dispatcher not setstransportDomainstransportAddresss securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionsPDUN(*sintsmessageProcessingModelsks snmpEnginesmessageProcessingSubsystemss mpHandlerserrorsStatusInformationserrindsunsupportedMsgProcessingModelsdebugsloggersflagDsps securityNamesPDUs prettyPrintsselfs#_MsgAndPduDispatcher__sendPduHandles sendPduHandlesexpectResponses_MsgAndPduDispatcher__cachesaddstimeoutscbFunscbCtxsprepareOutgoingMessagestransportDomainstransportAddresss securityModels securityLevelscontextEngineIds contextNames pduVersionsdestTransportDomainsdestTransportAddresssoutgoingMessagesstatusInformationstransportDispatchersNones PySnmpErrors sendMessagesupdate(sselfs snmpEnginestransportDomainstransportAddresssmessageProcessingModels securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionsPDUsexpectResponsestimeoutscbFunscbCtxs sendPduHandlesstatusInformationsdestTransportAddresssdestTransportDomains mpHandlersoutgoingMessagesk((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc3412.pyssendPdu\s^ .  + " c  Cst|}||ijo|i|}ntidti t i t i @o(t i d| o | ipdfy[|i||||||||| | | | \}}} t i t i @o t i dWntij o } nX|iiidd\}|i!ot"| |i!jo;|iiidd\}|i!d |_!ti$n|i%i&| ||d S( s2PDU dispatcher -- prepare and serialize a responseserrorIndicationsreturnResponsePdu: PDU %sssreturnResponsePdu: MP suceededs__SNMP-FRAMEWORK-MIBssnmpEngineMaxMessageSizes __SNMPv2-MIBssnmpSilentDropsiN('sintsmessageProcessingModelsks snmpEnginesmessageProcessingSubsystemss mpHandlerserrorsStatusInformationserrindsunsupportedMsgProcessingModelsdebugsloggersflagDspsPDUs prettyPrintsprepareResponseMessages securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionsmaxSizeResponseScopedPDUsstateReferencesstatusInformationsdestTransportDomainsdestTransportAddresssoutgoingMessagesselfsmibInstrumControllers mibBuilders importSymbolsssnmpEngineMaxMessageSizessyntaxslenssnmpSilentDropssMessageTooBigErrorstransportDispatchers sendMessage(sselfs snmpEnginesmessageProcessingModels securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionsPDUsmaxSizeResponseScopedPDUsstateReferencesstatusInformationsoutgoingMessagesdestTransportAddressssnmpEngineMaxMessageSizesdestTransportDomainssnmpSilentDropss mpHandlersk((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc3412.pysreturnResponsePdus< 9 "  c Cs |iiidd\}|id|_yd}ti|}WnBt j o6|iiidd\}|id|_dSnXt it i@ot id||}t|}||ijo|i|}n0|iiidd\}|id|_|Sya|i||||\ }} }}}}}}} }}}}t it i@o t idWnyt&i'j oj}d |joPt it i@ot id ||i(|d |i)i*|d ||n|SnXt it i@ot id |i+|t,jot it i@ot id | |i-|| } | t,joG|iiid d\}|id|_hdt0i1<d|i2<d|i<}t it i@o t idy=|i3||| ||||||||| \}} } Wn>t&i'j o/}t it i@ot id||SnXy|i7i8| || Wnt j onXt it i@o t id|Sq|t,j o||f|i9|t|}||ijo|i|}|i|ndS(N(sintsmessageProcessingModelsks snmpEnginesmessageProcessingSubsystemss mpHandlersreleaseStateInformations sendPduHandle(sselfs snmpEngines sendPduHandlesmessageProcessingModels mpHandlersk((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc3412.pysreleaseStateInformations  cCs|d}|tjoti|jodSn|d}titi@otid|| ot i dt i }n|i||d|d||tttttttt||d|d dSdS( NstimeoutscbFuns$__expireRequest: req cachedParams %sserrorIndications sendPduHandlesmessageProcessingModelscbCtxi(s cachedParamss timeoutAtsstatusInformationsNonestimesprocessResponsePdusdebugsloggersflagDspserrorsStatusInformationserrindsrequestTimedOutsselfsreleaseStateInformations snmpEngine(sselfscacheKeys cachedParamss snmpEnginesstatusInformations timeoutAtsprocessResponsePdu((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc3412.pys__expireRequests.   "   cCs|ii|i|dS(N(sselfs_MsgAndPduDispatcher__cachesexpires#_MsgAndPduDispatcher__expireRequests snmpEngine(sselfs snmpEnginestimeNow((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc3412.pysreceiveTimerTicks(s__name__s __module__s__doc__sNones__init__sgetTransportInfosregisterContextEngineIdsunregisterContextEngineIdsgetRegisteredAppssendPdusreturnResponsePdusreceiveMessagesreleaseStateInformations#_MsgAndPduDispatcher__expireRequestsreceiveTimerTick(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc3412.pysMsgAndPduDispatcher s     ^ B $(s__doc__stimes pysnmp.smisbuildersinstrums pysnmp.protoserrindserrorscachespysnmp.proto.apisverdecs pysnmp.errors PySnmpErrorspysnmpsnextidsdebugsMsgAndPduDispatcher( s PySnmpErrorsverdecsbuilderscachesMsgAndPduDispatchersinstrumstimeserrindserrorsdebugsnextid((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc3412.pys?s   PKK>^3pysnmp/proto/cache.pyfrom pysnmp.proto import error class Cache: def __init__(self): self.__cacheRepository = {} def add(self, index, **kwargs): self.__cacheRepository[index] = kwargs return index def pop(self, index): if index in self.__cacheRepository: cachedParams = self.__cacheRepository[index] else: return del self.__cacheRepository[index] return cachedParams def update(self, index, **kwargs): if index not in self.__cacheRepository: raise error.ProtocolError( 'Cache miss on update for %s' % kwargs ) self.__cacheRepository[index].update(kwargs) def expire(self, cbFun, cbCtx): for index, cachedParams in self.__cacheRepository.items(): if cbFun: if cbFun(index, cachedParams, cbCtx): del self.__cacheRepository[index] PKܓ<\!!pysnmp/proto/rfc1155.pyimport string from pyasn1.type import univ, tag, constraint, namedtype from pyasn1.error import PyAsn1Error from pysnmp.proto import error def ipAddressPrettyIn(value): if len(value) == 4: return value # IP as an octet stream try: packed = string.split(value, '.') except: raise error.ProtocolError( 'Bad IP address syntax %s' % value ) if len(packed) != 4: raise error.ProtocolError( 'Bad IP address syntax %s' % value ) try: return reduce( lambda x, y: x+y, map(lambda x: chr(string.atoi(x)), packed) ) except string.atoi_error: raise error.ProtocolError( 'Bad IP address value %s' % value ) def ipAddressPrettyOut(value): if value: return '%d.%d.%d.%d' % ( ord(value[0]), ord(value[1]), ord(value[2]), ord(value[3]) ) else: return '' class IpAddress(univ.OctetString): tagSet = univ.OctetString.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x00) ) subtypeSpec = univ.OctetString.subtypeSpec+constraint.ValueSizeConstraint( 4, 4 ) def prettyIn(self, value): return ipAddressPrettyIn(value) def prettyOut(self, value): return ipAddressPrettyOut(value) class Counter(univ.Integer): tagSet = univ.Integer.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x01) ) subtypeSpec = univ.Integer.subtypeSpec+constraint.ValueRangeConstraint( 0, 4294967295L ) class NetworkAddress(univ.Choice): componentType = namedtype.NamedTypes( namedtype.NamedType('internet', IpAddress()) ) class Gauge(univ.Integer): tagSet = univ.Integer.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x02) ) subtypeSpec = univ.Integer.subtypeSpec+constraint.ValueRangeConstraint( 0, 4294967295L ) class TimeTicks(univ.Integer): tagSet = univ.Integer.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x03) ) subtypeSpec = univ.Integer.subtypeSpec+constraint.ValueRangeConstraint( 0, 4294967295L ) class Opaque(univ.OctetString): tagSet = univ.OctetString.tagSet.tagImplicitly( tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 0x04) ) class ObjectName(univ.ObjectIdentifier): pass class TypeCoercionHackMixIn: # XXX # Reduce ASN1 type check to simple tag check as SMIv2 objects may # not be constraints-compatible with those used in SNMP PDU. def _verifyComponent(self, idx, value): componentType = self._componentType if componentType: if idx >= len(componentType): raise PyAsn1Error( 'Component type error out of range' ) t = componentType[idx].getType() if not t.getTagSet().isSuperTagSetOf(value.getTagSet()): raise PyAsn1Error('Component type error %s vs %s' % (repr(t), repr(value))) class SimpleSyntax(TypeCoercionHackMixIn, univ.Choice): componentType = namedtype.NamedTypes( namedtype.NamedType('number', univ.Integer()), namedtype.NamedType('string', univ.OctetString()), namedtype.NamedType('object', univ.ObjectIdentifier()), namedtype.NamedType('empty', univ.Null()) ) class ApplicationSyntax(TypeCoercionHackMixIn, univ.Choice): componentType = namedtype.NamedTypes( namedtype.NamedType('address', NetworkAddress()), namedtype.NamedType('counter', Counter()), namedtype.NamedType('gauge', Gauge()), namedtype.NamedType('ticks', TimeTicks()), namedtype.NamedType('arbitrary', Opaque()) ) class ObjectSyntax(univ.Choice): componentType = namedtype.NamedTypes( namedtype.NamedType('simple', SimpleSyntax()), namedtype.NamedType('application-wide', ApplicationSyntax()) ) PK3>DK pysnmp/proto/rfc1157.pyfrom pyasn1.type import univ, tag, namedtype, namedval from pysnmp.proto import rfc1155 class VarBind(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('name', rfc1155.ObjectName()), namedtype.NamedType('value', rfc1155.ObjectSyntax()) ) class VarBindList(univ.SequenceOf): componentType = VarBind() class _RequestBase(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('request-id', univ.Integer()), namedtype.NamedType('error-status', univ.Integer(namedValues=namedval.NamedValues(('noError', 0), ('tooBig', 1), ('noSuchName', 2), ('badValue', 3), ('readOnly', 4), ('genErr', 5)))), namedtype.NamedType('error-index', univ.Integer()), namedtype.NamedType('variable-bindings', VarBindList()) ) class GetRequestPDU(_RequestBase): tagSet = _RequestBase.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0) ) class GetNextRequestPDU(_RequestBase): tagSet = _RequestBase.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1) ) class GetResponsePDU(_RequestBase): tagSet = _RequestBase.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 2) ) class SetRequestPDU(_RequestBase): tagSet = _RequestBase.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 3) ) class TrapPDU(univ.Sequence): tagSet = univ.Sequence.tagSet.tagImplicitly( tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 4) ) componentType = namedtype.NamedTypes( namedtype.NamedType('enterprise', univ.ObjectIdentifier()), namedtype.NamedType('agent-addr', rfc1155.NetworkAddress()), namedtype.NamedType('generic-trap', univ.Integer().clone(namedValues=namedval.NamedValues(('coldStart', 0), ('warmStart', 1), ('linkDown', 2), ('linkUp', 3), ('authenticationFailure', 4), ('egpNeighborLoss', 5), ('enterpriseSpecific', 6)))), namedtype.NamedType('specific-trap', univ.Integer()), namedtype.NamedType('time-stamp', rfc1155.TimeTicks()), namedtype.NamedType('variable-bindings', VarBindList()) ) class PDUs(univ.Choice): componentType = namedtype.NamedTypes( namedtype.NamedType('get-request', GetRequestPDU()), namedtype.NamedType('get-next-request', GetNextRequestPDU()), namedtype.NamedType('get-response', GetResponsePDU()), namedtype.NamedType('set-request', SetRequestPDU()), namedtype.NamedType('trap', TrapPDU()) ) class Message(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('version', univ.Integer(namedValues = namedval.NamedValues(('version-1', 0)))), namedtype.NamedType('community', univ.OctetString()), namedtype.NamedType('data', PDUs()) ) PKAq> 2QQpysnmp/proto/__init__.pyc; ƔAc@s dZdS(s SNMP framework for Python. The pysnmp.proto sub-package implements various SNMP protocols. Copyright 1999-2004 by Ilya Etingof . See LICENSE for details. N(s__doc__(((s3build/bdist.linux-i686/egg/pysnmp/proto/__init__.pys?sPK=A'pysnmp/proto/errind.py# SNMPv3 error-indication values. # Object below could be compared with literals thus are backward-compatible # with original pysnmperror-indication values. from string import lower class ErrorIndication: def __init__(self, descr=None): self.__value = self.__descr = lower(self.__class__.__name__[0]) + self.__class__.__name__[1:] if descr: self.__descr = descr def __cmp__(self, other): if self is other or isinstance(other, self.__class__): return 0 else: return cmp(self.__value, other) def __str__(self): return self.__descr # SNMP message processing errors class ParseError(ErrorIndication): pass parseError = ParseError('SNMP message deserialization error') class UnsupportedMsgProcessingModel(ErrorIndication): pass unsupportedMsgProcessingModel = UnsupportedMsgProcessingModel('Unknown SNMP message processing model ID encountered') class UnknownPDUHandler(ErrorIndication): pass unknownPDUHandler = UnknownPDUHandler('Unhandled PDU type encountered') class UnsupportedPDUtype(ErrorIndication): pass unsupportedPDUtype = UnsupportedPDUtype('Unsupported SNMP PDU type encountered') class RequestTimedOut(ErrorIndication): pass requestTimedOut = RequestTimedOut('No SNMP response received before timeout') class EmptyResponse(ErrorIndication): pass emptyResponse = EmptyResponse('Empty SNMP response message') class NonReportable(ErrorIndication): pass nonReportable = NonReportable('Report PDU generation not attempted') class DataMismatch(ErrorIndication): pass dataMismatch = DataMismatch('SNMP request/response parameters mismatched') class EngineIDMispatch(ErrorIndication): pass engineIDMispatch = EngineIDMispatch('SNMP engine ID mismatch encountered') class UnknownEngineID(ErrorIndication): pass unknownEngineID = UnknownEngineID('Unknown SNMP engine ID encountered') class TooBig(ErrorIndication): pass tooBig = TooBig('SNMP message will be too big') class LoopTerminated(ErrorIndication):pass loopTerminated = LoopTerminated('Infinite SNMP entities talk terminated') class InvalidMsg(ErrorIndication):pass invalidMsg = InvalidMsg('Invalid SNMP message header parameters encountered') # SNMP security modules errors class UnknownCommunityName(ErrorIndication): pass unknownCommunityName = UnknownCommunityName('Unknown SNMP community name encountered') class NoEncryption(ErrorIndication): pass noEncryption = NoEncryption('No encryption services configured') class EncryptionError(ErrorIndication): pass encryptionError = EncryptionError('Ciphering services not available') class DecryptionError(ErrorIndication): pass decryptionError = DecryptionError('Ciphering services not available or ciphertext is broken') class NoAuthentication(ErrorIndication): pass noAuthentication = NoAuthentication('No authentication services configured') class AuthenticationError(ErrorIndication): pass authenticationError = AuthenticationError('Ciphering services not available or bad parameters') class AuthenticationFailure(ErrorIndication): pass authenticationFailure = AuthenticationFailure('Authenticator mismatched') class UnsupportedAuthProtocol(ErrorIndication): pass unsupportedAuthProtocol = UnsupportedAuthProtocol('Authentication protocol is not supprted') class UnsupportedPrivProtocol(ErrorIndication): pass unsupportedPrivProtocol = UnsupportedPrivProtocol('Privacy protocol is not supprted') class UnknownSecurityName(ErrorIndication): pass unknownSecurityName = UnknownSecurityName('Unknown SNMP security name encountered') class UnsupportedSecurityModel(ErrorIndication): pass unsupportedSecurityModel = UnsupportedSecurityModel('Unsupported SNMP security model') class UnsupportedSecurityLevel(ErrorIndication): pass unsupportedSecurityLevel = UnsupportedSecurityLevel('Unsupported SNMP security level') class NotInTimeWindow(ErrorIndication): pass notInTimeWindow = NotInTimeWindow('SNMP message timing parameters not in windows of trust') # SNMP access-control errors class NoSuchView(ErrorIndication): pass noSuchView = NoSuchView('No such MIB view currently exists') class NoAccessEntry(ErrorIndication): pass noAccessEntry = NoAccessEntry('Access to MIB node denined') class NoGroupName(ErrorIndication): pass noGroupName = NoGroupName('No such VACM group configured') class NoSuchContext(ErrorIndication): pass noSuchContext = NoSuchContext('SNMP context now found') class NotInView(ErrorIndication): pass notInView = NotInView('Requested OID is out of MIB view') class AccessAllowed(ErrorIndication): pass accessAllowed = AccessAllowed() class OtherError(ErrorIndication): pass otherError = OtherError('Unspecified SNMP engine error occurred') # SNMP Apps errors class OidNotIncreasing(ErrorIndication): pass oidNotIncreasing = OidNotIncreasing('OIDs are not increasing') PKAq>pysnmp/proto/rfc1155.pyc; GLc@skdkZdklZlZlZlZdklZdkl Z dZ dZ dei fdYZ deifd YZd eifd YZd eifd YZdeifdYZdei fdYZdeifdYZdfdYZdeeifdYZdeeifdYZdeifdYZdS(N(sunivstags constraints namedtype(s PyAsn1Error(serrorcCst|djo|Snyti|d}Wntid|nXt|djotid|ny tdtd|SWn)ti j otid|nXdS(Nis.sBad IP address syntax %scCs||S(N(sxsy(sxsy((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pysscCstti|S(N(schrsstringsatoisx(sx((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pysssBad IP address value %s( slensvaluesstringssplitspackedserrors ProtocolErrorsreducesmaps atoi_error(svaluespacked((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pysipAddressPrettyIns cCsO|o@dt|dt|dt|dt|dfSndSdS(Ns %d.%d.%d.%diiiis(svaluesord(svalue((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pysipAddressPrettyOuts@s IpAddresscBs`tZeiiieieiei dZeii e i ddZ dZ dZRS(NiicCst|SdS(N(sipAddressPrettyInsvalue(sselfsvalue((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pysprettyIn-scCst|SdS(N(sipAddressPrettyOutsvalue(sselfsvalue((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pys prettyOut.s(s__name__s __module__sunivs OctetStringstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimples subtypeSpecs constraintsValueSizeConstraintsprettyIns prettyOut(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pys IpAddress%s* sCountercBsNtZeiiieieiei dZeii e i ddZ RS(Niil( s__name__s __module__sunivsIntegerstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimples subtypeSpecs constraintsValueRangeConstraint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pysCounter0s*sNetworkAddresscBs&tZeieideZRS(Nsinternet(s__name__s __module__s namedtypes NamedTypess NamedTypes IpAddresss componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pysNetworkAddress8ssGaugecBsNtZeiiieieiei dZeii e i ddZ RS(Niil( s__name__s __module__sunivsIntegerstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimples subtypeSpecs constraintsValueRangeConstraint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pysGauge=s*s TimeTickscBsNtZeiiieieiei dZeii e i ddZ RS(Niil( s__name__s __module__sunivsIntegerstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimples subtypeSpecs constraintsValueRangeConstraint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pys TimeTicksEs*sOpaquecBs2tZeiiieieiei dZRS(Ni( s__name__s __module__sunivs OctetStringstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimple(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pysOpaqueMss ObjectNamecBstZRS(N(s__name__s __module__(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pys ObjectNameRssTypeCoercionHackMixIncBstZdZRS(NcCs|i}|oz|t|jotdn||i}|ii |i o&tdt |t |fqndS(Ns!Component type error out of rangesComponent type error %s vs %s( sselfs_componentTypes componentTypesidxslens PyAsn1ErrorsgetTypests getTagSetsisSuperTagSetOfsvaluesrepr(sselfsidxsvalues componentTypest((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pys_verifyComponentWs (s__name__s __module__s_verifyComponent(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pysTypeCoercionHackMixInTss SimpleSyntaxcBshtZeieideieideieideieidei Z RS(Nsnumbersstringsobjectsempty( s__name__s __module__s namedtypes NamedTypess NamedTypesunivsIntegers OctetStringsObjectIdentifiersNulls componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pys SimpleSyntaxcssApplicationSyntaxcBsntZeieideeideeideeideeide Z RS(Nsaddressscountersgaugestickss arbitrary( s__name__s __module__s namedtypes NamedTypess NamedTypesNetworkAddresssCountersGauges TimeTickssOpaques componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pysApplicationSyntaxks s ObjectSyntaxcBs8tZeieideeideZRS(Nssimplesapplication-wide(s__name__s __module__s namedtypes NamedTypess NamedTypes SimpleSyntaxsApplicationSyntaxs componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pys ObjectSyntaxts(sstrings pyasn1.typesunivstags constraints namedtypes pyasn1.errors PyAsn1Errors pysnmp.protoserrorsipAddressPrettyInsipAddressPrettyOuts OctetStrings IpAddresssIntegersCountersChoicesNetworkAddresssGauges TimeTickssOpaquesObjectIdentifiers ObjectNamesTypeCoercionHackMixIns SimpleSyntaxsApplicationSyntaxs ObjectSyntax(s SimpleSyntaxsNetworkAddresssstrings ObjectNames constraints IpAddresss TimeTickssCounterstagsipAddressPrettyOuts ObjectSyntaxsApplicationSyntaxs PyAsn1ErrorsGauges namedtypeserrorsOpaquesipAddressPrettyInsTypeCoercionHackMixInsuniv((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1155.pys?s       PKAq>%933pysnmp/proto/errind.pyc; Mc@sdklZdfdYZdefdYZedZdefdYZedZd efd YZed Zd efd YZ e dZ defdYZ e dZ defdYZ e dZdefdYZedZdefdYZedZdefdYZedZdefdYZed Zd!efd"YZed#Zd$efd%YZed&Zd'efd(YZed)Zd*efd+YZed,Zd-efd.YZed/Z d0efd1YZ!e!d2Z"d3efd4YZ#e#d5Z$d6efd7YZ%e%d8Z&d9efd:YZ'e'd;Z(d<efd=YZ)e)d>Z*d?efd@YZ+e+dAZ,dBefdCYZ-e-dDZ.dEefdFYZ/e/dGZ0dHefdIYZ1e1dJZ2dKefdLYZ3e3dMZ4dNefdOYZ5e5dPZ6dQefdRYZ7e7dSZ8dTefdUYZ9e9dVZ:dWefdXYZ;e;dYZ<dZefd[YZ=e=d\Z>d]efd^YZ?e?d_Z@d`efdaYZAeAZBdbefdcYZCeCddZDdeefdfYZEeEdgZFdhS(i(slowersErrorIndicationcBs&tZedZdZdZRS(NcCsFt|iid|iid|_|_|o ||_ndS(Nii(slowersselfs __class__s__name__s_ErrorIndication__values_ErrorIndication__descrsdescr(sselfsdescr((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys__init__s.cCs<||jpt||iodSnt|i|SdS(Ni(sselfsothers isinstances __class__scmps_ErrorIndication__value(sselfsother((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys__cmp__ s cCs |iSdS(N(sselfs_ErrorIndication__descr(sself((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys__str__s(s__name__s __module__sNones__init__s__cmp__s__str__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysErrorIndications  s ParseErrorcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys ParseErrorss"SNMP message deserialization errorsUnsupportedMsgProcessingModelcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysUnsupportedMsgProcessingModelss4Unknown SNMP message processing model ID encounteredsUnknownPDUHandlercBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysUnknownPDUHandlerssUnhandled PDU type encounteredsUnsupportedPDUtypecBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysUnsupportedPDUtypess%Unsupported SNMP PDU type encounteredsRequestTimedOutcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysRequestTimedOutss(No SNMP response received before timeouts EmptyResponsecBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys EmptyResponse"ssEmpty SNMP response messages NonReportablecBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys NonReportable%ss#Report PDU generation not attempteds DataMismatchcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys DataMismatch(ss+SNMP request/response parameters mismatchedsEngineIDMispatchcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysEngineIDMispatch+ss#SNMP engine ID mismatch encounteredsUnknownEngineIDcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysUnknownEngineID.ss"Unknown SNMP engine ID encounteredsTooBigcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysTooBig1ssSNMP message will be too bigsLoopTerminatedcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysLoopTerminated4ss&Infinite SNMP entities talk terminateds InvalidMsgcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys InvalidMsg7ss2Invalid SNMP message header parameters encounteredsUnknownCommunityNamecBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysUnknownCommunityName<ss'Unknown SNMP community name encountereds NoEncryptioncBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys NoEncryption?ss!No encryption services configuredsEncryptionErrorcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysEncryptionErrorBss Ciphering services not availablesDecryptionErrorcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysDecryptionErrorEss8Ciphering services not available or ciphertext is brokensNoAuthenticationcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysNoAuthenticationHss%No authentication services configuredsAuthenticationErrorcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysAuthenticationErrorKss2Ciphering services not available or bad parameterssAuthenticationFailurecBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysAuthenticationFailureNssAuthenticator mismatchedsUnsupportedAuthProtocolcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysUnsupportedAuthProtocolQss'Authentication protocol is not supprtedsUnsupportedPrivProtocolcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysUnsupportedPrivProtocolTss Privacy protocol is not supprtedsUnknownSecurityNamecBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysUnknownSecurityNameWss&Unknown SNMP security name encounteredsUnsupportedSecurityModelcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysUnsupportedSecurityModelZssUnsupported SNMP security modelsUnsupportedSecurityLevelcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysUnsupportedSecurityLevel]ssUnsupported SNMP security levelsNotInTimeWindowcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysNotInTimeWindow`ss6SNMP message timing parameters not in windows of trusts NoSuchViewcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys NoSuchViewess!No such MIB view currently existss NoAccessEntrycBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys NoAccessEntryhssAccess to MIB node denineds NoGroupNamecBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys NoGroupNamekssNo such VACM group configureds NoSuchContextcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys NoSuchContextnssSNMP context now founds NotInViewcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys NotInViewqss Requested OID is out of MIB views AccessAllowedcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys AccessAllowedtss OtherErrorcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys OtherErrorwss&Unspecified SNMP engine error occurredsOidNotIncreasingcBstZRS(N(s__name__s __module__(((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pysOidNotIncreasing|ssOIDs are not increasingN(GsstringslowersErrorIndications ParseErrors parseErrorsUnsupportedMsgProcessingModelsunsupportedMsgProcessingModelsUnknownPDUHandlersunknownPDUHandlersUnsupportedPDUtypesunsupportedPDUtypesRequestTimedOutsrequestTimedOuts EmptyResponses emptyResponses NonReportables nonReportables DataMismatchs dataMismatchsEngineIDMispatchsengineIDMispatchsUnknownEngineIDsunknownEngineIDsTooBigstooBigsLoopTerminatedsloopTerminateds InvalidMsgs invalidMsgsUnknownCommunityNamesunknownCommunityNames NoEncryptions noEncryptionsEncryptionErrorsencryptionErrorsDecryptionErrorsdecryptionErrorsNoAuthenticationsnoAuthenticationsAuthenticationErrorsauthenticationErrorsAuthenticationFailuresauthenticationFailuresUnsupportedAuthProtocolsunsupportedAuthProtocolsUnsupportedPrivProtocolsunsupportedPrivProtocolsUnknownSecurityNamesunknownSecurityNamesUnsupportedSecurityModelsunsupportedSecurityModelsUnsupportedSecurityLevelsunsupportedSecurityLevelsNotInTimeWindowsnotInTimeWindows NoSuchViews noSuchViews NoAccessEntrys noAccessEntrys NoGroupNames noGroupNames NoSuchContexts noSuchContexts NotInViews notInViews AccessAlloweds accessAlloweds OtherErrors otherErrorsOidNotIncreasingsoidNotIncreasing(FsEncryptionErrorsunknownEngineIDsunsupportedPrivProtocolsNoAuthenticationsUnsupportedSecurityLevelsUnsupportedPDUtypes NoEncryptionsUnknownPDUHandlersunsupportedSecurityModelsoidNotIncreasingsunknownCommunityNames EmptyResponsesunsupportedMsgProcessingModelsUnknownSecurityNamesrequestTimedOutsTooBigsauthenticationFailures invalidMsgsengineIDMispatchsUnknownCommunityNamesUnsupportedSecurityModelsunknownPDUHandlersnotInTimeWindows parseErrorsunsupportedSecurityLevels NoSuchContextsUnsupportedMsgProcessingModelsunknownSecurityNames accessAllowedsdecryptionErrors NotInViews InvalidMsgsauthenticationErrorsEngineIDMispatchsencryptionErrors nonReportablesloopTerminateds NoAccessEntrysNotInTimeWindowsunsupportedPDUtypesUnsupportedAuthProtocols NonReportables ParseErrors dataMismatchs noSuchContextsAuthenticationErrors AccessAllowedsDecryptionErrors NoSuchViewsAuthenticationFailures NoGroupNamesUnknownEngineIDsnoAuthenticationslowersLoopTerminateds noAccessEntrysUnsupportedPrivProtocols noEncryptionsunsupportedAuthProtocolsOidNotIncreasings DataMismatchs notInViews emptyResponses otherErrorsRequestTimedOuts noSuchViewstooBigs OtherErrors noGroupNamesErrorIndication((s1build/bdist.linux-i686/egg/pysnmp/proto/errind.pys?s                                   PKAq>];L.L.pysnmp/proto/rfc1902.pyc; 6jMc@sdkZdkZdklZlZlZlZlZdkl Z l Z dei fdYZ dei fdYZ dei fdYZ d ei fd YZd ei fd YZd ei fdYZdei fdYZdei fdYZdei fdYZdei fdYZdei fdYZdeifdYZde ieifdYZde ieifdYZdeifd YZdS(!N(sunivstags constraints namedtypesnamedval(srfc1155serrorsIntegercBs$tZeiieiddZRS(Nll(s__name__s __module__sunivsIntegers subtypeSpecs constraintsValueRangeConstraint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pysIntegerss Integer32cBs$tZeiieiddZRS(Nll(s__name__s __module__sunivsIntegers subtypeSpecs constraintsValueRangeConstraint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys Integer32 ss OctetStringcBsEtZeiieiddZeZdZ dZ dZ RS(NiicCs||_|SdS(N(svaluesselfs fixedLength(sselfsvalue((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pyssetFixedLengths cCs|itj SdS(N(sselfs fixedLengthsNone(sself((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys isFixedLengthscCs |iSdS(N(sselfs fixedLength(sself((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pysgetFixedLength!s( s__name__s __module__sunivsIntegers subtypeSpecs constraintsValueSizeConstraintsNones fixedLengthssetFixedLengths isFixedLengthsgetFixedLength(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys OctetStrings   s IpAddresscBsftZeiiieieiei dZeii e i ddZ dZ dZdZRS(NiicCsti|SdS(N(srfc1155sipAddressPrettyInsvalue(sselfsvalue((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pysprettyIn,scCsti|SdS(N(srfc1155sipAddressPrettyOutsvalue(sselfsvalue((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys prettyOut-s(s__name__s __module__sunivs OctetStringstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimples subtypeSpecs constraintsValueSizeConstraints fixedLengthsprettyIns prettyOut(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys IpAddress$s * s Counter32cBsNtZeiiieieiei dZeii e i ddZ RS(Niil( s__name__s __module__sunivsIntegerstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimples subtypeSpecs constraintsValueRangeConstraint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys Counter32/s*sGauge32cBsNtZeiiieieiei dZeii e i ddZ RS(Niil( s__name__s __module__sunivsIntegerstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimples subtypeSpecs constraintsValueRangeConstraint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pysGauge327s*s Unsigned32cBsNtZeiiieieiei dZeii e i ddZ RS(Niil( s__name__s __module__sunivsIntegerstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimples subtypeSpecs constraintsValueRangeConstraint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys Unsigned32?s*s TimeTickscBsNtZeiiieieiei dZeii e i ddZ RS(Niil( s__name__s __module__sunivsIntegerstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimples subtypeSpecs constraintsValueRangeConstraint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys TimeTicksGs*sOpaquecBs2tZeiiieieiei dZRS(Ni( s__name__s __module__sunivs OctetStringstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimple(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pysOpaqueOss Counter64cBsNtZeiiieieiei dZeii e i ddZ RS(Niil( s__name__s __module__sunivsIntegerstagSets tagImplicitlystagsTagstagClassApplicationstagFormatSimples subtypeSpecs constraintsValueRangeConstraint(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys Counter64Ts*sBitscBshtZeiZeeeedZdZdZeeeedZ eeeeedZ RS(NcCsC|tjo|i|_n ||_tii||||dS(N( s namedValuessNonesselfs_Bits__namedValuessunivs OctetStrings__init__svaluestagSets subtypeSpec(sselfsvaluestagSets subtypeSpecs namedValues((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys__init__^s  cCst|titifjot|Sng}x|D]}|i i |}|t jot id|nt|d\}}|t|jo&|idg|t|dn||dd|>B||vss(stypesbitsstypess TupleTypesListTypesstrsoctetssbitsselfs_Bits__namedValuessgetValuesvsNoneserrors ProtocolErrorsdivmodsdsmslensextendsstringsjoinsmap(sselfsbitssdsmsoctetssvsbit((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pysprettyInhs &cCsg}tttt|}d}x|t|jot ||}d}x~|djop|d|>@oS|i i|dd|}|tjotid|n|i|n|d}qVW|d}q*Wtitd|dSdS(NiiiisUnknown named value %scCs t|S(N(sstrsx(sx((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pysss, (snamesstuplesmapsNonesstrsvaluesoctetssislensordsvsjsselfs_Bits__namedValuessgetNamesnameserrors ProtocolErrorsappendsstringsjoin(sselfsvaluesnamesisjsoctetssnamessv((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys prettyOutxs"  cCs|tjo$|tjo|tjo |tjo|Sn|tjo |i}n|tjo |i}n|tjo |i}n|tjo |i }n|i ||||SdS(N( svaluesNonestagSets subtypeSpecs namedValuessselfs_values_tagSets _subtypeSpecs_Bits__namedValuess __class__(sselfsvaluestagSets subtypeSpecs namedValues((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pysclones4        cCs|tjo |i}n|tj o|ii|}n-|tj o|ii |}n |i}|tjo |i }n||i }|tjo |i }n||i }|i||||SdS(N(svaluesNonesselfs_values implicitTags_tagSets tagImplicitlystagSets explicitTags tagExplicitlys subtypeSpecs _subtypeSpecs namedValuess_Bits__namedValuess __class__(sselfsvalues implicitTags explicitTags subtypeSpecs namedValuesstagSet((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pyssubtypes           ( s__name__s __module__snamedvals NamedValuess namedValuessNones__init__sprettyIns prettyOutsclonessubtype(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pysBits\s    s ObjectNamecBstZRS(N(s__name__s __module__(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys ObjectNamess SimpleSyntaxcBsMtZeieideeideeideiZ RS(Ns integer-values string-valuesobjectID-value( s__name__s __module__s namedtypes NamedTypess NamedTypesIntegers OctetStringsunivsObjectIdentifiers componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys SimpleSyntaxssApplicationSyntaxc BstZeieideeideeideeideeide eide Z RS(NsipAddress-values counter-valuestimeticks-valuesarbitrary-valuesbig-counter-values gauge32-value( s__name__s __module__s namedtypes NamedTypess NamedTypes IpAddresss Counter32s TimeTickssOpaques Counter64sGauge32s componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pysApplicationSyntaxs s ObjectSyntaxcBs8tZeieideeideZRS(Nssimplesapplication-wide(s__name__s __module__s namedtypes NamedTypess NamedTypes SimpleSyntaxsApplicationSyntaxs componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys ObjectSyntaxs(stypessstrings pyasn1.typesunivstags constraints namedtypesnamedvals pysnmp.protosrfc1155serrorsIntegers Integer32s OctetStrings IpAddresss Counter32sGauge32s Unsigned32s TimeTickssOpaques Counter64sBitssObjectIdentifiers ObjectNamesTypeCoercionHackMixInsChoices SimpleSyntaxsApplicationSyntaxs ObjectSyntax(sOpaques TimeTicksstags namedtypes IpAddresssBitssrfc1155sIntegersnamedvals OctetStringsstrings Counter64s Unsigned32sApplicationSyntaxsGauge32sunivs ObjectSyntaxstypess Integer32s ObjectNames constraints SimpleSyntaxserrors Counter32((s2build/bdist.linux-i686/egg/pysnmp/proto/rfc1902.pys?s$  % R PKAq> "ѷbbpysnmp/proto/acmod/rfc3415.pyc; w4Mc@s^dklZdklZlZdklZdZdddddd d d gZd Z d S((sNoSuchObjectError(serrindserror(sdebugiii@i iiiiicCs&|ii} titi@otid||f| ii dd\}|i |}y$|i|idf|i}Wn(tj otidtinX| ii dd\} | i ||}y$| i| idf|i} Wn(tj otidtinX| ii dd\}|i | |||}|d jo|id f|}n^|d jo|id f|}n9|d jo|idf|}ntid|y|i|i}Wn(tj otidti!nXt"| otidti#n| ii dd\}|i |}|idf|}}|idf|}xno|i(|} |i(|} | i}| i}||t"| jotidti+nt"| i}|t"|joqn| iog}x?t.t/t0| iD]%}|t.t2|dt3}qLWt"|d}|d}xK|oC||jp ||o| i|||joPn|d}qW|oqq n| i|| joqntidti6SqWdS(Ns0isAccessAllowed: viewType %s for variableName %ssSNMP-VIEW-BASED-ACM-MIBsvacmContextEntryiserrorIndicationsvacmSecurityToGroupEntryisvacmAccessEntrysreadiswriteisnotifyisUnknown view type %ssvacmViewTreeFamilyEntryicCs||@S(N(sbsc(sbsc((s8build/bdist.linux-i686/egg/pysnmp/proto/acmod/rfc3415.pysds(7s snmpEngines msgAndPduDspsmibInstrumControllersdebugsloggersflagACLsviewTypes variableNames mibBuilders importSymbolssvacmContextEntrysgetInstIdFromIndicess contextNamestblIdxsgetNodesnamessyntaxsvacmContextNamesNoSuchObjectErrorserrorsStatusInformationserrinds noSuchContextsvacmSecurityToGroupEntrys securityModels securityNames vacmGroupNames noGroupNamesvacmAccessEntrys securityLevelsentryIdxs ProtocolErrorsviewNames noAccessEntryslens noSuchViewsvacmViewTreeFamilyEntrysinitialTreeNamestreeNamesmaskNames getNextNodesvacmViewTreeFamilySubtreesvacmViewTreeFamilyMasks notInViewslsmasksmapsNonesstrscsords __powOfTwoSeqsmsidxs accessAllowed(s snmpEngines securityModels securityNames securityLevelsviewTypes contextNames variableNamestreeNamesmaskNamesvacmSecurityToGroupEntrys vacmGroupNamesvacmViewTreeFamilySubtreesmibInstrumControllersvacmViewTreeFamilyMasksentryIdxsvacmAccessEntrysviewNamesvacmViewTreeFamilyEntrysmsvacmContextNamescsidxsmaskslstblIdxsinitialTreeNamesvacmContextEntry((s8build/bdist.linux-i686/egg/pysnmp/proto/acmod/rfc3415.pysisAccessAllowed sz ($$      # 0 N( spysnmp.smi.errorsNoSuchObjectErrors pysnmp.protoserrindserrorspysnmpsdebugs accessModelIDs __powOfTwoSeqsisAccessAllowed(sisAccessAllowedsNoSuchObjectErrorserrindserrorsdebugs __powOfTwoSeqs accessModelID((s8build/bdist.linux-i686/egg/pysnmp/proto/acmod/rfc3415.pys?s  PKs2pysnmp/proto/acmod/__init__.pyPKAq> zpysnmp/proto/acmod/void.pyc; 3Mc@s3dklZdklZlZdZdZdS((sNoSuchObjectError(serrindserroricCs?titi@otid||ftidtiSdS(Ns5isAccessAllowed: viewType %s for variableName %s - OKserrorIndication( sdebugsloggersflagACLsviewTypes variableNameserrorsStatusInformationserrinds accessAllowed(s snmpEngines securityModels securityNames securityLevelsviewTypes contextNames variableName((s5build/bdist.linux-i686/egg/pysnmp/proto/acmod/void.pysisAccessAlloweds (N(spysnmp.smi.errorsNoSuchObjectErrors pysnmp.protoserrindserrors accessModelIDsisAccessAllowed(s accessModelIDsNoSuchObjectErrorsisAccessAllowedserrindserror((s5build/bdist.linux-i686/egg/pysnmp/proto/acmod/void.pys?s PKAq>pysnmp/proto/acmod/__init__.pyc; Bc@sdS(N((((s9build/bdist.linux-i686/egg/pysnmp/proto/acmod/__init__.pys?sPK:1>̂WWpysnmp/proto/acmod/rfc3415.py# View-based Access Control Model from pysnmp.smi.error import NoSuchObjectError from pysnmp.proto import errind, error from pysnmp import debug accessModelID = 3 __powOfTwoSeq = [128, 64, 32, 16, 8, 4, 2, 1] # 3.2 def isAccessAllowed( snmpEngine, securityModel, securityName, securityLevel, viewType, contextName, variableName): mibInstrumController = snmpEngine.msgAndPduDsp.mibInstrumController debug.logger & debug.flagACL and debug.logger('isAccessAllowed: viewType %s for variableName %s' % (viewType, variableName)) # 3.2.1 vacmContextEntry, = mibInstrumController.mibBuilder.importSymbols('SNMP-VIEW-BASED-ACM-MIB', 'vacmContextEntry') tblIdx = vacmContextEntry.getInstIdFromIndices(contextName) try: vacmContextName = vacmContextEntry.getNode( vacmContextEntry.name + (1,) + tblIdx ).syntax except NoSuchObjectError: raise error.StatusInformation(errorIndication=errind.noSuchContext) # 3.2.2 vacmSecurityToGroupEntry, = mibInstrumController.mibBuilder.importSymbols( 'SNMP-VIEW-BASED-ACM-MIB', 'vacmSecurityToGroupEntry' ) tblIdx = vacmSecurityToGroupEntry.getInstIdFromIndices( securityModel, securityName ) try: vacmGroupName = vacmSecurityToGroupEntry.getNode( vacmSecurityToGroupEntry.name + (3,) + tblIdx ).syntax except NoSuchObjectError: raise error.StatusInformation(errorIndication=errind.noGroupName) # 3.2.3 vacmAccessEntry, = mibInstrumController.mibBuilder.importSymbols( 'SNMP-VIEW-BASED-ACM-MIB', 'vacmAccessEntry' ) # XXX partial context name match tblIdx = vacmAccessEntry.getInstIdFromIndices( vacmGroupName, contextName, securityModel, securityLevel ) # 3.2.4 if viewType == 'read': entryIdx = vacmAccessEntry.name + (5,) + tblIdx elif viewType == 'write': entryIdx = vacmAccessEntry.name + (6,) + tblIdx elif viewType == 'notify': entryIdx = vacmAccessEntry.name + (7,) + tblIdx else: raise error.ProtocolError('Unknown view type %s' % viewType) try: viewName = vacmAccessEntry.getNode(entryIdx).syntax except NoSuchObjectError: raise error.StatusInformation(errorIndication=errind.noAccessEntry) if not len(viewName): raise error.StatusInformation(errorIndication=errind.noSuchView) # XXX split onto object & instance ? # 3.2.5a vacmViewTreeFamilyEntry, = mibInstrumController.mibBuilder.importSymbols('SNMP-VIEW-BASED-ACM-MIB', 'vacmViewTreeFamilyEntry') tblIdx = vacmViewTreeFamilyEntry.getInstIdFromIndices(viewName) # Walk over entries initialTreeName = treeName = vacmViewTreeFamilyEntry.name + (2,) + tblIdx maskName = vacmViewTreeFamilyEntry.name + (3,) + tblIdx while 1: vacmViewTreeFamilySubtree = vacmViewTreeFamilyEntry.getNextNode( treeName ) vacmViewTreeFamilyMask = vacmViewTreeFamilyEntry.getNextNode( maskName ) treeName = vacmViewTreeFamilySubtree.name maskName = vacmViewTreeFamilyMask.name if initialTreeName != treeName[:len(initialTreeName)]: # 3.2.5b raise error.StatusInformation(errorIndication=errind.notInView) l = len(vacmViewTreeFamilySubtree.syntax) if l > len(variableName): continue if vacmViewTreeFamilyMask.syntax: mask = [] for c in map(None, str(vacmViewTreeFamilyMask.syntax)): mask = mask + map(lambda b,c=ord(c): b&c, __powOfTwoSeq) m = len(mask)-1 idx = l-1 while idx: if idx > m or mask[idx] and \ vacmViewTreeFamilySubtree.syntax[idx] != variableName[idx]: break idx = idx - 1 if idx: continue # no match else: # no mask if vacmViewTreeFamilySubtree.syntax != variableName[:l]: continue # no match # 3.2.5c return error.StatusInformation(errorIndication=errind.accessAllowed) PK1>b  pysnmp/proto/acmod/void.py# Void Access Control Model from pysnmp.smi.error import NoSuchObjectError from pysnmp.proto import errind, error accessModelID = 0 # rfc3415 3.2 def isAccessAllowed( snmpEngine, securityModel, securityName, securityLevel, viewType, contextName, variableName): debug.logger & debug.flagACL and debug.logger('isAccessAllowed: viewType %s for variableName %s - OK' % (viewType, variableName)) # rfc3415 3.2.5c return error.StatusInformation(errorIndication=errind.accessAllowed) PKAq>qpysnmp/proto/mpmod/cache.pyc; jFMc@s1dklZdklZdfdYZdS((serror(snextidsCachecBswtZeidZeidZdZdZdZdZ dZ dZ dZ d Z d ZRS( NicCs1h|_h|_h|_h|_d|_dS(Nl(sselfs_Cache__msgIdIndexs_Cache__stateReferenceIndexs_Cache__sendPduHandleIdxs_Cache__expirationQueues_Cache__expirationTimer(sself((s6build/bdist.linux-i686/egg/pysnmp/proto/mpmod/cache.pys__init__s     cCs|iSdS(N(sselfs_Cache__stateReference(sself((s6build/bdist.linux-i686/egg/pysnmp/proto/mpmod/cache.pysnewStateReferencescKs||ijotid||fn|id}||f|i|<||ijoh|i|N`g pysnmp/proto/mpmod/base.pyc; jFMc@s$dklZdfdYZdS((scachesAbstractMessageProcessingModelcBs>tZdZdZdZdZdZdZRS(NcCs"|i|_ti|_dS(N(sselfs snmpMsgSpecs _snmpMsgSpecscachesCaches_cache(sself((s5build/bdist.linux-i686/egg/pysnmp/proto/mpmod/base.pys__init__scCstiddS(Nsmethod not implemented(serrors ProtocolError(sselfs snmpEnginestransportDomainstransportAddresssmessageProcessingModels securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionspdusexpectResponses sendPduHandle((s5build/bdist.linux-i686/egg/pysnmp/proto/mpmod/base.pysprepareOutgoingMessage sc CstiddS(Nsmethod not implemented(serrors ProtocolError( sselfs snmpEnginesmessageProcessingModels securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionspdusmaxSizeResponseScopedPDUsstateReferencesstatusInformation((s5build/bdist.linux-i686/egg/pysnmp/proto/mpmod/base.pysprepareResponseMessagescCstiddS(Nsmethod not implemented(serrors ProtocolError(sselfs snmpEnginestransportDomainstransportAddressswholeMsg((s5build/bdist.linux-i686/egg/pysnmp/proto/mpmod/base.pysprepareDataElements,scCs1y|ii|Wntij onXdS(N(sselfs_cachespopBySendPduHandles sendPduHandleserrors ProtocolError(sselfs sendPduHandle((s5build/bdist.linux-i686/egg/pysnmp/proto/mpmod/base.pysreleaseStateInformation5scCs|iidS(N(sselfs_caches expireCaches(sselfs snmpEnginestimeNow((s5build/bdist.linux-i686/egg/pysnmp/proto/mpmod/base.pysreceiveTimerTick;s(s__name__s __module__s__init__sprepareOutgoingMessagesprepareResponseMessagesprepareDataElementssreleaseStateInformationsreceiveTimerTick(((s5build/bdist.linux-i686/egg/pysnmp/proto/mpmod/base.pysAbstractMessageProcessingModels     N(spysnmp.proto.mpmodscachesAbstractMessageProcessingModel(scachesAbstractMessageProcessingModel((s5build/bdist.linux-i686/egg/pysnmp/proto/mpmod/base.pys?s PKģO>`150w0wpysnmp/proto/mpmod/rfc3412.py# SNMP v3 message processing model implementation from pysnmp.proto.mpmod.base import AbstractMessageProcessingModel from pysnmp.proto.secmod import rfc3414 from pysnmp.proto import rfc1905, rfc3411, api, errind, error from pyasn1.type import univ, namedtype, constraint from pyasn1.codec.ber import decoder from pyasn1.error import PyAsn1Error from pysnmp import debug # API to rfc1905 protocol objects pMod = api.protoModules[api.protoVersion2c] # SNMPv3 message format class ScopedPDU(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('contextEngineId', univ.OctetString()), namedtype.NamedType('contextName', univ.OctetString()), namedtype.NamedType('data', rfc1905.PDUs()) ) class ScopedPduData(univ.Choice): componentType = namedtype.NamedTypes( namedtype.NamedType('plaintext', ScopedPDU()), namedtype.NamedType('encryptedPDU', univ.OctetString()), ) class HeaderData(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('msgID', univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 2147483647L))), namedtype.NamedType('msgMaxSize', univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(484, 2147483647L))), namedtype.NamedType('msgFlags', univ.OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 1))), namedtype.NamedType('msgSecurityModel', univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(1, 2147483647L))) ) class SNMPv3Message(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('msgVersion', univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 2147483647L))), namedtype.NamedType('msgGlobalData', HeaderData()), namedtype.NamedType('msgSecurityParameters', univ.OctetString()), namedtype.NamedType('msgData', ScopedPduData()) ) # XXX move somewhere? _snmpErrors = { (1, 3, 6, 1, 6, 3, 15, 1, 1, 1, 0): 'unsupportedSecLevel', (1, 3, 6, 1, 6, 3, 15, 1, 1, 2, 0): 'notInTimeWindow', (1, 3, 6, 1, 6, 3, 15, 1, 1, 3, 0): 'unknownUserName', (1, 3, 6, 1, 6, 3, 15, 1, 1, 4, 0): 'unknownEngineID', (1, 3, 6, 1, 6, 3, 15, 1, 1, 5, 0): 'wrongDigest', (1, 3, 6, 1, 6, 3, 15, 1, 1, 6, 0): 'decryptionError', } class SnmpV3MessageProcessingModel(AbstractMessageProcessingModel): messageProcessingModelID = univ.Integer(3) # SNMPv3 snmpMsgSpec = SNMPv3Message _scopedPDU = ScopedPDU() _emptyStr = univ.OctetString('') _msgFlags = { 0: univ.OctetString('\x00'), 1: univ.OctetString('\x01'), 3: univ.OctetString('\x03'), 4: univ.OctetString('\x04'), 5: univ.OctetString('\x05'), 7: univ.OctetString('\x07') } def __init__(self): AbstractMessageProcessingModel.__init__(self) self.__engineIDs = {} self.__engineIDsExpQueue = {} self.__expirationTimer = 0L # 7.1.1a def prepareOutgoingMessage( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, expectResponse, sendPduHandle ): snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') snmpEngineID = snmpEngineID.syntax # 7.1.1b msgID = self._cache.newMsgID() debug.logger & debug.flagMP and debug.logger('prepareOutgoingMessage: new msgID %s' % msgID) k = (transportDomain, transportAddress) if k in self.__engineIDs: peerSnmpEngineData = self.__engineIDs[k] else: peerSnmpEngineData = None debug.logger & debug.flagMP and debug.logger('prepareOutgoingMessage: peer SNMP engine data %s for transport %s, address %s' % (peerSnmpEngineData, transportDomain, transportAddress)) # 7.1.4 if contextEngineId is None: if peerSnmpEngineData is None: contextEngineId = snmpEngineID else: contextEngineId = peerSnmpEngineData['contextEngineId'] # Defaulting contextEngineID to securityEngineID should # probably be done on Agent side (see 7.1.3.d.2,) so this # is a sort of workaround. if not contextEngineId: contextEngineId = peerSnmpEngineData['securityEngineID'] # 7.1.5 if not contextName: contextName = self._emptyStr debug.logger & debug.flagMP and debug.logger('prepareOutgoingMessage: using contextEngineId %s, contextName %s' % (repr(contextEngineId), contextName)) # 7.1.6 scopedPDU = self._scopedPDU scopedPDU.setComponentByPosition(0, contextEngineId) scopedPDU.setComponentByPosition(1, contextName) scopedPDU.setComponentByPosition(2) scopedPDU.getComponentByPosition(2).setComponentByType( pdu.tagSet, pdu, verifyConstraints=False ) # 7.1.7 msg = self._snmpMsgSpec # 7.1.7a msg.setComponentByPosition( 0, self.messageProcessingModelID, verifyConstraints=False ) headerData = msg.setComponentByPosition(1).getComponentByPosition(1) # 7.1.7b headerData.setComponentByPosition(0, msgID, verifyConstraints=False) snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize') # 7.1.7c # XXX need to coerce MIB value as it has incompatible constraints set headerData.setComponentByPosition( 1, snmpEngineMaxMessageSize.syntax, verifyConstraints=False ) # 7.1.7d msgFlags = 0 if securityLevel == 1: pass elif securityLevel == 2: msgFlags = msgFlags | 0x01 elif securityLevel == 3: msgFlags = msgFlags | 0x03 else: raise error.ProtocolError( 'Unknown securityLevel %s' % securityLevel ) if pdu.tagSet in rfc3411.confirmedClassPDUs: msgFlags = msgFlags | 0x04 headerData.setComponentByPosition( 2, self._msgFlags[msgFlags], verifyConstraints=False ) # 7.1.7e # XXX need to coerce MIB value as it has incompatible constraints set headerData.setComponentByPosition(3, int(securityModel)) debug.logger & debug.flagMP and debug.logger('prepareOutgoingMessage: %s' % (msg.prettyPrint(),)) if securityModel in snmpEngine.securityModels: smHandler = snmpEngine.securityModels[securityModel] else: raise error.StatusInformation( errorIndication = errind.unsupportedSecurityModel ) # 7.1.9.a if pdu.tagSet in rfc3411.unconfirmedClassPDUs: securityEngineID = snmpEngineID else: if peerSnmpEngineData is None: # Force engineID discovery (rfc3414, 4) securityEngineID = securityName = self._emptyStr securityLevel = 1 # Clear possible auth&priv flags headerData.setComponentByPosition( 2, self._msgFlags[msgFlags & 0xfc], verifyConstraints=False ) # XXX scopedPDU = self._scopedPDU scopedPDU.setComponentByPosition( 0, self._emptyStr, verifyConstraints=False ) scopedPDU.setComponentByPosition(1, contextName) scopedPDU.setComponentByPosition(2) # Use dead-empty PDU for engine-discovery report emptyPdu = pdu.clone() pMod.apiPDU.setDefaults(emptyPdu) scopedPDU.getComponentByPosition(2).setComponentByType( emptyPdu.tagSet, emptyPdu, verifyConstraints=False ) debug.logger & debug.flagMP and debug.logger('prepareOutgoingMessage: force engineID discovery') else: securityEngineID = peerSnmpEngineData['securityEngineID'] debug.logger & debug.flagMP and debug.logger('prepareOutgoingMessage: securityEngineID %s' % securityEngineID) # 7.1.9.b ( securityParameters, wholeMsg ) = smHandler.generateRequestMsg( snmpEngine, self.messageProcessingModelID, msg, snmpEngineMaxMessageSize.syntax, securityModel, securityEngineID, securityName, securityLevel, scopedPDU ) # Message size constraint verification if len(wholeMsg) > snmpEngineMaxMessageSize.syntax: raise error.StatusInformation(errorIndication=errind.tooBig) # 7.1.9.c if pdu.tagSet in rfc3411.confirmedClassPDUs: # XXX rfc bug? why stateReference should be created? self._cache.pushByMsgId( msgID, sendPduHandle=sendPduHandle, msgID=msgID, snmpEngineID=snmpEngineID, securityModel=securityModel, securityName=securityName, securityLevel=securityLevel, contextEngineId=contextEngineId, contextName=contextName, transportDomain=transportDomain, transportAddress=transportAddress ) return ( transportDomain, transportAddress, wholeMsg ) def prepareResponseMessage( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, maxSizeResponseScopedPDU, stateReference, statusInformation ): snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') snmpEngineID = snmpEngineID.syntax # 7.1.2.b cachedParams = self._cache.popByStateRef(stateReference) msgID = cachedParams['msgID'] contextEngineId = cachedParams['contextEngineId'] contextName = cachedParams['contextName'] securityModel = cachedParams['securityModel'] securityName = cachedParams['securityName'] securityLevel = cachedParams['securityLevel'] securityStateReference = cachedParams['securityStateReference'] reportableFlag = cachedParams['reportableFlag'] maxMessageSize = cachedParams['msgMaxSize'] transportDomain = cachedParams['transportDomain'] transportAddress = cachedParams['transportAddress'] debug.logger & debug.flagMP and debug.logger('prepareResponseMessage: stateReference %s' % (stateReference)) # 7.1.3 if statusInformation is not None and 'oid' in statusInformation: # 7.1.3a if pdu is not None: requestID = pdu.getComponentByPosition(0) pduType = pdu.tagSet else: pduType = None # 7.1.3b if pdu is None and not reportableFlag or \ pduType is not None and \ pduType not in rfc3411.confirmedClassPDUs: raise error.StatusInformation( errorIndication = errind.loopTerminated ) # 7.1.3c reportPDU = rfc1905.ReportPDU() pMod.apiPDU.setVarBinds( reportPDU, ((statusInformation['oid'], statusInformation['val']),) ) pMod.apiPDU.setErrorStatus(reportPDU, 0) pMod.apiPDU.setErrorIndex(reportPDU, 0) if pdu is None: pMod.apiPDU.setRequestID(reportPDU, 0) else: pMod.apiPDU.setRequestID(reportPDU, requestID) # 7.1.3d.1 if 'securityLevel' in statusInformation: securityLevel = statusInformation['securityLevel'] else: securityLevel = 1 # 7.1.3d.2 if 'contextEngineId' in statusInformation: contextEngineId = statusInformation['contextEngineId'] else: contextEngineId = snmpEngineID # 7.1.3d.3 if 'contextName' in statusInformation: contextName = statusInformation['contextName'] else: contextName = "" # 7.1.3e pdu = reportPDU debug.logger & debug.flagMP and debug.logger('prepareResponseMessage: prepare report PDU for statusInformation %s' % statusInformation) # 7.1.4 if not contextEngineId: contextEngineId = snmpEngineID # XXX impl-dep manner # 7.1.5 if not contextName: contextName = self._emptyStr debug.logger & debug.flagMP and debug.logger('prepareResponseMessage: using contextEngineId %s, contextName %s' % (repr(contextEngineId), contextName)) # 7.1.6 scopedPDU = self._scopedPDU scopedPDU.setComponentByPosition(0, contextEngineId) scopedPDU.setComponentByPosition(1, contextName) scopedPDU.setComponentByPosition(2) scopedPDU.getComponentByPosition(2).setComponentByType( pdu.tagSet, pdu, verifyConstraints=False ) # 7.1.7 msg = self._snmpMsgSpec # 7.1.7a msg.setComponentByPosition( 0, self.messageProcessingModelID, verifyConstraints=False ) headerData = msg.setComponentByPosition(1).getComponentByPosition(1) # 7.1.7b headerData.setComponentByPosition( 0, msgID, verifyConstraints=False ) snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize') # 7.1.7c # XXX need to coerce MIB value as it has incompatible constraints set headerData.setComponentByPosition( 1, snmpEngineMaxMessageSize.syntax, verifyConstraints=False ) # 7.1.7d msgFlags = 0 if securityLevel == 1: pass elif securityLevel == 2: msgFlags = msgFlags | 0x01 elif securityLevel == 3: msgFlags = msgFlags | 0x03 else: raise error.ProtocolError( 'Unknown securityLevel %s' % securityLevel ) if pdu.tagSet in rfc3411.confirmedClassPDUs: # XXX not needed? msgFlags = msgFlags | 0x04 headerData.setComponentByPosition( 2, self._msgFlags[msgFlags], verifyConstraints=False ) # 7.1.7e headerData.setComponentByPosition( 3, securityModel, verifyConstraints=False ) debug.logger & debug.flagMP and debug.logger('prepareResponseMessage: %s' % (msg.prettyPrint(),)) if securityModel in snmpEngine.securityModels: smHandler = snmpEngine.securityModels[securityModel] else: raise error.StatusInformation( errorIndication = errind.unsupportedSecurityModel ) # 7.1.8a try: ( securityParameters, wholeMsg ) = smHandler.generateResponseMsg( snmpEngine, self.messageProcessingModelID, msg, snmpEngineMaxMessageSize.syntax, securityModel, snmpEngineID, securityName, securityLevel, scopedPDU, securityStateReference ) except error.StatusInformation, statusInformation: # 7.1.8.b raise debug.logger & debug.flagMP and debug.logger('prepareResponseMessage: SM finished') # Message size constraint verification if len(wholeMsg) > min(snmpEngineMaxMessageSize.syntax, maxMessageSize): raise error.StatusInformation(errorIndication=errind.tooBig) return ( transportDomain, transportAddress, wholeMsg ) # 7.2.1 def prepareDataElements( self, snmpEngine, transportDomain, transportAddress, wholeMsg ): # 7.2.2 try: msg, restOfwholeMsg = decoder.decode( wholeMsg, asn1Spec=self._snmpMsgSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInASNParseErrs') snmpInASNParseErrs.syntax = snmpInASNParseErrs.syntax + 1 raise error.StatusInformation( errorIndication = errind.parseError ) debug.logger & debug.flagMP and debug.logger('prepareDataElements: %s' % (msg.prettyPrint(),)) # 7.2.3 headerData = msg.getComponentByPosition(1) msgVersion = messageProcessingModel = msg.getComponentByPosition(0) msgID = headerData.getComponentByPosition(0) msgFlags = ord(str(headerData.getComponentByPosition(2))) maxMessageSize = headerData.getComponentByPosition(1) securityModel = headerData.getComponentByPosition(3) securityParameters = msg.getComponentByPosition(2) debug.logger & debug.flagMP and debug.logger('prepareDataElements: msg data msgVersion %s msgID %s securityModel %s' % (msgVersion, msgID, securityModel)) # 7.2.4 if securityModel not in snmpEngine.securityModels: snmpUnknownSecurityModels, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpUnknownSecurityModels') snmpUnknownSecurityModels.syntax = snmpUnknownSecurityModels.syntax + 1 raise error.StatusInformation( errorIndication = errind.unsupportedSecurityModel ) # 7.2.5 if msgFlags & 0x03 == 0x00: securityLevel = 1 elif (msgFlags & 0x03) == 0x01: securityLevel = 2 elif (msgFlags & 0x03) == 0x03: securityLevel = 3 else: snmpInvalidMsgs = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInvalidMsgs') snmpInvalidMsgs.syntax = snmpInvalidMsgs.syntax + 1 raise error.StatusInformation( errorIndication = errind.invalidMsg ) if msgFlags & 0x04: reportableFlag = 1 else: reportableFlag = 0 # 7.2.6 smHandler = snmpEngine.securityModels[securityModel] try: ( securityEngineID, securityName, scopedPDU, maxSizeResponseScopedPDU, securityStateReference ) = smHandler.processIncomingMsg( snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg ) debug.logger & debug.flagMP and debug.logger('prepareDataElements: SM succeeded') except error.StatusInformation, statusInformation: debug.logger & debug.flagMP and debug.logger('prepareDataElements: SM failed, statusInformation %s' % statusInformation) if 'errorIndication' in statusInformation: # 7.2.6a if 'oid' in statusInformation: # 7.2.6a1 securityStateReference = statusInformation[ 'securityStateReference' ] contextEngineId = statusInformation['contextEngineId'] contextName = statusInformation['contextName'] if 'scopedPDU' in statusInformation: scopedPDU = statusInformation['scopedPDU'] pdu = scopedPDU.getComponentByPosition(2).getComponent() else: pdu = None maxSizeResponseScopedPDU = statusInformation[ 'maxSizeResponseScopedPDU' ] securityName = None # XXX secmod cache used # 7.2.6a2 stateReference = self._cache.newStateReference() self._cache.pushByStateRef( stateReference, msgVersion=messageProcessingModel, msgID=msgID, contextEngineId=contextEngineId, contextName=contextName, securityModel=securityModel, securityName=securityName, securityLevel=securityLevel, securityStateReference=securityStateReference, reportableFlag=reportableFlag, msgMaxSize=maxMessageSize, maxSizeResponseScopedPDU=maxSizeResponseScopedPDU, transportDomain=transportDomain, transportAddress=transportAddress ) # 7.2.6a3 try: snmpEngine.msgAndPduDsp.returnResponsePdu( snmpEngine, 3, securityModel, securityName, securityLevel, contextEngineId, contextName, 1, pdu, maxSizeResponseScopedPDU, stateReference, statusInformation ) except error.StatusInformation: pass debug.logger & debug.flagMP and debug.logger('prepareDataElements: error reported') # 7.2.6b raise statusInformation else: # Sniff for engineIDs k = (transportDomain, transportAddress) if k not in self.__engineIDs: contextEngineId, contextName, pdu = scopedPDU self.__engineIDs[k] = { 'securityEngineID': securityEngineID, 'contextEngineId': contextEngineId, 'contextName': contextName } expireAt = self.__expirationTimer + 300 if expireAt not in self.__engineIDsExpQueue: self.__engineIDsExpQueue[expireAt] = [] self.__engineIDsExpQueue[expireAt].append(k) debug.logger & debug.flagMP and debug.logger('prepareDataElements: cache securityEngineID %s for %s %s' % (repr(securityEngineID), transportDomain, transportAddress)) snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') snmpEngineID = snmpEngineID.syntax # 7.2.7 XXX PDU would be parsed here? contextEngineId, contextName, pdu = scopedPDU pdu = pdu.getComponent() # PDUs # 7.2.8 pduVersion = api.protoVersion2c # 7.2.9 pduType = pdu.tagSet # 7.2.10 if pduType in rfc3411.responseClassPDUs or \ pduType in rfc3411.internalClassPDUs: # 7.2.10a try: cachedReqParams = self._cache.popByMsgId(msgID) except error.ProtocolError: smHandler.releaseStateInformation(securityStateReference) raise error.StatusInformation( errorIndication = errind.dataMismatch ) # 7.2.10b sendPduHandle = cachedReqParams['sendPduHandle'] else: sendPduHandle = None debug.logger & debug.flagMP and debug.logger('prepareDataElements: using sendPduHandle %s for msgID %s' % (sendPduHandle, msgID)) # 7.2.11 if pduType in rfc3411.internalClassPDUs: # 7.2.11a varBinds = pMod.apiPDU.getVarBinds(pdu) if varBinds: statusInformation = error.StatusInformation( errorIndication=_snmpErrors.get( varBinds[0][0], 'errorReportReceived' ), oid=varBinds[0][0], val=varBinds[0][1], sendPduHandle=sendPduHandle ) # 7.2.11b (incomplete implementation) # 7.2.11c smHandler.releaseStateInformation(securityStateReference) # 7.2.11d stateReference = None # 7.2.11e XXX may need to pass Reports up to app in some cases... raise statusInformation statusInformation = None # no errors ahead # 7.2.12 if pduType in rfc3411.responseClassPDUs: # 7.2.12a -> noop # 7.2.12b if securityModel != cachedReqParams['securityModel'] or \ securityName != cachedReqParams['securityName'] or \ securityLevel != cachedReqParams['securityLevel'] or \ contextEngineId != cachedReqParams['contextEngineId'] or \ contextName != cachedReqParams['contextName']: smHandler.releaseStateInformation(securityStateReference) raise error.StatusInformation( errorIndication = errind.dataMismatch ) # 7.2.12c smHandler.releaseStateInformation(securityStateReference) stateReference = None # 7.2.12d return ( messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, pduType, sendPduHandle, maxSizeResponseScopedPDU, statusInformation, stateReference ) # 7.2.13 if pduType in rfc3411.confirmedClassPDUs: # 7.2.13a if securityEngineID != snmpEngineID: smHandler.releaseStateInformation(securityStateReference) raise error.StatusInformation( errorIndication = errind.engineIDMismatch ) # 7.2.13b stateReference = self._cache.newStateReference() self._cache.pushByStateRef( stateReference, msgVersion=messageProcessingModel, msgID=msgID, contextEngineId=contextEngineId, contextName=contextName, securityModel=securityModel, securityName=securityName, securityLevel=securityLevel, securityStateReference=securityStateReference, reportableFlag=reportableFlag, msgMaxSize=maxMessageSize, maxSizeResponseScopedPDU=maxSizeResponseScopedPDU, transportDomain=transportDomain, transportAddress=transportAddress ) debug.logger & debug.flagMP and debug.logger('prepareDataElements: new stateReference %s' % stateReference) # 7.2.13c return ( messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, pduType, sendPduHandle, maxSizeResponseScopedPDU, statusInformation, stateReference ) # 7.2.14 if pduType in rfc3411.unconfirmedClassPDUs: # Pass new stateReference to let app browse request details stateReference = self._cache.newStateReference() # This is not specified explicitly in RFC smHandler.releaseStateInformation(securityStateReference) return ( messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, pduType, sendPduHandle, maxSizeResponseScopedPDU, statusInformation, stateReference ) smHandler.releaseStateInformation(securityStateReference) raise error.StatusInformation( errorIndication = errind.unsupportedPDUtype ) def __expireEnginesInfo(self): if self.__expirationTimer in self.__engineIDsExpQueue: for engineKey in self.__engineIDsExpQueue[self.__expirationTimer]: del self.__engineIDs[engineKey] debug.logger & debug.flagMP and debug.logger('__expireEnginesInfo: expiring %s' % (engineKey,)) del self.__engineIDsExpQueue[self.__expirationTimer] self.__expirationTimer = self.__expirationTimer + 1 def receiveTimerTick(self, snmpEngine, timeNow): self.__expireEnginesInfo() AbstractMessageProcessingModel.receiveTimerTick( self, snmpEngine, timeNow ) PKAq>kTcNcNpysnmp/proto/mpmod/rfc3412.pyc; !ZMc @sdklZdklZdklZlZlZlZl Z dk l Z l Z l Z dklZdklZdklZeieiZde ifdYZd e ifd YZd e ifd YZd e ifdYZhdddddddddddf d<dddddddddddf d<dddddddddddf d<dddddddddddf d<dddddddddddf d<dddddddddddf d|dt6|i4d|dt6titi@otid|i?f||i@jo|i@|}nt#i$dt%iBy:|iC||i9||i|||||| \}}Wnt#i$j o } nXtiti@o tidtF|tG|i|jot#i$dt%iHn|| |fSdS(Ns__SNMP-FRAMEWORK-MIBs snmpEngineIDsmsgIDscontextEngineIds contextNames securityModels securityNames securityLevelssecurityStateReferencesreportableFlags msgMaxSizestransportDomainstransportAddresss)prepareResponseMessage: stateReference %ssoidiserrorIndicationsvalissCprepareResponseMessage: prepare report PDU for statusInformation %ss@prepareResponseMessage: using contextEngineId %s, contextName %sisverifyConstraintsssnmpEngineMaxMessageSizeisUnknown securityLevel %sisprepareResponseMessage: %ss#prepareResponseMessage: SM finished(Is snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolss snmpEngineIDssyntaxsselfs_caches popByStateRefsstateReferences cachedParamssmsgIDscontextEngineIds contextNames securityModels securityNames securityLevelssecurityStateReferencesreportableFlagsmaxMessageSizestransportDomainstransportAddresssdebugsloggersflagMPsstatusInformationsNonespdusgetComponentByPositions requestIDstagSetspduTypesrfc3411sconfirmedClassPDUsserrorsStatusInformationserrindsloopTerminatedsrfc1905s ReportPDUs reportPDUspModsapiPDUs setVarBindsssetErrorStatuss setErrorIndexs setRequestIDs _emptyStrsreprs _scopedPDUs scopedPDUssetComponentByPositionssetComponentByTypesFalses _snmpMsgSpecsmsgsmessageProcessingModelIDs headerDatassnmpEngineMaxMessageSizesmsgFlagss ProtocolErrors _msgFlagss prettyPrintssecurityModelss smHandlersunsupportedSecurityModelsgenerateResponseMsgssecurityParametersswholeMsgslensminstooBig( sselfs snmpEnginesmessageProcessingModels securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionspdusmaxSizeResponseScopedPDUsstateReferencesstatusInformationstransportAddresss smHandlers reportPDUstransportDomains requestIDs headerDataspduTypes scopedPDUsmsgssecurityParametersssecurityStateReferencesreportableFlagsmsgFlagsssnmpEngineMaxMessageSizesmsgIDswholeMsgs snmpEngineIDsmaxMessageSizes cachedParams((s8build/bdist.linux-i686/egg/pysnmp/proto/mpmod/rfc3412.pysprepareResponseMessages            "  2      &  .  "    + c'Cs y"ti|d|i\}}#WnVtj oJ|i i i i dd\}|id|_tidtinXtiti@otid|if|id} |id}}| id}tt| id}| id}"| id } |id}titi@otid ||| f| |i"joG|i i i i dd \}|id|_tidti$n|d @djo d}nw|d @djo d}n\|d @d jo d }nA|i i i i dd }|id|_tidti'|d @o d}nd}|i"| }yU|i*|||"|| |||\}$} }}}titi@o tidWntij o} titi@otid| d| joRd| joA| d}| d}| d}d| jo#| d}|idi3}nt5}| d}t5} |i6i7}|i6i9|d|d|d|d|d| d| d|d|d|d|"d|d|d| y5|i i<|d | | |||d|||| Wntij onXtiti@o tidqFn| nX||f}%|%|i>jo|\}}}hd |$<d|<d|<|i>|%<|i?d!}||iAjog|iA|D>iipysnmp/proto/mpmod/cache.pyfrom pysnmp.proto import error from pysnmp import nextid class Cache: __stateReference = nextid.Integer(0xffffff) __msgID = nextid.Integer(0xffffff) def __init__(self): self.__msgIdIndex = {} self.__stateReferenceIndex = {} self.__sendPduHandleIdx = {} # Message expiration mechanics self.__expirationQueue = {} self.__expirationTimer = 0L # Server mode cache handling def newStateReference(self): return self.__stateReference() def pushByStateRef(self, stateReference, **msgInfo): if stateReference in self.__stateReferenceIndex: raise error.ProtocolError( 'Cache dup for stateReference=%s at %s' % (stateReference, self) ) expireAt = self.__expirationTimer+60 self.__stateReferenceIndex[stateReference] = ( msgInfo, expireAt ) # Schedule to expire if expireAt not in self.__expirationQueue: self.__expirationQueue[expireAt] = {} if 'stateReference' not in self.__expirationQueue[expireAt]: self.__expirationQueue[expireAt]['stateReference'] = {} self.__expirationQueue[expireAt]['stateReference'][stateReference] = 1 def popByStateRef(self, stateReference): if stateReference in self.__stateReferenceIndex: cacheInfo = self.__stateReferenceIndex[stateReference] else: raise error.ProtocolError( 'Cache miss for stateReference=%s at %s' % (stateReference, self) ) del self.__stateReferenceIndex[stateReference] cacheEntry, expireAt = cacheInfo del self.__expirationQueue[expireAt]['stateReference'][stateReference] return cacheEntry # Client mode cache handling def newMsgID(self): return self.__msgID() def pushByMsgId(self, msgId, **msgInfo): if msgId in self.__msgIdIndex: raise error.ProtocolError( 'Cache dup for msgId=%s at %s' % (msgId, self) ) expireAt = self.__expirationTimer+60 self.__msgIdIndex[msgId] = ( msgInfo, expireAt ) self.__sendPduHandleIdx[msgInfo['sendPduHandle']] = msgId # Schedule to expire if expireAt not in self.__expirationQueue: self.__expirationQueue[expireAt] = {} if 'msgId' not in self.__expirationQueue[expireAt]: self.__expirationQueue[expireAt]['msgId'] = {} self.__expirationQueue[expireAt]['msgId'][msgId] = 1 def popByMsgId(self, msgId): if msgId in self.__msgIdIndex: cacheInfo = self.__msgIdIndex[msgId] else: raise error.ProtocolError( 'Cache miss for msgId=%s at %s' % (msgId, self) ) msgInfo, expireAt = cacheInfo del self.__sendPduHandleIdx[msgInfo['sendPduHandle']] del self.__msgIdIndex[msgId] cacheEntry, expireAt = cacheInfo del self.__expirationQueue[expireAt]['msgId'][msgId] return cacheEntry def popBySendPduHandle(self, sendPduHandle): if sendPduHandle in self.__sendPduHandleIdx: self.popByMsgId(self.__sendPduHandleIdx[sendPduHandle]) def expireCaches(self): # Uses internal clock to expire pending messages if self.__expirationTimer in self.__expirationQueue: cacheInfo = self.__expirationQueue[self.__expirationTimer] if 'stateReference' in cacheInfo: for stateReference in cacheInfo['stateReference'].keys(): del self.__stateReferenceIndex[stateReference] if 'msgId' in cacheInfo: for msgId in cacheInfo['msgId'].keys(): del self.__msgIdIndex[msgId] del self.__expirationQueue[self.__expirationTimer] self.__expirationTimer = self.__expirationTimer + 1 PKAq>ppysnmp/proto/mpmod/__init__.pyc; Bc@sdS(N((((s9build/bdist.linux-i686/egg/pysnmp/proto/mpmod/__init__.pys?sPKV?>V//pysnmp/proto/mpmod/base.py# MP-specific cache management from pysnmp.proto.mpmod import cache class AbstractMessageProcessingModel: def __init__(self): self._snmpMsgSpec = self.snmpMsgSpec() # local copy self._cache = cache.Cache() def prepareOutgoingMessage( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, expectResponse, sendPduHandle ): raise error.ProtocolError('method not implemented') def prepareResponseMessage( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, maxSizeResponseScopedPDU, stateReference, statusInformation ): raise error.ProtocolError('method not implemented') def prepareDataElements( self, snmpEngine, transportDomain, transportAddress, wholeMsg ): raise error.ProtocolError('method not implemented') def releaseStateInformation(self, sendPduHandle): try: self._cache.popBySendPduHandle(sendPduHandle) except error.ProtocolError: pass # XXX maybe these should all follow some scheme? def receiveTimerTick(self, snmpEngine, timeNow): self._cache.expireCaches() PKkL>D;;pysnmp/proto/mpmod/rfc2576.py# SNMP v1 & v2c message processing models implementation from pyasn1.codec.ber import decoder from pysnmp.proto.mpmod.base import AbstractMessageProcessingModel from pysnmp.proto.secmod import rfc2576 from pysnmp.proto import rfc3411, errind, error from pysnmp.proto.api import v1, v2c from pyasn1.type import univ from pyasn1.error import PyAsn1Error from pysnmp import debug # Since I have not found a detailed reference to v1MP/v2cMP # inner workings, the following has been patterned from v3MP. Most # references here goes to RFC3412. class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel): messageProcessingModelID = univ.Integer(0) # SNMPv1 snmpMsgSpec = v1.Message # rfc3412: 7.1 def prepareOutgoingMessage( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, expectResponse, sendPduHandle ): snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') snmpEngineID = snmpEngineID.syntax # rfc3412: 7.1.1b if pdu.tagSet in rfc3411.confirmedClassPDUs: pdu.setComponentByPosition(1) msgID = pdu.getComponentByPosition(0) # rfc3412: 7.1.4 # Since there's no SNMP engine identification in v1/2c, # set destination contextEngineId to ours if not contextEngineId: contextEngineId = snmpEngineID # rfc3412: 7.1.5 if not contextName: contextName = '' debug.logger & debug.flagMP and debug.logger('prepareOutgoingMessage: using contextEngineId %s contextName %s' % (repr(contextEngineId), contextName)) # rfc3412: 7.1.6 scopedPDU = ( contextEngineId, contextName, pdu ) msg = self._snmpMsgSpec msg.setComponentByPosition(0, self.messageProcessingModelID) msg.setComponentByPosition(2) msg.getComponentByPosition(2).setComponentByType( pdu.tagSet, pdu, verifyConstraints=False ) # rfc3412: 7.1.7 globalData = ( msg, ) k = int(securityModel) if k in snmpEngine.securityModels: smHandler = snmpEngine.securityModels[k] else: raise error.StatusInformation( errorIndication = errind.unsupportedSecurityModel ) # rfc3412: 7.1.9.a & rfc2576: 5.2.1 --> no-op snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize') # rfc3412: 7.1.9.b ( securityParameters, wholeMsg ) = smHandler.generateRequestMsg( snmpEngine, self.messageProcessingModelID, globalData, snmpEngineMaxMessageSize.syntax, securityModel, snmpEngineID, securityName, securityLevel, scopedPDU ) # rfc3412: 7.1.9.c if pdu.tagSet in rfc3411.confirmedClassPDUs: # XXX rfc bug? why stateReference should be created? self._cache.pushByMsgId( long(msgID), sendPduHandle=sendPduHandle, msgID=msgID, snmpEngineID=snmpEngineID, securityModel=securityModel, securityName=securityName, securityLevel=securityLevel, contextEngineId=contextEngineId, contextName=contextName, transportDomain=transportDomain, transportAddress=transportAddress ) return ( transportDomain, transportAddress, wholeMsg ) # rfc3412: 7.1 def prepareResponseMessage( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, maxSizeResponseScopedPDU, stateReference, statusInformation ): snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') snmpEngineID = snmpEngineID.syntax # rfc3412: 7.1.2.b cachedParams = self._cache.popByStateRef(stateReference) msgID = cachedParams['msgID'] contextEngineId = cachedParams['contextEngineId'] contextName = cachedParams['contextName'] securityModel = cachedParams['securityModel'] securityName = cachedParams['securityName'] securityLevel = cachedParams['securityLevel'] securityStateReference = cachedParams['securityStateReference'] maxMessageSize = cachedParams['msgMaxSize'] transportDomain = cachedParams['transportDomain'] transportAddress = cachedParams['transportAddress'] debug.logger & debug.flagMP and debug.logger('prepareResponseMessage: cache read msgID %s transportDomain %s transportAddress %s by stateReference %s' % (msgID, transportDomain, transportAddress, stateReference)) # rfc3412: 7.1.3 if statusInformation: # rfc3412: 7.1.3a (N/A) # rfc3412: 7.1.3b (always discard) raise error.StatusInformation( errorIndication = errind.nonReportable ) # rfc3412: 7.1.4 # Since there's no SNMP engine identification in v1/2c, # set destination contextEngineId to ours if not contextEngineId: contextEngineId = snmpEngineID # rfc3412: 7.1.5 if not contextName: contextName = '' # rfc3412: 7.1.6 scopedPDU = ( contextEngineId, contextName, pdu ) debug.logger & debug.flagMP and debug.logger('prepareResponseMessage: using contextEngineId %s contextName %s' % (repr(contextEngineId), contextName)) msg = self._snmpMsgSpec msg.setComponentByPosition(0, messageProcessingModel) msg.setComponentByPosition(2) msg.getComponentByPosition(2).setComponentByType( pdu.tagSet, pdu, verifyConstraints=False ) # att: msgId not set back to PDU as it's up to responder app # rfc3412: 7.1.7 globalData = ( msg, ) k = int(securityModel) if k in snmpEngine.securityModels: smHandler = snmpEngine.securityModels[k] else: raise error.StatusInformation( errorIndication = errind.unsupportedSecurityModel ) securityEngineId = snmpEngineID # rfc3412: 7.1.8.a ( securityParameters, wholeMsg ) = smHandler.generateResponseMsg( snmpEngine, self.messageProcessingModelID, globalData, maxMessageSize, securityModel, snmpEngineID, securityName, securityLevel, scopedPDU, securityStateReference ) return ( transportDomain, transportAddress, wholeMsg ) # rfc3412: 7.2.1 def prepareDataElements( self, snmpEngine, transportDomain, transportAddress, wholeMsg ): # rfc3412: 7.2.2 try: msg, restOfwholeMsg = decoder.decode( wholeMsg, asn1Spec=self._snmpMsgSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInASNParseErrs') snmpInASNParseErrs.syntax = snmpInASNParseErrs.syntax + 1 raise error.StatusInformation( errorIndication = errind.parseError ) debug.logger & debug.flagMP and debug.logger('prepareDataElements: %s' % (msg.prettyPrint(),)) # rfc3412: 7.2.3 msgVersion = messageProcessingModel = msg.getComponentByPosition(0) # rfc2576: 5.2.1 snmpEngineMaxMessageSize, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize') securityParameters = ( msg.getComponentByPosition(1), (transportDomain, transportAddress), ('0.0.0.0', 0) # XXX ) messageProcessingModel = int(msg.getComponentByPosition(0)) securityModel = messageProcessingModel + 1 securityLevel = 1 # rfc3412: 7.2.4 -- 7.2.5 -> noop k = int(securityModel) if k in snmpEngine.securityModels: smHandler = snmpEngine.securityModels[k] else: raise error.StatusInformation( errorIndication = errind.unsupportedSecurityModel ) # rfc3412: 7.2.6 ( securityEngineID, securityName, scopedPDU, maxSizeResponseScopedPDU, securityStateReference ) = smHandler.processIncomingMsg( snmpEngine, messageProcessingModel, snmpEngineMaxMessageSize.syntax, securityParameters, securityModel, securityLevel, wholeMsg, msg ) debug.logger & debug.flagMP and debug.logger('prepareDataElements: SM returned securityEngineID %s securityName %s' % (repr(securityEngineID), securityName)) # rfc3412: 7.2.6a --> noop # rfc3412: 7.2.7 contextEngineId, contextName, pdu = scopedPDU # rfc2576: 5.2.1 pduVersion = msgVersion pduType = pdu.tagSet # XXX use cache # set stateref to null as in v3 model stateReference = securityStateReference # rfc3412: 7.2.8, 7.2.9 -> noop # rfc3412: 7.2.10 if pduType in rfc3411.responseClassPDUs: # (wild hack: use PDU reqID at MsgID) msgID = pdu.getComponentByPosition(0) # 7.2.10a try: cachedReqParams = self._cache.popByMsgId(long(msgID)) except error.ProtocolError: smHandler.releaseStateInformation(securityStateReference) raise error.StatusInformation( errorIndication = errind.dataMismatch ) # 7.2.10b sendPduHandle = cachedReqParams['sendPduHandle'] else: sendPduHandle = None statusInformation = None # rfc3412: 7.2.11 -> noop # rfc3412: 7.2.12 if pduType in rfc3411.responseClassPDUs: # rfc3412: 7.2.12a -> noop # rfc3412: 7.2.12b if securityModel != cachedReqParams['securityModel'] or \ securityName != cachedReqParams['securityName'] or \ securityLevel != cachedReqParams['securityLevel'] or \ contextEngineId != cachedReqParams['contextEngineId'] or \ contextName != cachedReqParams['contextName']: smHandler.releaseStateInformation(securityStateReference) raise error.StatusInformation( errorIndication = errind.dataMismatch ) # rfc3412: 7.2.12c smHandler.releaseStateInformation(securityStateReference) # rfc3412: 7.2.12d return ( messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, pduType, sendPduHandle, maxSizeResponseScopedPDU, statusInformation, stateReference ) # rfc3412: 7.2.13 if pduType in rfc3411.confirmedClassPDUs: # (wild hack: use PDU reqID at MsgID) msgID = pdu.getComponentByPosition(0) # rfc3412: 7.2.13a snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') if securityEngineID != snmpEngineID.syntax: smHandler.releaseStateInformation(securityStateReference) raise error.StatusInformation( errorIndication = errind.engineIDMispatch ) # rfc3412: 7.2.13b stateReference = self._cache.newStateReference() self._cache.pushByStateRef( stateReference, msgVersion=messageProcessingModel, msgID=msgID, contextEngineId=contextEngineId, contextName=contextName, securityModel=securityModel, securityName=securityName, securityLevel=securityLevel, securityStateReference=securityStateReference, msgMaxSize=snmpEngineMaxMessageSize.syntax, maxSizeResponseScopedPDU=maxSizeResponseScopedPDU, transportDomain=transportDomain, transportAddress=transportAddress ) debug.logger & debug.flagMP and debug.logger('prepareDataElements: cached by new stateReference %s' % stateReference) # rfc3412: 7.2.13c return ( messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, pduType, sendPduHandle, maxSizeResponseScopedPDU, statusInformation, stateReference ) # rfc3412: 7.2.14 if pduType in rfc3411.unconfirmedClassPDUs: # This is not specified explicitly in RFC smHandler.releaseStateInformation(securityStateReference) return ( messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, pdu, pduType, sendPduHandle, maxSizeResponseScopedPDU, statusInformation, stateReference ) smHandler.releaseStateInformation(securityStateReference) raise error.StatusInformation( errorIndication = errind.unsupportedPDUtype ) class SnmpV2cMessageProcessingModel(SnmpV1MessageProcessingModel): messageProcessingModelID = univ.Integer(1) # SNMPv2c snmpMsgSpec = v2c.Message PKAq>և))pysnmp/proto/mpmod/rfc2576.pyc; UMc@sdklZdklZdklZdklZlZl Z dk l Z l Z dk lZdklZdklZdefd YZd efd YZd S( (sdecoder(sAbstractMessageProcessingModel(srfc2576(srfc3411serrindserror(sv1sv2c(suniv(s PyAsn1Error(sdebugsSnmpV1MessageProcessingModelcBs;tZeidZeiZdZdZ dZ RS(NicCs|iiiidd\}|i}| it i jo | i d| i d}n| o |}n| o d} ntiti@otidt|| f|| | f}|i}|i d|i|i d|i di| i| dt|f}t|}||ijo|i|}nt!i"d t#i$|iiiidd \}|i&||i||i||||| \}}| it i joV|i+i,t-|d | d |d|d |d|d|d|d| d|d| n|||fSdS(Ns__SNMP-FRAMEWORK-MIBs snmpEngineIDiiss?prepareOutgoingMessage: using contextEngineId %s contextName %sisverifyConstraintsserrorIndicationssnmpEngineMaxMessageSizes sendPduHandlesmsgIDs securityModels securityNames securityLevelscontextEngineIds contextNamestransportDomainstransportAddress(1s snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolss snmpEngineIDssyntaxspdustagSetsrfc3411sconfirmedClassPDUsssetComponentByPositionsgetComponentByPositionsmsgIDscontextEngineIds contextNamesdebugsloggersflagMPsreprs scopedPDUsselfs _snmpMsgSpecsmsgsmessageProcessingModelIDssetComponentByTypesFalses globalDatasints securityModelskssecurityModelss smHandlerserrorsStatusInformationserrindsunsupportedSecurityModelssnmpEngineMaxMessageSizesgenerateRequestMsgs securityNames securityLevelssecurityParametersswholeMsgs_caches pushByMsgIdslongs sendPduHandlestransportDomainstransportAddress(sselfs snmpEnginestransportDomainstransportAddresssmessageProcessingModels securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionspdusexpectResponses sendPduHandles smHandlerssnmpEngineMaxMessageSizes scopedPDUsmsgssecurityParameterssmsgIDswholeMsgs globalDatas snmpEngineIDsk((s8build/bdist.linux-i686/egg/pysnmp/proto/mpmod/rfc2576.pysprepareOutgoingMessagesV    .  "   c  Cs)|iiiidd\}|i}|ii | }|d}|d}|d}|d}|d}|d}|d }|d }|d }|d } titi@otid ||| | f| otidtin| o |}n| o d}n||| f}titi@otidt ||f|i!}|i#d||i#d|i%di&| i'| dt(|f}t*|}||i,jo|i,|}ntidti.|}|i0||i1|||||||| \}}|| |fSdS(Ns__SNMP-FRAMEWORK-MIBs snmpEngineIDsmsgIDscontextEngineIds contextNames securityModels securityNames securityLevelssecurityStateReferences msgMaxSizestransportDomainstransportAddresssgprepareResponseMessage: cache read msgID %s transportDomain %s transportAddress %s by stateReference %sserrorIndicationss?prepareResponseMessage: using contextEngineId %s contextName %siisverifyConstraints(4s snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolss snmpEngineIDssyntaxsselfs_caches popByStateRefsstateReferences cachedParamssmsgIDscontextEngineIds contextNames securityModels securityNames securityLevelssecurityStateReferencesmaxMessageSizestransportDomainstransportAddresssdebugsloggersflagMPsstatusInformationserrorsStatusInformationserrinds nonReportablespdus scopedPDUsreprs _snmpMsgSpecsmsgssetComponentByPositionsmessageProcessingModelsgetComponentByPositionssetComponentByTypestagSetsFalses globalDatasintskssecurityModelss smHandlersunsupportedSecurityModelssecurityEngineIdsgenerateResponseMsgsmessageProcessingModelIDssecurityParametersswholeMsg(sselfs snmpEnginesmessageProcessingModels securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionspdusmaxSizeResponseScopedPDUsstateReferencesstatusInformationstransportAddresss smHandlerssecurityEngineIdstransportDomains scopedPDUsmsgssecurityStateReferencessecurityParameterssmsgIDswholeMsgs globalDatas snmpEngineIDsmaxMessageSizes cachedParamssk((s8build/bdist.linux-i686/egg/pysnmp/proto/mpmod/rfc2576.pysprepareResponseMessagersV           .  .  "   c Csy"ti|d|i\}}WnVtj oJ|i i i i dd\}|id|_tidtinXtiti@otid|if|id}} |i i i i dd \} |id||fd dff}t|id} | d} d}t| }||i"jo|i"|}ntidti$|i%|| | i|| |||\}}} }}titi@otid t+||f| \} }}|}|i0}|}|t3i4jot|id}y|i6i7t8|}Wn8ti:j o)|i;|tidti<nX|d }nt>}t>}|t3i4jo| |d jpA||djp0||djp| |djp||djo&|i;|tidti<n|i;|| | ||| ||||||||f Sn|t3i@jo|id}|i i i i dd\}||ijo&|i;|tidtiBn|i6iC}|i6iD|d| d|d| d|d | d|d|d|d| id|d|d| titi@otid|| | ||| ||||||||f Sn|t3iEjo<|i;|| | ||| ||||||||f Sn|i;|tidtiFdS(Nsasn1Specs __SNMPv2-MIBssnmpInASNParseErrsiserrorIndicationsprepareDataElements: %sis__SNMP-FRAMEWORK-MIBssnmpEngineMaxMessageSizes0.0.0.0sDprepareDataElements: SM returned securityEngineID %s securityName %ss sendPduHandles securityModels securityNames securityLevelscontextEngineIds contextNames snmpEngineIDs msgVersionsmsgIDssecurityStateReferences msgMaxSizesmaxSizeResponseScopedPDUstransportDomainstransportAddresss4prepareDataElements: cached by new stateReference %s(GsdecodersdecodeswholeMsgsselfs _snmpMsgSpecsmsgsrestOfwholeMsgs PyAsn1Errors snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolsssnmpInASNParseErrsssyntaxserrorsStatusInformationserrinds parseErrorsdebugsloggersflagMPs prettyPrintsgetComponentByPositions msgVersionsmessageProcessingModelssnmpEngineMaxMessageSizestransportDomainstransportAddressssecurityParameterssints securityModels securityLevelskssecurityModelss smHandlersunsupportedSecurityModelsprocessIncomingMsgssecurityEngineIDs securityNames scopedPDUsmaxSizeResponseScopedPDUssecurityStateReferencesreprscontextEngineIds contextNamespdus pduVersionstagSetspduTypesstateReferencesrfc3411sresponseClassPDUssmsgIDs_caches popByMsgIdslongscachedReqParamss ProtocolErrorsreleaseStateInformations dataMismatchs sendPduHandlesNonesstatusInformationsconfirmedClassPDUss snmpEngineIDsengineIDMispatchsnewStateReferencespushByStateRefsunconfirmedClassPDUssunsupportedPDUtype( sselfs snmpEnginestransportDomainstransportAddressswholeMsgs msgVersions sendPduHandles smHandlersstatusInformations securityModelssnmpEngineMaxMessageSizescontextEngineIdsmessageProcessingModels scopedPDUsmaxSizeResponseScopedPDUsmsgs contextNamessnmpInASNParseErrss pduVersionsstateReferencessecurityStateReferencessecurityParameterss securityLevelspduTypesmsgIDsks securityNames snmpEngineIDsrestOfwholeMsgssecurityEngineIDspduscachedReqParams((s8build/bdist.linux-i686/egg/pysnmp/proto/mpmod/rfc2576.pysprepareDataElementss"+$   .  U  /    "/ / ( s__name__s __module__sunivsIntegersmessageProcessingModelIDsv1sMessages snmpMsgSpecsprepareOutgoingMessagesprepareResponseMessagesprepareDataElements(((s8build/bdist.linux-i686/egg/pysnmp/proto/mpmod/rfc2576.pysSnmpV1MessageProcessingModels   _ bsSnmpV2cMessageProcessingModelcBs tZeidZeiZRS(Ni(s__name__s __module__sunivsIntegersmessageProcessingModelIDsv2csMessages snmpMsgSpec(((s8build/bdist.linux-i686/egg/pysnmp/proto/mpmod/rfc2576.pysSnmpV2cMessageProcessingModelsN(spyasn1.codec.bersdecoderspysnmp.proto.mpmod.basesAbstractMessageProcessingModelspysnmp.proto.secmodsrfc2576s pysnmp.protosrfc3411serrindserrorspysnmp.proto.apisv1sv2cs pyasn1.typesunivs pyasn1.errors PyAsn1ErrorspysnmpsdebugsSnmpV1MessageProcessingModelsSnmpV2cMessageProcessingModel( sv2csSnmpV1MessageProcessingModelsdecodersrfc2576sv1s PyAsn1ErrorsSnmpV2cMessageProcessingModelserrindserrorsdebugsrfc3411sunivsAbstractMessageProcessingModel((s8build/bdist.linux-i686/egg/pysnmp/proto/mpmod/rfc2576.pys?s      PKo2pysnmp/proto/proxy/__init__.pyPKAq>dxɉpysnmp/proto/proxy/__init__.pyc; Bc@sdS(N((((s9build/bdist.linux-i686/egg/pysnmp/proto/proxy/__init__.pys?sPKΒ5> bI5%5%pysnmp/proto/proxy/rfc2576.py# PDU v1/v2c two-way proxy from pysnmp.proto import rfc1905, rfc3411, error from pysnmp.proto.api import v1, v2c from pysnmp import debug # 2.1.1 __v1ToV2ValueMap = { v1.Integer.tagSet: v2c.Integer32(), v1.OctetString.tagSet: v2c.OctetString(), v1.Null.tagSet: v2c.Null(), v1.ObjectIdentifier.tagSet: v2c.ObjectIdentifier(), v1.IpAddress.tagSet: v2c.IpAddress(), v1.Counter.tagSet: v2c.Counter32(), v1.Gauge.tagSet: v2c.Gauge32(), v1.TimeTicks.tagSet: v2c.TimeTicks(), v1.Opaque.tagSet: v2c.Opaque() } __v2ToV1ValueMap = { # XXX do not re-create same-type items? v2c.Integer32.tagSet: v1.Integer(), v2c.OctetString.tagSet: v1.OctetString(), v2c.Null.tagSet: v1.Null(), v2c.ObjectIdentifier.tagSet: v1.ObjectIdentifier(), v2c.IpAddress.tagSet: v1.IpAddress(), v2c.Counter32.tagSet: v1.Counter(), v2c.Gauge32.tagSet: v1.Gauge(), v2c.TimeTicks.tagSet: v1.TimeTicks(), v2c.Opaque.tagSet: v1.Opaque() } # PDU map __v1ToV2PduMap = { v1.GetRequestPDU.tagSet: v2c.GetRequestPDU(), v1.GetNextRequestPDU.tagSet: v2c.GetNextRequestPDU(), v1.SetRequestPDU.tagSet: v2c.SetRequestPDU(), v1.GetResponsePDU.tagSet: v2c.ResponsePDU(), v1.TrapPDU.tagSet: v2c.SNMPv2TrapPDU() } __v2ToV1PduMap = { v2c.GetRequestPDU.tagSet: v1.GetRequestPDU(), v2c.GetNextRequestPDU.tagSet: v1.GetNextRequestPDU(), v2c.SetRequestPDU.tagSet: v1.SetRequestPDU(), v2c.ResponsePDU.tagSet: v1.GetResponsePDU(), v2c.SNMPv2TrapPDU.tagSet: v1.TrapPDU(), v2c.GetBulkRequestPDU.tagSet: v1.GetNextRequestPDU() # 4.1.1 } # Trap map __v1ToV2TrapMap = { 0: (1,3,6,1,6,3,1,1,5,1), 1: (1,3,6,1,6,3,1,1,5,2), 2: (1,3,6,1,6,3,1,1,5,3), 3: (1,3,6,1,6,3,1,1,5,4), 4: (1,3,6,1,6,3,1,1,5,5), 5: (1,3,6,1,6,3,1,1,5,6) } __v2ToV1TrapMap = { (1,3,6,1,6,3,1,1,5,1): 0, (1,3,6,1,6,3,1,1,5,2): 1, (1,3,6,1,6,3,1,1,5,3): 2, (1,3,6,1,6,3,1,1,5,4): 3, (1,3,6,1,6,3,1,1,5,5): 4, (1,3,6,1,6,3,1,1,5,6): 5 } # 4.3 __v2ToV1ErrorMap = { 0: 0, 1: 1, 5: 5, 10: 3, 9: 3, 7: 3, 8: 3, 12: 3, 6: 2, 17: 2, 11: 2, 18: 2, 13: 5, 14: 5, 15: 5, 16: 2 } __zeroInt = v1.Integer(0) def v1ToV2(v1Pdu, origV2Pdu=None): pduType = v1Pdu.tagSet v2Pdu = __v1ToV2PduMap[pduType].clone() debug.logger & debug.flagPrx and debug.logger('v1ToV2: v1Pdu %s' % v1Pdu.prettyPrint()) v2VarBinds = [] # 3.1 if pduType in rfc3411.notificationClassPDUs: # 3.1.1 sysUpTime = v1.apiTrapPDU.getTimeStamp(v1Pdu) # 3.1.2 genericTrap = v1.apiTrapPDU.getGenericTrap(v1Pdu) if genericTrap == 6: snmpTrapOIDParam = v1.apiTrapPDU.getEnterprise(v1Pdu) + (0,) + \ (v1.apiTrapPDU.getSpecificTrap(v1Pdu),) # 3.1.3 else: snmpTrapOIDParam = v2c.ObjectIdentifier( __v1ToV2TrapMap[genericTrap] ) # 3.1.4 (XXX snmpTrapCommunity.0 is missing here) v2VarBinds.append((v2c.apiTrapPDU.sysUpTime, sysUpTime)) v2VarBinds.append((v2c.apiTrapPDU.snmpTrapOID, snmpTrapOIDParam)) v2VarBinds.append( (v2c.apiTrapPDU.snmpTrapAddress, v1.apiTrapPDU.getAgentAddr(v1Pdu)) ) v2VarBinds.append((v2c.apiTrapPDU.snmpTrapCommunity, v2c.OctetString(""))) v2VarBinds.append((v2c.apiTrapPDU.snmpTrapEnterprise, v1.apiTrapPDU.getEnterprise(v1Pdu))) varBinds = v1.apiTrapPDU.getVarBinds(v1Pdu) else: varBinds = v1.apiPDU.getVarBinds(v1Pdu) # Translate Var-Binds for oid, v1Val in varBinds: # 2.1.1.11 if v1Val.tagSet == v1.NetworkAddress.tagSet: v1Val = v1Val.getComponent() v2VarBinds.append( (oid, __v1ToV2ValueMap[v1Val.tagSet].clone(v1Val)) ) if pduType in rfc3411.responseClassPDUs: # 4.1.2.2.1&2 errorStatus = int(v1.apiPDU.getErrorStatus(v1Pdu)) errorIndex = int(v1.apiPDU.getErrorIndex(v1Pdu)) if errorStatus == 2: # noSuchName if origV2Pdu.tagSet == v2c.GetNextRequestPDU.tagSet: v2VarBinds[errorIndex-1] = ( v2VarBinds[errorIndex-1][0], rfc1905.endOfMibView ) else: v2VarBinds[errorIndex-1] = ( v2VarBinds[errorIndex-1][0], rfc1905.noSuchObject ) # one-to-one mapping v2c.apiPDU.setErrorStatus(v2Pdu, errorStatus) v2c.apiPDU.setErrorIndex(v2Pdu, errorIndex) # 4.1.2.1 --> no-op if pduType not in rfc3411.notificationClassPDUs: v2c.apiPDU.setRequestID(v2Pdu, long(v1.apiPDU.getRequestID(v1Pdu))) v2c.apiPDU.setVarBinds(v2Pdu, v2VarBinds) debug.logger & debug.flagPrx and debug.logger('v1ToV2: v2Pdu %s' % v2Pdu.prettyPrint()) return v2Pdu def v2ToV1(v2Pdu, origV1Pdu=None): debug.logger & debug.flagPrx and debug.logger('v2ToV1: v2Pdu %s' % v2Pdu.prettyPrint()) pduType = v2Pdu.tagSet if pduType in __v2ToV1PduMap: v1Pdu = __v2ToV1PduMap[pduType].clone() else: raise error.ProtocolError('Unsupported PDU type') v2VarBinds = v2c.apiPDU.getVarBinds(v2Pdu) v1VarBinds = [] # 3.2 if pduType in rfc3411.notificationClassPDUs: # 3.2.1 (snmpTrapOID, snmpTrapOIDParam) = v2VarBinds[1] if snmpTrapOID != v2c.apiTrapPDU.snmpTrapOID: raise error.ProtocolError('Second OID not snmpTrapOID') if snmpTrapOIDParam in __v2ToV1TrapMap: for oid, val in v2VarBinds: if oid == v2c.apiTrapPDU.snmpTrapEnterprise: v1.apiTrapPDU.setEnterprise(v1Pdu, val) break else: # snmpTraps v1.apiTrapPDU.setEnterprise(v1Pdu, (1, 3, 6, 1, 6, 3, 1, 1, 5)) else: if snmpTrapOIDParam[-2] == 0: v1.apiTrapPDU.setEnterprise(v1Pdu, snmpTrapOIDParam[:-2]) else: v1.apiTrapPDU.setEnterprise(v1Pdu, snmpTrapOIDParam[:-1]) # 3.2.2 for oid, val in v2VarBinds: # snmpTrapAddress if oid == v2c.apiTrapPDU.snmpTrapAddress: v1.apiTrapPDU.setAgentAddr(v1Pdu, val) break else: v1.apiTrapPDU.setAgentAddr(v1Pdu, v1.apiTrapPDU.agentAddress) # 3.2.3 if snmpTrapOIDParam in __v2ToV1TrapMap: v1.apiTrapPDU.setGenericTrap(v1Pdu, __v2ToV1TrapMap[snmpTrapOIDParam]) else: v1.apiTrapPDU.setGenericTrap(v1Pdu, 6) # 3.2.4 if snmpTrapOIDParam in __v2ToV1TrapMap: v1.apiTrapPDU.setSpecificTrap(v1Pdu, __zeroInt) else: v1.apiTrapPDU.setSpecificTrap(v1Pdu, snmpTrapOIDParam[-1]) # 3.2.5 v1.apiTrapPDU.setTimeStamp(v1Pdu, v2VarBinds[0][1]) __v2VarBinds = [] for oid, val in v2VarBinds[2:]: if oid in __v2ToV1TrapMap or \ oid in (v2c.apiTrapPDU.sysUpTime, v2c.apiTrapPDU.snmpTrapAddress, v2c.apiTrapPDU.snmpTrapEnterprise): continue __v2VarBinds.append((oid, val)) v2VarBinds = __v2VarBinds; # 3.2.6 --> done below else: v1.apiPDU.setErrorStatus(v1Pdu, __zeroInt) v1.apiPDU.setErrorIndex(v1Pdu, __zeroInt) if pduType in rfc3411.responseClassPDUs: idx = len(v2VarBinds)-1 while idx >= 0: # 4.1.2.1 oid, val = v2VarBinds[idx] if v2c.Counter64.tagSet == val.tagSet: if origV1Pdu.tagSet == v1.GetRequestPDU.tagSet: v1.apiPDU.setErrorStatus(v1Pdu, 2) v1.apiPDU.setErrorIndex(v1Pdu, idx+1) break elif origV1Pdu.tagSet == v1.GetNextRequestPDU.tagSet: raise error.StatusInformation(idx=idx, pdu=v2Pdu) else: raise error.ProtocolError('Counter64 on the way') # 4.1.2.2.1&2 if isinstance(val, v2c.Null): v1.apiPDU.setErrorStatus(v1Pdu, 2) v1.apiPDU.setErrorIndex(v1Pdu, idx+1) idx = idx - 1 # 4.1.2.3.1 v2ErrorStatus = v2c.apiPDU.getErrorStatus(v2Pdu) if v2ErrorStatus: v1.apiPDU.setErrorStatus( v1Pdu, __v2ToV1ErrorMap[v2ErrorStatus] ) v1.apiPDU.setErrorIndex(v1Pdu, v2c.apiPDU.getErrorIndex(v2Pdu)) # Translate Var-Binds if pduType in rfc3411.responseClassPDUs and \ v1.apiPDU.getErrorStatus(v1Pdu): v1VarBinds = v1.apiPDU.getVarBinds(origV1Pdu) else: for oid, v2Val in v2VarBinds: v1VarBinds.append( (oid, __v2ToV1ValueMap[v2Val.tagSet].clone(v2Val)) ) if pduType in rfc3411.notificationClassPDUs: v1.apiTrapPDU.setVarBinds(v1Pdu, v1VarBinds) else: v1.apiPDU.setVarBinds(v1Pdu, v1VarBinds) v1.apiPDU.setRequestID( v1Pdu, v2c.apiPDU.getRequestID(v2Pdu) ) debug.logger & debug.flagPrx and debug.logger('v2ToV1: v1Pdu %s' % v1Pdu.prettyPrint()) return v1Pdu PKAq>{6pysnmp/proto/proxy/rfc2576.pyc; 9Mc @sSdklZlZlZdklZlZdklZhei i ei <ei i ei <ei i ei <eii ei<eii ei<eii ei<eii ei<eii ei<eii ei5pysnmp/proto/secmod/cache.pyc; TMc@s1dklZdklZdfdYZdS((snextid(serrorsCachecBs2tZeidZdZdZdZRS(NicCs h|_dS(N(sselfs_Cache__cacheEntries(sself((s7build/bdist.linux-i686/egg/pysnmp/proto/secmod/cache.pys__init__scKs!|i}||i|<|SdS(N(sselfs_Cache__stateReferencesstateReferences securityDatas_Cache__cacheEntries(sselfs securityDatasstateReference((s7build/bdist.linux-i686/egg/pysnmp/proto/secmod/cache.pyspush s  cCsL||ijo|i|}ntid||f|i|=|SdS(Ns&Cache miss for stateReference=%s at %s(sstateReferencesselfs_Cache__cacheEntriess securityDataserrors ProtocolError(sselfsstateReferences securityData((s7build/bdist.linux-i686/egg/pysnmp/proto/secmod/cache.pyspops  (s__name__s __module__snextidsIntegers_Cache__stateReferences__init__spushspop(((s7build/bdist.linux-i686/egg/pysnmp/proto/secmod/cache.pysCaches  N(spysnmpsnextids pysnmp.protoserrorsCache(snextidsCacheserror((s7build/bdist.linux-i686/egg/pysnmp/proto/secmod/cache.pys?s  PKl1pysnmp/proto/secmod/__init__.pyPKAq>.FU U pysnmp/proto/secmod/base.pyc; TMc@s1dklZdklZdfdYZdS((scache(serrorsAbstractSecurityModelcBsDtZeZdZdZdZdZdZdZ RS(NcCsti|_dS(N(scachesCachesselfs_cache(sself((s6build/bdist.linux-i686/egg/pysnmp/proto/secmod/base.pys__init__sc Cstid|dS(Ns!Security model %s not implemented(serrors ProtocolErrorsself( sselfs snmpEnginesmessageProcessingModelsmaxMessageSizessecurityParameterss securityModels securityLevelswholeMsgsmsg((s6build/bdist.linux-i686/egg/pysnmp/proto/secmod/base.pysprocessIncomingMsg s c Cstid|dS(Ns!Security model %s not implemented(serrors ProtocolErrorsself( sselfs snmpEnginesmessageProcessingModels globalDatasmaxMessageSizes securityModelssecurityEngineIDs securityNames securityLevels scopedPDU((s6build/bdist.linux-i686/egg/pysnmp/proto/secmod/base.pysgenerateRequestMsgs c Cstid|dS(Ns!Security model %s not implemented(serrors ProtocolErrorsself( sselfs snmpEnginesmessageProcessingModels globalDatasmaxMessageSizes securityModelssecurityEngineIDs securityNames securityLevels scopedPDUssecurityStateReference((s6build/bdist.linux-i686/egg/pysnmp/proto/secmod/base.pysgenerateResponseMsg(s cCs|ii|dS(N(sselfs_cachespopsstateReference(sselfsstateReference((s6build/bdist.linux-i686/egg/pysnmp/proto/secmod/base.pysreleaseStateInformation9scCsdS(N((sselfs snmpEnginestimeNow((s6build/bdist.linux-i686/egg/pysnmp/proto/secmod/base.pysreceiveTimerTick<s( s__name__s __module__sNonessecurityModelIDs__init__sprocessIncomingMsgsgenerateRequestMsgsgenerateResponseMsgsreleaseStateInformationsreceiveTimerTick(((s6build/bdist.linux-i686/egg/pysnmp/proto/secmod/base.pysAbstractSecurityModels     N(spysnmp.proto.secmodscaches pysnmp.protoserrorsAbstractSecurityModel(sAbstractSecurityModelscacheserror((s6build/bdist.linux-i686/egg/pysnmp/proto/secmod/base.pys?s  PKMYK>,3pysnmp/proto/secmod/cache.pyfrom pysnmp import nextid from pysnmp.proto import error class Cache: __stateReference = nextid.Integer(0xffffff) def __init__(self): self.__cacheEntries = {} def push(self, **securityData): stateReference = self.__stateReference() self.__cacheEntries[stateReference] = securityData return stateReference def pop(self, stateReference): if stateReference in self.__cacheEntries: securityData = self.__cacheEntries[stateReference] else: raise error.ProtocolError( 'Cache miss for stateReference=%s at %s' % (stateReference, self) ) del self.__cacheEntries[stateReference] return securityData PKAq>$Ev pysnmp/proto/secmod/__init__.pyc; ƔAc@sdS(N((((s:build/bdist.linux-i686/egg/pysnmp/proto/secmod/__init__.pys?sPKPYK>? pysnmp/proto/secmod/base.pyfrom pysnmp.proto.secmod import cache from pysnmp.proto import error class AbstractSecurityModel: securityModelID = None def __init__(self): self._cache = cache.Cache() def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg, ): raise error.ProtocolError( 'Security model %s not implemented' % self ) def generateRequestMsg( self, snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, ): raise error.ProtocolError( 'Security model %s not implemented' % self ) def generateResponseMsg( self, snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, securityStateReference ): raise error.ProtocolError( 'Security model %s not implemented' % self ) def releaseStateInformation(self, stateReference): self._cache.pop(stateReference) def receiveTimerTick(self, snmpEngine, timeNow): pass PKXK>,,pysnmp/proto/secmod/rfc2576.py# SNMP v1 & v2c security models implementation import string from pyasn1.codec.ber import encoder from pysnmp.proto.secmod import base from pysnmp.carrier.asynsock.dgram import udp, udp6 from pysnmp.smi.error import NoSuchInstanceError from pysnmp.proto import errind, error from pysnmp import debug class SnmpV1SecurityModel(base.AbstractSecurityModel): securityModelID = 1 # According to rfc2576, community name <-> contextEngineId/contextName # mapping is up to MP module for notifications but belongs to secmod # responsibility for other PDU types. Since I do not yet understand # the reason for this de-coupling, I've moved this code from MP-scope # in here. def generateRequestMsg( self, snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineId, securityName, securityLevel, scopedPDU ): msg, = globalData contextEngineId, contextName, pdu = scopedPDU # rfc2576: 5.2.3 ( snmpCommunityName, snmpCommunitySecurityName, snmpCommunityContextEngineId, snmpCommunityContextName, snmpCommunityTransportTag ) = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols( 'SNMP-COMMUNITY-MIB', 'snmpCommunityName', 'snmpCommunitySecurityName', 'snmpCommunityContextEngineID', 'snmpCommunityContextName', 'snmpCommunityTransportTag' ) nextMibNode = snmpCommunitySecurityName while 1: try: nextMibNode = snmpCommunitySecurityName.getNextNodeWithValue( nextMibNode.name, securityName ) except NoSuchInstanceError: break instId = nextMibNode.name[len(snmpCommunitySecurityName.name):] mibNode = snmpCommunityContextEngineId.getNode( snmpCommunityContextEngineId.name + instId ) if mibNode.syntax != contextEngineId: continue mibNode = snmpCommunityContextName.getNode( snmpCommunityContextName.name + instId ) if mibNode.syntax != contextName: continue mibNode = snmpCommunityName.getNode( snmpCommunityName.name + instId ) securityParameters = mibNode.syntax # XXX snmpCommunityTransportTag matching should probably be here debug.logger & debug.flagSM and debug.logger('generateRequestMsg: using community %s for securityName %s, contextEngineId %s contextName %s' % (securityParameters, securityName, contextEngineId, contextName)) msg.setComponentByPosition(1, securityParameters) msg.setComponentByPosition(2) msg.getComponentByPosition(2).setComponentByType( pdu.tagSet, pdu, verifyConstraints=False ) debug.logger & debug.flagMP and debug.logger('generateRequestMsg: %s' % (msg.prettyPrint(),)) wholeMsg = encoder.encode(msg) return ( securityParameters, wholeMsg ) raise error.StatusInformation( errorIndication = errind.unknownCommunityName ) def generateResponseMsg( self, snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, securityStateReference ): # rfc2576: 5.2.2 msg, = globalData contextEngineId, contextName, pdu = scopedPDU cachedSecurityData = self._cache.pop(securityStateReference) communityName = cachedSecurityData['communityName'] debug.logger & debug.flagSM and debug.logger('generateResponseMsg: recovered community %s by securityStateReference %s' % (communityName, securityStateReference)) msg.setComponentByPosition(1, communityName) msg.setComponentByPosition(2) msg.getComponentByPosition(2).setComponentByType( pdu.tagSet, pdu, verifyConstraints=False ) debug.logger & debug.flagMP and debug.logger('generateResponseMsg: %s' % (msg.prettyPrint(),)) wholeMsg = encoder.encode(msg) return ( communityName, wholeMsg ) def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg ): # rfc2576: 5.2.1 ( communityName, srcTransport, destTransport ) = securityParameters ( snmpCommunityName, snmpCommunitySecurityName, snmpCommunityContextEngineId, snmpCommunityContextName, snmpCommunityTransportTag ) = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols( 'SNMP-COMMUNITY-MIB', 'snmpCommunityName', 'snmpCommunitySecurityName', 'snmpCommunityContextEngineID', 'snmpCommunityContextName', 'snmpCommunityTransportTag' ) nextMibNode = snmpCommunityName addrToTagMap = {} # cache to save on inner loop while 1: try: nextMibNode = snmpCommunityName.getNextNodeWithValue( nextMibNode.name, communityName ) except NoSuchInstanceError: snmpInBadCommunityNames, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInBadCommunityNames') snmpInBadCommunityNames.syntax = snmpInBadCommunityNames.syntax+1 raise error.StatusInformation( errorIndication = errind.unknownCommunityName ) instId = nextMibNode.name[len(snmpCommunityName.name):] # snmpCommunityTransportTag matching mibNode = snmpCommunityTransportTag.getNode( snmpCommunityTransportTag.name + instId ) if mibNode.syntax: if not addrToTagMap: # Build a cache of addr->tag map ( snmpTargetAddrTDomain, snmpTargetAddrTAddress, snmpTargetAddrTagList ) = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-TARGET-MIB', 'snmpTargetAddrTDomain', 'snmpTargetAddrTAddress', 'snmpTargetAddrTagList') __nextMibNode = snmpTargetAddrTagList while 1: try: __nextMibNode = snmpTargetAddrTagList.getNextNode( __nextMibNode.name ) except NoSuchInstanceError: break __instId = __nextMibNode.name[ len(snmpTargetAddrTagList.name): ] targetAddrTDomain = snmpTargetAddrTDomain.getNode( snmpTargetAddrTDomain.name + __instId ).syntax targetAddrTAddress = snmpTargetAddrTAddress.getNode( snmpTargetAddrTAddress.name + __instId ).syntax targetAddrTDomain = tuple(targetAddrTDomain) if targetAddrTDomain[:len(udp.snmpUDPDomain)] == udp.snmpUDPDomain: SnmpUDPAddress, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMPv2-TM', 'SnmpUDPAddress') targetAddrTAddress = tuple( SnmpUDPAddress(targetAddrTAddress) ) elif targetAddrTDomain[:len(udp.snmpUDP6Domain)] == udp6.snmpUDP6Domain: TransportAddressIPv6, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('TRANSPORT-ADDRESS-MIB', 'TransportAddressIPv6') targetAddrTAddress = tuple( TransportAddressIPv6(targetAddrTAddress) ) targetAddr = targetAddrTDomain, targetAddrTAddress targetAddrTagList = snmpTargetAddrTagList.getNode( snmpTargetAddrTagList.name + __instId ).syntax if targetAddr not in addrToTagMap: addrToTagMap[targetAddr] = {} for tag in string.split(str(targetAddrTagList)): addrToTagMap[targetAddr][tag] = 1 debug.logger & debug.flagSM and debug.logger('processIncomingMsg: address-to-tag map %s' % addrToTagMap) # XXX snmpTargetAddrTMask matching not implemented if srcTransport in addrToTagMap: for tag in string.split(str(mibNode.syntax)): if tag in addrToTagMap[srcTransport]: debug.logger & debug.flagSM and debug.logger('processIncomingMsg: tag %s matched transport %s' % (tag, srcTransport)) break else: continue break communityName = snmpCommunityName.getNode( snmpCommunityName.name + instId ) securityName = snmpCommunitySecurityName.getNode( snmpCommunitySecurityName.name + instId ) contextEngineId = snmpCommunityContextEngineId.getNode( snmpCommunityContextEngineId.name + instId ) contextName = snmpCommunityContextName.getNode( snmpCommunityContextName.name + instId ) snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') debug.logger & debug.flagSM and debug.logger('processIncomingMsg: looked up securityName %s contextEngineId %s contextName %s by communityName %s' % (securityName, contextEngineId, contextName, communityName)) stateReference = self._cache.push( communityName=communityName.syntax ) securityEngineID = snmpEngineID.syntax securityName = securityName.syntax scopedPDU = ( contextEngineId.syntax, contextName.syntax, msg.getComponentByPosition(2).getComponent() ) maxSizeResponseScopedPDU = maxMessageSize - 128 securityStateReference = stateReference debug.logger & debug.flagSM and debug.logger('processIncomingMsg: generated maxSizeResponseScopedPDU %s securityStateReference %s' % (maxSizeResponseScopedPDU, securityStateReference)) return ( securityEngineID, securityName, scopedPDU, maxSizeResponseScopedPDU, securityStateReference ) class SnmpV2cSecurityModel(SnmpV1SecurityModel): securityModelID = 2 # XXX # contextEngineId/contextName goes to globalData PKAq>fLz|$|$pysnmp/proto/secmod/rfc2576.pyc; ETMc@sdkZdklZdklZdklZlZdkl Z dk l Z l Z dk lZdeifdYZd efd YZdS( N(sencoder(sbase(sudpsudp6(sNoSuchInstanceError(serrindserror(sdebugsSnmpV1SecurityModelcBs)tZdZdZdZdZRS(Nic Cs|\}| \}}}|iii i dddddd\}}} }}|} x|noty|i| i|} Wntj oPnX| it|i} | i| i| } | i|joq^n|i|i| } | i|joq^n|i|i| } | i}titi@otid||||f|id||id |id i |i!|d t"titi#@otid |i$ft%i&|}||fSq^Wt(i)d t*i+dS( NsSNMP-COMMUNITY-MIBssnmpCommunityNamessnmpCommunitySecurityNamessnmpCommunityContextEngineIDssnmpCommunityContextNamessnmpCommunityTransportTagis]generateRequestMsg: using community %s for securityName %s, contextEngineId %s contextName %sisverifyConstraintssgenerateRequestMsg: %sserrorIndication(,s globalDatasmsgs scopedPDUscontextEngineIds contextNamespdus snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolsssnmpCommunityNamessnmpCommunitySecurityNamessnmpCommunityContextEngineIdssnmpCommunityContextNamessnmpCommunityTransportTags nextMibNodesgetNextNodeWithValuesnames securityNamesNoSuchInstanceErrorslensinstIdsgetNodesmibNodessyntaxssecurityParameterssdebugsloggersflagSMssetComponentByPositionsgetComponentByPositionssetComponentByTypestagSetsFalsesflagMPs prettyPrintsencodersencodeswholeMsgserrorsStatusInformationserrindsunknownCommunityName(sselfs snmpEnginesmessageProcessingModels globalDatasmaxMessageSizes securityModelssecurityEngineIds securityNames securityLevels scopedPDUsmibNodesinstIds nextMibNodessnmpCommunityContextEngineIdscontextEngineIdssnmpCommunitySecurityNamesmsgs contextNamessnmpCommunityTransportTagssecurityParametersspduswholeMsgssnmpCommunityContextNamessnmpCommunityName((s9build/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc2576.pysgenerateRequestMsgs@  . "+c Cs|\}| \} } }|ii| } | d}t i t i@ot i d|| f|id||id|idi|i|dtt i t i@ot i d|ifti|}||fSdS(Ns communityNamesHgenerateResponseMsg: recovered community %s by securityStateReference %siisverifyConstraintssgenerateResponseMsg: %s(s globalDatasmsgs scopedPDUscontextEngineIds contextNamespdusselfs_cachespopssecurityStateReferencescachedSecurityDatas communityNamesdebugsloggersflagSMssetComponentByPositionsgetComponentByPositionssetComponentByTypestagSetsFalsesflagMPs prettyPrintsencodersencodeswholeMsg(sselfs snmpEnginesmessageProcessingModels globalDatasmaxMessageSizes securityModelssecurityEngineIDs securityNames securityLevels scopedPDUssecurityStateReferences contextNamescachedSecurityDatascontextEngineIdswholeMsgsmsgspdus communityName((s9build/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc2576.pysgenerateResponseMsgZs  ( "+c +Cs|\}}}|iiiidddddd\})}} }%}"|)} h}x,no$y|)i| i|} WnVtj oJ|iiiidd \}|id|_tid tinX| it|)i} |"i|"i| }$|$iow| o|iiiid d d d\} }(}|}*xnoy|i!|*i}*Wntj oPnX|*it|i}| i| i|i}|(i|(i|i}t%|}|tt&i' t&i'jo4|iiiidd\}!t%|!|}nR|tt&i) t*i)jo4|iiiidd\}t%||}n||f}#|i|i|i}'|#|joh||##pysnmp/proto/secmod/eso/__init__.pyPKAq>U{$pysnmp/proto/secmod/eso/__init__.pyc; N3Mc@sdS(N((((s>build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/__init__.pys?sPKe1>_vv&pysnmp/proto/secmod/eso/priv/aes256.py# AES 192/256 bit encryption (Internet draft) # http://tools.ietf.org/html/draft-blumenthal-aes-usm-04 from pysnmp.proto.secmod.rfc3826.priv import aes from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha from pysnmp.proto.secmod.rfc3414 import localkey class Aes256(aes.Aes): serviceID = (1, 3, 6, 1, 4, 1, 9, 12, 6, 1, 2) # cusmAESCfb256PrivProtocol keySize = 32 # 3.1.2.1 def localizeKey(self, authProtocol, privKey, snmpEngineID): if authProtocol == hmacmd5.HmacMd5.serviceID: localPrivKey = localkey.localizeKeyMD5(privKey, snmpEngineID) localPrivKey = localPrivKey + localkey.localizeKeyMD5( localPrivKey, snmpEngineID ) elif authProtocol == hmacsha.HmacSha.serviceID: localPrivKey = localkey.localizeKeySHA(privKey, snmpEngineID) localPrivKey = localPrivKey + localkey.localizeKeySHA( localPrivKey, snmpEngineID ) else: raise error.ProtocolError( 'Unknown auth protocol %s' % (authProtocol,) ) return localPrivKey[:32] PKe1>(pysnmp/proto/secmod/eso/priv/__init__.pyPKe1>svv&pysnmp/proto/secmod/eso/priv/aes192.py# AES 192/256 bit encryption (Internet draft) # http://tools.ietf.org/html/draft-blumenthal-aes-usm-04 from pysnmp.proto.secmod.rfc3826.priv import aes from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha from pysnmp.proto.secmod.rfc3414 import localkey class Aes192(aes.Aes): serviceID = (1, 3, 6, 1, 4, 1, 9, 12, 6, 1, 1) # cusmAESCfb192PrivProtocol keySize = 24 # 3.1.2.1 def localizeKey(self, authProtocol, privKey, snmpEngineID): if authProtocol == hmacmd5.HmacMd5.serviceID: localPrivKey = localkey.localizeKeyMD5(privKey, snmpEngineID) localPrivKey = localPrivKey + localkey.localizeKeyMD5( localPrivKey, snmpEngineID ) elif authProtocol == hmacsha.HmacSha.serviceID: localPrivKey = localkey.localizeKeySHA(privKey, snmpEngineID) localPrivKey = localPrivKey + localkey.localizeKeySHA( localPrivKey, snmpEngineID ) else: raise error.ProtocolError( 'Unknown auth protocol %s' % (authProtocol,) ) return localPrivKey[:24] PKAq>v""%pysnmp/proto/secmod/eso/priv/des3.pyc; N3Mc@sdkZdkZdklZdklZlZdklZdk l Z dk l Z ydk lZWnej oddfZnXydklZWnej o eZnXeid eifd YZdS( N(sbase(shmacmd5shmacsha(slocalkey(suniv(serror(s version_infoi(sDES3sDes3c BstZddddddddddf ZeddfjoeeidZneiddZdZd Z d Z d Z d Z d Z RS(Niiii ilicCsb|tiijoti|Sn;|tiijoti |Snt i d|fdS(NsUnknown auth protocol %s( s authProtocolshmacmd5sHmacMd5s serviceIDslocalkeyshashPassphraseMD5sprivKeyshmacshasHmacShashashPassphraseSHAserrors ProtocolError(sselfs authProtocolsprivKey((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pyshashPassphrases cCs|tiijo,ti||}|ti||}nV|t i ijo,ti ||}|ti ||}nt i d|f|d SdS(NsUnknown auth protocol %si (s authProtocolshmacmd5sHmacMd5s serviceIDslocalkeyslocalizeKeyMD5sprivKeys snmpEngineIDs localPrivKeyshmacshasHmacShaslocalizeKeySHAserrors ProtocolError(sselfs authProtocolsprivKeys snmpEngineIDs localPrivKey((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pys localizeKey)sc Cs|d }|dd!}t|}|d?d@|d?d@|d?d@|d@|id?d@|id?d@|id?d@|id@g}|idjo d|_n|id|_|t i t t |d t i t d ||d fSdS( Nii iiiliiscCst|t|AS(N(schrsxsordsy(sxsy((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pysUs( sprivKeysdes3KeyspreIVslongssnmpEngineBootsssecurityEngineBootssselfs _localIntssaltsstringsjoinsmapschr(sselfsprivKeyssnmpEngineBootssdes3KeyspreIVssecurityEngineBootsssalt((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pys__getEncryptionKey;s   b  cCs4|d titd||dd!dfSdS(NicCstt|t|AS(N(schrsordsxsy(sxsy((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pysYsi s(sprivKeysstringsjoinsmapssalt(sselfsprivKeyssalt((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pys__getDecryptionKeyWsc Cs ttjotidtin|\}}} |i t ||\} } }ti| ti|} ti| }|ddt|d}|}d} xN|oF| ititd||d d}| |} |d}qWti| |fSdS(NserrorIndicationsiscCstt|t|AS(N(schrsordsxsy(sxsy((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pysrs(sDES3sNoneserrorsStatusInformationserrindsencryptionErrorsprivParametersssnmpEngineBootsssnmpEngineTimessaltsselfs_Des3__getEncryptionKeysstrs encryptKeysdes3KeysivsnewsMODE_CBCsdes3Objsunivs OctetStrings dataToEncryptslens plaintexts cipherblocks ciphertextsencryptsstringsjoinsmap( sselfs encryptKeysprivParameterss dataToEncryptssnmpEngineTimes plaintexts cipherblocksivssnmpEngineBootssdes3Objs ciphertextsdes3Keyssalt((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pys encryptData]s !. c CsHttjotidtin|\}}} t | djotidtint | } |i t || \} }t |ddjotidtinti| ti|} d}t |} |}xR| oJ|titd|| i| d d}| d }| d} qW|SdS(NserrorIndicationiiscCstt|t|AS(N(schrsordsxsy(sxsy((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pyss(sDES3sNoneserrorsStatusInformationserrindsdecryptionErrorsprivParametersssnmpEngineBootsssnmpEngineTimessaltslensstrsselfs_Des3__getDecryptionKeys decryptKeysdes3Keysivs encryptedDatasnewsMODE_CBCsdes3Objs plaintexts ciphertexts cipherblocksstringsjoinsmapsdecrypt( sselfs decryptKeysprivParameterss encryptedDatassnmpEngineTimes plaintexts cipherblockssnmpEngineBootssivsdes3Keyssalts ciphertextsdes3Obj((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pys decryptDatazs,     (s__name__s __module__s serviceIDs version_infoslongsrandoms _localInts randrangeshashPassphrases localizeKeys_Des3__getEncryptionKeys_Des3__getDecryptionKeys encryptDatas decryptData(((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pysDes3s$    (srandomsstrings pysnmp.proto.secmod.rfc3414.privsbases pysnmp.proto.secmod.rfc3414.authshmacmd5shmacshaspysnmp.proto.secmod.rfc3414slocalkeys pyasn1.typesunivs pysnmp.protoserrorssyss version_infos ImportErrors Crypto.CiphersDES3sNonesseedsAbstractEncryptionServicesDes3( sstringshmacshas version_infosrandomsDES3shmacmd5sbaseserrorsDes3sunivslocalkey((s?build/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/des3.pys?s      PKAq>'pysnmp/proto/secmod/eso/priv/aes192.pyc; N3Mc@sJdklZdklZlZdklZdeifdYZdS((saes(shmacmd5shmacsha(slocalkeysAes192c Bs>tZdddddddddddf ZdZdZRS( Niiiii i icCs|tiijo,ti||}|ti||}nV|t i ijo,ti ||}|ti ||}nt i d|f|d SdS(NsUnknown auth protocol %si(s authProtocolshmacmd5sHmacMd5s serviceIDslocalkeyslocalizeKeyMD5sprivKeys snmpEngineIDs localPrivKeyshmacshasHmacShaslocalizeKeySHAserrors ProtocolError(sselfs authProtocolsprivKeys snmpEngineIDs localPrivKey((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/aes192.pys localizeKey s(s__name__s __module__s serviceIDskeySizes localizeKey(((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/aes192.pysAes192s'N( s pysnmp.proto.secmod.rfc3826.privsaess pysnmp.proto.secmod.rfc3414.authshmacmd5shmacshaspysnmp.proto.secmod.rfc3414slocalkeysAessAes192(shmacmd5sAes192saesslocalkeyshmacsha((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/aes192.pys?s  PKAq> fP'pysnmp/proto/secmod/eso/priv/aes256.pyc; N3Mc@sJdklZdklZlZdklZdeifdYZdS((saes(shmacmd5shmacsha(slocalkeysAes256c Bs>tZdddddddddddf ZdZd ZRS( Niiiii i ii cCs|tiijo,ti||}|ti||}nV|t i ijo,ti ||}|ti ||}nt i d|f|d SdS(NsUnknown auth protocol %si (s authProtocolshmacmd5sHmacMd5s serviceIDslocalkeyslocalizeKeyMD5sprivKeys snmpEngineIDs localPrivKeyshmacshasHmacShaslocalizeKeySHAserrors ProtocolError(sselfs authProtocolsprivKeys snmpEngineIDs localPrivKey((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/aes256.pys localizeKey s(s__name__s __module__s serviceIDskeySizes localizeKey(((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/aes256.pysAes256s'N( s pysnmp.proto.secmod.rfc3826.privsaess pysnmp.proto.secmod.rfc3414.authshmacmd5shmacshaspysnmp.proto.secmod.rfc3414slocalkeysAessAes256(shmacmd5saessAes256slocalkeyshmacsha((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/aes256.pys?s  PKAq>u;Y)pysnmp/proto/secmod/eso/priv/__init__.pyc; N3Mc@sdS(N((((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/eso/priv/__init__.pys?sPKe1>]rB$pysnmp/proto/secmod/eso/priv/des3.py# Reeder 3DES-EDE for USM (Internet draft) # http://www.snmp.com/eso/draft-reeder-snmpv3-usm-3desede-00.txt import random, string from pysnmp.proto.secmod.rfc3414.priv import base from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha from pysnmp.proto.secmod.rfc3414 import localkey from pyasn1.type import univ from pysnmp.proto import error try: from sys import version_info except ImportError: version_info = ( 0, 0 ) # a really early version try: from Crypto.Cipher import DES3 except ImportError: DES3 = None random.seed() # 5.1.1 class Des3(base.AbstractEncryptionService): serviceID = (1, 3, 6, 1, 6, 3, 10, 1, 2, 3) # usm3DESEDEPrivProtocol if version_info < (2, 3): _localInt = long(random.random()*0xffffffffL) else: _localInt = random.randrange(0, 0xffffffffL) def hashPassphrase(self, authProtocol, privKey): if authProtocol == hmacmd5.HmacMd5.serviceID: return localkey.hashPassphraseMD5(privKey) elif authProtocol == hmacsha.HmacSha.serviceID: return localkey.hashPassphraseSHA(privKey) else: raise error.ProtocolError( 'Unknown auth protocol %s' % (authProtocol,) ) def localizeKey(self, authProtocol, privKey, snmpEngineID): if authProtocol == hmacmd5.HmacMd5.serviceID: localPrivKey = localkey.localizeKeyMD5(privKey, snmpEngineID) localPrivKey = localPrivKey + localkey.localizeKeyMD5( localPrivKey, snmpEngineID ) elif authProtocol == hmacsha.HmacSha.serviceID: localPrivKey = localkey.localizeKeySHA(privKey, snmpEngineID) localPrivKey = localPrivKey + localkey.localizeKeySHA( localPrivKey, snmpEngineID ) else: raise error.ProtocolError( 'Unknown auth protocol %s' % (authProtocol,) ) return localPrivKey[:32] # key+IV # 5.1.1.1 def __getEncryptionKey(self, privKey, snmpEngineBoots): # 5.1.1.1.1 des3Key = privKey[:24] preIV = privKey[24:32] securityEngineBoots = long(snmpEngineBoots) salt = [ securityEngineBoots>>24&0xff, securityEngineBoots>>16&0xff, securityEngineBoots>>8&0xff, securityEngineBoots&0xff, self._localInt>>24&0xff, self._localInt>>16&0xff, self._localInt>>8&0xff, self._localInt&0xff ] if self._localInt == 0xffffffffL: self._localInt = 0 else: self._localInt = self._localInt + 1 # salt not yet hashed XXX return des3Key, \ string.join(map(chr, salt), ''), \ string.join(map(lambda x,y: chr(x^ord(y)), salt, preIV), '') def __getDecryptionKey(self, privKey, salt): return privKey[:24], string.join( map(lambda x,y: chr(ord(x)^ord(y)), salt, privKey[24:32]), '' ) # 5.1.1.2 def encryptData(self, encryptKey, privParameters, dataToEncrypt): if DES3 is None: raise error.StatusInformation( errorIndication=errind.encryptionError ) snmpEngineBoots, snmpEngineTime, salt = privParameters des3Key, salt, iv = self.__getEncryptionKey( str(encryptKey), snmpEngineBoots ) des3Obj = DES3.new(des3Key, DES3.MODE_CBC, iv) privParameters = univ.OctetString(salt) plaintext = dataToEncrypt + '\x00' * (8 - len(dataToEncrypt) % 8) cipherblock = iv ciphertext = '' while plaintext: cipherblock = des3Obj.encrypt( string.join(map(lambda x,y: chr(ord(x)^ord(y)), cipherblock, plaintext[:8]), '') ) ciphertext = ciphertext + cipherblock plaintext = plaintext[8:] return univ.OctetString(ciphertext), privParameters # 5.1.1.3 def decryptData(self, decryptKey, privParameters, encryptedData): if DES3 is None: raise error.StatusInformation( errorIndication=errind.decryptionError ) snmpEngineBoots, snmpEngineTime, salt = privParameters if len(salt) != 8: raise error.StatusInformation( errorIndication=errind.decryptionError ) salt = str(salt) des3Key, iv = self.__getDecryptionKey(str(decryptKey), salt) if len(encryptedData) % 8 != 0: raise error.StatusInformation( errorIndication=errind.decryptionError ) des3Obj = DES3.new(des3Key, DES3.MODE_CBC, iv) plaintext = '' ciphertext = str(encryptedData) cipherblock = iv while ciphertext: plaintext = plaintext + string.join(map( lambda x,y: chr(ord(x)^ord(y)), cipherblock, des3Obj.decrypt(ciphertext[:8]) ), '') cipherblock = ciphertext[:8] ciphertext = ciphertext[8:] return plaintext PKu&pysnmp/proto/secmod/rfc3414/service.py# SNMP v3 USM model services from pysnmp.proto.secmod.base import AbstractSecurityModel from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha, noauth from pysnmp.proto.secmod.rfc3414.priv import des, nopriv from pysnmp.proto.secmod.rfc3826.priv import aes from pysnmp.proto.secmod.eso.priv import des3, aes192, aes256 from pysnmp.smi.error import NoSuchInstanceError from pysnmp.proto import rfc1155, errind, error from pyasn1.type import univ, namedtype, constraint from pyasn1.codec.ber import encoder, decoder from pyasn1.error import PyAsn1Error from pysnmp import debug import time # USM security params class UsmSecurityParameters(rfc1155.TypeCoercionHackMixIn, univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('msgAuthoritativeEngineID', univ.OctetString()), namedtype.NamedType('msgAuthoritativeEngineBoots', univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 2147483647L))), namedtype.NamedType('msgAuthoritativeEngineTime', univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 2147483647L))), namedtype.NamedType('msgUserName', univ.OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 32))), namedtype.NamedType('msgAuthenticationParameters', univ.OctetString()), namedtype.NamedType('msgPrivacyParameters', univ.OctetString()) ) class SnmpUSMSecurityModel(AbstractSecurityModel): securityModelID = 3 authServices = { hmacmd5.HmacMd5.serviceID: hmacmd5.HmacMd5(), hmacsha.HmacSha.serviceID: hmacsha.HmacSha(), noauth.NoAuth.serviceID: noauth.NoAuth() } privServices = { des.Des.serviceID: des.Des(), des3.Des3.serviceID: des3.Des3(), aes.Aes.serviceID: aes.Aes(), aes192.Aes192.serviceID: aes192.Aes192(), aes256.Aes256.serviceID: aes256.Aes256(), nopriv.NoPriv.serviceID: nopriv.NoPriv() } _securityParametersSpec = UsmSecurityParameters() def __init__(self): AbstractSecurityModel.__init__(self) self.__timeline = {} self.__timelineExpQueue = {} self.__expirationTimer = 0L def __getUserInfo( self, mibInstrumController, securityEngineID, securityName ): usmUserEntry, = mibInstrumController.mibBuilder.importSymbols( 'SNMP-USER-BASED-SM-MIB', 'usmUserEntry' ) tblIdx = usmUserEntry.getInstIdFromIndices( securityEngineID, securityName ) # Get protocols usmUserSecurityName = usmUserEntry.getNode( usmUserEntry.name + (3,) + tblIdx ).syntax usmUserAuthProtocol = usmUserEntry.getNode( usmUserEntry.name + (5,) + tblIdx ).syntax usmUserPrivProtocol = usmUserEntry.getNode( usmUserEntry.name + (8,) + tblIdx ).syntax # Get keys pysnmpUsmKeyEntry, = mibInstrumController.mibBuilder.importSymbols( 'PYSNMP-USM-MIB', 'pysnmpUsmKeyEntry' ) pysnmpUsmKeyAuthLocalized = pysnmpUsmKeyEntry.getNode( pysnmpUsmKeyEntry.name + (1,) + tblIdx ).syntax pysnmpUsmKeyPrivLocalized = pysnmpUsmKeyEntry.getNode( pysnmpUsmKeyEntry.name + (2,) + tblIdx ).syntax return ( usmUserSecurityName, # XXX function needed? usmUserAuthProtocol, pysnmpUsmKeyAuthLocalized, usmUserPrivProtocol, pysnmpUsmKeyPrivLocalized ) def __cloneUserInfo( self, mibInstrumController, securityEngineID, securityName ): snmpEngineID, = mibInstrumController.mibBuilder.importSymbols( '__SNMP-FRAMEWORK-MIB', 'snmpEngineID' ) # Proto entry usmUserEntry, = mibInstrumController.mibBuilder.importSymbols( 'SNMP-USER-BASED-SM-MIB', 'usmUserEntry' ) tblIdx = usmUserEntry.getInstIdFromIndices( snmpEngineID.syntax, securityName ) # Get proto protocols usmUserSecurityName = usmUserEntry.getNode( usmUserEntry.name + (3,) + tblIdx ) usmUserAuthProtocol = usmUserEntry.getNode( usmUserEntry.name + (5,) + tblIdx ) usmUserPrivProtocol = usmUserEntry.getNode( usmUserEntry.name + (8,) + tblIdx ) # Get proto keys pysnmpUsmKeyEntry, = mibInstrumController.mibBuilder.importSymbols( 'PYSNMP-USM-MIB', 'pysnmpUsmKeyEntry' ) pysnmpUsmKeyAuth = pysnmpUsmKeyEntry.getNode( pysnmpUsmKeyEntry.name + (3,) + tblIdx ) pysnmpUsmKeyPriv = pysnmpUsmKeyEntry.getNode( pysnmpUsmKeyEntry.name + (4,) + tblIdx ) # Create new row from proto values tblIdx = usmUserEntry.getInstIdFromIndices( securityEngineID, securityName ) # New row mibInstrumController.writeVars( ((usmUserEntry.name + (13,) + tblIdx, 4),) ) # Set protocols usmUserEntry.getNode( usmUserEntry.name + (3,) + tblIdx ).syntax = usmUserSecurityName.syntax usmUserEntry.getNode( usmUserEntry.name + (5,) + tblIdx ).syntax = usmUserAuthProtocol.syntax usmUserEntry.getNode( usmUserEntry.name + (8,) + tblIdx ).syntax = usmUserPrivProtocol.syntax # Localize and set keys pysnmpUsmKeyEntry, = mibInstrumController.mibBuilder.importSymbols( 'PYSNMP-USM-MIB', 'pysnmpUsmKeyEntry' ) pysnmpUsmKeyAuthLocalized = pysnmpUsmKeyEntry.getNode( pysnmpUsmKeyEntry.name + (1,) + tblIdx ) if usmUserAuthProtocol.syntax in self.authServices: localizeKey = self.authServices[usmUserAuthProtocol.syntax].localizeKey localAuthKey = localizeKey( pysnmpUsmKeyAuth.syntax, securityEngineID ) else: raise error.StatusInformation( errorIndication = errind.unsupportedAuthProtocol ) if localAuthKey is not None: pysnmpUsmKeyAuthLocalized.syntax = pysnmpUsmKeyAuthLocalized.syntax.clone(localAuthKey) pysnmpUsmKeyPrivLocalized = pysnmpUsmKeyEntry.getNode( pysnmpUsmKeyEntry.name + (2,) + tblIdx ) if usmUserPrivProtocol.syntax in self.privServices: localizeKey = self.privServices[usmUserPrivProtocol.syntax].localizeKey localPrivKey = localizeKey( usmUserAuthProtocol.syntax, pysnmpUsmKeyPriv.syntax, securityEngineID ) else: raise error.StatusInformation( errorIndication = errind.unsupportedPrivProtocol ) if localPrivKey is not None: pysnmpUsmKeyPrivLocalized.syntax = pysnmpUsmKeyPrivLocalized.syntax.clone(localPrivKey) return ( usmUserSecurityName.syntax, # XXX function needed? usmUserAuthProtocol.syntax, pysnmpUsmKeyAuthLocalized.syntax, usmUserPrivProtocol.syntax, pysnmpUsmKeyPrivLocalized.syntax ) def __generateRequestOrResponseMsg( self, snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, securityStateReference ): snmpEngineID = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')[0].syntax # 3.1.1 if securityStateReference is not None: # 3.1.1a cachedSecurityData = self._cache.pop(securityStateReference) usmUserName = cachedSecurityData['msgUserName'] if 'usmUserAuthProtocol' in cachedSecurityData: usmUserAuthProtocol = cachedSecurityData['usmUserAuthProtocol'] else: usmUserAuthProtocol = None if 'usmUserAuthKeyLocalized' in cachedSecurityData: usmUserAuthKeyLocalized = cachedSecurityData['usmUserAuthKeyLocalized'] else: usmUserAuthKeyLocalized = None if 'usmUserPrivProtocol' in cachedSecurityData: usmUserPrivProtocol = cachedSecurityData['usmUserPrivProtocol'] else: usmUserPrivProtocol = None if 'usmUserPrivKeyLocalized' in cachedSecurityData: usmUserPrivKeyLocalized = cachedSecurityData['usmUserPrivKeyLocalized'] else: usmUserPrivKeyLocalized = None securityEngineID = snmpEngineID debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: user info read from cache') elif securityName: # 3.1.1b try: ( usmUserName, usmUserAuthProtocol, usmUserAuthKeyLocalized, usmUserPrivProtocol, usmUserPrivKeyLocalized ) = self.__getUserInfo( snmpEngine.msgAndPduDsp.mibInstrumController, securityEngineID, securityName ) debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: read user info') except NoSuchInstanceError: pysnmpUsmDiscovery, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__PYSNMP-USM-MIB', 'pysnmpUsmDiscovery') __reportUnknownName = not pysnmpUsmDiscovery.syntax if not __reportUnknownName: try: ( usmUserName, usmUserAuthProtocol, usmUserAuthKeyLocalized, usmUserPrivProtocol, usmUserPrivKeyLocalized ) = self.__cloneUserInfo( snmpEngine.msgAndPduDsp.mibInstrumController, securityEngineID, securityName ) except NoSuchInstanceError: __reportUnknownName = 1 if __reportUnknownName: raise error.StatusInformation( errorIndication = errind.unknownSecurityName ) debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: clone user info') else: # empty username used for engineID discovery usmUserName = usmUserSecurityName = '' usmUserAuthProtocol = usmUserAuthKeyLocalized = None usmUserPrivProtocol = usmUserPrivKeyLocalized = None debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: use empty USM data') debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: local user usmUserName %s usmUserAuthProtocol %s usmUserPrivProtocol %s securityEngineID %s securityName %s' % (usmUserName, usmUserAuthProtocol, usmUserPrivProtocol, repr(securityEngineID), securityName)) msg = globalData # 3.1.2 if securityLevel == 3: if not usmUserAuthProtocol or not usmUserPrivProtocol: raise error.StatusInformation( errorIndication = errind.unsupportedSecurityLevel ) # 3.1.3 if securityLevel == 3 or securityLevel == 2: if not usmUserAuthProtocol: raise error.StatusInformation( errorIndication = errind.unsupportedSecurityLevel ) securityParameters = self._securityParametersSpec scopedPDUData = msg.setComponentByPosition(3).getComponentByPosition(3) scopedPDUData.setComponentByPosition( 0, scopedPDU, verifyConstraints=False ) # 3.1.6a if securityStateReference is None and ( # request type check added securityLevel == 3 or securityLevel == 2 ): if securityEngineID in self.__timeline: ( snmpEngineBoots, snmpEngineTime, latestReceivedEngineTime, latestUpdateTimestamp) = self.__timeline[ securityEngineID ] debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: read snmpEngineBoots, snmpEngineTime from timeline') else: # 2.3 XXX is this correct? snmpEngineBoots = snmpEngineTime = 0 debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: no timeline for securityEngineID %s' % repr(securityEngineID)) # 3.1.6.b elif securityStateReference is not None: # XXX Report? ( snmpEngineBoots, snmpEngineTime ) = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineBoots', 'snmpEngineTime') snmpEngineBoots = snmpEngineBoots.syntax snmpEngineTime = snmpEngineTime.syntax.clone() debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: read snmpEngineBoots, snmpEngineTime from LCD') # 3.1.6.c else: snmpEngineBoots = snmpEngineTime = 0 debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: assuming zero snmpEngineBoots, snmpEngineTime') debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: use snmpEngineBoots %s snmpEngineTime %s for securityEngineID %s' % (snmpEngineBoots, snmpEngineTime, repr(securityEngineID))) # 3.1.4a if securityLevel == 3: if usmUserPrivProtocol in self.privServices: privHandler = self.privServices[usmUserPrivProtocol] else: raise error.StatusInformation( errorIndication = errind.encryptionError ) debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: scopedPDU %s' % scopedPDU.prettyPrint()) dataToEncrypt = encoder.encode(scopedPDU) debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: scopedPDU encoded into %s' % repr(dataToEncrypt)) ( encryptedData, privParameters ) = privHandler.encryptData( usmUserPrivKeyLocalized, ( snmpEngineBoots, snmpEngineTime, None ), dataToEncrypt ) securityParameters.setComponentByPosition( 5, privParameters, verifyConstraints=False ) scopedPDUData.setComponentByPosition( 1, encryptedData, verifyConstraints=False ) debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: scopedPDU ciphered') # 3.1.4b elif securityLevel == 1 or securityLevel == 2: securityParameters.setComponentByPosition(5, '') debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: %s' % scopedPDUData.prettyPrint()) # 3.1.5 securityParameters.setComponentByPosition( 0, securityEngineID, verifyConstraints=False ) securityParameters.setComponentByPosition( 1, snmpEngineBoots, verifyConstraints=False ) securityParameters.setComponentByPosition( 2, snmpEngineTime, verifyConstraints=False ) # 3.1.7 securityParameters.setComponentByPosition( 3, usmUserName, verifyConstraints=False ) # 3.1.8a if securityLevel == 3 or securityLevel == 2: if usmUserAuthProtocol in self.authServices: authHandler = self.authServices[usmUserAuthProtocol] else: raise error.StatusInformation( errorIndication = errind.authenticationFailure ) # extra-wild hack to facilitate BER substrate in-place re-write securityParameters.setComponentByPosition( 4, '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ) debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: %s' % (securityParameters.prettyPrint(),)) msg.setComponentByPosition( 2, encoder.encode(securityParameters), verifyConstraints=False ) debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: auth outgoing msg: %s' % msg.prettyPrint()) wholeMsg = encoder.encode(msg) authenticatedWholeMsg = authHandler.authenticateOutgoingMsg( usmUserAuthKeyLocalized, wholeMsg ) # 3.1.8b else: securityParameters.setComponentByPosition( 4, '', verifyConstraints=False ) debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: %s' % (securityParameters.prettyPrint(),)) msg.setComponentByPosition( 2, encoder.encode(securityParameters), verifyConstraints=False ) debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: plain outgoing msg: %s' % msg.prettyPrint()) authenticatedWholeMsg = encoder.encode(msg) # 3.1.9 return ( msg.getComponentByPosition(2), authenticatedWholeMsg ) def generateRequestMsg( self, snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, ): return self.__generateRequestOrResponseMsg( snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, None ) def generateResponseMsg( self, snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, securityStateReference ): return self.__generateRequestOrResponseMsg( snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, securityStateReference ) # 3.2 def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.9 -- moved up here to be able to report # maxSizeResponseScopedPDU on error # (48 - maximum SNMPv3 header length) maxSizeResponseScopedPDU = maxMessageSize - len(securityParameters)-48 # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInASNParseErrs') snmpInASNParseErrs.syntax = snmpInASNParseErrs.syntax + 1 raise error.StatusInformation( errorIndication=errind.parseError ) debug.logger & debug.flagSM and debug.logger('processIncomingMsg: %s' % (securityParameters.prettyPrint(),)) # 3.2.2 msgAuthoritativeEngineID = securityParameters.getComponentByPosition(0) securityStateReference = self._cache.push( msgUserName=securityParameters.getComponentByPosition(3) ) debug.logger & debug.flagSM and debug.logger('processIncomingMsg: cache write securityStateReference %s by msgUserName %s' % (securityStateReference, securityParameters.getComponentByPosition(3))) scopedPduData = msg.getComponentByPosition(3) # Used for error reporting contextEngineId = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')[0].syntax contextName = '' # 3.2.3 if msgAuthoritativeEngineID not in self.__timeline: debug.logger & debug.flagSM and debug.logger('processIncomingMsg: unknown securityEngineID %s' % repr(msgAuthoritativeEngineID)) if not msgAuthoritativeEngineID: # 3.2.3b usmStatsUnknownEngineIDs, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-USER-BASED-SM-MIB', 'usmStatsUnknownEngineIDs') usmStatsUnknownEngineIDs.syntax = usmStatsUnknownEngineIDs.syntax+1 debug.logger & debug.flagSM and debug.logger('processIncomingMsg: null securityEngineID') pysnmpUsmDiscoverable, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__PYSNMP-USM-MIB', 'pysnmpUsmDiscoverable') if pysnmpUsmDiscoverable.syntax: debug.logger & debug.flagSM and debug.logger('processIncomingMsg: request EngineID discovery') # Report original contextName if scopedPduData.getName() != 'plaintext': debug.logger & debug.flagSM and debug.logger('processIncomingMsg: scopedPduData not plaintext %s' % scopedPduData.prettyPrint()) raise error.StatusInformation( errorIndication = errind.unknownEngineID ) # 7.2.6.a.1 scopedPdu = scopedPduData.getComponent() contextEngineId = scopedPdu.getComponentByPosition(0) contextName = scopedPdu.getComponentByPosition(1) raise error.StatusInformation( errorIndication = errind.unknownEngineID, oid=usmStatsUnknownEngineIDs.name, val=usmStatsUnknownEngineIDs.syntax, securityStateReference=securityStateReference, securityLevel=securityLevel, contextEngineId=contextEngineId, contextName=contextName, scopedPDU=scopedPdu, maxSizeResponseScopedPDU=maxSizeResponseScopedPDU ) else: debug.logger & debug.flagSM and debug.logger('processIncomingMsg: will not discover EngineID') # free securityStateReference XXX raise error.StatusInformation( errorIndication = errind.unknownEngineID ) snmpEngineID = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID')[0].syntax msgUserName = securityParameters.getComponentByPosition(3) debug.logger & debug.flagSM and debug.logger('processIncomingMsg: read from securityParams msgAuthoritativeEngineID %s msgUserName %s' % (repr(msgAuthoritativeEngineID), msgUserName)) if msgUserName: # 3.2.4 try: ( usmUserSecurityName, usmUserAuthProtocol, usmUserAuthKeyLocalized, usmUserPrivProtocol, usmUserPrivKeyLocalized ) = self.__getUserInfo( snmpEngine.msgAndPduDsp.mibInstrumController, msgAuthoritativeEngineID, msgUserName ) debug.logger & debug.flagSM and debug.logger('processIncomingMsg: read user info from LCD') except NoSuchInstanceError: pysnmpUsmDiscoverable, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__PYSNMP-USM-MIB', 'pysnmpUsmDiscoverable') __reportUnknownName = not pysnmpUsmDiscoverable.syntax if not __reportUnknownName: try: ( usmUserSecurityName, usmUserAuthProtocol, usmUserAuthKeyLocalized, usmUserPrivProtocol, usmUserPrivKeyLocalized ) = self.__cloneUserInfo( snmpEngine.msgAndPduDsp.mibInstrumController, msgAuthoritativeEngineID, msgUserName ) debug.logger & debug.flagSM and debug.logger('processIncomingMsg: cloned user info') except NoSuchInstanceError: __reportUnknownName = 1 debug.logger & debug.flagSM and debug.logger('processIncomingMsg: unknown securityEngineID %s msgUserName %s' % (repr(msgAuthoritativeEngineID), msgUserName)) if __reportUnknownName: usmStatsUnknownUserNames, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-USER-BASED-SM-MIB', 'usmStatsUnknownUserNames') usmStatsUnknownUserNames.syntax = usmStatsUnknownUserNames.syntax+1 raise error.StatusInformation( errorIndication = errind.unknownSecurityName, oid = usmStatsUnknownUserNames.name, val = usmStatsUnknownUserNames.syntax, securityStateReference=securityStateReference, securityLevel=securityLevel, contextEngineId=contextEngineId, contextName=contextName, maxSizeResponseScopedPDU=maxSizeResponseScopedPDU ) else: # empty username used for engineID discovery usmUserName = usmUserSecurityName = '' usmUserAuthProtocol = usmUserAuthKeyLocalized = None usmUserPrivProtocol = usmUserPrivKeyLocalized = None debug.logger & debug.flagSM and debug.logger('processIncomingMsg: now have usmUserSecurityName %s usmUserAuthProtocol %s usmUserPrivProtocol %s for msgUserName %s' % (usmUserSecurityName, usmUserAuthProtocol, usmUserPrivProtocol, msgUserName)) # 3.2.11 (moved up here to let Reports be authenticated & encrypted) self._cache.pop(securityStateReference) securityStateReference = self._cache.push( msgUserName=securityParameters.getComponentByPosition(3), usmUserAuthProtocol=usmUserAuthProtocol, usmUserAuthKeyLocalized=usmUserAuthKeyLocalized, usmUserPrivProtocol=usmUserPrivProtocol, usmUserPrivKeyLocalized=usmUserPrivKeyLocalized ) # 3.2.5 __reportError = 0 if securityLevel == 3: if not usmUserAuthProtocol or not usmUserPrivProtocol: __reportError = 1 elif securityLevel == 2: if not usmUserAuthProtocol: __reportError = 1 if __reportError: usmStatsUnsupportedSecLevels, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-USER-BASED-SM-MIB', 'usmStatsUnsupportedSecLevels') usmStatsUnsupportedSecLevels.syntax = usmStatsUnsupportedSecLevels.syntax + 1 raise error.StatusInformation( errorIndication=errind.unsupportedSecurityLevel, oid=usmStatsUnknownEngineIDs.name, val=usmStatsUnknownEngineIDs.syntax, securityStateReference=securityStateReference, securityLevel=securityLevel, contextEngineId=contextEngineId, contextName=contextName, maxSizeResponseScopedPDU=maxSizeResponseScopedPDU ) # 3.2.6 if securityLevel == 3 or securityLevel == 2: if usmUserAuthProtocol in self.authServices: authHandler = self.authServices[usmUserAuthProtocol] else: raise error.StatusInformation( errorIndication = errind.authenticationFailure ) try: authenticatedWholeMsg = authHandler.authenticateIncomingMsg( usmUserAuthKeyLocalized, securityParameters.getComponentByPosition(4), wholeMsg ) except error.StatusInformation: usmStatsWrongDigests, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-USER-BASED-SM-MIB', 'usmStatsWrongDigests') usmStatsWrongDigests.syntax = usmStatsWrongDigests.syntax+1 raise error.StatusInformation( errorIndication = errind.authenticationFailure, oid=usmStatsWrongDigests.name, val=usmStatsWrongDigests.syntax, securityStateReference=securityStateReference, securityLevel=securityLevel, contextEngineId=contextEngineId, contextName=contextName, maxSizeResponseScopedPDU=maxSizeResponseScopedPDU ) debug.logger & debug.flagSM and debug.logger('processIncomingMsg: incoming msg authenticated') if msgAuthoritativeEngineID: # 3.2.3a moved down here to execute only for authed msg self.__timeline[msgAuthoritativeEngineID] = ( securityParameters.getComponentByPosition(1), securityParameters.getComponentByPosition(2), securityParameters.getComponentByPosition(2), int(time.time()) ) expireAt = self.__expirationTimer + 300 if expireAt not in self.__timelineExpQueue: self.__timelineExpQueue[expireAt] = [] self.__timelineExpQueue[expireAt].append( msgAuthoritativeEngineID ) debug.logger & debug.flagSM and debug.logger('processIncomingMsg: store timeline for securityEngineID %s' % repr(msgAuthoritativeEngineID)) # 3.2.7 if securityLevel == 3 or securityLevel == 2: if msgAuthoritativeEngineID == snmpEngineID: # Authoritative SNMP engine: use local notion (SF bug #1649032) ( snmpEngineBoots, snmpEngineTime ) = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineBoots', 'snmpEngineTime') snmpEngineBoots = snmpEngineBoots.syntax snmpEngineTime = snmpEngineTime.syntax.clone() idleTime = 0 debug.logger & debug.flagSM and debug.logger('processIncomingMsg: read snmpEngineBoots (%s), snmpEngineTime (%s) from LCD' % (snmpEngineBoots, snmpEngineTime)) else: # Non-authoritative SNMP engine: use cached estimates if msgAuthoritativeEngineID in self.__timeline: ( snmpEngineBoots, snmpEngineTime, latestReceivedEngineTime, latestUpdateTimestamp ) = self.__timeline[ msgAuthoritativeEngineID ] # time passed since last talk with this SNMP engine idleTime = int(time.time())-latestUpdateTimestamp debug.logger & debug.flagSM and debug.logger('processIncomingMsg: read timeline snmpEngineBoots %s snmpEngineTime %s for msgAuthoritativeEngineID %s, idle time %s secs' % (snmpEngineBoots, snmpEngineTime, repr(msgAuthoritativeEngineID), idleTime)) else: raise error.ProtocolError('Peer SNMP engine info missing') msgAuthoritativeEngineBoots = securityParameters.getComponentByPosition(1) msgAuthoritativeEngineTime = securityParameters.getComponentByPosition(2) # 3.2.7a if msgAuthoritativeEngineID == snmpEngineID: if snmpEngineBoots == 2147483647L or \ snmpEngineBoots != msgAuthoritativeEngineBoots or \ abs(idleTime + int(snmpEngineTime) - \ int(msgAuthoritativeEngineTime)) > 150: usmStatsNotInTimeWindows, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-USER-BASED-SM-MIB', 'usmStatsNotInTimeWindows') usmStatsNotInTimeWindows.syntax = usmStatsNotInTimeWindows.syntax+1 raise error.StatusInformation( errorIndication = errind.notInTimeWindow, oid=usmStatsNotInTimeWindows.name, val=usmStatsNotInTimeWindows.syntax, securityStateReference=securityStateReference, securityLevel=2, contextEngineId=contextEngineId, contextName=contextName, maxSizeResponseScopedPDU=maxSizeResponseScopedPDU ) # 3.2.7b else: # 3.2.7b.1 if msgAuthoritativeEngineBoots > snmpEngineBoots or \ msgAuthoritativeEngineBoots == snmpEngineBoots and \ msgAuthoritativeEngineTime > latestReceivedEngineTime: self.__timeline[msgAuthoritativeEngineID] = ( msgAuthoritativeEngineBoots, msgAuthoritativeEngineTime, msgAuthoritativeEngineTime, int(time.time()) ) expireAt = self.__expirationTimer + 300 if expireAt not in self.__timelineExpQueue: self.__timelineExpQueue[expireAt] = [] self.__timelineExpQueue[expireAt].append( msgAuthoritativeEngineID ) debug.logger & debug.flagSM and debug.logger('processIncomingMsg: stored timeline msgAuthoritativeEngineBoots %s msgAuthoritativeEngineTime %s for msgAuthoritativeEngineID %s' % (msgAuthoritativeEngineBoots, msgAuthoritativeEngineTime, repr(msgAuthoritativeEngineID))) # 3.2.7b.2 if snmpEngineBoots == 2147483647L or \ msgAuthoritativeEngineBoots < snmpEngineBoots or \ msgAuthoritativeEngineBoots == snmpEngineBoots and \ abs(idleTime + int(snmpEngineTime) - \ int(msgAuthoritativeEngineTime)) > 150: raise error.StatusInformation( errorIndication = errind.notInTimeWindow ) # 3.2.8a if securityLevel == 3: if usmUserPrivProtocol in self.privServices: privHandler = self.privServices[usmUserPrivProtocol] else: raise error.StatusInformation( errorIndication = errind.decryptionError ) encryptedPDU = scopedPduData.getComponentByPosition(1) if encryptedPDU is None: # no ciphertext raise error.StatusInformation( errorIndication = errind.decryptionError ) try: decryptedData = privHandler.decryptData( usmUserPrivKeyLocalized, ( securityParameters.getComponentByPosition(1), securityParameters.getComponentByPosition(2), securityParameters.getComponentByPosition(5) ), encryptedPDU ) debug.logger & debug.flagSM and debug.logger('processIncomingMsg: PDU deciphered into %s' % repr(decryptedData)) except error.StatusInformation: usmStatsDecryptionErrors, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-USER-BASED-SM-MIB', 'usmStatsDecryptionErrors') usmStatsDecryptionErrors.syntax = usmStatsDecryptionErrors.syntax+1 raise error.StatusInformation( errorIndication = errind.decryptionError, oid=usmStatsDecryptionErrors.name, val=usmStatsDecryptionErrors.syntax, securityStateReference=securityStateReference, securityLevel=securityLevel, contextEngineId=contextEngineId, contextName=contextName, maxSizeResponseScopedPDU=maxSizeResponseScopedPDU ) scopedPduSpec = scopedPduData.setComponentByPosition(0).getComponentByPosition(0) try: scopedPDU, rest = decoder.decode( decryptedData, asn1Spec=scopedPduSpec ) except PyAsn1Error, why: debug.logger & debug.flagSM and debug.logger('processIncomingMsg: scopedPDU decoder failed %s' % why) raise error.StatusInformation( errorIndication = errind.decryptionError ) else: # 3.2.8b scopedPDU = scopedPduData.getComponentByPosition(0) if scopedPDU is None: # no plaintext raise error.StatusInformation( errorIndication = errind.decryptionError ) debug.logger & debug.flagSM and debug.logger('processIncomingMsg: scopedPDU decoded %s' % scopedPDU.prettyPrint()) # 3.2.10 securityName = usmUserSecurityName debug.logger & debug.flagSM and debug.logger('processIncomingMsg: cached msgUserName %s info by securityStateReference %s' % (msgUserName, securityStateReference)) # Delayed to include details if not msgUserName and not msgAuthoritativeEngineID: usmStatsUnknownUserNames, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-USER-BASED-SM-MIB', 'usmStatsUnknownUserNames') usmStatsUnknownUserNames.syntax = usmStatsUnknownUserNames.syntax+1 raise error.StatusInformation( errorIndication=errind.unknownSecurityName, oid=usmStatsUnknownUserNames.name, val=usmStatsUnknownUserNames.syntax, securityStateReference=securityStateReference, securityEngineID=msgAuthoritativeEngineID, securityLevel=securityLevel, contextEngineId=contextEngineId, contextName=contextName, maxSizeResponseScopedPDU=maxSizeResponseScopedPDU, PDU=scopedPDU ) # 3.2.12 return ( msgAuthoritativeEngineID, securityName, scopedPDU, maxSizeResponseScopedPDU, securityStateReference ) def __expireTimelineInfo(self): if self.__expirationTimer in self.__timelineExpQueue: for engineIdKey in self.__timelineExpQueue[self.__expirationTimer]: if engineIdKey in self.__timeline: del self.__timeline[engineIdKey] debug.logger & debug.flagSM and debug.logger('__expireEnginesInfo: expiring %s' % (engineIdKey,)) del self.__timelineExpQueue[self.__expirationTimer] self.__expirationTimer = self.__expirationTimer + 1 def receiveTimerTick(self, snmpEngine, timeNow): self.__expireTimelineInfo() PKAq>Kٵ (pysnmp/proto/secmod/rfc3414/localkey.pyc; OHLc@sydklZlZWn7ej o+dkZdkZeiZeiZnXdZdZdZdZ dZ dZ dS((smd5ssha1NcCst}||odt|dpd}t|}d}d}x~|djop|d}||jo|i |||!|}n.|i |||!|d||!||}|d}qJW|i SdS(Ni@iii@( smd5smds passphraseslens ringBuffers ringBufferLenscountsmarksesupdatesdigest(s passphrasescountsmds ringBufferLensmarks ringBufferse((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/localkey.pyshashPassphraseMD5 s &     # cCs'td|t||fiSdS(Ns%s%s%s(smd5spassKeysstrs snmpEngineIdsdigest(spassKeys snmpEngineId((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/localkey.pyslocalizeKeyMD5scCstt||SdS(N(slocalizeKeyMD5shashPassphraseMD5s passphrases snmpEngineId(s passphrases snmpEngineId((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/localkey.pyspasswordToKeyMD5 scCst}|dt|d}t|}d}d}x~|djop|d}||jo|i |||!|}n.|i |||!|d||!||}|d}q<W|i SdS(Ni@iii@( ssha1smds passphraseslens ringBuffers ringBufferLenscountsmarksesupdatesdigest(s passphrasescountsmds ringBufferLensmarks ringBufferse((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/localkey.pyshashPassphraseSHA$s      # cCs'td|t||fiSdS(Ns%s%s%s(ssha1spassKeysstrs snmpEngineIdsdigest(spassKeys snmpEngineId((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/localkey.pyslocalizeKeySHA7scCstt||SdS(N(slocalizeKeySHAshashPassphraseSHAs passphrases snmpEngineId(s passphrases snmpEngineId((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/localkey.pyspasswordToKeySHA:s( shashlibsmd5ssha1s ImportErrorsshasnewshashPassphraseMD5slocalizeKeyMD5spasswordToKeyMD5shashPassphraseSHAslocalizeKeySHAspasswordToKeySHA( ssha1shashPassphraseSHAshashPassphraseMD5spasswordToKeyMD5spasswordToKeySHAsshaslocalizeKeySHAslocalizeKeyMD5smd5((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/localkey.pys?s      PKAq>eaa'pysnmp/proto/secmod/rfc3414/service.pyc; yTMc@s dklZdklZlZlZdklZlZdk l Z dk l Z l Z lZdklZdklZlZlZdklZlZlZdklZlZd klZd klZd k Z d ei!ei"fd YZ#defdYZ$d S((sAbstractSecurityModel(shmacmd5shmacshasnoauth(sdessnopriv(saes(sdes3saes192saes256(sNoSuchInstanceError(srfc1155serrindserror(sunivs namedtypes constraint(sencodersdecoder(s PyAsn1Error(sdebugNsUsmSecurityParametersc BstZeieideieideiide i ddeideiide i ddeideiide i ddeid eieid eiZ RS( NsmsgAuthoritativeEngineIDsmsgAuthoritativeEngineBootss subtypeSpecilsmsgAuthoritativeEngineTimes msgUserNamei smsgAuthenticationParameterssmsgPrivacyParameters( s__name__s __module__s namedtypes NamedTypess NamedTypesunivs OctetStringsIntegerssubtypes constraintsValueRangeConstraintsValueSizeConstraints componentType(((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/service.pysUsmSecurityParameterss ---sSnmpUSMSecurityModelcBs1tZdZheiiei<eiiei<ei iei d|i*d|id|(d|d|d|d|n|d jp |d+jo||i?jo|i?|}0ntidtiAy"|0iB| |id-|}Wntij oz|i i i idd.\}|id|_tidtiAd|i*d|id|(d|d|d|d|nXtiti@o tid/|*o|id|id+|id+tFtGiGf|i"|*<|iHd0}||iJjog|iJ||3|&jp1|3|&jo$tU|tF| tF|)d8jotidtiWq n|d jo|%|iXjo|iX|%}!ntidtiZ|2id}|t:jotidtiZnye|!i\||id|id+|id;f|}titi@otid<t#|Wntij oz|i i i idd=\}|id|_tidtiZd|i*d|id|(d|d|d|d|nX|2i_did}1yti|d|1\}$}Wq t j o@}titi@otid>|tidtiZq Xn6|2id}$|$t:jotidtiZntiti@otid?|$i|"} titi@otid@||(f| o|* o|i i i idd%\}-|-id|-_tidti8d|-i*d|-id|(dA|*d|d|d|d|dB|$ n|*| |$||(fSdS(CNi0sasn1Specs __SNMPv2-MIBssnmpInASNParseErrsiserrorIndicationsprocessIncomingMsg: %sis msgUserNameisKprocessIncomingMsg: cache write securityStateReference %s by msgUserName %ss__SNMP-FRAMEWORK-MIBs snmpEngineIDss/processIncomingMsg: unknown securityEngineID %ss__SNMP-USER-BASED-SM-MIBsusmStatsUnknownEngineIDss)processIncomingMsg: null securityEngineIDs__PYSNMP-USM-MIBspysnmpUsmDiscoverables.processIncomingMsg: request EngineID discoverys plaintexts2processIncomingMsg: scopedPduData not plaintext %ssoidsvalssecurityStateReferences securityLevelscontextEngineIds contextNames scopedPDUsmaxSizeResponseScopedPDUs.processIncomingMsg: will not discover EngineIDsWprocessIncomingMsg: read from securityParams msgAuthoritativeEngineID %s msgUserName %ss+processIncomingMsg: read user info from LCDs$processIncomingMsg: cloned user infos>processIncomingMsg: unknown securityEngineID %s msgUserName %ssusmStatsUnknownUserNamesstprocessIncomingMsg: now have usmUserSecurityName %s usmUserAuthProtocol %s usmUserPrivProtocol %s for msgUserName %ssusmUserAuthProtocolsusmUserAuthKeyLocalizedsusmUserPrivProtocolsusmUserPrivKeyLocalizedisusmStatsUnsupportedSecLevelsisusmStatsWrongDigestss.processIncomingMsg: incoming msg authenticatedi,s:processIncomingMsg: store timeline for securityEngineID %sssnmpEngineBootsssnmpEngineTimesKprocessIncomingMsg: read snmpEngineBoots (%s), snmpEngineTime (%s) from LCDsyprocessIncomingMsg: read timeline snmpEngineBoots %s snmpEngineTime %s for msgAuthoritativeEngineID %s, idle time %s secssPeer SNMP engine info missinglisusmStatsNotInTimeWindowssprocessIncomingMsg: stored timeline msgAuthoritativeEngineBoots %s msgAuthoritativeEngineTime %s for msgAuthoritativeEngineID %sis*processIncomingMsg: PDU deciphered into %ssusmStatsDecryptionErrorss/processIncomingMsg: scopedPDU decoder failed %ss(processIncomingMsg: scopedPDU decoded %ssKprocessIncomingMsg: cached msgUserName %s info by securityStateReference %sssecurityEngineIDsPDU(dsmaxMessageSizeslenssecurityParameterssmaxSizeResponseScopedPDUsdecodersdecodesselfs_securityParametersSpecsrests PyAsn1Errors snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolsssnmpInASNParseErrsssyntaxserrorsStatusInformationserrinds parseErrorsdebugsloggersflagSMs prettyPrintsgetComponentByPositionsmsgAuthoritativeEngineIDs_cachespushssecurityStateReferencesmsgs scopedPduDatascontextEngineIds contextNames_SnmpUSMSecurityModel__timelinesreprsusmStatsUnknownEngineIDsspysnmpUsmDiscoverablesgetNamesunknownEngineIDs getComponents scopedPdusnames securityLevels snmpEngineIDs msgUserNames"_SnmpUSMSecurityModel__getUserInfosusmUserSecurityNamesusmUserAuthProtocolsusmUserAuthKeyLocalizedsusmUserPrivProtocolsusmUserPrivKeyLocalizedsNoSuchInstanceErrors(_SnmpUSMSecurityModel__reportUnknownNames$_SnmpUSMSecurityModel__cloneUserInfosusmStatsUnknownUserNamessunknownSecurityNames usmUserNamesNonespops"_SnmpUSMSecurityModel__reportErrorsusmStatsUnsupportedSecLevelssunsupportedSecurityLevels authServicess authHandlersauthenticationFailuresauthenticateIncomingMsgswholeMsgsauthenticatedWholeMsgsusmStatsWrongDigestssintstimes&_SnmpUSMSecurityModel__expirationTimersexpireAts'_SnmpUSMSecurityModel__timelineExpQueuesappendssnmpEngineBootsssnmpEngineTimesclonesidleTimeslatestReceivedEngineTimeslatestUpdateTimestamps ProtocolErrorsmsgAuthoritativeEngineBootssmsgAuthoritativeEngineTimesabssusmStatsNotInTimeWindowssnotInTimeWindows privServicess privHandlersdecryptionErrors encryptedPDUs decryptDatas decryptedDatasusmStatsDecryptionErrorsssetComponentByPositions scopedPduSpecs scopedPDUswhys securityName(4sselfs snmpEnginesmessageProcessingModelsmaxMessageSizessecurityParameterss securityModels securityLevelswholeMsgsmsgs securityNamespysnmpUsmDiscoverables usmUserNamessnmpEngineTimes(_SnmpUSMSecurityModel__reportUnknownNames decryptedDatasrestsusmUserAuthProtocols"_SnmpUSMSecurityModel__reportErrorsusmUserPrivKeyLocalizedsauthenticatedWholeMsgsexpireAtscontextEngineIdsusmStatsWrongDigestssusmStatsUnsupportedSecLevelssusmStatsDecryptionErrorsswhys encryptedPDUsmaxSizeResponseScopedPDUsidleTimesusmStatsUnknownEngineIDss contextNames msgUserNamesusmUserAuthKeyLocalizeds privHandlersusmUserSecurityNamessnmpInASNParseErrss scopedPDUsusmUserPrivProtocolssnmpEngineBootsslatestUpdateTimestampssecurityStateReferencesmsgAuthoritativeEngineTimesmsgAuthoritativeEngineIDsusmStatsNotInTimeWindowsslatestReceivedEngineTimesusmStatsUnknownUserNamess scopedPdus snmpEngineIDs authHandlers scopedPduSpecs scopedPduDatasmsgAuthoritativeEngineBoots((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/service.pysprocessIncomingMsgs +1"( (   "." ".     .           @ 0 $ ,8 A  '% 5N   ' ,  " ((  cCs|i|ijoox[|i|iD]I}||ijo3|i|=titi@otid|fq$q$W|i|i=n|id|_dS(Ns __expireEnginesInfo: expiring %si(sselfs&_SnmpUSMSecurityModel__expirationTimers'_SnmpUSMSecurityModel__timelineExpQueues engineIdKeys_SnmpUSMSecurityModel__timelinesdebugsloggersflagSM(sselfs engineIdKey((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/service.pys__expireTimelineInfoXs -cCs|idS(N(sselfs)_SnmpUSMSecurityModel__expireTimelineInfo(sselfs snmpEnginestimeNow((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/service.pysreceiveTimerTickas(#s__name__s __module__ssecurityModelIDshmacmd5sHmacMd5s serviceIDshmacshasHmacShasnoauthsNoAuths authServicessdessDessdes3sDes3saessAessaes192sAes192saes256sAes256snoprivsNoPrivs privServicessUsmSecurityParameterss_securityParametersSpecs__init__s"_SnmpUSMSecurityModel__getUserInfos$_SnmpUSMSecurityModel__cloneUserInfos3_SnmpUSMSecurityModel__generateRequestOrResponseMsgsgenerateRequestMsgsgenerateResponseMsgsprocessIncomingMsgs)_SnmpUSMSecurityModel__expireTimelineInfosreceiveTimerTick(((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/service.pysSnmpUSMSecurityModelsE   % a   (%spysnmp.proto.secmod.basesAbstractSecurityModels pysnmp.proto.secmod.rfc3414.authshmacmd5shmacshasnoauths pysnmp.proto.secmod.rfc3414.privsdessnoprivs pysnmp.proto.secmod.rfc3826.privsaesspysnmp.proto.secmod.eso.privsdes3saes192saes256spysnmp.smi.errorsNoSuchInstanceErrors pysnmp.protosrfc1155serrindserrors pyasn1.typesunivs namedtypes constraintspyasn1.codec.bersencodersdecoders pyasn1.errors PyAsn1ErrorspysnmpsdebugstimesTypeCoercionHackMixInsSequencesUsmSecurityParameterssSnmpUSMSecurityModel(serrindsdes3shmacmd5sAbstractSecurityModelsnoauths namedtypesaes192sunivsaes256snoprivs PyAsn1Errorsrfc1155sSnmpUSMSecurityModelshmacshastimesUsmSecurityParameterssencodersdecodersNoSuchInstanceErrorsaess constraintsdesserrorsdebug((sAbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/service.pys?s       PKAq>f%%(pysnmp/proto/secmod/rfc3414/__init__.pyc; UBc@sdklZeiZdS((sserviceN(spysnmp.proto.secmod.rfc3414sservicesSnmpUSMSecurityModel(sSnmpUSMSecurityModelsservice((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/__init__.pys?s PK de,pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pyc; 3Mc@sydklZWn%ej odkZeiZnXdkZdklZdklZdk l Z l Z ddZ ddZ deifd YZdS( (smd5N(sbase(slocalkey(serrindserrorsi i0sHmacMd5c BsjtZddddddddddf ZdgdZdgdZd Zd Zd Zd ZRS( Niiii ii6i@i\cCsti|SdS(N(slocalkeyshashPassphraseMD5sauthKey(sselfsauthKey((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pyshashPassphrasescCsti||SdS(N(slocalkeyslocalizeKeyMD5sauthKeys snmpEngineID(sselfsauthKeys snmpEngineID((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pys localizeKeysc Csti|t}|djotidn|| }||d}t t t |t }tit d||id} tit d||id}t| |i}t||i} | d } d|| |fSdS(NisCant locate digest placeholderi cCst||AS(N(schrsxsy(sxsy((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pys0sss%s%s%s(sstringsfindswholeMsgs _twelveZerosslserrors ProtocolErrors wholeHeads wholeTailsmapsordsstrsauthKeys_fortyEightZerossextendedAuthKeysjoinsselfs_HmacMd5__ipadsk1s_HmacMd5__opadsk2smd5sdigestsd1sd2smac( sselfsauthKeyswholeMsgs wholeHeadsextendedAuthKeyslsk2s wholeTailsd1sd2smacsk1((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pysauthenticateOutgoingMsgs  $$ cCsTt|djotidtinti|t |} | djoti dn|| } || d} d| t| f}ttt |t}titd||id} titd||id}t| |i}t||i}|d } | |jotidti n|SdS(Ni serrorIndicationisCant locate digest in wholeMsgs%s%s%scCst||AS(N(schrsxsy(sxsy((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pys]ss(!slensauthParametersserrorsStatusInformationserrindsauthenticationErrorsstringsfindswholeMsgsstrsls ProtocolErrors wholeHeads wholeTails _twelveZerossauthenticatedWholeMsgsmapsordsauthKeys_fortyEightZerossextendedAuthKeysjoinsselfs_HmacMd5__ipadsk1s_HmacMd5__opadsk2smd5sdigestsd1sd2smacsauthenticationFailure(sselfsauthKeysauthParametersswholeMsgsextendedAuthKeysd2sd1sauthenticatedWholeMsgsk2sk1s wholeTails wholeHeadslsmac((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pysauthenticateIncomingMsgEs"  $$  ( s__name__s __module__s serviceIDs_HmacMd5__ipads_HmacMd5__opadshashPassphrases localizeKeysauthenticateOutgoingMsgsauthenticateIncomingMsg(((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pysHmacMd5s$     )(shashlibsmd5s ImportErrorsnewsstrings pysnmp.proto.secmod.rfc3414.authsbasespysnmp.proto.secmod.rfc3414slocalkeys pysnmp.protoserrindserrors _twelveZeross_fortyEightZerossAbstractAuthenticationServicesHmacMd5( s _twelveZeross_fortyEightZerossstringsHmacMd5sbaseserrindserrorslocalkeysmd5((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pys?s      PKAq> $$)pysnmp/proto/secmod/rfc3414/auth/base.pyc; 3Mc@s*dklZlZdfdYZdS((serrindserrorsAbstractAuthenticationServicecBs2tZeZdZdZdZdZRS(NcCstitidS(N(serrors ProtocolErrorserrindsnoAuthentication(sselfsauthKey((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/base.pyshashPassphrasescCstitidS(N(serrors ProtocolErrorserrindsnoAuthentication(sselfsauthKeys snmpEngineID((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/base.pys localizeKey scCstitidS(N(serrors ProtocolErrorserrindsnoAuthentication(sselfsauthKeyswholeMsg((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/base.pysauthenticateOutgoingMsg scCstitidS(N(serrors ProtocolErrorserrindsnoAuthentication(sselfsauthKeysauthParametersswholeMsg((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/base.pysauthenticateIncomingMsgs(s__name__s __module__sNones serviceIDshashPassphrases localizeKeysauthenticateOutgoingMsgsauthenticateIncomingMsg(((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/base.pysAbstractAuthenticationServices    N(s pysnmp.protoserrindserrorsAbstractAuthenticationService(sAbstractAuthenticationServiceserrindserror((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/base.pys?sPK1>bF +pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pytry: from hashlib import md5 except ImportError: import md5 md5 = md5.new import string from pysnmp.proto.secmod.rfc3414.auth import base from pysnmp.proto.secmod.rfc3414 import localkey from pysnmp.proto import errind, error _twelveZeros = '\x00'*12 _fortyEightZeros = '\x00'*48 # rfc3414: 6.2.4 class HmacMd5(base.AbstractAuthenticationService): serviceID = (1, 3, 6, 1, 6, 3, 10, 1, 1, 2) # usmHMACMD5AuthProtocol __ipad = [0x36]*64 __opad = [0x5C]*64 def hashPassphrase(self, authKey): return localkey.hashPassphraseMD5(authKey) def localizeKey(self, authKey, snmpEngineID): return localkey.localizeKeyMD5(authKey, snmpEngineID) # 6.3.1 def authenticateOutgoingMsg(self, authKey, wholeMsg): # Here we expect calling secmod to indicate where the digest # should be in the substrate. Also, it pre-sets digest placeholder # so we hash wholeMsg out of the box. # Yes, that's ugly but that's rfc... l = string.find(wholeMsg, _twelveZeros) if l == -1: raise error.ProtocolError('Cant locate digest placeholder') wholeHead = wholeMsg[:l] wholeTail = wholeMsg[l+12:] # 6.3.1.1 # 6.3.1.2a extendedAuthKey = map(ord, str(authKey) + _fortyEightZeros) # 6.3.1.2b --> noop # 6.3.1.2c k1 = string.join( map(lambda x,y: chr(x^y), extendedAuthKey, self.__ipad), '' ) # 6.3.1.2d --> noop # 6.3.1.2e k2 = string.join( map(lambda x,y: chr(x^y), extendedAuthKey, self.__opad), '' ) # 6.3.1.3 d1 = md5(k1+wholeMsg).digest() # 6.3.1.4 d2 = md5(k2+d1).digest() mac = d2[:12] # 6.3.1.5 & 6 return '%s%s%s' % (wholeHead, mac, wholeTail) # 6.3.2 def authenticateIncomingMsg(self, authKey, authParameters, wholeMsg): # 6.3.2.1 & 2 if len(authParameters) != 12: raise error.StatusInformation( errorIndication=errind.authenticationError ) # 6.3.2.3 l = string.find(wholeMsg, str(authParameters)) if l == -1: raise error.ProtocolError('Cant locate digest in wholeMsg') wholeHead = wholeMsg[:l] wholeTail = wholeMsg[l+12:] authenticatedWholeMsg = '%s%s%s' % ( wholeHead, _twelveZeros, wholeTail ) # 6.3.2.4a extendedAuthKey = map(ord, str(authKey) + _fortyEightZeros) # 6.3.2.4b --> noop # 6.3.2.4c k1 = string.join( map(lambda x,y: chr(x^y), extendedAuthKey, self.__ipad), '' ) # 6.3.2.4d --> noop # 6.3.2.4e k2 = string.join( map(lambda x,y: chr(x^y), extendedAuthKey, self.__opad), '' ) # 6.3.2.5a d1 = md5(k1+authenticatedWholeMsg).digest() # 6.3.2.5b d2 = md5(k2+d1).digest() # 6.3.2.5c mac = d2[:12] # 6.3.2.6 if mac != authParameters: raise error.StatusInformation( errorIndication=errind.authenticationFailure ) return authenticatedWholeMsg PK1>=*pysnmp/proto/secmod/rfc3414/auth/noauth.pyfrom pysnmp.proto.secmod.rfc3414.auth import base from pysnmp.proto import errind, error class NoAuth(base.AbstractAuthenticationService): serviceID = (1, 3, 6, 1, 6, 3, 10, 1, 1, 1) # usmNoAuthProtocol def hashPassphrase(self, authKey): return def localizeKey(self, authKey, snmpEngineID): return # 7.2.4.2 def authenticateOutgoingMsg(self, authKey, wholeMsg): raise error.StatusInformation(errorIndication=errind.noAuthentication) def authenticateIncomingMsg(self, authKey, authParameters, wholeMsg): raise error.StatusInformation(errorIndication=errind.noAuthentication) PKAq>cd-pysnmp/proto/secmod/rfc3414/auth/__init__.pyc; Bc@sdS(N((((sGbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/__init__.pys?sPK1>,SS(pysnmp/proto/secmod/rfc3414/auth/base.pyfrom pysnmp.proto import errind, error class AbstractAuthenticationService: serviceID = None def hashPassphrase(self, authKey): raise error.ProtocolError(errind.noAuthentication) def localizeKey(self, authKey, snmpEngineID): raise error.ProtocolError(errind.noAuthentication) # 7.2.4.1 def authenticateOutgoingMsg(self, authKey, wholeMsg): raise error.ProtocolError(errind.noAuthentication) # 7.2.4.2 def authenticateIncomingMsg(self, authKey, authParameters, wholeMsg): raise error.ProtocolError(errind.noAuthentication) PKAq>*,pysnmp/proto/secmod/rfc3414/auth/hmacsha.pyc; 3Mc@sydklZWn%ej odkZeiZnXdkZdklZdkl Z dk l Z l Z ddZ ddZdeifd YZdS( (ssha1N(sbase(slocalkey(serrindserrorsi i,sHmacShac BsjtZddddddddddf ZdgdZdgdZdZd Zd Zd ZRS( Niiii i6i@i\cCsti|SdS(N(slocalkeyshashPassphraseSHAsauthKey(sselfsauthKey((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacsha.pyshashPassphrasescCsti||SdS(N(slocalkeyslocalizeKeySHAsauthKeys snmpEngineID(sselfsauthKeys snmpEngineID((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacsha.pys localizeKeysc Csti|t}|djotidn|| }||d}t t t |t }tit d||id} tit d||id}t| |i}t||i} | d } d|| |fSdS(NisCant locate digest placeholderi cCst||AS(N(schrsxsy(sxsy((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacsha.pys/sss%s%s%s(sstringsfindswholeMsgs _twelveZerosslserrors ProtocolErrors wholeHeads wholeTailsmapsordsstrsauthKeys_fortyFourZerossextendedAuthKeysjoinsselfs_HmacSha__ipadsk1s_HmacSha__opadsk2ssha1sdigestsd1sd2smac( sselfsauthKeyswholeMsgs wholeHeadsextendedAuthKeyslsk2s wholeTailsd1sd2smacsk1((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacsha.pysauthenticateOutgoingMsgs  $$ cCsTt|djotidtinti|t |} | djoti dn|| } || d} d| t| f}ttt |t}titd||id} titd||id}t| |i}t||i}|d } | |jotidti n|SdS(Ni serrorIndicationisCant locate digest in wholeMsgs%s%s%scCst||AS(N(schrsxsy(sxsy((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacsha.pys\ss(!slensauthParametersserrorsStatusInformationserrindsauthenticationErrorsstringsfindswholeMsgsstrsls ProtocolErrors wholeHeads wholeTails _twelveZerossauthenticatedWholeMsgsmapsordsauthKeys_fortyFourZerossextendedAuthKeysjoinsselfs_HmacSha__ipadsk1s_HmacSha__opadsk2ssha1sdigestsd1sd2smacsauthenticationFailure(sselfsauthKeysauthParametersswholeMsgsextendedAuthKeysd2sd1sauthenticatedWholeMsgsk2sk1s wholeTails wholeHeadslsmac((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacsha.pysauthenticateIncomingMsgDs"  $$  ( s__name__s __module__s serviceIDs_HmacSha__ipads_HmacSha__opadshashPassphrases localizeKeysauthenticateOutgoingMsgsauthenticateIncomingMsg(((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacsha.pysHmacShas$     ((shashlibssha1s ImportErrorsshasnewsstrings pysnmp.proto.secmod.rfc3414.authsbasespysnmp.proto.secmod.rfc3414slocalkeys pysnmp.protoserrindserrors _twelveZeross_fortyFourZerossAbstractAuthenticationServicesHmacSha( s _twelveZerosssha1sstringsHmacShasshasbaseserrindserrors_fortyFourZerosslocalkey((sFbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/hmacsha.pys?s      PKAq>J+pysnmp/proto/secmod/rfc3414/auth/noauth.pyc; 3Mc@s=dklZdklZlZdeifdYZdS((sbase(serrindserrorsNoAuthc BsPtZddddddddddf ZdZdZdZdZRS( Niiii cCsdSdS(N((sselfsauthKey((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/noauth.pyshashPassphrasescCsdSdS(N((sselfsauthKeys snmpEngineID((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/noauth.pys localizeKey scCstidtidS(NserrorIndication(serrorsStatusInformationserrindsnoAuthentication(sselfsauthKeyswholeMsg((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/noauth.pysauthenticateOutgoingMsgscCstidtidS(NserrorIndication(serrorsStatusInformationserrindsnoAuthentication(sselfsauthKeysauthParametersswholeMsg((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/noauth.pysauthenticateIncomingMsgs(s__name__s __module__s serviceIDshashPassphrases localizeKeysauthenticateOutgoingMsgsauthenticateIncomingMsg(((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/noauth.pysNoAuths $   N(s pysnmp.proto.secmod.rfc3414.authsbases pysnmp.protoserrindserrorsAbstractAuthenticationServicesNoAuth(sbasesNoAuthserrindserror((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/auth/noauth.pys?s PK1>r; +pysnmp/proto/secmod/rfc3414/auth/hmacsha.pytry: from hashlib import sha1 except ImportError: import sha sha1 = sha.new import string from pysnmp.proto.secmod.rfc3414.auth import base from pysnmp.proto.secmod.rfc3414 import localkey from pysnmp.proto import errind, error _twelveZeros = '\x00'*12 _fortyFourZeros = '\x00'*44 # 7.2.4 class HmacSha(base.AbstractAuthenticationService): serviceID = (1, 3, 6, 1, 6, 3, 10, 1, 1, 3) # usmHMACSHAAuthProtocol __ipad = [0x36]*64 __opad = [0x5C]*64 def hashPassphrase(self, authKey): return localkey.hashPassphraseSHA(authKey) def localizeKey(self, authKey, snmpEngineID): return localkey.localizeKeySHA(authKey, snmpEngineID) # 7.3.1 def authenticateOutgoingMsg(self, authKey, wholeMsg): # 7.3.1.1 # Here we expect calling secmod to indicate where the digest # should be in the substrate. Also, it pre-sets digest placeholder # so we hash wholeMsg out of the box. # Yes, that's ugly but that's rfc... l = string.find(wholeMsg, _twelveZeros) if l == -1: raise error.ProtocolError('Cant locate digest placeholder') wholeHead = wholeMsg[:l] wholeTail = wholeMsg[l+12:] # 7.3.1.2a extendedAuthKey = map(ord, str(authKey) + _fortyFourZeros) # 7.3.1.2b -- noop # 7.3.1.2c k1 = string.join( map(lambda x,y: chr(x^y), extendedAuthKey, self.__ipad), '' ) # 7.3.1.2d -- noop # 7.3.1.2e k2 = string.join( map(lambda x,y: chr(x^y), extendedAuthKey, self.__opad), '' ) # 7.3.1.3 d1 = sha1(k1+wholeMsg).digest() # 7.3.1.4 d2 = sha1(k2+d1).digest() mac = d2[:12] # 7.3.1.5 & 6 return '%s%s%s' % (wholeHead, mac, wholeTail) # 7.3.2 def authenticateIncomingMsg(self, authKey, authParameters, wholeMsg): # 7.3.2.1 & 2 if len(authParameters) != 12: raise error.StatusInformation( errorIndication=errind.authenticationError ) # 7.3.2.3 l = string.find(wholeMsg, str(authParameters)) if l == -1: raise error.ProtocolError('Cant locate digest in wholeMsg') wholeHead = wholeMsg[:l] wholeTail = wholeMsg[l+12:] authenticatedWholeMsg = '%s%s%s' % ( wholeHead, _twelveZeros, wholeTail ) # 7.3.2.4a extendedAuthKey = map(ord, str(authKey) + _fortyFourZeros) # 7.3.2.4b --> noop # 7.3.2.4c k1 = string.join( map(lambda x,y: chr(x^y), extendedAuthKey, self.__ipad), '' ) # 7.3.2.4d --> noop # 7.3.2.4e k2 = string.join( map(lambda x,y: chr(x^y), extendedAuthKey, self.__opad), '' ) # 7.3.2.5a d1 = sha1(k1+authenticatedWholeMsg).digest() # 7.3.2.5b d2 = sha1(k2+d1).digest() # 7.3.2.5c mac = d2[:12] # 7.3.2.6 if mac != authParameters: raise error.StatusInformation( errorIndication=errind.authenticationFailure ) return authenticatedWholeMsg PK\v2,pysnmp/proto/secmod/rfc3414/priv/__init__.pyPKAq>H[0)pysnmp/proto/secmod/rfc3414/priv/base.pyc; 3Mc@s$dklZdfdYZdS((serrorsAbstractEncryptionServicecBs2tZeZdZdZdZdZRS(NcCstiddS(Ns no encryption(serrors ProtocolError(sselfs authProtocolsprivKey((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/base.pyshashPassphrasescCstiddS(Ns no encryption(serrors ProtocolError(sselfs authProtocolsprivKeys snmpEngineID((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/base.pys localizeKey scCstiddS(Ns no encryption(serrors ProtocolError(sselfs encryptKeysprivParameterss dataToEncrypt((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/base.pys encryptData scCstiddS(Ns no encryption(serrors ProtocolError(sselfs decryptKeysprivParameterss encryptedData((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/base.pys decryptDatas(s__name__s __module__sNones serviceIDshashPassphrases localizeKeys encryptDatas decryptData(((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/base.pysAbstractEncryptionServices    N(s pysnmp.protoserrorsAbstractEncryptionService(sAbstractEncryptionServiceserror((sCbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/base.pys?s PK1>F'pysnmp/proto/secmod/rfc3414/priv/des.pyimport random, string from pysnmp.proto.secmod.rfc3414.priv import base from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha from pysnmp.proto.secmod.rfc3414 import localkey from pyasn1.type import univ from pysnmp.proto import error try: from sys import version_info except ImportError: version_info = ( 0, 0 ) # a really early version try: from Crypto.Cipher import DES except ImportError: DES = None random.seed() # 8.2.4 class Des(base.AbstractEncryptionService): serviceID = (1, 3, 6, 1, 6, 3, 10, 1, 2, 2) # usmDESPrivProtocol if version_info < (2, 3): _localInt = long(random.random()*0xffffffffL) else: _localInt = random.randrange(0, 0xffffffffL) def hashPassphrase(self, authProtocol, privKey): if authProtocol == hmacmd5.HmacMd5.serviceID: return localkey.hashPassphraseMD5(privKey) elif authProtocol == hmacsha.HmacSha.serviceID: return localkey.hashPassphraseSHA(privKey) else: raise error.ProtocolError( 'Unknown auth protocol %s' % (authProtocol,) ) def localizeKey(self, authProtocol, privKey, snmpEngineID): if authProtocol == hmacmd5.HmacMd5.serviceID: localPrivKey = localkey.localizeKeyMD5(privKey, snmpEngineID) elif authProtocol == hmacsha.HmacSha.serviceID: localPrivKey = localkey.localizeKeySHA(privKey, snmpEngineID) else: raise error.ProtocolError( 'Unknown auth protocol %s' % (authProtocol,) ) return localPrivKey[:32] # key+IV # 8.1.1.1 def __getEncryptionKey(self, privKey, snmpEngineBoots): desKey = privKey[:8] preIV = privKey[8:16] securityEngineBoots = long(snmpEngineBoots) salt = [ securityEngineBoots>>24&0xff, securityEngineBoots>>16&0xff, securityEngineBoots>>8&0xff, securityEngineBoots&0xff, self._localInt>>24&0xff, self._localInt>>16&0xff, self._localInt>>8&0xff, self._localInt&0xff ] if self._localInt == 0xffffffffL: self._localInt = 0 else: self._localInt = self._localInt + 1 return desKey, \ string.join(map(chr, salt), ''), \ string.join(map(lambda x,y: chr(x^ord(y)), salt, preIV), '') def __getDecryptionKey(self, privKey, salt): return privKey[:8], string.join( map(lambda x,y: chr(ord(x)^ord(y)), salt, privKey[8:16]), '' ) # 8.2.4.1 def encryptData(self, encryptKey, privParameters, dataToEncrypt): if DES is None: raise error.StatusInformation( errorIndication=errind.encryptionError ) snmpEngineBoots, snmpEngineTime, salt = privParameters # 8.3.1.1 desKey, salt, iv = self.__getEncryptionKey( str(encryptKey), snmpEngineBoots ) # 8.3.1.2 privParameters = univ.OctetString(salt) # 8.1.1.2 desObj = DES.new(desKey, DES.MODE_CBC, iv) plaintext = dataToEncrypt + '\x00' * (8 - len(dataToEncrypt) % 8) ciphertext = desObj.encrypt(plaintext) # 8.3.1.3 & 4 return univ.OctetString(ciphertext), privParameters # 8.2.4.2 def decryptData(self, decryptKey, privParameters, encryptedData): if DES is None: raise error.StatusInformation( errorIndication=errind.decryptionError ) snmpEngineBoots, snmpEngineTime, salt = privParameters # 8.3.2.1 if len(salt) != 8: raise error.StatusInformation( errorIndication=errind.decryptionError ) # 8.3.2.2 salt = str(salt) # 8.3.2.3 desKey, iv = self.__getDecryptionKey(str(decryptKey), salt) # 8.3.2.4 -> 8.1.1.3 if len(encryptedData) % 8 != 0: raise error.StatusInformation( errorIndication=errind.decryptionError ) desObj = DES.new(desKey, DES.MODE_CBC, iv) # 8.3.2.6 return desObj.decrypt(str(encryptedData)) PKAq>ۤ(pysnmp/proto/secmod/rfc3414/priv/des.pyc; 3Mc@sdkZdkZdklZdklZlZdklZdk l Z dk l Z ydk lZWnej oddfZnXydklZWnej o eZnXeid eifd YZdS( N(sbase(shmacmd5shmacsha(slocalkey(suniv(serror(s version_infoi(sDESsDesc BstZddddddddddf ZeddfjoeeidZneiddZdZd Z d Z d Z d Z d Z RS(Niiii ilicCsb|tiijoti|Sn;|tiijoti |Snt i d|fdS(NsUnknown auth protocol %s( s authProtocolshmacmd5sHmacMd5s serviceIDslocalkeyshashPassphraseMD5sprivKeyshmacshasHmacShashashPassphraseSHAserrors ProtocolError(sselfs authProtocolsprivKey((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/des.pyshashPassphrases cCst|tiijoti||}n@|t i ijoti ||}nt i d|f|d SdS(NsUnknown auth protocol %si (s authProtocolshmacmd5sHmacMd5s serviceIDslocalkeyslocalizeKeyMD5sprivKeys snmpEngineIDs localPrivKeyshmacshasHmacShaslocalizeKeySHAserrors ProtocolError(sselfs authProtocolsprivKeys snmpEngineIDs localPrivKey((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/des.pys localizeKey's c Cs|d }|dd!}t|}|d?d@|d?d@|d?d@|d@|id?d@|id?d@|id?d@|id@g}|idjo d|_n|id|_|t i t t |dt i t d ||dfSdS( NiiiiliiscCst|t|AS(N(schrsxsordsy(sxsy((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/des.pysJs( sprivKeysdesKeyspreIVslongssnmpEngineBootsssecurityEngineBootssselfs _localIntssaltsstringsjoinsmapschr(sselfsprivKeyssnmpEngineBootssdesKeyspreIVssecurityEngineBootsssalt((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/des.pys__getEncryptionKey3s   b  cCs4|d titd||dd!dfSdS(NicCstt|t|AS(N(schrsordsxsy(sxsy((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/des.pysNsis(sprivKeysstringsjoinsmapssalt(sselfsprivKeyssalt((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/des.pys__getDecryptionKeyLsc Csttjotidtin|\} }} |i t || \}} }ti| }ti|ti|} |ddt|d}| i|}ti||fSdS(NserrorIndicationsi(sDESsNoneserrorsStatusInformationserrindsencryptionErrorsprivParametersssnmpEngineBootsssnmpEngineTimessaltsselfs_Des__getEncryptionKeysstrs encryptKeysdesKeysivsunivs OctetStringsnewsMODE_CBCsdesObjs dataToEncryptslens plaintextsencrypts ciphertext( sselfs encryptKeysprivParameterss dataToEncryptsdesKeys plaintexts ciphertextsivssnmpEngineTimessnmpEngineBootssdesObjssalt((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/des.pys encryptDataRs !c Csttjotidtin|\}}} t | djotidtint | } |i t || \}}t |ddjotidtinti|ti|}|it |SdS(NserrorIndicationii(sDESsNoneserrorsStatusInformationserrindsdecryptionErrorsprivParametersssnmpEngineBootsssnmpEngineTimessaltslensstrsselfs_Des__getDecryptionKeys decryptKeysdesKeysivs encryptedDatasnewsMODE_CBCsdesObjsdecrypt( sselfs decryptKeysprivParameterss encryptedDatasdesKeyssnmpEngineTimesivssnmpEngineBootssdesObjssalt((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/des.pys decryptDataks  (s__name__s __module__s serviceIDs version_infoslongsrandoms _localInts randrangeshashPassphrases localizeKeys_Des__getEncryptionKeys_Des__getDecryptionKeys encryptDatas decryptData(((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/des.pysDess$   (srandomsstrings pysnmp.proto.secmod.rfc3414.privsbases pysnmp.proto.secmod.rfc3414.authshmacmd5shmacshaspysnmp.proto.secmod.rfc3414slocalkeys pyasn1.typesunivs pysnmp.protoserrorssyss version_infos ImportErrors Crypto.CiphersDESsNonesseedsAbstractEncryptionServicesDes( sDESsstringshmacshas version_infosDessrandomshmacmd5sbaseserrorsunivslocalkey((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/des.pys?s      PKAq>Fk>-pysnmp/proto/secmod/rfc3414/priv/__init__.pyc; Bc@sdS(N((((sGbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/__init__.pys?sPKAq>ܥM))+pysnmp/proto/secmod/rfc3414/priv/nopriv.pyc; 3Mc@s=dklZdklZlZdeifdYZdS((sbase(serrindserrorsNoPrivc BsPtZddddddddddf ZdZdZdZd ZRS( Niiii icCsdSdS(N((sselfs authProtocolsprivKey((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/nopriv.pyshashPassphrasescCsdSdS(N((sselfs authProtocolsprivKeys snmpEngineID((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/nopriv.pys localizeKey scCstidtidS(NserrorIndication(serrorsStatusInformationserrinds noEncryption(sselfs encryptKeysprivParameterss dataToEncrypt((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/nopriv.pys encryptData scCstidtidS(NserrorIndication(serrorsStatusInformationserrinds noEncryption(sselfs decryptKeysprivParameterss encryptedData((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/nopriv.pys decryptDatas(s__name__s __module__s serviceIDshashPassphrases localizeKeys encryptDatas decryptData(((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/nopriv.pysNoPrivs $   N(s pysnmp.proto.secmod.rfc3414.privsbases pysnmp.protoserrindserrorsAbstractEncryptionServicesNoPriv(sbasesNoPrivserrindserror((sEbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3414/priv/nopriv.pys?s PK1>l44(pysnmp/proto/secmod/rfc3414/priv/base.pyfrom pysnmp.proto import error class AbstractEncryptionService: serviceID = None def hashPassphrase(self, authProtocol, privKey): raise error.ProtocolError('no encryption') def localizeKey(self, authProtocol, privKey, snmpEngineID): raise error.ProtocolError('no encryption') def encryptData(self, encryptKey, privParameters, dataToEncrypt): raise error.ProtocolError('no encryption') def decryptData(self, decryptKey, privParameters, encryptedData): raise error.ProtocolError('no encryption') PK6'pysnmp/proto/secmod/rfc3826/__init__.pyPKAq>OOT(pysnmp/proto/secmod/rfc3826/__init__.pyc; :Fc@sdS(N((((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3826/__init__.pys?sPK6,pysnmp/proto/secmod/rfc3826/priv/__init__.pyPKAq>X-pysnmp/proto/secmod/rfc3826/priv/__init__.pyc; :Fc@sdS(N((((sGbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3826/priv/__init__.pys?sPK1>=22'pysnmp/proto/secmod/rfc3826/priv/aes.pyimport random, string from pysnmp.proto.secmod.rfc3414.priv import base from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha from pysnmp.proto.secmod.rfc3414 import localkey from pyasn1.type import univ from pysnmp.proto import errind, error try: from sys import version_info except ImportError: version_info = ( 0, 0 ) # a really early version try: from Crypto.Cipher import AES except ImportError: AES = None random.seed() # RFC3826 # class Aes(base.AbstractEncryptionService): serviceID = (1, 3, 6, 1, 6, 3, 10, 1, 2, 4) # usmAesCfb128Protocol keySize = 16 if version_info < (2, 3): _localInt = long(random.random()*0xffffffffffffffffL) else: _localInt = random.randrange(0, 0xffffffffffffffffL) # 3.1.2.1 def __getEncryptionKey(self, privKey, snmpEngineBoots, snmpEngineTime): salt = [ self._localInt>>56&0xff, self._localInt>>48&0xff, self._localInt>>40&0xff, self._localInt>>32&0xff, self._localInt>>24&0xff, self._localInt>>16&0xff, self._localInt>>8&0xff, self._localInt&0xff ] if self._localInt == 0xffffffffffffffffL: self._localInt = 0 else: self._localInt = self._localInt + 1 salt = string.join(map(chr, salt), '') return self.__getDecryptionKey(privKey, snmpEngineBoots, snmpEngineTime, salt) + ( salt, ) def __getDecryptionKey(self, privKey, snmpEngineBoots, snmpEngineTime, salt): snmpEngineBoots, snmpEngineTime, salt = ( long(snmpEngineBoots), long(snmpEngineTime), str(salt) ) iv = [ snmpEngineBoots>>24&0xff, snmpEngineBoots>>16&0xff, snmpEngineBoots>>8&0xff, snmpEngineBoots&0xff, snmpEngineTime>>24&0xff, snmpEngineTime>>16&0xff, snmpEngineTime>>8&0xff, snmpEngineTime&0xff, ord(salt[0]), ord(salt[1]), ord(salt[2]), ord(salt[3]), ord(salt[4]), ord(salt[5]), ord(salt[6]), ord(salt[7]) ] return privKey[:self.keySize], string.join(map(chr, iv), '') def hashPassphrase(self, authProtocol, privKey): if authProtocol == hmacmd5.HmacMd5.serviceID: return localkey.hashPassphraseMD5(privKey) elif authProtocol == hmacsha.HmacSha.serviceID: return localkey.hashPassphraseSHA(privKey) else: raise error.ProtocolError( 'Unknown auth protocol %s' % (authProtocol,) ) def localizeKey(self, authProtocol, privKey, snmpEngineID): if authProtocol == hmacmd5.HmacMd5.serviceID: localPrivKey = localkey.localizeKeyMD5(privKey, snmpEngineID) elif authProtocol == hmacsha.HmacSha.serviceID: localPrivKey = localkey.localizeKeySHA(privKey, snmpEngineID) else: raise error.ProtocolError( 'Unknown auth protocol %s' % (authProtocol,) ) return localPrivKey[:16] # 3.2.4.1 def encryptData(self, encryptKey, privParameters, dataToEncrypt): if AES is None: raise error.StatusInformation( errorIndication=errind.encryptionError ) snmpEngineBoots, snmpEngineTime, salt = privParameters # 3.3.1.1 aesKey, iv, salt = self.__getEncryptionKey( str(encryptKey), snmpEngineBoots, snmpEngineTime ) # 3.3.1.3 aesObj = AES.new(aesKey, AES.MODE_CFB, iv, segment_size=128) # PyCrypto seems to require padding dataToEncrypt = dataToEncrypt + '\0' * (16-len(dataToEncrypt)%16) ciphertext = aesObj.encrypt(dataToEncrypt) # 3.3.1.4 return univ.OctetString(ciphertext), univ.OctetString(salt) # 3.2.4.2 def decryptData(self, decryptKey, privParameters, encryptedData): if AES is None: raise error.StatusInformation( errorIndication=errind.decryptionError ) snmpEngineBoots, snmpEngineTime, salt = privParameters # 3.3.2.1 if len(salt) != 8: raise error.StatusInformation( errorIndication=errind.decryptionError ) # 3.3.2.3 aesKey, iv = self.__getDecryptionKey( str(decryptKey), snmpEngineBoots, snmpEngineTime, salt ) aesObj = AES.new(aesKey, AES.MODE_CFB, iv, segment_size=128) # PyCrypto seems to require padding encryptedData = encryptedData + '\0' * (16-len(encryptedData)%16) # 3.3.2.4-6 return aesObj.decrypt(str(encryptedData)) PKAq>(pysnmp/proto/secmod/rfc3826/priv/aes.pyc; 3Mc@sdkZdkZdklZdklZlZdklZdk l Z dk l Z l Z ydklZWnej oddfZnXydklZWnej o eZnXeid eifd YZdS( N(sbase(shmacmd5shmacsha(slocalkey(suniv(serrindserror(s version_infoi(sAESsAesc BstZddddddddddf ZdZeddfjoeeidZneid dZd Z d Z d Z d Z dZ dZRS(Niiii iiilic Cs|id?d@|id?d@|id?d@|id?d@|id?d@|id?d@|id?d@|id@g}|id jo d |_n|id |_titt|d }|i|||||fSdS( Ni8ii0i(i iiiliis( sselfs _localIntssaltsstringsjoinsmapschrs_Aes__getDecryptionKeysprivKeyssnmpEngineBootsssnmpEngineTime(sselfsprivKeyssnmpEngineBootsssnmpEngineTimessalt((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3826/priv/aes.pys__getEncryptionKey sr   cCst|t|t|f\}}}|d?d@|d?d@|d?d@|d@|d?d@|d?d@|d?d@|d@t|dt|dt|dt|dt|d t|d t|d t|d g}||i t i t t |d fSdS(Niiiiiiiiiiiis(slongssnmpEngineBootsssnmpEngineTimesstrssaltsordsivsprivKeysselfskeySizesstringsjoinsmapschr(sselfsprivKeyssnmpEngineBootsssnmpEngineTimessaltsiv((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3826/priv/aes.pys__getDecryptionKey6s*cCsb|tiijoti|Sn;|tiijoti |Snt i d|fdS(NsUnknown auth protocol %s( s authProtocolshmacmd5sHmacMd5s serviceIDslocalkeyshashPassphraseMD5sprivKeyshmacshasHmacShashashPassphraseSHAserrors ProtocolError(sselfs authProtocolsprivKey((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3826/priv/aes.pyshashPassphraseQs cCst|tiijoti||}n@|t i ijoti ||}nt i d|f|d SdS(NsUnknown auth protocol %si(s authProtocolshmacmd5sHmacMd5s serviceIDslocalkeyslocalizeKeyMD5sprivKeys snmpEngineIDs localPrivKeyshmacshasHmacShaslocalizeKeySHAserrors ProtocolError(sselfs authProtocolsprivKeys snmpEngineIDs localPrivKey((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3826/priv/aes.pys localizeKey[s c Csttjotidtin|\}}}|i t |||\}}}ti|ti|dd} |ddt|d}| i|} ti| ti|fSdS(NserrorIndications segment_sizeisi(sAESsNoneserrorsStatusInformationserrindsencryptionErrorsprivParametersssnmpEngineBootsssnmpEngineTimessaltsselfs_Aes__getEncryptionKeysstrs encryptKeysaesKeysivsnewsMODE_CFBsaesObjs dataToEncryptslensencrypts ciphertextsunivs OctetString( sselfs encryptKeysprivParameterss dataToEncryptsaesKeyssnmpEngineTimesivssnmpEngineBootsssalts ciphertextsaesObj((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3826/priv/aes.pys encryptDatags $c Csttjotidtin|\}}}t |djotidtin|i t ||||\}}ti|ti|dd} |ddt |d}| it |SdS(NserrorIndicationis segment_sizeisi(sAESsNoneserrorsStatusInformationserrindsdecryptionErrorsprivParametersssnmpEngineBootsssnmpEngineTimessaltslensselfs_Aes__getDecryptionKeysstrs decryptKeysaesKeysivsnewsMODE_CFBsaesObjs encryptedDatasdecrypt( sselfs decryptKeysprivParameterss encryptedDatassnmpEngineTimesaesKeysivssnmpEngineBootsssaltsaesObj((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3826/priv/aes.pys decryptDatas $(s__name__s __module__s serviceIDskeySizes version_infoslongsrandoms _localInts randranges_Aes__getEncryptionKeys_Aes__getDecryptionKeyshashPassphrases localizeKeys encryptDatas decryptData(((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3826/priv/aes.pysAess$   (srandomsstrings pysnmp.proto.secmod.rfc3414.privsbases pysnmp.proto.secmod.rfc3414.authshmacmd5shmacshaspysnmp.proto.secmod.rfc3414slocalkeys pyasn1.typesunivs pysnmp.protoserrindserrorssyss version_infos ImportErrors Crypto.CiphersAESsNonesseedsAbstractEncryptionServicesAes( sAESsstringshmacshas version_infosrandomsAesshmacmd5sbaseserrindserrorsunivslocalkey((sBbuild/bdist.linux-i686/egg/pysnmp/proto/secmod/rfc3826/priv/aes.pys?s     PKu2ΩFpysnmp/proto/api/__init__.pyfrom pysnmp.proto.api import v1, v2c, verdec # Protocol versions protoVersion1 = 0 protoVersion2c = 1 protoModules = { protoVersion1: v1, protoVersion2c: v2c } decodeMessageVersion = verdec.decodeMessageVersion PK1L>*NNpysnmp/proto/api/v1.pyimport types from pyasn1.type import univ from pysnmp.proto import rfc1155, rfc1157, error from pysnmp import nextid # Shortcuts to SNMP types Integer = univ.Integer OctetString = univ.OctetString Null = univ.Null ObjectIdentifier = univ.ObjectIdentifier IpAddress = rfc1155.IpAddress NetworkAddress = rfc1155.NetworkAddress Counter = rfc1155.Counter Gauge = rfc1155.Gauge TimeTicks = rfc1155.TimeTicks Opaque = rfc1155.Opaque VarBind = rfc1157.VarBind VarBindList = rfc1157.VarBindList GetRequestPDU = rfc1157.GetRequestPDU GetNextRequestPDU = rfc1157.GetNextRequestPDU GetResponsePDU = rfc1157.GetResponsePDU SetRequestPDU = rfc1157.SetRequestPDU TrapPDU = rfc1157.TrapPDU Message = rfc1157.Message class VarBindAPI: _null = Null('') def setOIDVal(self, varBind, (oid, val)): varBind.setComponentByPosition(0, oid) if val is None: val = self._null varBind.setComponentByPosition(1).getComponentByPosition(1).setComponentByType(val.getTagSet(), val, 1, verifyConstraints=False) return varBind def getOIDVal(self, varBind): return varBind[0], varBind[1].getComponent(1) apiVarBind = VarBindAPI() getNextRequestID = nextid.Integer(0xffffff) class PDUAPI: _null = Null('') _errorStatus = _errorIndex = Integer(0) def setDefaults(self, pdu): pdu.setComponentByPosition( 0, getNextRequestID(), verifyConstraints=False ) pdu.setComponentByPosition( 1, self._errorStatus, verifyConstraints=False ) pdu.setComponentByPosition( 2, self._errorIndex, verifyConstraints=False ) pdu.setComponentByPosition(3) def getRequestID(self, pdu): return pdu.getComponentByPosition(0) def setRequestID(self, pdu, value): pdu.setComponentByPosition(0, value) def getErrorStatus(self, pdu): return pdu.getComponentByPosition(1) def setErrorStatus(self, pdu, value): pdu.setComponentByPosition(1, value) def getErrorIndex(self, pdu): errorIndex = pdu.getComponentByPosition(2) if errorIndex > len(pdu[3]): raise error.ProtocolError( 'Error index out of range: %s > %s' % (errorIndex, len(pdu[3])) ) return errorIndex def setErrorIndex(self, pdu, value): pdu.setComponentByPosition(2, value) def setEndOfMibError(self, pdu, errorIndex): self.setErrorStatus(pdu, 2) def setNoSuchInstanceError(self, pdu, errorIndex): self.setEndOfMibError(pdu, errorIndex) def getVarBindList(self, pdu): return pdu.getComponentByPosition(3) def setVarBindList(self, pdu, varBindList): varBindList = pdu.setComponentByPosition(3, varBindList) def getVarBinds(self, pdu): varBinds = [] for varBind in pdu.getComponentByPosition(3): varBinds.append(apiVarBind.getOIDVal(varBind)) return varBinds def setVarBinds(self, pdu, varBinds): varBindList = pdu.setComponentByPosition(3).getComponentByPosition(3) varBindList.clear() idx = 0 for varBind in varBinds: if type(varBind) is types.InstanceType: varBindList.setComponentByPosition(idx, varBind) else: varBindList.setComponentByPosition(idx) apiVarBind.setOIDVal( varBindList.getComponentByPosition(idx), varBind ) idx = idx + 1 def getResponse(self, reqPDU): rspPDU = GetResponsePDU() self.setDefaults(rspPDU) self.setRequestID(rspPDU, self.getRequestID(reqPDU)) return rspPDU def getVarBindTable(self, reqPDU, rspPDU): if apiPDU.getErrorStatus(rspPDU) == 2: varBindRow = [] for varBind in apiPDU.getVarBinds(reqPDU): varBindRow.append((varBind[0], self._null)) return [ varBindRow ] else: return [ apiPDU.getVarBinds(rspPDU) ] apiPDU = PDUAPI() class TrapPDUAPI: try: import socket agentAddress = IpAddress(socket.gethostbyname(socket.gethostname())) except: agentAddress = IpAddress('0.0.0.0') _entOid = ObjectIdentifier((1,3,6,1,4,1,20408)) _zeroInt = univ.Integer(0) def setDefaults(self, pdu): pdu.setComponentByPosition(0, self._entOid, verifyConstraints=False) pdu.setComponentByPosition(1).getComponentByPosition(1).setComponentByPosition(0, self.agentAddress, verifyConstraints=False) pdu.setComponentByPosition(2, self._zeroInt, verifyConstraints=False) pdu.setComponentByPosition(3, self._zeroInt, verifyConstraints=False) pdu.setComponentByPosition(4, self._zeroInt, verifyConstraints=False) pdu.setComponentByPosition(5) def getEnterprise(self, pdu): return pdu.getComponentByPosition(0) def setEnterprise(self, pdu, value): pdu.setComponentByPosition(0, value) def getAgentAddr(self, pdu): return pdu.getComponentByPosition(1).getComponentByPosition(0) def setAgentAddr(self, pdu, value): pdu.getComponentByPosition(1).setComponentByPosition(0, value) def getGenericTrap(self, pdu): return pdu.getComponentByPosition(2) def setGenericTrap(self, pdu, value): pdu.setComponentByPosition(2, value) def getSpecificTrap(self, pdu): return pdu.getComponentByPosition(3) def setSpecificTrap(self, pdu, value): pdu.setComponentByPosition(3, value) def getTimeStamp(self, pdu): return pdu.getComponentByPosition(4) def setTimeStamp(self, pdu, value): pdu.setComponentByPosition(4, value) def getVarBindList(self, pdu): return pdu.getComponentByPosition(5) def setVarBindList(self, pdu, varBindList): varBindList = pdu.setComponentByPosition(5, varBindList) def getVarBinds(self, pdu): varBinds = [] for varBind in pdu.getComponentByPosition(5): varBinds.append(apiVarBind.getOIDVal(varBind)) return varBinds def setVarBinds(self, pdu, varBinds): varBindList = pdu.setComponentByPosition(5).getComponentByPosition(5) varBindList.clear() idx = 0 for varBind in varBinds: if type(varBind) is types.InstanceType: varBindList.setComponentByPosition(idx, varBind) else: varBindList.setComponentByPosition(idx) apiVarBind.setOIDVal( varBindList.getComponentByPosition(idx), varBind ) idx = idx + 1 apiTrapPDU = TrapPDUAPI() class MessageAPI: _verInt = univ.Integer(0) _commStr = univ.OctetString('public') def setDefaults(self, msg): msg.setComponentByPosition(0, self._verInt, verifyConstraints=False) msg.setComponentByPosition(1, self._commStr, verifyConstraints=False) return msg def getVersion(self, msg): return msg.getComponentByPosition(0) def setVersion(self, msg, value): msg.setComponentByPosition(0, value) def getCommunity(self, msg): return msg.getComponentByPosition(1) def setCommunity(self, msg, value): msg.setComponentByPosition(1, value) def getPDU(self, msg): return msg.getComponentByPosition(2).getComponent() def setPDU(self, msg, value): msg.setComponentByPosition(2).getComponentByPosition(2).setComponentByType(value.getTagSet(), value, 1, verifyConstraints=False) def getResponse(self, reqMsg): rspMsg = Message() self.setDefaults(rspMsg) self.setVersion(rspMsg, self.getVersion(reqMsg)) self.setCommunity(rspMsg, self.getCommunity(reqMsg)) self.setPDU(rspMsg, apiPDU.getResponse(self.getPDU(reqMsg))) return rspMsg apiMessage = MessageAPI() PKAq>HEEpysnmp/proto/api/verdec.pyc; 9Mc@sdklZdZdS((sdecodercCs>ti|dd\}}ti|dd\}}|SdS(Ns recursiveFlagi(sdecodersdecodeswholeMsgsseqsver(swholeMsgsversseq((s5build/bdist.linux-i686/egg/pysnmp/proto/api/verdec.pysdecodeMessageVersionsN(spyasn1.codec.bersdecodersdecodeMessageVersion(sdecodeMessageVersionsdecoder((s5build/bdist.linux-i686/egg/pysnmp/proto/api/verdec.pys?s PKAq>M9j,<,<pysnmp/proto/api/v1.pyc; /UMc@sadkZdklZdklZlZlZdklZei Z ei Z ei Z ei Z ei Z eiZeiZeiZeiZeiZeiZeiZeiZeiZeiZeiZeiZeiZdfdYZeZei dZdfdYZeZd fd YZ e Z!d fd YZ"e"Z#dS( N(suniv(srfc1155srfc1157serror(snextids VarBindAPIcBs&tZedZdZdZRS(NscCso|\}}|id||tjo |i}n|ididi|i |ddt |SdS(NiisverifyConstraints( soidsvalsvarBindssetComponentByPositionsNonesselfs_nullsgetComponentByPositionssetComponentByTypes getTagSetsFalse(sselfsvarBinds.4soidsval((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setOIDVals  1cCs|d|didfSdS(Nii(svarBinds getComponent(sselfsvarBind((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getOIDVal$s(s__name__s __module__sNulls_nulls setOIDVals getOIDVal(((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys VarBindAPIs  isPDUAPIcBstZedZedZZdZdZdZ dZ dZ dZ d Z d Zd Zd Zd ZdZdZdZdZRS(NsicCs\|idtdt|id|idt|id|idt|iddS(NisverifyConstraintsiii(spdussetComponentByPositionsgetNextRequestIDsFalsesselfs _errorStatuss _errorIndex(sselfspdu((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setDefaults.scCs|idSdS(Ni(spdusgetComponentByPosition(sselfspdu((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getRequestID:scCs|id|dS(Ni(spdussetComponentByPositionsvalue(sselfspdusvalue((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setRequestID;scCs|idSdS(Ni(spdusgetComponentByPosition(sselfspdu((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pysgetErrorStatus=scCs|id|dS(Ni(spdussetComponentByPositionsvalue(sselfspdusvalue((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pyssetErrorStatus>scCsU|id}|t|djo'tid|t|dfn|SdS(Niis!Error index out of range: %s > %s(spdusgetComponentByPositions errorIndexslenserrors ProtocolError(sselfspdus errorIndex((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getErrorIndex@s'cCs|id|dS(Ni(spdussetComponentByPositionsvalue(sselfspdusvalue((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setErrorIndexGscCs|i|ddS(Ni(sselfssetErrorStatusspdu(sselfspdus errorIndex((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pyssetEndOfMibErrorJscCs|i||dS(N(sselfssetEndOfMibErrorspdus errorIndex(sselfspdus errorIndex((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pyssetNoSuchInstanceErrorMscCs|idSdS(Ni(spdusgetComponentByPosition(sselfspdu((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pysgetVarBindListPscCs|id|}dS(Ni(spdussetComponentByPositions varBindList(sselfspdus varBindList((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pyssetVarBindListSscCs>g}x-|idD]}|iti|qW|SdS(Ni(svarBindsspdusgetComponentByPositionsvarBindsappends apiVarBinds getOIDVal(sselfspdusvarBindssvarBind((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getVarBindsUs cCs|idid}|id}xh|D]`}t|t i jo|i||n'|i|t i |i|||d}q/WdS(Niii( spdussetComponentByPositionsgetComponentByPositions varBindListsclearsidxsvarBindssvarBindstypestypess InstanceTypes apiVarBinds setOIDVal(sselfspdusvarBindssidxs varBindListsvarBind((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setVarBindsZs  cCs7t}|i||i||i||SdS(N(sGetResponsePDUsrspPDUsselfs setDefaultss setRequestIDs getRequestIDsreqPDU(sselfsreqPDUsrspPDU((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getResponsehs  cCsoti|djoEg}x1ti|D] }|i|d|i fq,W|gSnti|gSdS(Nii( sapiPDUsgetErrorStatussrspPDUs varBindRows getVarBindssreqPDUsvarBindsappendsselfs_null(sselfsreqPDUsrspPDUs varBindRowsvarBind((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pysgetVarBindTablens (s__name__s __module__sNulls_nullsIntegers _errorStatuss _errorIndexs setDefaultss getRequestIDs setRequestIDsgetErrorStatusssetErrorStatuss getErrorIndexs setErrorIndexssetEndOfMibErrorssetNoSuchInstanceErrorsgetVarBindListssetVarBindLists getVarBindss setVarBindss getResponsesgetVarBindTable(((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pysPDUAPI+s"              s TrapPDUAPIcBstZy(dkZeeieiZWnedZnXedddddddfZe i dZ dZ d Z d Zd Zd Zd ZdZdZdZdZdZdZdZdZdZRS(Ns0.0.0.0iiiiiOicCs|id|idt|ididid|idt|id|idt|id|idt|id|idt|iddS(NisverifyConstraintsiiiii(spdussetComponentByPositionsselfs_entOidsFalsesgetComponentByPositions agentAddresss_zeroInt(sselfspdu((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setDefaultss +cCs|idSdS(Ni(spdusgetComponentByPosition(sselfspdu((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getEnterprisescCs|id|dS(Ni(spdussetComponentByPositionsvalue(sselfspdusvalue((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setEnterprisescCs|ididSdS(Nii(spdusgetComponentByPosition(sselfspdu((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getAgentAddrscCs|idid|dS(Nii(spdusgetComponentByPositionssetComponentByPositionsvalue(sselfspdusvalue((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setAgentAddrscCs|idSdS(Ni(spdusgetComponentByPosition(sselfspdu((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pysgetGenericTrapscCs|id|dS(Ni(spdussetComponentByPositionsvalue(sselfspdusvalue((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pyssetGenericTrapscCs|idSdS(Ni(spdusgetComponentByPosition(sselfspdu((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pysgetSpecificTrapscCs|id|dS(Ni(spdussetComponentByPositionsvalue(sselfspdusvalue((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pyssetSpecificTrapscCs|idSdS(Ni(spdusgetComponentByPosition(sselfspdu((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getTimeStampscCs|id|dS(Ni(spdussetComponentByPositionsvalue(sselfspdusvalue((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setTimeStampscCs|idSdS(Ni(spdusgetComponentByPosition(sselfspdu((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pysgetVarBindListscCs|id|}dS(Ni(spdussetComponentByPositions varBindList(sselfspdus varBindList((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pyssetVarBindListscCs>g}x-|idD]}|iti|qW|SdS(Ni(svarBindsspdusgetComponentByPositionsvarBindsappends apiVarBinds getOIDVal(sselfspdusvarBindssvarBind((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getVarBindss cCs|idid}|id}xh|D]`}t|t i jo|i||n'|i|t i |i|||d}q/WdS(Niii( spdussetComponentByPositionsgetComponentByPositions varBindListsclearsidxsvarBindssvarBindstypestypess InstanceTypes apiVarBinds setOIDVal(sselfspdusvarBindssidxs varBindListsvarBind((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setVarBindss  (s__name__s __module__ssockets IpAddresss gethostbynames gethostnames agentAddresssObjectIdentifiers_entOidsunivsIntegers_zeroInts setDefaultss getEnterprises setEnterprises getAgentAddrs setAgentAddrsgetGenericTrapssetGenericTrapsgetSpecificTrapssetSpecificTraps getTimeStamps setTimeStampsgetVarBindListssetVarBindLists getVarBindss setVarBinds(((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys TrapPDUAPIys, !              s MessageAPIcBsntZeidZeidZdZdZdZ dZ dZ dZ d Z d ZRS( NispubliccCs:|id|idt|id|idt|SdS(NisverifyConstraintsi(smsgssetComponentByPositionsselfs_verIntsFalses_commStr(sselfsmsg((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setDefaultsscCs|idSdS(Ni(smsgsgetComponentByPosition(sselfsmsg((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getVersionscCs|id|dS(Ni(smsgssetComponentByPositionsvalue(sselfsmsgsvalue((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setVersionscCs|idSdS(Ni(smsgsgetComponentByPosition(sselfsmsg((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getCommunityscCs|id|dS(Ni(smsgssetComponentByPositionsvalue(sselfsmsgsvalue((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys setCommunityscCs|idiSdS(Ni(smsgsgetComponentByPositions getComponent(sselfsmsg((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pysgetPDUscCs5|ididi|i|ddtdS(NiisverifyConstraints(smsgssetComponentByPositionsgetComponentByPositionssetComponentByTypesvalues getTagSetsFalse(sselfsmsgsvalue((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pyssetPDUscCsrt}|i||i||i||i||i||i |t i |i ||SdS(N( sMessagesrspMsgsselfs setDefaultss setVersions getVersionsreqMsgs setCommunitys getCommunityssetPDUsapiPDUs getResponsesgetPDU(sselfsreqMsgsrspMsg((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys getResponses   "(s__name__s __module__sunivsIntegers_verInts OctetStrings_commStrs setDefaultss getVersions setVersions getCommunitys setCommunitysgetPDUssetPDUs getResponse(((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys MessageAPIs       ($stypess pyasn1.typesunivs pysnmp.protosrfc1155srfc1157serrorspysnmpsnextidsIntegers OctetStringsNullsObjectIdentifiers IpAddresssNetworkAddresssCountersGauges TimeTickssOpaquesVarBinds VarBindLists GetRequestPDUsGetNextRequestPDUsGetResponsePDUs SetRequestPDUsTrapPDUsMessages VarBindAPIs apiVarBindsgetNextRequestIDsPDUAPIsapiPDUs TrapPDUAPIs apiTrapPDUs MessageAPIs apiMessage(!sNetworkAddresssOpaques TimeTickssTrapPDUsnextids IpAddresss VarBindAPIs apiVarBindsgetNextRequestIDsunivsIntegers MessageAPIsrfc1155s GetRequestPDUsrfc1157sObjectIdentifiers OctetStringsGetNextRequestPDUsGetResponsePDUs VarBindListsCountersPDUAPIsVarBinds TrapPDUAPIstypess apiMessages apiTrapPDUsGaugeserrorsMessagesNulls SetRequestPDUsapiPDU((s1build/bdist.linux-i686/egg/pysnmp/proto/api/v1.pys?s<                      L 9 PKAq>spysnmp/proto/api/__init__.pyc; Bc@sJdklZlZlZdZdZhee<ee r##pysnmp/proto/api/v2c.pyc; '9Mc@sdklZlZlZdklZdklZlZl Z l Z ei Z ei Z ei Z eiZeiZeiZeiZeiZeiZeiZeiZeiZeiZeiZeiZeiZeiZeiZZeiZeiZei Z ei!Z!Z"ei#Z#dei$fdYZ$ei%Z%ei&Z&dei'fdYZ'e'Z(de'fdYZ)e)Z*d ei'fd YZ+e+Z,d ei-fd YZ-e-Z.d S((srfc1902srfc1905serror(sv1(sunivs namedtypesnamedvals constraintsMessagecBshtZeieideideiddfeidei eide i Z RS(Nsversions namedValuess version-2is communitysdata( s__name__s __module__s namedtypes NamedTypess NamedTypesunivsIntegersnamedvals NamedValuess OctetStringsrfc1905sPDUss componentType(((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pysMessage!s0sPDUAPIcBsVtZeidideideiZ dZ dZ dZ dZ RS(Nis subtypeSpeccCs7t}|i||i||i||SdS(N(s ResponsePDUsrspPDUsselfs setDefaultss setRequestIDs getRequestIDsreqPDU(sselfsreqPDUsrspPDU((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pys getResponse.s  cCsti|gSdS(N(sapiPDUs getVarBindssrspPDU(sselfsreqPDUsrspPDU((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pysgetVarBindTable4scCs4|i|}||didtidtdS(NisverifyConstraints( sselfsgetVarBindListspdus varBindLists errorIndexssetComponentByPositionsrfc1905s endOfMibViewsFalse(sselfspdus errorIndexs varBindList((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pyssetEndOfMibError7scCs4|i|}||didtidtdS(NisverifyConstraints( sselfsgetVarBindListspdus varBindLists errorIndexssetComponentByPositionsrfc1905snoSuchInstancesFalse(sselfspdus errorIndexs varBindList((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pyssetNoSuchInstanceError=s(s__name__s __module__sunivsIntegerssubtypes constraintsValueRangeConstraintsrfc1905s max_bindingss _errorIndexs getResponsesgetVarBindTablessetEndOfMibErrorssetNoSuchInstanceError(((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pysPDUAPI,s *   s BulkPDUAPIcBsMtZeidZdZdZdZdZdZ dZ RS(Ni cCs-ti|||id|idtdS(NisverifyConstraints(sPDUAPIs setDefaultssselfspdussetComponentByPositions_tenIntsFalse(sselfspdu((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pys setDefaultsGscCs|idSdS(Ni(spdusgetComponentByPosition(sselfspdu((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pysgetNonRepeatersKscCs|id|dS(Ni(spdussetComponentByPositionsvalue(sselfspdusvalue((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pyssetNonRepeatersLscCs|idSdS(Ni(spdusgetComponentByPosition(sselfspdu((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pysgetMaxRepetitionsNscCs|id|dS(Ni(spdussetComponentByPositionsvalue(sselfspdusvalue((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pyssetMaxRepetitionsOsc Cs|i|} |i|}|i|} tt | t | }t |}t t | |d}|i|} g}|oYxrtdt | ||D]4}| | | |||||!} |i| qWn|o|i| | n|SdS(Ni(sselfsgetNonRepeaterssreqPDUs nonRepeaterssgetMaxRepetitionssmaxRepetitionss getVarBindss reqVarBindssminsintslensNsMsmaxsRsrspPDUs rspVarBindss varBindTablesrangesis varBindRowsappend( sselfsreqPDUsrspPDUsis varBindTablesmaxRepetitionssMsNsRs rspVarBindss varBindRows reqVarBindss nonRepeaters((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pysgetVarBindTableQs  !( s__name__s __module__srfc1902sIntegers_tenInts setDefaultssgetNonRepeatersssetNonRepeaterssgetMaxRepetitionsssetMaxRepetitionssgetVarBindTable(((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pys BulkPDUAPIEs     s TrapPDUAPIc BstZdddddddddf Zddddddddddf Zddddddddddf Zdddddddddddf Zdddddddddddf ZedZe ddddddddddf Z d Z RS( NiiiiiiiicCsKtii|||i|if|i|ifg}|i ||dS(N( sv1sPDUAPIs setDefaultssselfspdus sysUpTimes _zeroTimes snmpTrapOIDs_genTrapsvarBindss setVarBinds(sselfspdusvarBinds((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pys setDefaultsrs$( s__name__s __module__s sysUpTimessnmpTrapAddressssnmpTrapCommunitys snmpTrapOIDssnmpTrapEnterprises TimeTickss _zeroTimesObjectIdentifiers_genTraps setDefaults(((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pys TrapPDUAPIjs!$$'' *s MessageAPIcBs)tZeidZdZdZRS(NicCs:|id|idt|id|idt|SdS(NisverifyConstraintsi(smsgssetComponentByPositionsselfs_verIntsFalses_commStr(sselfsmsg((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pys setDefaultsscCsrt}|i||i||i||i||i||i |t i |i ||SdS(N( sMessagesrspMsgsselfs setDefaultss setVersions getVersionsreqMsgs setCommunitys getCommunityssetPDUsapiPDUs getResponsesgetPDU(sselfsreqMsgsrspMsg((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pys getResponses   "(s__name__s __module__sunivsIntegers_verInts setDefaultss getResponse(((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pys MessageAPI}s N(/s pysnmp.protosrfc1902srfc1905serrorspysnmp.proto.apisv1s pyasn1.typesunivs namedtypesnamedvals constraintsNullsObjectIdentifiersIntegers Integer32s OctetStrings IpAddresss Counter32sGauge32s Unsigned32s TimeTickssOpaques Counter64sBitssVarBinds VarBindLists GetRequestPDUsGetNextRequestPDUs ResponsePDUsGetResponsePDUs SetRequestPDUsGetBulkRequestPDUsInformRequestPDUs SNMPv2TrapPDUsTrapPDUs ReportPDUsMessagesgetNextRequestIDs apiVarBindsPDUAPIsapiPDUs BulkPDUAPIs apiBulkPDUs TrapPDUAPIs apiTrapPDUs MessageAPIs apiMessage(,s MessageAPIsOpaques TimeTickssapiPDUsTrapPDUs namedtypes IpAddresss apiVarBindsgetNextRequestIDsBitss ReportPDUs SNMPv2TrapPDUsIntegersnamedvals apiMessages OctetStringsGetNextRequestPDUsGetResponsePDUs VarBindLists Counter64s Unsigned32s GetRequestPDUs apiBulkPDUsv1sGauge32sunivsVarBindsGetBulkRequestPDUs TrapPDUAPIs BulkPDUAPIs Integer32s ResponsePDUs constraints apiTrapPDUsrfc1905srfc1902sInformRequestPDUsObjectIdentifierserrorsMessagesNulls SetRequestPDUs Counter32sPDUAPI((s2build/bdist.linux-i686/egg/pysnmp/proto/api/v2c.pys?sH                           #  PKC5>^ոpysnmp/proto/api/verdec.pyfrom pyasn1.codec.ber import decoder def decodeMessageVersion(wholeMsg): seq, wholeMsg = decoder.decode(wholeMsg, recursiveFlag=0) ver, wholeMsg = decoder.decode(wholeMsg, recursiveFlag=0) return ver PK5>dpysnmp/proto/api/v2c.pyfrom pysnmp.proto import rfc1902, rfc1905, error from pysnmp.proto.api import v1 from pyasn1.type import univ, namedtype, namedval, constraint # Shortcuts to SNMP types Null = univ.Null ObjectIdentifier = univ.ObjectIdentifier Integer = rfc1902.Integer Integer32 = rfc1902.Integer32 OctetString = rfc1902.OctetString IpAddress = rfc1902.IpAddress Counter32 = rfc1902.Counter32 Gauge32 = rfc1902.Gauge32 Unsigned32 = rfc1902.Unsigned32 TimeTicks = rfc1902.TimeTicks Opaque = rfc1902.Opaque Counter64 = rfc1902.Counter64 Bits = rfc1902.Bits VarBind = rfc1905.VarBind VarBindList = rfc1905.VarBindList GetRequestPDU = rfc1905.GetRequestPDU GetNextRequestPDU = rfc1905.GetNextRequestPDU ResponsePDU = GetResponsePDU = rfc1905.ResponsePDU SetRequestPDU = rfc1905.SetRequestPDU GetBulkRequestPDU = rfc1905.GetBulkRequestPDU InformRequestPDU = rfc1905.InformRequestPDU SNMPv2TrapPDU = TrapPDU = rfc1905.SNMPv2TrapPDU ReportPDU = rfc1905.ReportPDU # v2 model uses v1 messaging but it's not defined in v2 MIB class Message(v1.Message): componentType = namedtype.NamedTypes( namedtype.NamedType('version', univ.Integer(namedValues = namedval.NamedValues(('version-2', 1)))), namedtype.NamedType('community', univ.OctetString()), namedtype.NamedType('data', rfc1905.PDUs()) ) getNextRequestID = v1.getNextRequestID apiVarBind = v1.apiVarBind class PDUAPI(v1.PDUAPI): _errorIndex = univ.Integer(0).subtype(subtypeSpec=constraint.ValueRangeConstraint(0, rfc1905.max_bindings)) def getResponse(self, reqPDU): rspPDU = ResponsePDU() self.setDefaults(rspPDU) self.setRequestID(rspPDU, self.getRequestID(reqPDU)) return rspPDU def getVarBindTable(self, reqPDU, rspPDU): return [ apiPDU.getVarBinds(rspPDU) ] def setEndOfMibError(self, pdu, errorIndex): varBindList = self.getVarBindList(pdu) varBindList[errorIndex-1].setComponentByPosition( 1, rfc1905.endOfMibView, verifyConstraints=False ) def setNoSuchInstanceError(self, pdu, errorIndex): varBindList = self.getVarBindList(pdu) varBindList[errorIndex-1].setComponentByPosition( 1, rfc1905.noSuchInstance, verifyConstraints=False ) apiPDU = PDUAPI() class BulkPDUAPI(PDUAPI): _tenInt = rfc1902.Integer(10) def setDefaults(self, pdu): PDUAPI.setDefaults(self, pdu) pdu.setComponentByPosition(2, self._tenInt, verifyConstraints=False) def getNonRepeaters(self, pdu): return pdu.getComponentByPosition(1) def setNonRepeaters(self, pdu, value): pdu.setComponentByPosition(1, value) def getMaxRepetitions(self, pdu): return pdu.getComponentByPosition(2) def setMaxRepetitions(self,pdu,value): pdu.setComponentByPosition(2,value) def getVarBindTable(self, reqPDU, rspPDU): nonRepeaters = self.getNonRepeaters(reqPDU) maxRepetitions = self.getMaxRepetitions(reqPDU) reqVarBinds = self.getVarBinds(reqPDU) N = min(int(nonRepeaters), len(reqVarBinds)) M = int(maxRepetitions) R = max(len(reqVarBinds)-N, 0) rspVarBinds = self.getVarBinds(rspPDU) varBindTable = [] if R: for i in range(0, len(rspVarBinds)-N, R): varBindRow = rspVarBinds[:N] + rspVarBinds[N+i:N+R+i] varBindTable.append(varBindRow) elif N: varBindTable.append(rspVarBinds[:N]) return varBindTable apiBulkPDU = BulkPDUAPI() class TrapPDUAPI(v1.PDUAPI): sysUpTime = (1,3,6,1,2,1,1,3,0) snmpTrapAddress = (1,3,6,1,6,3,18,1,3,0) snmpTrapCommunity = (1,3,6,1,6,3,18,1,4,0) snmpTrapOID = (1,3,6,1,6,3,1,1,4,1,0) snmpTrapEnterprise = (1,3,6,1,6,3,1,1,4,3,0) _zeroTime = TimeTicks(0) _genTrap = ObjectIdentifier((1,3,6,1,6,3,1,1,5,1)) def setDefaults(self, pdu): v1.PDUAPI.setDefaults(self, pdu) varBinds = [ ( self.sysUpTime, self._zeroTime), # generic trap ( self.snmpTrapOID, self._genTrap) ] self.setVarBinds(pdu, varBinds) apiTrapPDU = TrapPDUAPI() class MessageAPI(v1.MessageAPI): _verInt = univ.Integer(1) def setDefaults(self, msg): msg.setComponentByPosition(0, self._verInt, verifyConstraints=False) msg.setComponentByPosition(1, self._commStr, verifyConstraints=False) return msg def getResponse(self, reqMsg): rspMsg = Message() self.setDefaults(rspMsg) self.setVersion(rspMsg, self.getVersion(reqMsg)) self.setCommunity(rspMsg, self.getCommunity(reqMsg)) self.setPDU(rspMsg, apiPDU.getResponse(self.getPDU(reqMsg))) return rspMsg apiMessage = MessageAPI() PKAq>,8 . .pysnmp/smi/view.pyc; :Mc@sfdklZlZlZdklZlZdklZdk l Z dgZ dfdYZ dS((s ClassTypes InstanceTypes TupleType(s OrderedDictsOidOrderedDict(serror(sdebugsMibViewControllercBstZdZdZdZdZdZddZddZdd Z dd Z dd Z dd Z dd Z ddZddZddZRS(NcCs||_d|_dS(Ni(s mibBuildersselfs lastBuildId(sselfs mibBuilder((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pys__init__ s cCsg|i|iijodSntiti@o tid|iidd\} t|_ |ii d}|ii i }|i|xdg|D]}hdt<dh<dh<d t<d h<|i |<}| o |}qnx|ii |iD]x\}} |d joqnt| tjoY||d jo(tid |||d |fn||d |<||d | (oid, label, suffix)iiN( snodeNames labelToOidIdxs oidToLabelIdxslensselfs_MibViewController__getOidLabelsoidslabelssuffixsresLabelsresOid( sselfsnodeNames oidToLabelIdxs labelToOidIdxsoidsresOidslabelsresLabelssuffix((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pys __getOidLabels$  "    scCs|i||ijo|i|}ntid||f|i||d|d\}}}||jo#ti dd|||fnt it i@ot id||||f|||fSdS(NsNo module %s at %ss oidToLabelIdxs labelToOidIdxsstrs$Can't resolve node name %s::%s at %ss&getNodeNameByOid: resolved %s:%s -> %s(sselfsindexMibsmodNames!_MibViewController__mibSymbolsIdxsmibModserrorsSmiErrors_MibViewController__getOidLabelsnodeNamesoidslabelssuffixsNoSuchObjectErrorsdebugsloggersflagMIB(sselfsnodeNamesmodNamesoidslabelsmibModssuffix((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pysgetNodeNameByOids & #/cCs|i||ijo|i|}ntid||f||djo|d|}n ti dd|||ft i t i @ot i d|||f|i ||SdS(NsNo module %s at %ss varToNameIdxsstrsNo such symbol %s::%s at %ss'getNodeNameByDesc: resolved %s:%s -> %s(sselfsindexMibsmodNames!_MibViewController__mibSymbolsIdxsmibModserrorsSmiErrorsnodeNamesoidsNoSuchObjectErrorsdebugsloggersflagMIBsgetNodeNameByOid(sselfsnodeNamesmodNamesoidsmibMod((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pysgetNodeNameByDescs +cCsly|i||SWnQtij oB|i|d|\}}}|i|||d|SnXdS(Nii( sselfsgetNodeNameByOidsnodeNamesmodNameserrorsNoSuchObjectErrorsgetNodeNameByDescsoidslabelssuffix(sselfsnodeNamesmodNamesoidslabelssuffix((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pys getNodeNames cCs|i||ijo|i|}ntid||f|d o tidd||fn|did\}}||ffSdS(NsNo module %s at %ss oidToLabelIdxsstrs#No variables at MIB module %s at %si( sselfsindexMibsmodNames!_MibViewController__mibSymbolsIdxsmibModserrorsSmiErrorsNoSuchObjectErrorsitemssoidslabel(sselfsmodNamesoidslabelsmibMod((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pysgetFirstNodeNames   cCs|i||\}}}y,|i|i|di|||SWn2t j o&t i dd|||fnXdS(Ns oidToLabelIdxsstrsNo name next to %s::%s at %s( sselfs getNodeNamesnodeNamesmodNamesoidslabelssuffixs!_MibViewController__mibSymbolsIdxsnextKeysKeyErrorserrorsNoSuchObjectError(sselfsnodeNamesmodNamessuffixsoidslabel((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pysgetNextNodeNames ,cCsr|i||\}}}t|djo#ti dd|||fn|d |d |d|fSdS(NisstrsNo parent name for %s::%s at %si( sselfs getNodeNamesnodeNamesmodNamesoidslabelssuffixslenserrorsNoSuchObjectError(sselfsnodeNamesmodNamessuffixsoidslabel((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pysgetParentNodeNames#cCs?|i||\}}}|idd||d|fSdS(Nss oidToModIdxi(sselfs getNodeNamesnodeNamesmodNamesoidslabelssuffixs!_MibViewController__mibSymbolsIdx(sselfsnodeNamesmodNamessuffixsoidslabel((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pysgetNodeLocationscCs|i||ijo|i|}ntid||f||djo|d|}n ti dd|||f||fSdS(NsNo module %s at %ss typeToModIdxsstrsNo such type %s::%s at %s( sselfsindexMibsmodNames!_MibViewController__mibSymbolsIdxsmibModserrorsSmiErrorstypeNamesmsNoSuchObjectError(sselfstypeNamesmodNamesmsmibMod((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pys getTypeNames cCs|i||ijo|i|}ntid||f|d o tidd||fn|did}|d||fSdS(NsNo module %s at %ss typeToModIdxsstrsNo types at MIB module %s at %si( sselfsindexMibsmodNames!_MibViewController__mibSymbolsIdxsmibModserrorsSmiErrorsNoSuchObjectErrorskeysst(sselfsmodNamesmibModst((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pysgetFirstTypeName's   cCsm|i||\}}y|i|di|SWn2tj o&t i dd|||fnXdS(Ns typeToModIdxsstrsNo type next to %s::%s at %s( sselfs getTypeNamestypeNamesmodNamesmsts!_MibViewController__mibSymbolsIdxsnextKeysKeyErrorserrorsNoSuchObjectError(sselfstypeNamesmodNamesmst((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pys getNextType6s (s__name__s __module__s__init__sindexMibsgetFirstModuleNamesgetNextModuleNames_MibViewController__getOidLabelsgetNodeNameByOidsgetNodeNameByDescs getNodeNamesgetFirstNodeNamesgetNextNodeNamesgetParentNodeNamesgetNodeLocations getTypeNamesgetFirstTypeNames getNextType(((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pysMibViewController s          N( stypess ClassTypes InstanceTypes TupleTypespysnmp.smi.indicess OrderedDictsOidOrderedDicts pysnmp.smiserrorspysnmpsdebugs__all__sMibViewController( s OrderedDicts__all__s ClassTypesOidOrderedDictserrorsdebugs TupleTypes InstanceTypesMibViewController((s-build/bdist.linux-i686/egg/pysnmp/smi/view.pys?s    PKl1Qpysnmp/smi/__init__.py"""SNMP SMI""" PKAq>mpysnmp/smi/error.pyc; =M8Mc@sdklZdklZdeefdYZdefdYZdefdYZdefd YZd efd YZd efd YZ defdYZ defdYZ defdYZ defdYZ defdYZdefdYZdefdYZdefdYZdefdYZd efd!YZd"efd#YZd$efd%YZd&efd'YZd(S()(s PyAsn1Error(s PySnmpErrorsSmiErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysSmiErrorssMibOperationErrorcBsJtZdZdZdZdZedZdZdZ RS(NcKs ||_dS(N(skwargssselfs_MibOperationError__outArgs(sselfskwargs((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pys__init__scCsd|ii|ifSdS(Ns%s(%s)(sselfs __class__s__name__s_MibOperationError__outArgs(sself((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pys__str__scCs|i|SdS(N(sselfs_MibOperationError__outArgsskey(sselfskey((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pys __getitem__ scCs||ijSdS(N(skeysselfs_MibOperationError__outArgs(sselfskey((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pys __contains__ scCs|ii||SdS(N(sselfs_MibOperationError__outArgssgetskeysdefVal(sselfskeysdefVal((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysget scCs|iiSdS(N(sselfs_MibOperationError__outArgsskeys(sself((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pyskeys scCs|ii|dS(N(sselfs_MibOperationError__outArgssupdatesd(sselfsd((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysupdates( s__name__s __module__s__init__s__str__s __getitem__s __contains__sNonesgetskeyssupdate(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysMibOperationErrors      sGenErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysGenErrorss NoAccessErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pys NoAccessErrorssWrongTypeErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysWrongTypeErrorssWrongValueErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysWrongValueErrorssNoCreationErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysNoCreationErrorssInconsistentValueErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysInconsistentValueErrorssResourceUnavailableErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysResourceUnavailableErrorssCommitFailedErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysCommitFailedErrorssUndoFailedErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysUndoFailedErrorssAuthorizationErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysAuthorizationErrorssNotWritableErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysNotWritableErrorssInconsistentNameErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysInconsistentNameErrorssNoSuchObjectErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysNoSuchObjectErrorssNoSuchInstanceErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysNoSuchInstanceError ssEndOfMibViewErrorcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysEndOfMibViewError!ssRowCreationWantedcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysRowCreationWanted$ssRowDestructionWantedcBstZRS(N(s__name__s __module__(((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pysRowDestructionWanted%sN(s pyasn1.errors PyAsn1Errors pysnmp.errors PySnmpErrorsSmiErrorsMibOperationErrorsGenErrors NoAccessErrorsWrongTypeErrorsWrongValueErrorsNoCreationErrorsInconsistentValueErrorsResourceUnavailableErrorsCommitFailedErrorsUndoFailedErrorsAuthorizationErrorsNotWritableErrorsInconsistentNameErrorsNoSuchObjectErrorsNoSuchInstanceErrorsEndOfMibViewErrorsRowCreationWantedsRowDestructionWanted(sRowCreationWantedsNoSuchInstanceErrors PySnmpErrorsMibOperationErrorsAuthorizationErrorsRowDestructionWantedsInconsistentNameErrorsGenErrorsSmiErrorsEndOfMibViewErrorsCommitFailedErrors PyAsn1ErrorsNoSuchObjectErrorsNotWritableErrorsNoCreationErrorsResourceUnavailableErrorsUndoFailedErrorsWrongValueErrorsInconsistentValueErrorsWrongTypeErrors NoAccessError((s.build/bdist.linux-i686/egg/pysnmp/smi/error.pys?s(   PK 4>f  pysnmp/smi/error.pyfrom pyasn1.error import PyAsn1Error from pysnmp.error import PySnmpError class SmiError(PySnmpError, PyAsn1Error): pass class MibOperationError(SmiError): def __init__(self, **kwargs): self.__outArgs = kwargs def __str__(self): return '%s(%s)' % ( self.__class__.__name__, self.__outArgs ) def __getitem__(self, key): return self.__outArgs[key] def __contains__(self, key): return key in self.__outArgs def get(self, key, defVal=None): return self.__outArgs.get(key, defVal) def keys(self): return self.__outArgs.keys() def update(self, d): self.__outArgs.update(d) # Aligned with SNMPv2 PDU error-status class GenError(MibOperationError): pass class NoAccessError(MibOperationError): pass class WrongTypeError(MibOperationError): pass class WrongValueError(MibOperationError): pass class NoCreationError(MibOperationError): pass class InconsistentValueError(MibOperationError): pass class ResourceUnavailableError(MibOperationError): pass class CommitFailedError(MibOperationError): pass class UndoFailedError(MibOperationError): pass class AuthorizationError(MibOperationError): pass class NotWritableError(MibOperationError): pass class InconsistentNameError(MibOperationError): pass # Aligned with SNMPv2 Var-Bind exceptions class NoSuchObjectError(MibOperationError): pass class NoSuchInstanceError(NoSuchObjectError): pass class EndOfMibViewError(MibOperationError): pass # Row management class RowCreationWanted(MibOperationError): pass class RowDestructionWanted(MibOperationError): pass PKAq>c#annpysnmp/smi/exval.pyc; sLc@s0dklZeiZeiZeiZZdS((srfc1905N(s pysnmp.protosrfc1905s noSuchObjectsnoSuchInstances endOfMibViewsendOfMib(sendOfMibs noSuchObjectsrfc1905s endOfMibViewsnoSuchInstance((s.build/bdist.linux-i686/egg/pysnmp/smi/exval.pys?s   PK 4><""pysnmp/smi/instrum.py# MIB modules management from types import InstanceType from pysnmp.smi import error from pysnmp import debug __all__ = [ 'MibInstrumController' ] class MibInstrumController: fsmReadVar = { # ( state, status ) -> newState ('start', 'ok'): 'readTest', ('readTest', 'ok'): 'readGet', ('readGet', 'ok'): 'stop', ('*', 'err'): 'stop' } fsmReadVarFast = { # ( state, status ) -> newState ('start', 'ok'): 'readGet', ('readGet', 'ok'): 'stop', ('*', 'err'): 'stop' } fsmReadNextVar = { # ( state, status ) -> newState ('start', 'ok'): 'readTestNext', ('readTestNext', 'ok'): 'readGetNext', ('readGetNext', 'ok'): 'stop', ('*', 'err'): 'stop' } fsmWriteVar = { # ( state, status ) -> newState ('start', 'ok'): 'writeTest', ('writeTest', 'ok'): 'writeCommit', ('writeCommit', 'ok'): 'writeCleanup', ('writeCleanup', 'ok'): 'readTest', # Do read after successful write ('readTest', 'ok'): 'readGet', ('readGet', 'ok'): 'stop', # Error handling ('writeTest', 'err'): 'writeCleanup', ('writeCommit', 'err'): 'writeUndo', ('writeUndo', 'ok'): 'readTest', # Ignore read errors (removed columns) ('readTest', 'err'): 'stop', ('readGet', 'err'): 'stop', ('*', 'err'): 'stop' } def __init__(self, mibBuilder): self.mibBuilder = mibBuilder self.lastBuildId = -1 self.lastBuildSyms = {} # MIB indexing def __indexMib(self): # Build a tree from MIB objects found at currently loaded modules if self.lastBuildId == self.mibBuilder.lastBuildId: return ( MibScalarInstance, MibScalar, MibTableColumn, MibTableRow, MibTable, MibTree ) = self.mibBuilder.importSymbols( 'SNMPv2-SMI', 'MibScalarInstance', 'MibScalar', 'MibTableColumn', 'MibTableRow', 'MibTable', 'MibTree' ) mibTree, = self.mibBuilder.importSymbols('SNMPv2-SMI', 'iso') # # Management Instrumentation gets organized as follows: # # MibTree # | # +----MibScalar # | | # | +-----MibScalarInstance # | # +----MibTable # | # +----MibTableRow # | # +-------MibTableColumn # | # +------MibScalarInstance(s) # # Mind you, only Managed Objects get indexed here, various MIB defs and # constants can't be SNMP managed so we drop them. # scalars = {}; instances = {}; tables = {}; rows = {}; cols = {} # Sort by module name to give user a chance to slip-in # custom MIB modules (that would be sorted out first) mibSymbols = self.mibBuilder.mibSymbols.items() mibSymbols.sort(lambda x,y: cmp(y[0], x[0])) for modName, mibMod in mibSymbols: for symObj in mibMod.values(): if type(symObj) != InstanceType: continue if isinstance(symObj, MibTable): tables[symObj.name] = symObj elif isinstance(symObj, MibTableRow): rows[symObj.name] = symObj elif isinstance(symObj, MibTableColumn): cols[symObj.name] = symObj elif isinstance(symObj, MibScalarInstance): instances[symObj.name] = symObj elif isinstance(symObj, MibScalar): scalars[symObj.name] = symObj # Detach items from each other for symName, parentName in self.lastBuildSyms.items(): if parentName in scalars: scalars[parentName].unregisterSubtrees(symName) elif parentName in cols: cols[parentName].unregisterSubtrees(symName) elif parentName in rows: rows[parentName].unregisterSubtrees(symName) else: mibTree.unregisterSubtrees(symName) lastBuildSyms = {} # Attach Managed Objects Instances to Managed Objects for inst in instances.values(): if inst.typeName in scalars: scalars[inst.typeName].registerSubtrees(inst) elif inst.typeName in cols: cols[inst.typeName].registerSubtrees(inst) else: raise error.SmiError( 'Orphan MIB scalar instance %s at %s' % (inst, self) ) lastBuildSyms[inst.name] = inst.typeName # Attach Table Columns to Table Rows for col in cols.values(): rowName = col.name[:-1] # XXX if rowName in rows: rows[rowName].registerSubtrees(col) else: raise error.SmiError( 'Orphan MIB table column %s at %s' % (col, self) ) lastBuildSyms[col.name] = rowName # Attach Table Rows to MIB tree for row in rows.values(): mibTree.registerSubtrees(row) lastBuildSyms[row.name] = mibTree.name # Attach Tables to MIB tree for table in tables.values(): mibTree.registerSubtrees(table) lastBuildSyms[table.name] = mibTree.name # Attach Scalars to MIB tree for scalar in scalars.values(): mibTree.registerSubtrees(scalar) lastBuildSyms[scalar.name] = mibTree.name self.lastBuildSyms = lastBuildSyms self.lastBuildId = self.mibBuilder.lastBuildId debug.logger & debug.flagIns and debug.logger('__indexMib: rebuilt') # MIB instrumentation def flipFlopFsm(self, fsmTable, inputNameVals, (acFun, acCtx)): self.__indexMib() debug.logger & debug.flagIns and debug.logger('flipFlopFsm: inputNameVals %s' % repr(inputNameVals)) mibTree, = self.mibBuilder.importSymbols('SNMPv2-SMI', 'iso') outputNameVals = [] state, status = 'start', 'ok' myErr = None while 1: k = (state, status) if k in fsmTable: fsmState = fsmTable[k] else: k = ('*', status) if k in fsmTable: fsmState = fsmTable[k] else: raise error.SmiError( 'Unresolved FSM state %s, %s' % (state, status) ) debug.logger & debug.flagIns and debug.logger('flipFlopFsm: state %s status %s -> fsmState %s' % (state, status, fsmState)) state = fsmState status = 'ok' if state == 'stop': break idx = 0 for name, val in inputNameVals: f = getattr(mibTree, state, None) if f is None: raise error.SmiError( 'Unsupported state handler %s at %s' % (state, self) ) try: # Convert to tuple to avoid ObjectName instantiation # on subscription rval = f(tuple(name), val, idx, (acFun, acCtx)) except error.SmiError, why: debug.logger & debug.flagIns and debug.logger('flipFlopFsm: fun %s failed %s for %s=%s' % (f, why, name, repr(val))) if myErr is None: # Take the first exception myErr = why status = 'err' break else: debug.logger & debug.flagIns and debug.logger('flipFlopFsm: fun %s suceeded for %s=%s' % (f, name, repr(val))) if rval is not None: outputNameVals.append((rval[0], rval[1])) idx = idx + 1 if myErr: raise myErr return outputNameVals def readVars(self, vars, (acFun, acCtx)=(None, None)): return self.flipFlopFsm(self.fsmReadVar, vars, (acFun, acCtx)) def readNextVars(self, vars, (acFun, acCtx)=(None, None)): return self.flipFlopFsm(self.fsmReadNextVar, vars, (acFun, acCtx)) def writeVars(self, vars, (acFun, acCtx)=(None, None)): return self.flipFlopFsm(self.fsmWriteVar, vars, (acFun, acCtx)) # This version of the above method skips "test" phase for performance def readVarsFast(self, vars, (acFun, acCtx)=(None, None)): return self.flipFlopFsm(self.fsmReadVarFast, vars, (acFun, acCtx)) PKAq>[v;;pysnmp/smi/instrum.pyc; |8Mc@sGdklZdklZdklZdgZdfdYZdS((s InstanceType(serror(sdebugsMibInstrumControllercBstZhddfd<ddfd<ddfd<ddfdfss#Orphan MIB scalar instance %s at %sis Orphan MIB table column %s at %ss__indexMib: rebuilt(,sselfs lastBuildIds mibBuilders importSymbolssMibScalarInstances MibScalarsMibTableColumns MibTableRowsMibTablesMibTreesmibTreesscalarss instancesstablessrowsscolss mibSymbolssitemsssortsmodNamesmibModsvaluesssymObjstypes InstanceTypes isinstancesnames lastBuildSymsssymNames parentNamesunregisterSubtreessinststypeNamesregisterSubtreesserrorsSmiErrorscolsrowNamesrowstablesscalarsdebugsloggersflagIns(sselfsrowNames MibScalars lastBuildSymss parentNamescolss instancessscalarstables mibSymbolsstablessrowssMibTableColumnsMibTablesmibTreesrowsmodNames MibTableRowsscalarsssymNamesMibScalarInstancesMibTreessymObjsmibModsinstscol((s0build/bdist.linux-i686/egg/pysnmp/smi/instrum.pys __indexMib7s                  cCs|\}}|ititi@otidt||i i dd\} g}ddf\} } t}xno| | f}||jo||} nAd| f}||jo||} ntid| | ftiti@otid | | | f| } d} | d joPnd }xI|D]A\}}t| | t}|tjotid | |fny%|t|||||f} Wnjtij o[}titi@o#tid |||t|f|tjo |}nd} Pn_Xtiti@o tid||t|f| tj o|i| d | dfn|d}q;Wq~W|o |n|SdS(NsflipFlopFsm: inputNameVals %ss SNMPv2-SMIsisosstartsokis*sUnresolved FSM state %s, %ss.flipFlopFsm: state %s status %s -> fsmState %ssstopis"Unsupported state handler %s at %ss'flipFlopFsm: fun %s failed %s for %s=%sserrs&flipFlopFsm: fun %s suceeded for %s=%s(sacFunsacCtxsselfs_MibInstrumController__indexMibsdebugsloggersflagInssreprs inputNameValss mibBuilders importSymbolssmibTreesoutputNameValssstatesstatussNonesmyErrsksfsmTablesfsmStateserrorsSmiErrorsidxsnamesvalsgetattrsfstuplesrvalswhysappend(sselfsfsmTables inputNameValss.6sacFunsacCtxsoutputNameValssmyErrsvalsrvalsstatesmibTreesstatussfsmStateswhysnamesidxsfsk((s0build/bdist.linux-i686/egg/pysnmp/smi/instrum.pys flipFlopFsmsR  (    +   %4  1  cCs,|\}}|i|i|||fSdS(N(sacFunsacCtxsselfs flipFlopFsms fsmReadVarsvars(sselfsvarss.4sacFunsacCtx((s0build/bdist.linux-i686/egg/pysnmp/smi/instrum.pysreadVarss cCs,|\}}|i|i|||fSdS(N(sacFunsacCtxsselfs flipFlopFsmsfsmReadNextVarsvars(sselfsvarss.4sacFunsacCtx((s0build/bdist.linux-i686/egg/pysnmp/smi/instrum.pys readNextVarss cCs,|\}}|i|i|||fSdS(N(sacFunsacCtxsselfs flipFlopFsms fsmWriteVarsvars(sselfsvarss.4sacFunsacCtx((s0build/bdist.linux-i686/egg/pysnmp/smi/instrum.pys writeVarss cCs,|\}}|i|i|||fSdS(N(sacFunsacCtxsselfs flipFlopFsmsfsmReadVarFastsvars(sselfsvarss.4sacFunsacCtx((s0build/bdist.linux-i686/egg/pysnmp/smi/instrum.pys readVarsFasts (s__name__s __module__s fsmReadVarsfsmReadVarFastsfsmReadNextVars fsmWriteVars__init__s_MibInstrumController__indexMibs flipFlopFsmsNonesreadVarss readNextVarss writeVarss readVarsFast(((s0build/bdist.linux-i686/egg/pysnmp/smi/instrum.pysMibInstrumControllersB3B  { 2N(stypess InstanceTypes pysnmp.smiserrorspysnmpsdebugs__all__sMibInstrumController(sdebugsMibInstrumControllers InstanceTypes__all__serror((s0build/bdist.linux-i686/egg/pysnmp/smi/instrum.pys?s    PKAq>q``pysnmp/smi/indices.pyc; :8Mc@sodZdklZlZdklZlZlZdklZdefdYZ de fdYZ dS( s-Ordered dictionaries classes used for indices(sDictTypes TupleType(sjoinssplitsatol(sbisects OrderedDictcBstZdZdZdZdZdZeZdZdZ dZ d Z d Z d Z d Zd ZdZRS(NcKsAg|_d|_tt|i|o|i|ndS(Ni(sselfs_OrderedDict__keyss_OrderedDict__dirtyssupers OrderedDicts__init__skwargssupdate(sselfskwargs((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys__init__s   cCsG||jo|ii|ntt|i||d|_dS(Ni( skeysselfs_OrderedDict__keyssappendssupers OrderedDicts __setitem__svalues_OrderedDict__dirty(sselfskeysvalue((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys __setitem__ s cCs/|io|intt|iSdS(N(sselfs_OrderedDict__dirtys_OrderedDict__orderssupers OrderedDicts__repr__(sself((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys__repr__s cCs/|io|intt|iSdS(N(sselfs_OrderedDict__dirtys_OrderedDict__orderssupers OrderedDicts__str__(sself((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys__str__s cCsPtt|i|o|ii|ntt|i|d|_dS(Ni( ssupers OrderedDictsselfs __contains__skeys_OrderedDict__keyssremoves __delitem__s_OrderedDict__dirty(sselfskey((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys __delitem__scCs)tt|ig|_d|_dS(Ni(ssupers OrderedDictsselfsclears_OrderedDict__keyss_OrderedDict__dirty(sself((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pysclears cCs)|io|int|iSdS(N(sselfs_OrderedDict__dirtys_OrderedDict__orderslists_OrderedDict__keys(sself((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pyskeys"s cCs2|io|int|d|iSdS(NcCs||S(N(sdsk(sksd((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys's(sselfs_OrderedDict__dirtys_OrderedDict__ordersmaps_OrderedDict__keys(sself((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pysvalues%s cCs2|io|int|d|iSdS(NcCs|||fS(N(sksd(sksd((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys*s(sselfs_OrderedDict__dirtys_OrderedDict__ordersmaps_OrderedDict__keys(sself((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pysitems(s cCst|d|idS(NcCs|\}}|i||S(N(sksvsselfs __setitem__(s.0sselfsksv((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys,s(smapsselfsdsitems(sselfsd((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pysupdate+scCs|idS(N(skeysssort(sselfskeys((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys sortingFun-scCsv|i|ih}x!|iD]}d|t|Pss.( skeysselfs_OidOrderedDict__keysCachestypes TupleTypesmapsfiltersNonessplits OrderedDicts __setitem__svalue(sselfskeysvalue((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys __setitem__Js /cCs2||ijo|i|=nti||dS(N(skeysselfs_OidOrderedDict__keysCaches OrderedDicts __delitem__(sselfskey((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys __delitem__TscCs|d}|i|dS(NcCst|i||i|SdS(N(scmpsselfs_OidOrderedDict__keysCacheso1so2(so1so2sself((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pysf[s(sselfsfskeysssort(sselfskeyssf((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys sortingFunZs (s__name__s __module__s__init__s __setitem__s __delitem__s __delattr__s sortingFun(((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pysOidOrderedDictEs   N( s__doc__stypessDictTypes TupleTypesstringsjoinssplitsatolsbisects OrderedDictsOidOrderedDict(sDictTypesjoinsbisectsOidOrderedDictssplitsatols OrderedDicts TupleType((s0build/bdist.linux-i686/egg/pysnmp/smi/indices.pys?s  ?PKAq>0FgϠpysnmp/smi/__init__.pyc; ƔAc@s dZdS(sSNMP SMIN(s__doc__(((s1build/bdist.linux-i686/egg/pysnmp/smi/__init__.pys?sPK6>̷..pysnmp/smi/view.py# MIB modules management from types import ClassType, InstanceType, TupleType from pysnmp.smi.indices import OrderedDict, OidOrderedDict from pysnmp.smi import error from pysnmp import debug __all__ = [ 'MibViewController' ] class MibViewController: def __init__(self, mibBuilder): self.mibBuilder = mibBuilder self.lastBuildId = -1 # Indexing part def indexMib(self): if self.lastBuildId == self.mibBuilder.lastBuildId: return debug.logger & debug.flagMIB and debug.logger('indexMib: re-indexing MIB view') MibScalarInstance, = self.mibBuilder.importSymbols( 'SNMPv2-SMI', 'MibScalarInstance' ) # # Create indices # # Module name -> module-scope indices self.__mibSymbolsIdx = OrderedDict() # Oid <-> label indices # This is potentionally ambiguous mapping. Sort modules in # ascending age for resolution def __sortFun(x, y, s=self.mibBuilder.mibSymbols): if "PYSNMP_MODULE_ID" in s[x]: m1 = s[x]["PYSNMP_MODULE_ID"] else: m1 = None if "PYSNMP_MODULE_ID" in s[y]: m2 = s[y]["PYSNMP_MODULE_ID"] else: m2 = None r1 = r2 = "1970-01-01 00:00" if m1: r = m1.getRevisions() if r: r1 = r[0] if m2: r = m2.getRevisions() if r: r2 = r[0] return cmp(r1, r2) modNames = self.mibBuilder.mibSymbols.keys() modNames.sort(__sortFun) # Index modules names for modName in [ '' ] + modNames: # Modules index self.__mibSymbolsIdx[modName] = mibMod = { 'oidToLabelIdx': OidOrderedDict(), 'labelToOidIdx': {}, 'varToNameIdx': {}, 'typeToModIdx': OrderedDict(), 'oidToModIdx': {} } if not modName: globMibMod = mibMod continue # Types & MIB vars indices for n, v in self.mibBuilder.mibSymbols[modName].items(): if n == "PYSNMP_MODULE_ID": # do not index this special symbol continue if type(v) == ClassType: if n in mibMod['typeToModIdx']: raise error.SmiError( 'Duplicate SMI type %s::%s, has %s' % \ (modName, n, mibMod['typeToModIdx'][n]) ) globMibMod['typeToModIdx'][n] = modName mibMod['typeToModIdx'][n] = modName elif type(v) == InstanceType: if isinstance(v, MibScalarInstance): continue if n in mibMod['varToNameIdx']: raise error.SmiError( 'Duplicate MIB variable %s::%s has %s' % \ (modName, n, mibMod['varToNameIdx'][n]) ) globMibMod['varToNameIdx'][n] = v.name mibMod['varToNameIdx'][n] = v.name # Potentionally ambiguous mapping ahead globMibMod['oidToModIdx'][v.name] = modName mibMod['oidToModIdx'][v.name] = modName globMibMod['oidToLabelIdx'][v.name] = (n, ) mibMod['oidToLabelIdx'][v.name] = (n, ) else: raise error.SmiError( 'Unexpected object %s::%s' % (modName, n) ) # Build oid->long-label index oidToLabelIdx = self.__mibSymbolsIdx['']['oidToLabelIdx'] labelToOidIdx = self.__mibSymbolsIdx['']['labelToOidIdx'] if oidToLabelIdx: prevOid = oidToLabelIdx.keys()[0] else: prevOid = () baseLabel = () for key in oidToLabelIdx.keys(): keydiff = len(key) - len(prevOid) if keydiff > 0: baseLabel = oidToLabelIdx[prevOid] if keydiff > 1: baseLabel = baseLabel + key[-keydiff:-1] if keydiff < 0: keyLen = len(key) i = keyLen-1 while i: k = key[:i] if k in oidToLabelIdx: baseLabel = oidToLabelIdx[k] if i != keyLen-1: baseLabel = baseLabel + key[i:-1] break i = i - 1 # Build oid->long-label index oidToLabelIdx[key] = baseLabel + oidToLabelIdx[key] # Build label->oid index labelToOidIdx[oidToLabelIdx[key]] = key prevOid = key # Build module-scope oid->long-label index for mibMod in self.__mibSymbolsIdx.values(): for oid in mibMod['oidToLabelIdx'].keys(): mibMod['oidToLabelIdx'][oid] = oidToLabelIdx[oid] mibMod['labelToOidIdx'][oidToLabelIdx[oid]] = oid self.lastBuildId = self.mibBuilder.lastBuildId # Module management def getFirstModuleName(self): self.indexMib() modNames = self.__mibSymbolsIdx.keys() if modNames: return modNames[0] raise error.SmiError('No modules loaded at %s' % self) def getNextModuleName(self, modName): self.indexMib() try: return self.__mibSymbolsIdx.nextKey(modName) except KeyError: raise error.SmiError( 'No module next to %s at %s' % (modName, self) ) # MIB tree node management def __getOidLabel(self, nodeName, oidToLabelIdx, labelToOidIdx): """getOidLabel(nodeName) -> (oid, label, suffix)""" if not nodeName: return nodeName, nodeName, () if nodeName in labelToOidIdx: return labelToOidIdx[nodeName], nodeName, () if nodeName in oidToLabelIdx: return nodeName, oidToLabelIdx[nodeName], () if len(nodeName) < 2: return nodeName, nodeName, () oid, label, suffix = self.__getOidLabel( nodeName[:-1], oidToLabelIdx, labelToOidIdx ) suffix = suffix + nodeName[-1:] resLabel = label + suffix if resLabel in labelToOidIdx: return labelToOidIdx[resLabel], resLabel, () resOid = oid + suffix if resOid in oidToLabelIdx: return resOid, oidToLabelIdx[resOid], () return oid, label, suffix def getNodeNameByOid(self, nodeName, modName=''): self.indexMib() if modName in self.__mibSymbolsIdx: mibMod = self.__mibSymbolsIdx[modName] else: raise error.SmiError( 'No module %s at %s' % (modName, self) ) oid, label, suffix = self.__getOidLabel( nodeName, mibMod['oidToLabelIdx'], mibMod['labelToOidIdx'] ) if oid == label: raise error.NoSuchObjectError( str='Can\'t resolve node name %s::%s at %s' % (modName, nodeName, self) ) debug.logger & debug.flagMIB and debug.logger('getNodeNameByOid: resolved %s:%s -> %s' % (modName, nodeName, label + suffix)) return oid, label, suffix def getNodeNameByDesc(self, nodeName, modName=''): self.indexMib() if modName in self.__mibSymbolsIdx: mibMod = self.__mibSymbolsIdx[modName] else: raise error.SmiError( 'No module %s at %s' % (modName, self) ) if nodeName in mibMod['varToNameIdx']: oid = mibMod['varToNameIdx'][nodeName] else: raise error.NoSuchObjectError( str='No such symbol %s::%s at %s' % (modName, nodeName, self) ) debug.logger & debug.flagMIB and debug.logger('getNodeNameByDesc: resolved %s:%s -> %s' % (modName, nodeName, oid)) return self.getNodeNameByOid(oid, modName) def getNodeName(self, nodeName, modName=''): # nodeName may be either an absolute OID/label or a # ( MIB-symbol, su, ff, ix) try: # First try nodeName as an OID/label return self.getNodeNameByOid(nodeName, modName) except error.NoSuchObjectError: # ...on failure, try as MIB symbol oid, label, suffix = self.getNodeNameByDesc( nodeName[0], modName ) # ...with trailing suffix return self.getNodeNameByOid( oid + suffix + nodeName[1:], modName ) def getFirstNodeName(self, modName=''): self.indexMib() if modName in self.__mibSymbolsIdx: mibMod = self.__mibSymbolsIdx[modName] else: raise error.SmiError( 'No module %s at %s' % (modName, self) ) if not mibMod['oidToLabelIdx']: raise error.NoSuchObjectError( str='No variables at MIB module %s at %s' % (modName, self) ) oid, label = mibMod['oidToLabelIdx'].items()[0] return oid, label, () def getNextNodeName(self, nodeName, modName=''): oid, label, suffix = self.getNodeName(nodeName, modName) try: return self.getNodeName( self.__mibSymbolsIdx[modName]['oidToLabelIdx'].nextKey(oid) + suffix, modName ) except KeyError: raise error.NoSuchObjectError( str='No name next to %s::%s at %s' % (modName, nodeName, self) ) def getParentNodeName(self, nodeName, modName=''): oid, label, suffix = self.getNodeName(nodeName, modName) if len(oid) < 2: raise error.NoSuchObjectError( str='No parent name for %s::%s at %s' % (modName, nodeName, self) ) return oid[:-1], label[:-1], oid[-1:] + suffix def getNodeLocation(self, nodeName, modName=''): oid, label, suffix = self.getNodeName(nodeName, modName) return self.__mibSymbolsIdx['']['oidToModIdx'][oid], label[-1], suffix # MIB type management def getTypeName(self, typeName, modName=''): self.indexMib() if modName in self.__mibSymbolsIdx: mibMod = self.__mibSymbolsIdx[modName] else: raise error.SmiError( 'No module %s at %s' % (modName, self) ) if typeName in mibMod['typeToModIdx']: m = mibMod['typeToModIdx'][typeName] else: raise error.NoSuchObjectError( str='No such type %s::%s at %s' % (modName, typeName, self) ) return m, typeName def getFirstTypeName(self, modName=''): self.indexMib() if modName in self.__mibSymbolsIdx: mibMod = self.__mibSymbolsIdx[modName] else: raise error.SmiError( 'No module %s at %s' % (modName, self) ) if not mibMod['typeToModIdx']: raise error.NoSuchObjectError( str='No types at MIB module %s at %s' % (modName, self) ) t = mibMod['typeToModIdx'].keys()[0] return mibMod['typeToModIdx'][t], t def getNextType(self, typeName, modName=''): m, t = self.getTypeName(typeName, modName) try: return self.__mibSymbolsIdx[m]['typeToModIdx'].nextKey(t) except KeyError: raise error.NoSuchObjectError( str='No type next to %s::%s at %s' % (modName, typeName, self) ) PKAq>)p99pysnmp/smi/builder.pyc; ixMc@sdkZdkZdkZdkZdkZdkZdkZdklZdk l Z dfdYZ de fdYZ de fdYZ d fd YZdS( N(serror(sdebugs__AbstractMibSourcecBsMtZdZdZdZdddZdZdZdZRS( NcCs||_ti|_h|_xatiD]S\}}}||ijog|i|Wq Wt |iSdS(Ni s __init__.(susfilessfsimps PY_SOURCEs PY_COMPILEDstypsselfs_AbstractMibSource__sfxssfxssfxLensmodesNonestupleskeys(sselfsfilesssfxsfssfxLensusmodestyp((s0build/bdist.linux-i686/egg/pysnmp/smi/builder.pys _uniqNamessscCs(|i|oti||pdSdS(Ns(sselfs_srcNamesfsosssepssfx(sselfsfssfx((s0build/bdist.linux-i686/egg/pysnmp/smi/builder.pysfullPath"scCs|iSdS(N(sselfs_init(sself((s0build/bdist.linux-i686/egg/pysnmp/smi/builder.pysinit%scCs|iSdS(N(sselfs_listdir(sself((s0build/bdist.linux-i686/egg/pysnmp/smi/builder.pyslistdir&sc Csx|itiD]\} }}tii |i || }y|i ||} Wntj o d}qX|i| d jo3| d} tid| d d}| d} Pqtiti@otid|d}qWtiti@otid||fxs|itiD]a\}} }tii |i ||}y|i|}Wnttfj o d}qXPqWtiti@otid||f|djo ||joti| | fSn|djo|i |||fSntddS(NiistitiddD]}|i t|i qWn|ioWxTti|idD]9}y|i t |i Wqtj oqXqWnh|_h|_h|_t|i|dS(NlsPYSNMP_MIB_PKGSs:sPYSNMP_MIB_DIRsPYSNMP_MIB_DIRS(sselfs lastBuildIds _autoNamessourcessstringssplitsossenvironsgetsdefaultCoreMibssmsappends ZipMibSourcesinits DirMibSourcesdefaultMiscMibss ImportErrors mibSymbolss_MibBuilder__modSeens_MibBuilder__modPathsSeensapplys setMibSources(sselfsmssources((s0build/bdist.linux-i686/egg/pysnmp/smi/builder.pys__init__s,%!     cGs5||_titi@otid|ifdS(NssetMibPath: new MIB sources %s(s mibSourcessselfs_MibBuilder__mibSourcessdebugsloggersflagBld(sselfs mibSources((s0build/bdist.linux-i686/egg/pysnmp/smi/builder.pys setMibSourcess cCs |iSdS(N(sselfs_MibBuilder__mibSources(sself((s0build/bdist.linux-i686/egg/pysnmp/smi/builder.pys getMibSourcesscGst|itt|dS(N(sapplysselfs setMibSourcessmaps DirMibSourcesmibPaths(sselfsmibPaths((s0build/bdist.linux-i686/egg/pysnmp/smi/builder.pys setMibPathscCsRg}x;|iD]-}t|to|i|iqqWt|SdS(N( slsselfs getMibSourcess mibSources isinstances DirMibSourcesappendsfullPathstuple(sselfs mibSourcesl((s0build/bdist.linux-i686/egg/pysnmp/smi/builder.pys getMibPaths  c Fs_| oKh}x2|iD]'}x|iD]}e||1܎  pysnmp/smi/indices.py"""Ordered dictionaries classes used for indices""" from types import DictType, TupleType from string import join, split, atol from bisect import bisect class OrderedDict(DictType): def __init__(self, **kwargs): self.__keys = [] self.__dirty = 1 super(OrderedDict, self).__init__() if kwargs: self.update(kwargs) def __setitem__(self, key, value): if key not in self: self.__keys.append(key) super(OrderedDict, self).__setitem__(key, value) self.__dirty = 1 def __repr__(self): if self.__dirty: self.__order() return super(OrderedDict, self).__repr__() def __str__(self): if self.__dirty: self.__order() return super(OrderedDict, self).__str__() def __delitem__(self, key): if super(OrderedDict, self).__contains__(key): self.__keys.remove(key) super(OrderedDict, self).__delitem__(key) self.__dirty = 1 __delattr__ = __delitem__ def clear(self): super(OrderedDict, self).clear() self.__keys = [] self.__dirty = 1 def keys(self): if self.__dirty: self.__order() return list(self.__keys) def values(self): if self.__dirty: self.__order() return map(lambda k, d=self: d[k], self.__keys) def items(self): if self.__dirty: self.__order() return map(lambda k, d=self: (k, d[k]), self.__keys) def update(self, d): map(lambda (k, v), self=self: self.__setitem__(k, v), d.items()) def sortingFun(self, keys): keys.sort() def __order(self): self.sortingFun(self.__keys) d = {} for k in self.__keys: d[len(k)] = 1 l = d.keys() l.sort(); l.reverse() self.__keysLens = tuple(l) self.__dirty = 0 def nextKey(self, key): keys = self.keys() if key in self: nextIdx = keys.index(key) + 1 else: nextIdx = bisect(keys, key) if nextIdx < len(keys): return keys[nextIdx] else: raise KeyError(key) def getKeysLens(self): if self.__dirty: self.__order() return self.__keysLens class OidOrderedDict(OrderedDict): def __init__(self, **kwargs): self.__keysCache = {} apply(OrderedDict.__init__, [self], kwargs) def __setitem__(self, key, value): if key not in self.__keysCache: if type(key) == TupleType: self.__keysCache[key] = key else: self.__keysCache[key] = map( lambda x: atol(x), filter(None, split(key, '.')) ) OrderedDict.__setitem__(self, key, value) def __delitem__(self, key): if key in self.__keysCache: del self.__keysCache[key] OrderedDict.__delitem__(self, key) __delattr__ = __delitem__ def sortingFun(self, keys): def f(o1, o2, self=self): return cmp(self.__keysCache[o1], self.__keysCache[o2]) keys.sort(f) PK}j>5--pysnmp/smi/builder.py# MIB modules loader import os, types, string import imp, struct, marshal, time from pysnmp.smi import error from pysnmp import debug class __AbstractMibSource: def __init__(self, srcName): self._srcName = srcName self.__magic = imp.get_magic() self.__sfx = {} for sfx, mode, typ in imp.get_suffixes(): if typ not in self.__sfx: self.__sfx[typ] = [] self.__sfx[typ].append((sfx, len(sfx), mode)) debug.logger & debug.flagBld and debug.logger('trying %s' % self) def __repr__(self): return '%s(\'%s\')' % (self.__class__.__name__, self._srcName) def _uniqNames(self, files): u = {} for f in files: if f[:9] == '__init__.': continue for typ in (imp.PY_SOURCE, imp.PY_COMPILED): for sfx, sfxLen, mode in self.__sfx[typ]: if f[-sfxLen:] == sfx: u[f[:-sfxLen]] = None return tuple(u.keys()) # MibSource API follows def fullPath(self, f='', sfx=''): return self._srcName + (f and (os.sep + f + sfx) or '') def init(self): return self._init() def listdir(self): return self._listdir() def read(self, f): for pycSfx, pycSfxLen, pycMode in self.__sfx[imp.PY_COMPILED]: p = os.path.join(self._srcName, f) + pycSfx try: pycData = self._getData(p, pycMode) except IOError: pycTime = -1 else: if self.__magic == pycData[:4]: pycData = pycData[4:] pycTime = struct.unpack('= pyTime: return marshal.loads(pycData), pycSfx if pyTime != -1: return self._getData(p, pyMode), pySfx raise IOError('No suitable module found') class ZipMibSource(__AbstractMibSource): def _init(self): p = __import__( self._srcName, globals(),locals(), string.split(self._srcName, '.') ) if hasattr(p, '__loader__'): self.__loader = p.__loader__ self._srcName = string.replace(self._srcName, '.', os.sep) return self else: return DirMibSource(os.path.split(p.__file__)[0]).init() def _parseDosTime(self, dosdate, dostime): t = ( ((dosdate >> 9) & 0x7f) + 1980, # year ((dosdate >> 5) & 0x0f), # month dosdate & 0x1f, # mday (dostime >> 11) & 0x1f, # hour (dostime >> 5) & 0x3f, # min (dostime & 0x1f) * 2, # sec -1, # wday -1, # yday -1 ) # dst return time.mktime(t) def _listdir(self): l = [] for f in self.__loader._files.keys(): d, f = os.path.split(f) if d == self._srcName: l.append(f) return tuple(self._uniqNames(l)) def _getTimestamp(self, p): if p in self.__loader._files: return self._parseDosTime( self.__loader._files[p][6], self.__loader._files[p][5] ) else: raise IOError('No file in ZIP: %s' % p) def _getData(self, p, mode=None): return self.__loader.get_data(p) class DirMibSource(__AbstractMibSource): def _init(self): self._srcName = os.path.normpath(self._srcName) return self def _listdir(self): return self._uniqNames(os.listdir(self._srcName)) def _getTimestamp(self, p): return os.stat(p)[8] def _getData(self, p, mode): return open(p, mode).read() class MibBuilder: loadTexts = 0 defaultCoreMibs = 'pysnmp.smi.mibs.instances:pysnmp.smi.mibs' defaultMiscMibs = 'pysnmp_mibs' def __init__(self): self.lastBuildId = self._autoName = 0L sources = [] for m in string.split( os.environ.get('PYSNMP_MIB_PKGS', self.defaultCoreMibs), ':' ): sources.append(ZipMibSource(m).init()) # Compatibility variable if 'PYSNMP_MIB_DIR' in os.environ: os.environ['PYSNMP_MIB_DIRS'] = os.environ['PYSNMP_MIB_DIR'] if 'PYSNMP_MIB_DIRS' in os.environ: for m in string.split(os.environ['PYSNMP_MIB_DIRS'], ':'): sources.append(DirMibSource(m).init()) if self.defaultMiscMibs: for m in string.split(self.defaultMiscMibs, ':'): try: sources.append(ZipMibSource(m).init()) except ImportError: pass self.mibSymbols = {} self.__modSeen = {} self.__modPathsSeen = {} apply(self.setMibSources, sources) # MIB modules management def setMibSources(self, *mibSources): self.__mibSources = mibSources debug.logger & debug.flagBld and debug.logger('setMibPath: new MIB sources %s' % (self.__mibSources,)) def getMibSources(self): return self.__mibSources # Legacy/compatibility methods def setMibPath(self, *mibPaths): apply(self.setMibSources, map(DirMibSource, mibPaths)) def getMibPath(self): l = [] for mibSource in self.getMibSources(): if isinstance(mibSource, DirMibSource): l.append(mibSource.fullPath()) return tuple(l) def loadModules(self, *modNames): # Build a list of available modules if not modNames: modNames = {} for mibSource in self.__mibSources: for modName in mibSource.listdir(): modNames[modName] = None modNames = modNames.keys() if not modNames: raise error.SmiError( 'No MIB module to load at %s' % (self,) ) for modName in modNames: for mibSource in self.__mibSources: debug.logger & debug.flagBld and debug.logger('loadModules: trying %s at %s' % (modName, mibSource)) try: modData, sfx = mibSource.read(modName) except IOError, why: debug.logger & debug.flagBld and debug.logger('loadModules: read %s from %s failed: %s' % (modName, mibSource, why)) continue modPath = mibSource.fullPath(modName, sfx) if modPath in self.__modPathsSeen: debug.logger & debug.flagBld and debug.logger('loadModules: seen %s' % modPath) break else: self.__modPathsSeen[modPath] = 1 debug.logger & debug.flagBld and debug.logger('loadModules: evaluating %s' % modPath) g = { 'mibBuilder': self } try: exec(modData, g) except StandardError, why: del self.__modPathsSeen[modPath] raise error.SmiError( 'MIB module \"%s\" load error: %s' % (modPath, why) ) self.__modSeen[modName] = modPath debug.logger & debug.flagBld and debug.logger('loadModules: loaded %s' % modPath) break if modName not in self.__modSeen: raise error.SmiError( 'MIB file \"%s\" not found in search path' % (modName and modName + ".py[co]") ) return self def unloadModules(self, *modNames): if not modNames: modNames = self.mibSymbols.keys() for modName in modNames: if modName not in self.mibSymbols: raise error.SmiError( 'No module %s at %s' % (modName, self) ) self.unexportSymbols(modName) del self.__modPathsSeen[self.__modSeen[modName]] del self.__modSeen[modName] debug.logger & debug.flagBld and debug.logger('unloadModules: ' % (modName)) return self def importSymbols(self, modName, *symNames): if not modName: raise error.SmiError( 'importSymbols: empty MIB module name' ) r = () for symName in symNames: if modName not in self.mibSymbols: self.loadModules(modName) if modName not in self.mibSymbols: raise error.SmiError( 'No module %s loaded at %s' % (modName, self) ) if symName not in self.mibSymbols[modName]: raise error.SmiError( 'No symbol %s::%s at %s' % (modName, symName, self) ) r = r + (self.mibSymbols[modName][symName],) return r def exportSymbols(self, modName, *anonymousSyms, **namedSyms): if modName not in self.mibSymbols: self.mibSymbols[modName] = {} mibSymbols = self.mibSymbols[modName] for symObj in anonymousSyms: debug.logger & debug.flagBld and debug.logger('exportSymbols: anonymous symbol %s::__pysnmp_%ld' % (modName, self._autoName)) mibSymbols['__pysnmp_%ld' % self._autoName] = symObj self._autoName = self._autoName + 1 for symName, symObj in namedSyms.items(): if symName in mibSymbols: raise error.SmiError( 'Symbol %s already exported at %s' % (symName, modName) ) if hasattr(symObj, 'label'): symName = symObj.label or symName # class if type(symObj) == types.InstanceType: symName = symObj.getLabel() or symName # class instance mibSymbols[symName] = symObj debug.logger & debug.flagBld and debug.logger('exportSymbols: symbol %s::%s' % (modName, symName)) self.lastBuildId = self.lastBuildId + 1 def unexportSymbols(self, modName, *symNames): if modName not in self.mibSymbols: raise error.SmiError( 'No module %s at %s' % (modName, self) ) mibSymbols = self.mibSymbols[modName] if not symNames: symNames = mibSymbols.keys() for symName in symNames: if symName not in mibSymbols: raise error.SmiError( 'No symbol %s::%s at %s' % (modName, symName, self) ) del mibSymbols[symName] debug.logger & debug.flagBld and debug.logger('unexportSymbols: symbol %s::%s' % (modName, symName)) if not self.mibSymbols[modName]: del self.mibSymbols[modName] self.lastBuildId = self.lastBuildId + 1 PKAq>_MY=~~pysnmp/smi/mibs/ASN1.pyc; 1Bc @svdklZdklZeiZeiZeiZeiZei Z e i ddedededede dS( (suniv(srfc1902sASN1sIntegers OctetStrings BitStringsNullsObjectIdentifierN( s pyasn1.typesunivs pysnmp.protosrfc1902s Integer32sIntegers OctetStrings BitStringsNullsObjectIdentifiers mibBuilders exportSymbols(s OctetStringsrfc1902s BitStringsObjectIdentifiersIntegersNullsuniv((s2build/bdist.linux-i686/egg/pysnmp/smi/mibs/ASN1.pys?s       PKAq>RnG??pysnmp/smi/mibs/SNMPv2-SMI.pyc; ;McN@shdkZdklZdklZlZdklZdkl Z dk l Z l Z dk lZlZeiddd d \ZZZeiZeiZeiZeiZeiZeiZeiZeiZeiZeiZd efd YZd fdYZ de fdYZ!de fdYZ"de fdYZ#de fdYZ$de fdYZ%de%fdYZ&de&fdYZ'de&fdYZ(de'fd YZ)d!e&fd"YZ*d#e&fd$YZ+e"d%d%fZ,e&d&fZ-e$e-i.d'fZ/e$e/i.d(fZ0e$e0i.d&fZ1e$e1i.d&fZ2e$e1i.d)fZ3e$e3i.d&fZ4d*e4_5e$e4i.d+fZ6e$e1i.d'fZ7e$e1i.d,fZ8e$e8i.d&fZ9e$e1i.d-fZ:e$e1i.d(fZ;e$e;i.d&fZ<e$e;i.d)fZ=e$e;i.d'fZ>ei?d.d/ed0ed1ed2ed3ed4ed5ed6ed7ed ed e de!de"de#de'de(de$de&de)d!e*d#e+d8e,d9e-d:e/d;e0d<e1d=e2d>e3d?e4d@e6dAe7dBe8dCe9dDe:dEe;dFe<dGe=dHe>&dS(IN(sOidOrderedDict(sexvalserror(srfc1902(s constraint(sValueConstraintErrors PyAsn1Error(scachesdebugsASN1sIntegersObjectIdentifiersNulls ExtUTCTimecBs9tZeieieiddeiddZRS(Ni i (s__name__s __module__s OctetStrings subtypeSpecs constraintsConstraintsUnionsValueSizeConstraint(((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys ExtUTCTimessMibNodecBsGtZdZdZdZdZdZdZedZ RS(NscCs ||_dS(N(snamesself(sselfsname((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys__init__scCsd|ii|ifSdS(Ns%s(%s)(sselfs __class__s__name__sname(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys__repr__"scCs |iSdS(N(sselfsname(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysgetName%scCs |iSdS(N(sselfslabel(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysgetLabel'scCs||_|SdS(N(slabelsself(sselfslabel((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pyssetLabel(s cCsT|i|i}|tj o ||_n|itj o|i|_n|SdS(N(sselfs __class__snamesmyClonesNoneslabel(sselfsnamesmyClone((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysclone,s   ( s__name__s __module__slabels__init__s__repr__sgetNamesgetLabelssetLabelsNonesclone(((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysMibNodes     sModuleIdentitycBsktZdZdZdZdZdZdZdZdZ d Z d Z d Z RS( NcCst|ddSdS(Ns lastUpdateds(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysgetLastUpdated7scCs||_|SdS(N(svsselfs lastUpdated(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pyssetLastUpdated9s cCst|ddSdS(Ns organizations(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysgetOrganization<scCs||_|SdS(N(svsselfs organization(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pyssetOrganization>s cCst|ddSdS(Ns contactInfos(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysgetContactInfoAscCs||_|SdS(N(svsselfs contactInfo(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pyssetContactInfoCs cCst|ddSdS(Ns descriptions(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysgetDescriptionFscCs||_|SdS(N(svsselfs description(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pyssetDescriptionHs cCst|dfSdS(Ns revisions(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys getRevisionsKscCs||_|SdS(N(sargssselfs revisions(sselfsargs((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys setRevisionsMs c CsNd|i|i|i|ititd|ifSdS(NsaMODULE-IDENTITY LAST-UPDATED %s ORGANIZATION "%s" CONTACT-INFO "%s" DESCRIPTION "%s" %scCsd|S(NsREVISION "%s" (sx(sx((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys]s( sselfsgetLastUpdatedsgetOrganizationsgetContactInfosgetDescriptionsstringsjoinsmaps getRevisions(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys asn1PrintQs( s__name__s __module__sgetLastUpdatedssetLastUpdatedsgetOrganizationssetOrganizationsgetContactInfossetContactInfosgetDescriptionssetDescriptions getRevisionss setRevisionss asn1Print(((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysModuleIdentity6s          sObjectIdentitycBsGtZdZdZdZdZdZdZdZRS(NcCst|ddSdS(Nsstatusscurrent(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys getStatus`scCs||_|SdS(N(svsselfsstatus(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys setStatusbs cCst|ddSdS(Ns descriptions(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysgetDescriptionescCs||_|SdS(N(svsselfs description(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pyssetDescriptiongs cCst|ddSdS(Ns references(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys getReferencejscCs||_|SdS(N(svsselfs reference(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys setReferencels cCs'd|i|i|ifSdS(Ns?OBJECT-IDENTITY STATUS %s DESCRIPTION "%s" REFERENCE "%s"(sselfs getStatussgetDescriptions getReference(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys asn1Printps( s__name__s __module__s getStatuss setStatussgetDescriptionssetDescriptions getReferences setReferences asn1Print(((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysObjectIdentity_s      sNotificationTypecBsYtZdZdZdZdZdZdZdZdZ d Z RS( NcCst|dfSdS(Nsobjects(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys getObjects}scGs||_|SdS(N(sargssselfsobjects(sselfsargs((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys setObjectss cCst|ddSdS(Nsstatusscurrent(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys getStatusscCs||_|SdS(N(svsselfsstatus(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys setStatuss cCst|ddSdS(Ns descriptions(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysgetDescriptionscCs||_|SdS(N(svsselfs description(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pyssetDescriptions cCst|dfSdS(Ns revisions(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys getRevisionsscCs||_|SdS(N(sargssselfs revisions(sselfsargs((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys setRevisionss cCsZdtd|iddf|i|ititd|ifSdS(NsFNOTIFICATION-TYPE OBJECTS { %s } STATUS %s DESCRIPTION "%s" %scCsd|d|dfS(Ns%s, %si(sxsy(sxsy((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pyssscCsd|S(NsREVISION "%s" (sx(sx((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pyss( sreducesselfs getObjectss getStatussgetDescriptionsstringsjoinsmaps getRevisions(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys asn1Prints( s__name__s __module__s getObjectss setObjectss getStatuss setStatussgetDescriptionssetDescriptions getRevisionss setRevisionss asn1Print(((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysNotificationType|s        s MibIdentifiercBstZdZRS(NcCsdSdS(NsOBJECT IDENTIFIER((sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys asn1Prints(s__name__s __module__s asn1Print(((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys MibIdentifierss ObjectTypecBstZeZedZdZdZdZdZdZ dZ dZ d Z d Z d Zd Zd ZdZdZRS(NcCsti||||_dS(N(sMibNodes__init__sselfsnamessyntax(sselfsnamessyntax((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys__init__scCst|i|SdS(N(scmpsselfssyntaxsother(sselfsother((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys__cmp__scCs!d|ii|i|ifSdS(Ns %s(%s, %s)(sselfs __class__s__name__snamessyntax(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys__repr__scCs |iSdS(N(sselfssyntax(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys getSyntaxscCst|ddSdS(Nsunitss(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysgetUnitsscCs||_|SdS(N(svsselfsunits(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pyssetUnitss cCst|ddSdS(Ns maxAccesssnot-accessible(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys getMaxAccessscCs||_|SdS(N(svsselfs maxAccess(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys setMaxAccesss cCst|ddSdS(Nsstatusscurrent(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys getStatusscCs||_|SdS(N(svsselfsstatus(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys setStatuss cCst|ddSdS(Ns descriptions(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysgetDescriptionscCs||_|SdS(N(svsselfs description(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pyssetDescriptions cCst|ddSdS(Ns references(sgetattrsself(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys getReferencescCs||_|SdS(N(svsselfs reference(sselfsv((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys setReferences cCsHd|iii|i|i|i|i|ifSdS(NsdOBJECT-TYPE SYNTAX %s UNITS "%s" MAX-ACCESS %s STATUS %s DESCRIPTION "%s" REFERENCE "%s"( sselfs getSyntaxs __class__s__name__sgetUnitss getMaxAccesss getStatussgetDescriptions getReference(sself((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys asn1Prints(s__name__s __module__sNones maxAccesss__init__s__cmp__s__repr__s getSyntaxsgetUnitsssetUnitss getMaxAccesss setMaxAccesss getStatuss setStatussgetDescriptionssetDescriptions getReferences setReferences asn1Print(((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys ObjectTypes               sMibTreecBstZdZdZedZdZdZdZedZ edZ d Z d Z d Z d Zd ZdZdZdZRS(Nlsnot-accessiblecCs#ti|||t|_dS(N(s ObjectTypes__init__sselfsnamessyntaxsOidOrderedDicts_vars(sselfsnamessyntax((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys__init__scGshxa|D]Y}|i|ijo tid|i|fn||i|id}x|D]}|t|}qW|i |ffSq|ioR|i}d}x"|| D]}|t|}q2W|i |||fSqd}x-|d|dd!D]}|t|}qW|i |||ddfSn||ijoP|o|i |ffSq|i |d|dd!||ddfSn||ijoYd}x-td|dd!D]}|t|}qLW|i |||ddfSntidt|dS(NsShort OID for index %siiis.ssUnknown value type for index %s(svalueserrorsSmiErrorsreprsobjs getTagSets getBaseTagsbaseTagsselfs_MibTableRow__intBaseTagsclones_MibTableRow__ipaddrTagSetsisSuperTagSetOfsstringsjoinsmapsstrs_MibTableRow__strBaseTags impliedFlagssscschrs isFixedLengthsgetFixedLengthsls_MibTableRow__oidBaseTags_MibTableRow__bitsBaseTags valuevalue(sselfsobjsvalues impliedFlagscslsssbaseTag((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys setFromNamesJ4   #2#cCsn|ii}||ijot|fSn8|ii|iot t t |Sn||i jo_|p |io f}nt|f}x't|D]}|t |f}qW|Sn||ijo3|ot |Sqjt|ift |SnV||ijo,tdt d|t|fSntidt|dS(NcCs ||fS(N(sxsy(sxsy((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysEscCs t|S(N(sordsx(sx((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysEssUnknown value type for index %s(sobjs getTagSets getBaseTagsbaseTagsselfs_MibTableRow__intBaseTagsints_MibTableRow__ipaddrTagSetsisSuperTagSetOfstuplesmapsords_MibTableRow__strBaseTags impliedFlags isFixedLengthsinitialslensstrscs_MibTableRow__oidBaseTagsnames_MibTableRow__bitsBaseTagsreduceserrorsSmiErrorsrepr(sselfsobjs impliedFlagscsinitialsbaseTag((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pys getAsName/s(  ,cCs^|\}}|t|id} g} x~|iD]s\}}} t i || \} |i| i| |\}} |i| id jo| i| i|fq3q3W| otid|| fn| odSnxy|iiD]h\}} t i || \} titi@otid|| f| i|| ||||fqWdS(Niis5Excessive instance identifier sub-OIDs left at %s: %ss announceManagementEvent %s to %s(sacFunsacCtxsnameslensselfsinstIds baseIndicess indexNamess impliedFlagsmodNamessymNames mibBuilders importSymbolssmibObjs setFromNamessyntaxsappendserrorsSmiErrorsaugmentingRowsskeyssmibSymsdebugsloggersflagInssactionsreceiveManagementEventsvalsidx(sselfsactionsnamesvalsidxs.10sacFunsacCtxsmodNamesinstIdssymNames baseIndicessmibSymsmibObjs impliedFlagssyntax((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysannounceManagementEventLs"   (cCs|\}}f}xp|iD]e\} } } ti | | \} x>|D]6\}} || i jo||i| | }qGqGWqW|oNtiti@otid||f|i|f|||||fndS(Ns'receiveManagementEvent %s for suffix %s(sacFunsacCtxs newSuffixsselfs indexNamess impliedFlagsmodNamessymNames mibBuilders importSymbolssmibObjs baseIndicessnamessyntaxs getAsNamesdebugsloggersflagInssactions_MibTableRow__manageColumnssvalsidx(sselfsactions baseIndicessvalsidxs.10sacFunsacCtxs newSuffixssymNamesmodNamesmibObjs impliedFlagssyntaxsname((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-SMI.pysreceiveManagementEventes   "(cGskx`|D]X\}}||f|ijo#tid|i||fnd|i||f."pysnmp/smi/mibs/PYSNMP-USM-MIB.pyc; $Ic*@s- dklZlZeidddd\ZZZeidd\Zeidd\Z eid d \Z eid d d ddddddd \ Z Z Z ZZZZZZeidd\Ze ddddddddddf idfZeioeidneioeidneioeidnedddddddddddf Zeddddddddddddf Zedddddddddddddf eid eidd!id"eid#d!fd$dfi di!d%Z"eioe"id&neddddddddddddd'f eid eidd!id"eid(d!fd)dfi di!d%Z#eioe#id*nedddddddddddd'f Z$eioe$id+nedddddddddddd'df i%dd,d-fZ&eioe&id.nedddddddddddd'ddfe id ei'dd/i!d0Z(eioe(id1nedddddddddddd'dd'feid ei'd2d3i!d0Z)eioe)id4nedddddddddddd'ddfeid ei'd2d3i!d0Z*eioe*id5nedddddddddddd'ddfei!d6Z+eioe+id7neddddddddddddf Z,edddddddddddddf Z-eioe-id.neddddddddddddddfeid ei'd2d/i!d0Z.eioe.id8nedddddddddddddd'feid ei'd2d/i!d0Z/eioe/id9neddddddddddddddfeid ei'd2d/i!d0Z0eioe0id:neddddddddddddddfeid ei'd2d/i!d0Z1eioe1id;neddddddddddd'f Z2eddddddddddd'df Z3eddddddddddd'd'f Z4eid d \Z e i5d,d<fe6e-i%e i7ei8d,d=eei8d,d>ed?ed@edAe"dBe#dCe$dDe&d-e(dEe)dFe*dGe+dHe,d<e-dIe.dJe/dKe0dLe1dMe2dNe3dOe4dPS(Q(s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStrings PYSNMP-MIBspysnmpModuleIDssSNMP-FRAMEWORK-MIBsSnmpAdminStringsSNMP-USER-BASED-SM-MIBs usmUserEntrys SNMPv2-SMIsBitss Integer32sModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss SNMPv2-TCs RowStatusiiiiiOs2005-05-14 00:00sThe PySNMP projectsPE-mail: ilya@glas.net Subscribe: pysnmp-users-request@lists.sourceforge.nets_This MIB module defines objects specific to User Security Model (USM) implementation at PySNMP.s subtypeSpecis namedValuessnotDiscoverables discoverables readwritesQWhether SNMP engine would support its discovery by responding to unknown clients.is doNotDiscovers doDiscoversdWhether SNMP engine would try to figure out the EngineIDs of its peers by sending discover requests.shThe table of USM users passphrases configured in the SNMP engine's Local Configuration Datastore (LCD).sPYSNMP-USM-MIBspysnmpUsmSecretUserNames4Information about a particular USM user credentials.i snoaccesssMThe username string for which a row in this table represents a configuration.iisCUser's authentication passphrase used for localized key generation.s?User's encryption passphrase used for localized key generation.s readcreates Table statuss-User's localized key used for authentication.s)User's localized key used for encryption.s1User's non-localized key used for authentication.s-User's non-localized key used for encryption.spysnmpUsmKeyEntrysPYSNMP_MODULE_IDs pysnmpUsmMIBspysnmpUsmMIBObjectss pysnmpUsmCfgspysnmpUsmDiscoverablespysnmpUsmDiscoveryspysnmpUsmSecretTablespysnmpUsmSecretEntryspysnmpUsmSecretAuthKeyspysnmpUsmSecretPrivKeyspysnmpUsmSecretStatuss pysnmpUsmUserspysnmpUsmKeyAuthLocalizedspysnmpUsmKeyPrivLocalizedspysnmpUsmKeyAuthspysnmpUsmKeyPrivspysnmpUsmMIBConformancespysnmpUsmMIBCompliancesspysnmpUsmMIBGroupsN(9s pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringspysnmpModuleIDssSnmpAdminStrings usmUserEntrysBitss Integer32sModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss RowStatuss setRevisionss pysnmpUsmMIBs loadTextsssetOrganizationssetContactInfossetDescriptionspysnmpUsmMIBObjectss pysnmpUsmCfgssubtypesSingleValueConstraints NamedValuessclones setMaxAccessspysnmpUsmDiscoverablespysnmpUsmDiscoveryspysnmpUsmSecretTables setIndexNamesspysnmpUsmSecretEntrysValueSizeConstraintspysnmpUsmSecretUserNamespysnmpUsmSecretAuthKeyspysnmpUsmSecretPrivKeyspysnmpUsmSecretStatuss pysnmpUsmUserspysnmpUsmKeyEntryspysnmpUsmKeyAuthLocalizedspysnmpUsmKeyPrivLocalizedspysnmpUsmKeyAuthspysnmpUsmKeyPrivspysnmpUsmMIBConformancespysnmpUsmMIBCompliancesspysnmpUsmMIBGroupssregisterAugmentionssapplys getIndexNamess exportSymbols(&sSnmpAdminStringspysnmpUsmSecretTables MibScalars TimeTicksspysnmpUsmKeyPrivLocalizedspysnmpUsmKeyAuthLocalizedsModuleIdentityspysnmpUsmMIBConformancespysnmpUsmMIBCompliancesspysnmpUsmDiscoverablesBitsspysnmpUsmDiscoverysMibTableColumnsMibTables pysnmpUsmCfgspysnmpUsmKeyPrivs RowStatussObjectIdentifiersnamedvals OctetStrings MibTableRowspysnmpUsmSecretStatuss pysnmpUsmMIBs usmUserEntryspysnmpUsmMIBObjectssIntegers pysnmpUsmUsers Integer32spysnmpUsmSecretPrivKeys constraintspysnmpUsmSecretUserNamespysnmpUsmKeyAuthspysnmpUsmMIBGroupsspysnmpModuleIDss MibIdentifierspysnmpUsmSecretEntryspysnmpUsmSecretAuthKeyspysnmpUsmKeyEntry((s<build/bdist.linux-i686/egg/pysnmp/smi/mibs/PYSNMP-USM-MIB.pys?s~!E6   -0  0 E ] ] ] E 03 ] ] ] ] -00PKAq>!kjkj*pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.pyc; qŨGcF@s dklZlZeidddd\ZZZeiddddd \ZZ Z Z eid d d \Z Z eid dddddddddddd \ ZZZZZZZZZZZZeiddddddd \ZZZZZZd!efd"YZ ed#d$d%d#d%d$d&d#d#d#f Z!ei"oe!i#d'ned#d$d%d#d%d$d&d#d#d(f Z$ei"oe$i#d)ned#d$d%d#d%d$d&d#d#d$f Z%ei"oe%i#d*ned#d$d%d#d%d$d&d#d(d#f Z&ei"oe&i#d+ned#d$d%d#d%d$d&d#d(d(f Z'ei"oe'i#d,ned#d$d%d#d%d$d-fi(d.d/d0fZ)ei"oe)i*d1nei"oe)i+d2nei"oe)i#d3ned#d$d%d#d%d$d-d#fZ,ed#d$d%d#d%d$d-d#d#f Z-ed#d$d%d#d%d$d-d#d#d#f ei.d4Z/ei"oe/i#d5ned#d$d%d#d%d$d-d#d#d(f ei.d4Z0ei"oe0i#d6ned#d$d%d#d%d$d-d#d#d$f ei.d4Z1ei"oe1i#d7ned#d$d%d#d%d$d-d#d#d8f ei.d4Z2ei"oe2i#d9ned#d$d%d#d%d$d-d#d#d:f ei.d4Z3ei"oe3i#d;ned#d$d%d#d%d$d-d#d#d%f ei.d4Z4ei"oe4i#d<ned#d$d%d#d%d$d-d#d(f Z5ed#d$d%d#d%d$d-d#d(d#f ei.d=Z6ei"oe6i#d>ned#d$d%d#d%d$d-d#d(d(f Z7ei"oe7i#d?ned#d$d%d#d%d$d-d#d(d(d#f i8d@dAdBfd@dAdCfZ9ei"oe9i#dDned#d$d%d#d%d$d-d#d(d(d#d#f e i.dEZ:ei"oe:i#dFned#d$d%d#d%d$d-d#d(d(d#d(f ei;dGei<d#dHi.dEZ=ei"oe=i#dIndJefdKYZ>e>d#d$d%d#d%d$d-d#d(d(d#d$f ei.d4Z?ei"oe?i#dLned#d$d%d#d%d$d-d#d(d(d#d8f ei.dMZ@ei"oe@i#dNned#d$d%d#d%d$d-d#d(d(d#d:f eiAdOi.dMZBei"oeBi#dPned#d$d%d#d%d$d-d#d(d(d#d%f e iAdQi.dMZCei"oeCi#dRned#d$d%d#d%d$d-d#d(d(d#dSf e iAdQi.dMZDei"oeDi#dTned#d$d%d#d%d$d-d#d(d(d#dUf eiAdVi.dMZEei"oeEi#dWned#d$d%d#d%d$d-d#d(d(d#dXf e iAdQi.dMZFei"oeFi#dYned#d$d%d#d%d$d-d#d(d(d#d&f e iAdQi.dMZGei"oeGi#dZned#d$d%d#d%d$d-d#d(d(d#d[f ei;dGei<d@dHiAdQi.dMZHei"oeHi#d\ned#d$d%d#d%d$d-d#d(d(d#d]f eiAd^i.dMZIei"oeIi#d_ned#d$d%d#d%d$d-d#d(d(d#d`f ei.dMZJei"oeJi#daned#d$d%d#d%d$d-d(fZKed#d$d%d#d%d$d-d(d#f ZLed#d$d%d#d%d$d-d(d(f ZMe d#d$d%d#d%d$d-d(d(d#f iNdAdbfdAdcfdAddfdAdefdAdffdAdgfdAdhfdAdifdAdjfdAdkfdAdlfdAdmfdAdnfdAdofdAdpfdAdqfdAdrfdAdsfZOeiPdAdte)eiPdAd!e eiPdAdue!dve$dwe%dxe&dye'dze)d{e,d|e-dge/dde0dee1dbe2dre3dhe4d}e5dme6d~e7de9dBe:dCe=dfe?doe@dqeBdneCdceDdpeEdjeFdkeGdseHdleIdieJdeKdeLdeM"eiPdAdeOdS((s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStringsSNMP-FRAMEWORK-MIBsSnmpAdminStrings SnmpEngineIDssnmpAuthProtocolsssnmpPrivProtocolss SNMPv2-CONFsModuleCompliances ObjectGroups SNMPv2-SMIsBitss Counter32s Integer32sModuleIdentitys MibIdentifiersObjectIdentitys MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModuless SNMPv2-TCsAutonomousTypes RowPointers RowStatuss StorageTypesTextualConventions TestAndIncrs KeyChangecBstZRS(N(s__name__s __module__(((sDbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.pys KeyChangesiiii sNo Authentication Protocol.is/The HMAC-MD5-96 Digest Authentication Protocol.s/The HMAC-SHA-96 Digest Authentication Protocol.sNo Privacy Protocol.s*The CBC-DES Symmetric Encryption Protocol.is2002-10-16 00:00s1999-01-20 00:00s1997-11-20 00:00sSNMPv3 Working GroupsWG-email: snmpv3@lists.tislabs.com Subscribe: majordomo@lists.tislabs.com In msg body: subscribe snmpv3 Chair: Russ Mundy Network Associates Laboratories postal: 15204 Omega Drive, Suite 300 Rockville, MD 20850-4601 USA email: mundy@tislabs.com phone: +1 301-947-7107 Co-Chair: David Harrington Enterasys Networks Postal: 35 Industrial Way P. O. Box 5004 Rochester, New Hampshire 03866-5005 USA EMail: dbh@enterasys.com Phone: +1 603-337-2614 Co-editor Uri Blumenthal Lucent Technologies postal: 67 Whippany Rd. Whippany, NJ 07981 USA email: uri@lucent.com phone: +1-973-386-2163 Co-editor: Bert Wijnen Lucent Technologies postal: Schagen 33 3461 GL Linschoten Netherlands email: bwijnen@lucent.com phone: +31-348-480-685sThe management information definitions for the SNMP User-based Security Model. Copyright (C) The Internet Society (2002). This version of this MIB module is part of RFC 3414; see the RFC itself for full legal notices.sreadonlysThe total number of packets received by the SNMP engine which were dropped because they requested a securityLevel that was unknown to the SNMP engine or otherwise unavailable.sThe total number of packets received by the SNMP engine which were dropped because they appeared outside of the authoritative SNMP engine's window.sThe total number of packets received by the SNMP engine which were dropped because they referenced a user that was not known to the SNMP engine.isThe total number of packets received by the SNMP engine which were dropped because they referenced an snmpEngineID that was not known to the SNMP engine.isThe total number of packets received by the SNMP engine which were dropped because they didn't contain the expected digest value.soThe total number of packets received by the SNMP engine which were dropped because they could not be decrypted.s readwritesAn advisory lock used to allow several cooperating Command Generator Applications to coordinate their use of facilities to alter secrets in the usmUserTable.sThe table of users configured in the SNMP engine's Local Configuration Datastore (LCD). To create a new user (i.e., to instantiate a new conceptual row in this table), it is recommended to follow this procedure: 1) GET(usmUserSpinLock.0) and save in sValue. 2) SET(usmUserSpinLock.0=sValue, usmUserCloneFrom=templateUser, usmUserStatus=createAndWait) You should use a template user to clone from which has the proper auth/priv protocol defined. If the new user is to use privacy: 3) generate the keyChange value based on the secret privKey of the clone-from user and the secret key to be used for the new user. Let us call this pkcValue. 4) GET(usmUserSpinLock.0) and save in sValue. 5) SET(usmUserSpinLock.0=sValue, usmUserPrivKeyChange=pkcValue usmUserPublic=randomValue1) 6) GET(usmUserPulic) and check it has randomValue1. If not, repeat steps 4-6. If the new user will never use privacy: 7) SET(usmUserPrivProtocol=usmNoPrivProtocol) If the new user is to use authentication: 8) generate the keyChange value based on the secret authKey of the clone-from user and the secret key to be used for the new user. Let us call this akcValue. 9) GET(usmUserSpinLock.0) and save in sValue. 10) SET(usmUserSpinLock.0=sValue, usmUserAuthKeyChange=akcValue usmUserPublic=randomValue2) 11) GET(usmUserPulic) and check it has randomValue2. If not, repeat steps 9-11. If the new user will never use authentication: 12) SET(usmUserAuthProtocol=usmNoAuthProtocol) Finally, activate the new user: 13) SET(usmUserStatus=active) The new user should now be available and ready to be used for SNMPv3 communication. Note however that access to MIB data must be provided via configuration of the SNMP-VIEW-BASED-ACM-MIB. The use of usmUserSpinlock is to avoid conflicts with another SNMP command generator application which may also be acting on the usmUserTable.isSNMP-USER-BASED-SM-MIBsusmUserEngineIDs usmUserNamesmA user configured in the SNMP engine's Local Configuration Datastore (LCD) for the User-based Security Model.snoaccesssAn SNMP engine's administratively-unique identifier. In a simple agent, this value is always that agent's own snmpEngineID value. The value can also take the value of the snmpEngineID of a remote SNMP engine with which this user can communicate.s subtypeSpeci szA human readable string representing the name of the user. This is the (User-based Security) Model dependent security ID.sUsmUserSecurityNamecBs5tZdZdZdZdZdZRS(NcCs?tidd\}|i|t|i\}}|SdS(NsSNMP-USER-BASED-SM-MIBs usmUserEntry( s mibBuilders importSymbolss"_UsmUserSecurityName__usmUserEntrysgetIndicesFromInstIdsnameslensselfs%_UsmUserSecurityName__usmUserEngineIDs!_UsmUserSecurityName__usmUserName(sselfsnames!_UsmUserSecurityName__usmUserNames"_UsmUserSecurityName__usmUserEntrys%_UsmUserSecurityName__usmUserEngineID((sDbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.pys__getUsmUserNameBs"cCs8|\}}ti|||i||||fSdS(N(sacFunsacCtxsMibTableColumns createTestsselfsnames$_UsmUserSecurityName__getUsmUserNamesidx(sselfsnamesvalsidxs.8sacFunsacCtx((sDbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.pys createTestJs cCs8|\}}ti|||i||||fSdS(N(sacFunsacCtxsMibTableColumns createCommitsselfsnames$_UsmUserSecurityName__getUsmUserNamesidx(sselfsnamesvalsidxs.8sacFunsacCtx((sDbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.pys createCommitNs cCs8|\}}ti|||i||||fSdS(N(sacFunsacCtxsMibTableColumns createCleanupsselfsnames$_UsmUserSecurityName__getUsmUserNamesidx(sselfsnamesvalsidxs.8sacFunsacCtx((sDbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.pys createCleanupRs cCs8|\}}ti|||i||||fSdS(N(sacFunsacCtxsMibTableColumns createUndosselfsnames$_UsmUserSecurityName__getUsmUserNamesidx(sselfsnamesvalsidxs.8sacFunsacCtx((sDbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.pys createUndoVs (s__name__s __module__s$_UsmUserSecurityName__getUsmUserNames createTests createCommits createCleanups createUndo(((sDbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.pysUsmUserSecurityNameAs     sA human readable string representing the user in Security Model independent format. The default transformation of the User-based Security Model dependent security ID to the securityName and vice versa is the identity function so that the securityName is the same as the userName.s readcreatesA pointer to another conceptual row in this usmUserTable. The user in this other conceptual row is called the clone-from user. When a new user is created (i.e., a new conceptual row is instantiated in this table), the privacy and authentication parameters of the new user must be cloned from its clone-from user. These parameters are: - authentication protocol (usmUserAuthProtocol) - privacy protocol (usmUserPrivProtocol) They will be copied regardless of what the current value is. Cloning also causes the initial values of the secret authentication key (authKey) and the secret encryption key (privKey) of the new user to be set to the same values as the corresponding secrets of the clone-from user to allow the KeyChange process to occur as required during user creation. The first time an instance of this object is set by a management operation (either at or after its instantiation), the cloning process is invoked. Subsequent writes are successful but invoke no action to be taken by the receiver. The cloning process fails with an 'inconsistentName' error if the conceptual row representing the clone-from user does not exist or is not in an active state when the cloning process is invoked. When this object is read, the ZeroDotZero OID is returned.s1.3.6.1.6.3.10.1.1.1sAn indication of whether messages sent on behalf of this user to/from the SNMP engine identified by usmUserEngineID, can be authenticated, and if so, the type of authentication protocol which is used. An instance of this object is created concurrently with the creation of any other object instance for the same user (i.e., as part of the processing of the set operation which creates the first object instance in the same conceptual row). If an initial set operation (i.e. at row creation time) tries to set a value for an unknown or unsupported protocol, then a 'wrongValue' error must be returned. The value will be overwritten/set when a set operation is performed on the corresponding instance of usmUserCloneFrom. Once instantiated, the value of such an instance of this object can only be changed via a set operation to the value of the usmNoAuthProtocol. If a set operation tries to change the value of an existing instance of this object to any value other than usmNoAuthProtocol, then an 'inconsistentValue' error must be returned. If a set operation tries to set the value to the usmNoAuthProtocol while the usmUserPrivProtocol value in the same row is not equal to usmNoPrivProtocol, then an 'inconsistentValue' error must be returned. That means that an SNMP command generator application must first ensure that the usmUserPrivProtocol is set to the usmNoPrivProtocol value before it can set the usmUserAuthProtocol value to usmNoAuthProtocol.ssVAn object, which when modified, causes the secret authentication key used for messages sent on behalf of this user to/from the SNMP engine identified by usmUserEngineID, to be modified via a one-way function. The associated protocol is the usmUserAuthProtocol. The associated secret key is the user's secret authentication key (authKey). The associated hash algorithm is the algorithm used by the user's usmUserAuthProtocol. When creating a new user, it is an 'inconsistentName' error for a set operation to refer to this object unless it is previously or concurrently initialized through a set operation on the corresponding instance of usmUserCloneFrom. When the value of the corresponding usmUserAuthProtocol is usmNoAuthProtocol, then a set is successful, but effectively is a no-op. When this object is read, the zero-length (empty) string is returned. The recommended way to do a key change is as follows: 1) GET(usmUserSpinLock.0) and save in sValue. 2) generate the keyChange value based on the old (existing) secret key and the new secret key, let us call this kcValue. If you do the key change on behalf of another user: 3) SET(usmUserSpinLock.0=sValue, usmUserAuthKeyChange=kcValue usmUserPublic=randomValue) If you do the key change for yourself: 4) SET(usmUserSpinLock.0=sValue, usmUserOwnAuthKeyChange=kcValue usmUserPublic=randomValue) If you get a response with error-status of noError, then the SET succeeded and the new key is active. If you do not get a response, then you can issue a GET(usmUserPublic) and check if the value is equal to the randomValue you did send in the SET. If so, then the key change succeeded and the new key is active (probably the response got lost). If not, then the SET request probably never reached the target and so you can start over with the procedure above.is2Behaves exactly as usmUserAuthKeyChange, with one notable difference: in order for the set operation to succeed, the usmUserName of the operation requester must match the usmUserName that indexes the row which is targeted by this operation. In addition, the USM security model must be used for this operation. The idea here is that access to this column can be public, since it will only allow a user to change his own secret authentication key (authKey). Note that this can only be done once the row is active. When a set is received and the usmUserName of the requester is not the same as the umsUserName that indexes the row which is targeted by this operation, then a 'noAccess' error must be returned. When a set is received and the security model in use is not USM, then a 'noAccess' error must be returned.is1.3.6.1.6.3.10.1.2.1suAn indication of whether messages sent on behalf of this user to/from the SNMP engine identified by usmUserEngineID, can be protected from disclosure, and if so, the type of privacy protocol which is used. An instance of this object is created concurrently with the creation of any other object instance for the same user (i.e., as part of the processing of the set operation which creates the first object instance in the same conceptual row). If an initial set operation (i.e. at row creation time) tries to set a value for an unknown or unsupported protocol, then a 'wrongValue' error must be returned. The value will be overwritten/set when a set operation is performed on the corresponding instance of usmUserCloneFrom. Once instantiated, the value of such an instance of this object can only be changed via a set operation to the value of the usmNoPrivProtocol. If a set operation tries to change the value of an existing instance of this object to any value other than usmNoPrivProtocol, then an 'inconsistentValue' error must be returned. Note that if any privacy protocol is used, then you must also use an authentication protocol. In other words, if usmUserPrivProtocol is set to anything else than usmNoPrivProtocol, then the corresponding instance of usmUserAuthProtocol cannot have a value of usmNoAuthProtocol. If it does, then an 'inconsistentValue' error must be returned.i sAn object, which when modified, causes the secret encryption key used for messages sent on behalf of this user to/from the SNMP engine identified by usmUserEngineID, to be modified via a one-way function. The associated protocol is the usmUserPrivProtocol. The associated secret key is the user's secret privacy key (privKey). The associated hash algorithm is the algorithm used by the user's usmUserAuthProtocol. When creating a new user, it is an 'inconsistentName' error for a set operation to refer to this object unless it is previously or concurrently initialized through a set operation on the corresponding instance of usmUserCloneFrom. When the value of the corresponding usmUserPrivProtocol is usmNoPrivProtocol, then a set is successful, but effectively is a no-op. When this object is read, the zero-length (empty) string is returned. See the description clause of usmUserAuthKeyChange for a recommended procedure to do a key change.s,Behaves exactly as usmUserPrivKeyChange, with one notable difference: in order for the Set operation to succeed, the usmUserName of the operation requester must match the usmUserName that indexes the row which is targeted by this operation. In addition, the USM security model must be used for this operation. The idea here is that access to this column can be public, since it will only allow a user to change his own secret privacy key (privKey). Note that this can only be done once the row is active. When a set is received and the usmUserName of the requester is not the same as the umsUserName that indexes the row which is targeted by this operation, then a 'noAccess' error must be returned. When a set is received and the security model in use is not USM, then a 'noAccess' error must be returned.i sA publicly-readable value which can be written as part of the procedure for changing a user's secret authentication and/or privacy key, and later read to determine whether the change of the secret was effected.i s nonVolatiles-The storage type for this conceptual row. Conceptual rows having the value 'permanent' must allow write-access at a minimum to: - usmUserAuthKeyChange, usmUserOwnAuthKeyChange and usmUserPublic for a user who employs authentication, and - usmUserPrivKeyChange, usmUserOwnPrivKeyChange and usmUserPublic for a user who employs privacy. Note that any user who employs authentication or privacy must allow its secret(s) to be updated and thus cannot be 'readOnly'. If an initial set operation tries to set the value to 'readOnly' for a user who employs authentication or privacy, then an 'inconsistentValue' error must be returned. Note that if the value has been previously set (implicit or explicit) to any value, then the rules as defined in the StorageType Textual Convention apply. It is an implementation issue to decide if a SET for a readOnly or permanent row is accepted at all. In some contexts this may make sense, in others it may not. If a SET for a readOnly or permanent row is not accepted at all, then a 'wrongValue' error must be returned.i ssThe status of this conceptual row. Until instances of all corresponding columns are appropriately configured, the value of the corresponding instance of the usmUserStatus column is 'notReady'. In particular, a newly created row for a user who employs authentication, cannot be made active until the corresponding usmUserCloneFrom and usmUserAuthKeyChange have been set. Further, a newly created row for a user who also employs privacy, cannot be made active until the usmUserPrivKeyChange has been set. The RowStatus TC [RFC2579] requires that this DESCRIPTION clause states under which circumstances other objects in this row can be modified: The value of this object has no effect on whether other objects in this conceptual row can be modified, except for usmUserOwnAuthKeyChange and usmUserOwnPrivKeyChange. For these 2 objects, the value of usmUserStatus MUST be active.susmStatsUnknownEngineIDssusmUserOwnAuthKeyChangesusmStatsNotInTimeWindowssusmStatsUnknownUserNamessusmUserSecurityNamesusmStatsUnsupportedSecLevelssusmStatsDecryptionErrorss usmUserStatussusmUserPrivKeyChangesusmUserOwnPrivKeyChangesusmUserStorageTypesusmUserSpinLocksusmUserAuthKeyChangesusmUserCloneFromsusmUserPrivProtocolsusmUserAuthProtocolsusmStatsWrongDigestss usmUserPublicsPYSNMP_MODULE_IDsusmNoAuthProtocolsusmHMACMD5AuthProtocolsusmHMACSHAAuthProtocolsusmNoPrivProtocolsusmDESPrivProtocols snmpUsmMIBs usmMIBObjectssusmStatssusmUsers usmUserTables usmUserEntrysusmMIBConformancesusmMIBCompliancess usmMIBGroupssusmMIBBasicGroupN(Qs pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsSnmpAdminStrings SnmpEngineIDssnmpAuthProtocolsssnmpPrivProtocolssModuleCompliances ObjectGroupsBitss Counter32s Integer32sModuleIdentitys MibIdentifiersObjectIdentitys MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModulessAutonomousTypes RowPointers RowStatuss StorageTypesTextualConventions TestAndIncrs KeyChangesusmNoAuthProtocols loadTextsssetDescriptionsusmHMACMD5AuthProtocolsusmHMACSHAAuthProtocolsusmNoPrivProtocolsusmDESPrivProtocols setRevisionss snmpUsmMIBssetOrganizationssetContactInfos usmMIBObjectssusmStatss setMaxAccesssusmStatsUnsupportedSecLevelssusmStatsNotInTimeWindowssusmStatsUnknownUserNamessusmStatsUnknownEngineIDssusmStatsWrongDigestssusmStatsDecryptionErrorssusmUsersusmUserSpinLocks usmUserTables setIndexNamess usmUserEntrysusmUserEngineIDssubtypesValueSizeConstraints usmUserNamesUsmUserSecurityNamesusmUserSecurityNamesusmUserCloneFromsclonesusmUserAuthProtocolsusmUserAuthKeyChangesusmUserOwnAuthKeyChangesusmUserPrivProtocolsusmUserPrivKeyChangesusmUserOwnPrivKeyChanges usmUserPublicsusmUserStorageTypes usmUserStatussusmMIBConformancesusmMIBCompliancess usmMIBGroupss setObjectssusmMIBBasicGroups exportSymbols(BsusmUserOwnAuthKeyChangesSnmpAdminStringsusmNoAuthProtocols MibScalarsAutonomousTypesusmStatsDecryptionErrorss TimeTickssusmStatsWrongDigestssusmUserEngineIDsModuleIdentitys SnmpEngineIDsusmUserSpinLocksusmUserCloneFroms snmpModulessusmUserAuthProtocolsusmUserOwnPrivKeyChangesBitss usmUserPublics ObjectGroupsMibTableColumnsusmStatsUnknownUserNamessModuleCompliancesusmStatsUnsupportedSecLevelssMibTables usmUserStatuss usmMIBGroupssusmMIBBasicGroups RowStatussusmMIBCompliancess usmUserTablesObjectIdentifiersnamedvalsusmStatssusmUserSecurityNames OctetStringsusmNoPrivProtocols MibTableRows RowPointers usmUserEntrysusmStatsUnknownEngineIDsssnmpAuthProtocolss usmMIBObjectss TestAndIncrsusmUserAuthKeyChangessnmpPrivProtocolssusmDESPrivProtocolsIntegersusmHMACMD5AuthProtocolsusmUsers Integer32s KeyChangesusmStatsNotInTimeWindowss constraints StorageTypesusmUserStorageTypesusmHMACSHAAuthProtocolsUsmUserSecurityNamesTextualConventions snmpUsmMIBs usmUserNamesusmMIBConformances MibIdentifiersusmUserPrivProtocolsusmUserPrivKeyChangesObjectIdentitys Counter32((sDbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.pys?s!'W3* * * * * 3   $'9 9 9 9 9 9 '9 * K ? W ? ? H H H H H H ` H ? $''PKo1pysnmp/smi/mibs/__init__.pyPKAq> HHpysnmp/smi/mibs/SNMPv2-CONF.pyc; 7Lc @seidd\ZdefdYZdefdYZdefdYZdefd YZeid dedededed S( s SNMPv2-SMIsMibNodes ObjectGroupcBs5tZdZdZdZdZdZRS(NcCst|dfSdS(Nsobjects(sgetattrsself(sself((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys getObjectsscGs||_|SdS(N(sargssselfsobjects(sselfsargs((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys setObjectss cCst|ddSdS(Ns descriptions(sgetattrsself(sself((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pysgetDescription scCs||_|SdS(N(svsselfs description(sselfsv((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pyssetDescription s cCs3dtd|iddf|ifSdS(Ns0OBJECT-GROUP OBJECTS { %s } DESCRIPTION "%s"cCsd|d|dfS(Ns%s, %si(sxsy(sxsy((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pysss(sreducesselfs getObjectssgetDescription(sself((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys asn1Prints(s__name__s __module__s getObjectss setObjectssgetDescriptionssetDescriptions asn1Print(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys ObjectGroups     sNotificationGroupcBs5tZdZdZdZdZdZRS(NcCst|dfSdS(Nsobjects(sgetattrsself(sself((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys getObjectsscGs||_|SdS(N(sargssselfsobjects(sselfsargs((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys setObjectss cCst|ddSdS(Ns descriptions(sgetattrsself(sself((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pysgetDescriptionscCs||_|SdS(N(svsselfs description(sselfsv((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pyssetDescriptions cCs3dtd|iddf|ifSdS(Ns<NOTIFICATION-GROUP NOTIFICATIONS { %s } DESCRIPTION "%s"cCsd|d|dfS(Ns%s, %si(sxsy(sxsy((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys&ss(sreducesselfs getObjectssgetDescription(sself((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys asn1Print!s(s__name__s __module__s getObjectss setObjectssgetDescriptionssetDescriptions asn1Print(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pysNotificationGroups     sModuleCompliancecBs5tZdZdZdZdZdZRS(NcCst|dfSdS(Nsobjects(sgetattrsself(sself((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys getObjects*scGs||_|SdS(N(sargssselfsobjects(sselfsargs((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys setObjects,s cCst|ddSdS(Ns descriptions(sgetattrsself(sself((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pysgetDescription/scCs||_|SdS(N(svsselfs description(sselfsv((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pyssetDescription1s cCs3dtd|iddf|ifSdS(Ns6MODULE-COMPLIANCE OBJECT { %s } DESCRIPTION "%s" cCsd|d|dfS(Ns%s, %si(sxsy(sxsy((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys9ss(sreducesselfs getObjectssgetDescription(sself((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys asn1Print4s(s__name__s __module__s getObjectss setObjectssgetDescriptionssetDescriptions asn1Print(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pysModuleCompliance)s     sAgentCapabilitiescBs#tZdZdZdZRS(NcCst|ddSdS(Ns descriptions(sgetattrsself(sself((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pysgetDescription=scCs||_|SdS(N(svsselfs description(sselfsv((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pyssetDescription?s cCsd|iSdS(Ns&AGENT-CAPABILITIES DESCRIPTION "%s" (sselfsgetDescription(sself((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys asn1PrintBs(s__name__s __module__sgetDescriptionssetDescriptions asn1Print(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pysAgentCapabilities<s  s SNMPv2-CONFN(s mibBuilders importSymbolssMibNodes ObjectGroupsNotificationGroupsModuleCompliancesAgentCapabilitiess exportSymbols(sAgentCapabilitiess ObjectGroupsModuleCompliancesMibNodesNotificationGroup((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-CONF.pys?s  PK 7>h/ / pysnmp/smi/mibs/SNMPv2-TM.pyimport types, string 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') 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) displayHint = "1d.1d.1d.1d/2d" def prettyIn(self, value): if type(value) == types.TupleType: # Wild hack -- need to implement TextualConvention.prettyIn return reduce(lambda x,y: x+y, map(lambda x: chr(string.atoi(x)), string.split(value[0], '.'))) + chr((value[1] >> 8) & 0xff) + chr((value[1] & 0xff)) else: return OctetString.prettyIn(self, value) # Socket address syntax coercion def __getitem__(self, i): if not hasattr(self, '__tuple_value'): self.__tuple_value = ( '%s.%s.%s.%s' % (ord(self._value[0]), ord(self._value[1]),ord(self._value[2]),ord(self._value[3])), ord(self._value[4]) << 8 | ord(self._value[5]) ) return self.__tuple_value[i] snmpCLNSDomain = ObjectIdentity(snmpDomains.name + (2,)) snmpCONSDomain = ObjectIdentity(snmpDomains.name + (3,)) class SnmpOSIAddress(TextualConvention, OctetString): subtypeSpec = OctetString.subtypeSpec + constraint.ValueSizeConstraint(1, 85) displayHint = "*1x:/1x:" snmpDDPDomain = ObjectIdentity(snmpDomains.name + (4,)) class SnmpNBPAddress(OctetString, TextualConvention): subtypeSpec = OctetString.subtypeSpec + constraint.ValueSizeConstraint(3, 99) snmpIPXDomain = ObjectIdentity(snmpDomains.name + (5,)) class SnmpIPXAddress(TextualConvention, OctetString): subtypeSpec = OctetString.subtypeSpec + constraint.ValueSizeConstraint(12, 12) displayHint = "4x.1x:1x:1x:1x:1x:1x.2d" rfc1157Proxy = MibIdentifier(snmpProxys.name + (1,)) rfc1157Domain = MibIdentifier(rfc1157Proxy.name + (1,)) # Module identity mibBuilder.exportSymbols("SNMPv2-TM", PYSNMP_MODULE_ID=snmpv2tm) mibBuilder.exportSymbols( 'SNMPv2-TM', snmpv2tm=snmpv2tm, snmpUDPDomain=snmpUDPDomain, SnmpUDPAddress=SnmpUDPAddress, snmpCLNSDomain=snmpCLNSDomain, snmpCONSDomain=snmpCONSDomain, SnmpOSIAddress=SnmpOSIAddress, snmpDDPDomain=snmpDDPDomain, SnmpNBPAddress=SnmpNBPAddress, snmpIPXDomain=snmpIPXDomain, SnmpIPXAddress=SnmpIPXAddress, rfc1157Proxy=rfc1157Proxy, rfc1157Domain=rfc1157Domain ) PKz:Gopysnmp/smi/mibs/RFC1213-MIB.py# PySNMP SMI module. Autogenerated from smidump -f python RFC1213-MIB # by libsmi2pysnmp-0.0.9-alpha at Thu Mar 26 20:59:40 2009, # Python version (2, 4, 4, 'final', 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") ( NetworkAddress, ) = mibBuilder.importSymbols("RFC1155-SMI", "NetworkAddress") ( Bits, Counter32, Gauge32, Integer32, Integer32, IpAddress, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, TimeTicks, mgmt, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Counter32", "Gauge32", "Integer32", "Integer32", "IpAddress", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "TimeTicks", "mgmt") # Types class DisplayString(OctetString): pass class PhysAddress(OctetString): pass # Objects mib_2 = MibIdentifier((1, 3, 6, 1, 2, 1)).setLabel("mib-2") 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") if mibBuilder.loadTexts: sysDescr.setDescription("A textual description of the entity. This value\nshould include the full name and version\nidentification of the system's hardware type,\nsoftware operating-system, and networking\nsoftware. It is mandatory that this only contain\nprintable ASCII characters.") 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\nentity. This value is allocated within the SMI\nenterprises subtree (1.3.6.1.4.1) and provides an\neasy and unambiguous means for determining `what\nkind of box' is being managed. For example, if\nvendor `Flintstones, Inc.' was assigned the\nsubtree 1.3.6.1.4.1.4242, it could assign the\nidentifier 1.3.6.1.4.1.4242.1.1 to its `Fred\nRouter'.") 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") if mibBuilder.loadTexts: sysContact.setDescription("The textual identification of the contact person\nfor this managed node, together with information\non how to contact this person.") sysName = MibScalar((1, 3, 6, 1, 2, 1, 1, 5), DisplayString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sysName.setDescription("An administratively-assigned name for this\nmanaged node. By convention, this is the node's\nfully-qualified domain name.") sysLocation = MibScalar((1, 3, 6, 1, 2, 1, 1, 6), DisplayString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sysLocation.setDescription("The physical location of this node (e.g.,\n`telephone closet, 3rd floor').") sysServices = MibScalar((1, 3, 6, 1, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 127))).setMaxAccess("readonly") if mibBuilder.loadTexts: sysServices.setDescription("A value which indicates the set of services that\nthis entity primarily offers.\n\nThe value is a sum. This sum initially takes the\nvalue zero, Then, for each layer, L, in the range\n1 through 7, that this node performs transactions\nfor, 2 raised to (L - 1) is added to the sum. For\nexample, a node which performs primarily routing\nfunctions would have a value of 4 (2^(3-1)). In\ncontrast, a node which is a host offering\napplication services would have a value of 72\n(2^(4-1) + 2^(7-1)). Note that in the context of\nthe Internet suite of protocols, values should be\ncalculated accordingly:\n\n layer functionality\n 1 physical (e.g., repeaters)\n 2 datalink/subnetwork (e.g., bridges)\n 3 internet (e.g., IP gateways)\n 4 end-to-end (e.g., IP hosts)\n 7 applications (e.g., mail relays)\n\nFor systems including OSI protocols, layers 5 and\n6 may also be counted.") interfaces = MibIdentifier((1, 3, 6, 1, 2, 1, 2)) ifNumber = MibScalar((1, 3, 6, 1, 2, 1, 2, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifNumber.setDescription("The number of network interfaces (regardless of\ntheir current state) present on this system.") ifTable = MibTable((1, 3, 6, 1, 2, 1, 2, 2)) if mibBuilder.loadTexts: ifTable.setDescription("A list of interface entries. The number of\nentries is given by the value of ifNumber.") ifEntry = MibTableRow((1, 3, 6, 1, 2, 1, 2, 2, 1)).setIndexNames((0, "RFC1213-MIB", "ifIndex")) if mibBuilder.loadTexts: ifEntry.setDescription("An interface entry containing objects at the\nsubnetwork layer and below for a particular\ninterface.") ifIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifIndex.setDescription("A unique value for each interface. Its value\nranges between 1 and the value of ifNumber. The\nvalue for each interface must remain constant at\nleast from one re-initialization of the entity's\nnetwork management system to the next re-\ninitialization.") ifDescr = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 2), DisplayString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: ifDescr.setDescription("A textual string containing information about the\ninterface. This string should include the name of\nthe manufacturer, the product name and the version\nof the hardware interface.") ifType = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 3), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(22,32,24,5,30,23,4,28,12,26,31,7,1,17,16,8,14,20,6,21,19,15,13,11,25,9,18,3,27,2,10,29,)).subtype(namedValues=namedval.NamedValues(("other", 1), ("iso88026-man", 10), ("starLan", 11), ("proteon-10Mbit", 12), ("proteon-80Mbit", 13), ("hyperchannel", 14), ("fddi", 15), ("lapb", 16), ("sdlc", 17), ("ds1", 18), ("e1", 19), ("regular1822", 2), ("basicISDN", 20), ("primaryISDN", 21), ("propPointToPointSerial", 22), ("ppp", 23), ("softwareLoopback", 24), ("eon", 25), ("ethernet-3Mbit", 26), ("nsip", 27), ("slip", 28), ("ultra", 29), ("hdh1822", 3), ("ds3", 30), ("sip", 31), ("frame-relay", 32), ("ddn-x25", 4), ("rfc877-x25", 5), ("ethernet-csmacd", 6), ("iso88023-csmacd", 7), ("iso88024-tokenBus", 8), ("iso88025-tokenRing", 9), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: ifType.setDescription("The type of interface, distinguished according to\nthe physical/link protocol(s) immediately `below'\nthe network layer in the protocol stack.") ifMtu = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifMtu.setDescription("The size of the largest datagram which can be\nsent/received on the interface, specified in\noctets. For interfaces that are used for\ntransmitting network datagrams, this is the size\nof the largest network datagram that can be sent\non the interface.") ifSpeed = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 5), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifSpeed.setDescription("An estimate of the interface's current bandwidth\nin bits per second. For interfaces which do not\nvary in bandwidth or for those where no accurate\nestimation can be made, this object should contain\nthe nominal bandwidth.") ifPhysAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 6), PhysAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifPhysAddress.setDescription("The interface's address at the protocol layer\nimmediately `below' the network layer in the\nprotocol stack. For interfaces which do not have\nsuch an address (e.g., a serial line), this object\nshould contain an octet string of zero length.") ifAdminStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 7), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(2,3,1,)).subtype(namedValues=namedval.NamedValues(("up", 1), ("down", 2), ("testing", 3), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ifAdminStatus.setDescription("The desired state of the interface. The\ntesting(3) state indicates that no operational\npackets can be passed.") ifOperStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 8), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(2,3,1,)).subtype(namedValues=namedval.NamedValues(("up", 1), ("down", 2), ("testing", 3), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: ifOperStatus.setDescription("The current operational state of the interface.\nThe testing(3) state indicates that no operational\npackets can be passed.") ifLastChange = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 9), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifLastChange.setDescription("The value of sysUpTime at the time the interface\nentered its current operational state. If the\ncurrent state was entered prior to the last re-\ninitialization of the local network management\nsubsystem, then this object contains a zero\nvalue.") ifInOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifInOctets.setDescription("The total number of octets received on the\ninterface, including framing characters.") ifInUcastPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifInUcastPkts.setDescription("The number of subnetwork-unicast packets\ndelivered to a higher-layer protocol.") ifInNUcastPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifInNUcastPkts.setDescription("The number of non-unicast (i.e., subnetwork-\nbroadcast or subnetwork-multicast) packets\ndelivered to a higher-layer protocol.") ifInDiscards = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifInDiscards.setDescription("The number of inbound packets which were chosen\nto be discarded even though no errors had been\ndetected to prevent their being deliverable to a\nhigher-layer protocol. One possible reason for\ndiscarding such a packet could be to free up\nbuffer space.") ifInErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifInErrors.setDescription("The number of inbound packets that contained\nerrors preventing them from being deliverable to a\nhigher-layer protocol.") ifInUnknownProtos = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifInUnknownProtos.setDescription("The number of packets received via the interface\nwhich were discarded because of an unknown or\nunsupported protocol.") ifOutOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifOutOctets.setDescription("The total number of octets transmitted out of the\ninterface, including framing characters.") ifOutUcastPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifOutUcastPkts.setDescription("The total number of packets that higher-level\nprotocols requested be transmitted to a\nsubnetwork-unicast address, including those that\nwere discarded or not sent.") ifOutNUcastPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifOutNUcastPkts.setDescription("The total number of packets that higher-level\nprotocols requested be transmitted to a non-\nunicast (i.e., a subnetwork-broadcast or\nsubnetwork-multicast) address, including those\nthat were discarded or not sent.") ifOutDiscards = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifOutDiscards.setDescription("The number of outbound packets which were chosen\nto be discarded even though no errors had been\ndetected to prevent their being transmitted. One\npossible reason for discarding such a packet could\nbe to free up buffer space.") ifOutErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifOutErrors.setDescription("The number of outbound packets that could not be\ntransmitted because of errors.") ifOutQLen = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 21), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifOutQLen.setDescription("The length of the output packet queue (in\npackets).") ifSpecific = MibTableColumn((1, 3, 6, 1, 2, 1, 2, 2, 1, 22), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifSpecific.setDescription("A reference to MIB definitions specific to the\nparticular media being used to realize the\ninterface. For example, if the interface is\nrealized by an ethernet, then the value of this\nobject refers to a document defining objects\nspecific to ethernet. If this information is not\npresent, its value should be set to the OBJECT\nIDENTIFIER { 0 0 }, which is a syntatically valid\nobject identifier, and any conformant\nimplementation of ASN.1 and BER must be able to\ngenerate and recognize this value.") at = MibIdentifier((1, 3, 6, 1, 2, 1, 3)) atTable = MibTable((1, 3, 6, 1, 2, 1, 3, 1)) if mibBuilder.loadTexts: atTable.setDescription("The Address Translation tables contain the\nNetworkAddress to `physical' address equivalences.\nSome interfaces do not use translation tables for\ndetermining address equivalences (e.g., DDN-X.25\nhas an algorithmic method); if all interfaces are\nof this type, then the Address Translation table\nis empty, i.e., has zero entries.") atEntry = MibTableRow((1, 3, 6, 1, 2, 1, 3, 1, 1)).setIndexNames((0, "RFC1213-MIB", "atIfIndex"), (0, "RFC1213-MIB", "atNetAddressPlaceholder"), (0, "RFC1213-MIB", "atNetAddress")) if mibBuilder.loadTexts: atEntry.setDescription("Each entry contains one NetworkAddress to\n`physical' address equivalence.") atIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 3, 1, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: atIfIndex.setDescription("The interface on which this entry's equivalence\nis effective. The interface identified by a\nparticular value of this index is the same\ninterface as identified by the same value of\nifIndex.") atPhysAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 3, 1, 1, 2), PhysAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: atPhysAddress.setDescription("The media-dependent `physical' address.\n\nSetting this object to a null string (one of zero\nlength) has the effect of invaliding the\ncorresponding entry in the atTable object. That\nis, it effectively dissasociates the interface\nidentified with said entry from the mapping\nidentified with said entry. It is an\nimplementation-specific matter as to whether the\nagent removes an invalidated entry from the table.\nAccordingly, management stations must be prepared\nto receive tabular information from agents that\ncorresponds to entries not currently in use.\nProper interpretation of such entries requires\nexamination of the relevant atPhysAddress object.") atNetAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 3, 1, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: atNetAddress.setDescription("The NetworkAddress (e.g., the IP address)\ncorresponding to the media-dependent `physical'\naddress.") # Pre-index placeholder.Should be done by smidump but it is not for some reason # See RFC2576 2.1.1.10 for details atNetAddressPlaceholder = MibTableColumn((1, 3, 6, 1, 2, 1, 3, 1, 1, 9993), Integer(1)).setMaxAccess("not-accessible") ip = MibIdentifier((1, 3, 6, 1, 2, 1, 4)) ipForwarding = MibScalar((1, 3, 6, 1, 2, 1, 4, 1), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(1,2,)).subtype(namedValues=namedval.NamedValues(("forwarding", 1), ("not-forwarding", 2), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipForwarding.setDescription("The indication of whether this entity is acting\nas an IP gateway in respect to the forwarding of\ndatagrams received by, but not addressed to, this\nentity. IP gateways forward datagrams. IP hosts\ndo not (except those source-routed via the host).\n\nNote that for some managed nodes, this object may\ntake on only a subset of the values possible.\nAccordingly, it is appropriate for an agent to\nreturn a `badValue' response if a management\nstation attempts to change this object to an\ninappropriate value.") ipDefaultTTL = MibScalar((1, 3, 6, 1, 2, 1, 4, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipDefaultTTL.setDescription("The default value inserted into the Time-To-Live\nfield of the IP header of datagrams originated at\nthis entity, whenever a TTL value is not supplied\nby the transport layer protocol.") ipInReceives = MibScalar((1, 3, 6, 1, 2, 1, 4, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipInReceives.setDescription("The total number of input datagrams received from\ninterfaces, including those received in error.") ipInHdrErrors = MibScalar((1, 3, 6, 1, 2, 1, 4, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipInHdrErrors.setDescription("The number of input datagrams discarded due to\nerrors in their IP headers, including bad\nchecksums, version number mismatch, other format\nerrors, time-to-live exceeded, errors discovered\nin processing their IP options, etc.") ipInAddrErrors = MibScalar((1, 3, 6, 1, 2, 1, 4, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipInAddrErrors.setDescription("The number of input datagrams discarded because\nthe IP address in their IP header's destination\nfield was not a valid address to be received at\nthis entity. This count includes invalid\naddresses (e.g., 0.0.0.0) and addresses of\nunsupported Classes (e.g., Class E). For entities\nwhich are not IP Gateways and therefore do not\nforward datagrams, this counter includes datagrams\ndiscarded because the destination address was not\na local address.") ipForwDatagrams = MibScalar((1, 3, 6, 1, 2, 1, 4, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipForwDatagrams.setDescription("The number of input datagrams for which this\nentity was not their final IP destination, as a\nresult of which an attempt was made to find a\nroute to forward them to that final destination.\nIn entities which do not act as IP Gateways, this\ncounter will include only those packets which were\nSource-Routed via this entity, and the Source-\nRoute option processing was successful.") ipInUnknownProtos = MibScalar((1, 3, 6, 1, 2, 1, 4, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipInUnknownProtos.setDescription("The number of locally-addressed datagrams\nreceived successfully but discarded because of an\nunknown or unsupported protocol.") ipInDiscards = MibScalar((1, 3, 6, 1, 2, 1, 4, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipInDiscards.setDescription("The number of input IP datagrams for which no\nproblems were encountered to prevent their\ncontinued processing, but which were discarded\n(e.g., for lack of buffer space). Note that this\ncounter does not include any datagrams discarded\nwhile awaiting re-assembly.") ipInDelivers = MibScalar((1, 3, 6, 1, 2, 1, 4, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipInDelivers.setDescription("The total number of input datagrams successfully\ndelivered to IP user-protocols (including ICMP).") ipOutRequests = MibScalar((1, 3, 6, 1, 2, 1, 4, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipOutRequests.setDescription("The total number of IP datagrams which local IP\nuser-protocols (including ICMP) supplied to IP in\nrequests for transmission. Note that this counter\ndoes not include any datagrams counted in\nipForwDatagrams.") ipOutDiscards = MibScalar((1, 3, 6, 1, 2, 1, 4, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipOutDiscards.setDescription("The number of output IP datagrams for which no\nproblem was encountered to prevent their\ntransmission to their destination, but which were\ndiscarded (e.g., for lack of buffer space). Note\nthat this counter would include datagrams counted\nin ipForwDatagrams if any such packets met this\n(discretionary) discard criterion.") ipOutNoRoutes = MibScalar((1, 3, 6, 1, 2, 1, 4, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipOutNoRoutes.setDescription("The number of IP datagrams discarded because no\nroute could be found to transmit them to their\ndestination. Note that this counter includes any\npackets counted in ipForwDatagrams which meet this\n`no-route' criterion. Note that this includes any\ndatagarms which a host cannot route because all of\nits default gateways are down.") ipReasmTimeout = MibScalar((1, 3, 6, 1, 2, 1, 4, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipReasmTimeout.setDescription("The maximum number of seconds which received\nfragments are held while they are awaiting\nreassembly at this entity.") ipReasmReqds = MibScalar((1, 3, 6, 1, 2, 1, 4, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipReasmReqds.setDescription("The number of IP fragments received which needed\nto be reassembled at this entity.") ipReasmOKs = MibScalar((1, 3, 6, 1, 2, 1, 4, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipReasmOKs.setDescription("The number of IP datagrams successfully re-\nassembled.") ipReasmFails = MibScalar((1, 3, 6, 1, 2, 1, 4, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipReasmFails.setDescription("The number of failures detected by the IP re-\nassembly algorithm (for whatever reason: timed\nout, errors, etc). Note that this is not\nnecessarily a count of discarded IP fragments\nsince some algorithms (notably the algorithm in\nRFC 815) can lose track of the number of fragments\nby combining them as they are received.") ipFragOKs = MibScalar((1, 3, 6, 1, 2, 1, 4, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipFragOKs.setDescription("The number of IP datagrams that have been\nsuccessfully fragmented at this entity.") ipFragFails = MibScalar((1, 3, 6, 1, 2, 1, 4, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipFragFails.setDescription("The number of IP datagrams that have been\ndiscarded because they needed to be fragmented at\nthis entity but could not be, e.g., because their\nDon't Fragment flag was set.") ipFragCreates = MibScalar((1, 3, 6, 1, 2, 1, 4, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipFragCreates.setDescription("The number of IP datagram fragments that have\nbeen generated as a result of fragmentation at\nthis entity.") ipAddrTable = MibTable((1, 3, 6, 1, 2, 1, 4, 20)) if mibBuilder.loadTexts: ipAddrTable.setDescription("The table of addressing information relevant to\nthis entity's IP addresses.") ipAddrEntry = MibTableRow((1, 3, 6, 1, 2, 1, 4, 20, 1)).setIndexNames((0, "RFC1213-MIB", "ipAdEntAddr")) if mibBuilder.loadTexts: ipAddrEntry.setDescription("The addressing information for one of this\nentity's IP addresses.") ipAdEntAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 20, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipAdEntAddr.setDescription("The IP address to which this entry's addressing\ninformation pertains.") ipAdEntIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 20, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipAdEntIfIndex.setDescription("The index value which uniquely identifies the\ninterface to which this entry is applicable. The\ninterface identified by a particular value of this\nindex is the same interface as identified by the\nsame value of ifIndex.") ipAdEntNetMask = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 20, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipAdEntNetMask.setDescription("The subnet mask associated with the IP address of\nthis entry. The value of the mask is an IP\naddress with all the network bits set to 1 and all\nthe hosts bits set to 0.") ipAdEntBcastAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 20, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipAdEntBcastAddr.setDescription("The value of the least-significant bit in the IP\nbroadcast address used for sending datagrams on\nthe (logical) interface associated with the IP\naddress of this entry. For example, when the\nInternet standard all-ones broadcast address is\nused, the value will be 1. This value applies to\nboth the subnet and network broadcasts addresses\nused by the entity on this (logical) interface.") ipAdEntReasmMaxSize = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 20, 1, 5), Integer32().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipAdEntReasmMaxSize.setDescription("The size of the largest IP datagram which this\nentity can re-assemble from incoming IP fragmented\ndatagrams received on this interface.") ipRouteTable = MibTable((1, 3, 6, 1, 2, 1, 4, 21)) if mibBuilder.loadTexts: ipRouteTable.setDescription("This entity's IP Routing table.") ipRouteEntry = MibTableRow((1, 3, 6, 1, 2, 1, 4, 21, 1)).setIndexNames((0, "RFC1213-MIB", "ipRouteDest")) if mibBuilder.loadTexts: ipRouteEntry.setDescription("A route to a particular destination.") ipRouteDest = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRouteDest.setDescription("The destination IP address of this route. An\nentry with a value of 0.0.0.0 is considered a\ndefault route. Multiple routes to a single\ndestination can appear in the table, but access to\nsuch multiple entries is dependent on the table-\naccess mechanisms defined by the network\nmanagement protocol in use.") ipRouteIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRouteIfIndex.setDescription("The index value which uniquely identifies the\nlocal interface through which the next hop of this\nroute should be reached. The interface identified\nby a particular value of this index is the same\ninterface as identified by the same value of\nifIndex.") ipRouteMetric1 = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRouteMetric1.setDescription("The primary routing metric for this route. The\nsemantics of this metric are determined by the\nrouting-protocol specified in the route's\nipRouteProto value. If this metric is not used,\nits value should be set to -1.") ipRouteMetric2 = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRouteMetric2.setDescription("An alternate routing metric for this route. The\nsemantics of this metric are determined by the\nrouting-protocol specified in the route's\nipRouteProto value. If this metric is not used,\nits value should be set to -1.") ipRouteMetric3 = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRouteMetric3.setDescription("An alternate routing metric for this route. The\nsemantics of this metric are determined by the\nrouting-protocol specified in the route's\nipRouteProto value. If this metric is not used,\nits value should be set to -1.") ipRouteMetric4 = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRouteMetric4.setDescription("An alternate routing metric for this route. The\nsemantics of this metric are determined by the\nrouting-protocol specified in the route's\nipRouteProto value. If this metric is not used,\nits value should be set to -1.") ipRouteNextHop = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 7), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRouteNextHop.setDescription("The IP address of the next hop of this route.\n(In the case of a route bound to an interface\nwhich is realized via a broadcast media, the value\nof this field is the agent's IP address on that\ninterface.)") ipRouteType = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 8), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(4,1,3,2,)).subtype(namedValues=namedval.NamedValues(("other", 1), ("invalid", 2), ("direct", 3), ("indirect", 4), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRouteType.setDescription("The type of route. Note that the values\ndirect(3) and indirect(4) refer to the notion of\ndirect and indirect routing in the IP\narchitecture.\n\nSetting this object to the value invalid(2) has\nthe effect of invalidating the corresponding entry\nin the ipRouteTable object. That is, it\neffectively dissasociates the destination\nidentified with said entry from the route\nidentified with said entry. It is an\nimplementation-specific matter as to whether the\nagent removes an invalidated entry from the table.\nAccordingly, management stations must be prepared\nto receive tabular information from agents that\ncorresponds to entries not currently in use.\nProper interpretation of such entries requires\nexamination of the relevant ipRouteType object.") ipRouteProto = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 9), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(14,12,3,13,5,8,10,11,1,9,4,2,7,6,)).subtype(namedValues=namedval.NamedValues(("other", 1), ("es-is", 10), ("ciscoIgrp", 11), ("bbnSpfIgp", 12), ("ospf", 13), ("bgp", 14), ("local", 2), ("netmgmt", 3), ("icmp", 4), ("egp", 5), ("ggp", 6), ("hello", 7), ("rip", 8), ("is-is", 9), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipRouteProto.setDescription("The routing mechanism via which this route was\nlearned. Inclusion of values for gateway routing\nprotocols is not intended to imply that hosts\nshould support those protocols.") ipRouteAge = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 10), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRouteAge.setDescription("The number of seconds since this route was last\nupdated or otherwise determined to be correct.\nNote that no semantics of `too old' can be implied\nexcept through knowledge of the routing protocol\nby which the route was learned.") ipRouteMask = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 11), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRouteMask.setDescription("Indicate the mask to be logical-ANDed with the\ndestination address before being compared to the\nvalue in the ipRouteDest field. For those systems\nthat do not support arbitrary subnet masks, an\nagent constructs the value of the ipRouteMask by\ndetermining whether the value of the correspondent\nipRouteDest field belong to a class-A, B, or C\nnetwork, and then using one of:\n\n mask network\n 255.0.0.0 class-A\n 255.255.0.0 class-B\n 255.255.255.0 class-C\nIf the value of the ipRouteDest is 0.0.0.0 (a\ndefault route), then the mask value is also\n0.0.0.0. It should be noted that all IP routing\nsubsystems implicitly use this mechanism.") ipRouteMetric5 = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 12), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRouteMetric5.setDescription("An alternate routing metric for this route. The\nsemantics of this metric are determined by the\nrouting-protocol specified in the route's\nipRouteProto value. If this metric is not used,\nits value should be set to -1.") ipRouteInfo = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 21, 1, 13), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipRouteInfo.setDescription("A reference to MIB definitions specific to the\nparticular routing protocol which is responsible\nfor this route, as determined by the value\nspecified in the route's ipRouteProto value. If\nthis information is not present, its value should\nbe set to the OBJECT IDENTIFIER { 0 0 }, which is\na syntatically valid object identifier, and any\nconformant implementation of ASN.1 and BER must be\nable to generate and recognize this value.") ipNetToMediaTable = MibTable((1, 3, 6, 1, 2, 1, 4, 22)) if mibBuilder.loadTexts: ipNetToMediaTable.setDescription("The IP Address Translation table used for mapping\nfrom IP addresses to physical addresses.") ipNetToMediaEntry = MibTableRow((1, 3, 6, 1, 2, 1, 4, 22, 1)).setIndexNames((0, "RFC1213-MIB", "ipNetToMediaIfIndex"), (0, "RFC1213-MIB", "ipNetToMediaNetAddress")) if mibBuilder.loadTexts: ipNetToMediaEntry.setDescription("Each entry contains one IpAddress to `physical'\naddress equivalence.") ipNetToMediaIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 22, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipNetToMediaIfIndex.setDescription("The interface on which this entry's equivalence\nis effective. The interface identified by a\nparticular value of this index is the same\ninterface as identified by the same value of\nifIndex.") ipNetToMediaPhysAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 22, 1, 2), PhysAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipNetToMediaPhysAddress.setDescription("The media-dependent `physical' address.") ipNetToMediaNetAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 22, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipNetToMediaNetAddress.setDescription("The IpAddress corresponding to the media-\ndependent `physical' address.") ipNetToMediaType = MibTableColumn((1, 3, 6, 1, 2, 1, 4, 22, 1, 4), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(4,1,3,2,)).subtype(namedValues=namedval.NamedValues(("other", 1), ("invalid", 2), ("dynamic", 3), ("static", 4), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipNetToMediaType.setDescription("The type of mapping.\n\nSetting this object to the value invalid(2) has\nthe effect of invalidating the corresponding entry\nin the ipNetToMediaTable. That is, it effectively\ndissasociates the interface identified with said\nentry from the mapping identified with said entry.\nIt is an implementation-specific matter as to\nwhether the agent removes an invalidated entry\nfrom the table. Accordingly, management stations\nmust be prepared to receive tabular information\nfrom agents that corresponds to entries not\ncurrently in use. Proper interpretation of such\nentries requires examination of the relevant\nipNetToMediaType object.") ipRoutingDiscards = MibScalar((1, 3, 6, 1, 2, 1, 4, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipRoutingDiscards.setDescription("The number of routing entries which were chosen\nto be discarded even though they are valid. One\npossible reason for discarding such an entry could\nbe to free-up buffer space for other routing\nentries.") icmp = MibIdentifier((1, 3, 6, 1, 2, 1, 5)) icmpInMsgs = MibScalar((1, 3, 6, 1, 2, 1, 5, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInMsgs.setDescription("The total number of ICMP messages which the\nentity received. Note that this counter includes\nall those counted by icmpInErrors.") icmpInErrors = MibScalar((1, 3, 6, 1, 2, 1, 5, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInErrors.setDescription("The number of ICMP messages which the entity\nreceived but determined as having ICMP-specific\nerrors (bad ICMP checksums, bad length, etc.).") icmpInDestUnreachs = MibScalar((1, 3, 6, 1, 2, 1, 5, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInDestUnreachs.setDescription("The number of ICMP Destination Unreachable\nmessages received.") icmpInTimeExcds = MibScalar((1, 3, 6, 1, 2, 1, 5, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInTimeExcds.setDescription("The number of ICMP Time Exceeded messages\nreceived.") icmpInParmProbs = MibScalar((1, 3, 6, 1, 2, 1, 5, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInParmProbs.setDescription("The number of ICMP Parameter Problem messages\nreceived.") icmpInSrcQuenchs = MibScalar((1, 3, 6, 1, 2, 1, 5, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInSrcQuenchs.setDescription("The number of ICMP Source Quench messages\nreceived.") icmpInRedirects = MibScalar((1, 3, 6, 1, 2, 1, 5, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInRedirects.setDescription("The number of ICMP Redirect messages received.") icmpInEchos = MibScalar((1, 3, 6, 1, 2, 1, 5, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInEchos.setDescription("The number of ICMP Echo (request) messages\nreceived.") icmpInEchoReps = MibScalar((1, 3, 6, 1, 2, 1, 5, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInEchoReps.setDescription("The number of ICMP Echo Reply messages received.") icmpInTimestamps = MibScalar((1, 3, 6, 1, 2, 1, 5, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInTimestamps.setDescription("The number of ICMP Timestamp (request) messages\nreceived.") icmpInTimestampReps = MibScalar((1, 3, 6, 1, 2, 1, 5, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInTimestampReps.setDescription("The number of ICMP Timestamp Reply messages\nreceived.") icmpInAddrMasks = MibScalar((1, 3, 6, 1, 2, 1, 5, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInAddrMasks.setDescription("The number of ICMP Address Mask Request messages\nreceived.") icmpInAddrMaskReps = MibScalar((1, 3, 6, 1, 2, 1, 5, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpInAddrMaskReps.setDescription("The number of ICMP Address Mask Reply messages\nreceived.") icmpOutMsgs = MibScalar((1, 3, 6, 1, 2, 1, 5, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutMsgs.setDescription("The total number of ICMP messages which this\nentity attempted to send. Note that this counter\nincludes all those counted by icmpOutErrors.") icmpOutErrors = MibScalar((1, 3, 6, 1, 2, 1, 5, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutErrors.setDescription("The number of ICMP messages which this entity did\nnot send due to problems discovered within ICMP\nsuch as a lack of buffers. This value should not\ninclude errors discovered outside the ICMP layer\nsuch as the inability of IP to route the resultant\ndatagram. In some implementations there may be no\ntypes of error which contribute to this counter's\nvalue.") icmpOutDestUnreachs = MibScalar((1, 3, 6, 1, 2, 1, 5, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutDestUnreachs.setDescription("The number of ICMP Destination Unreachable\nmessages sent.") icmpOutTimeExcds = MibScalar((1, 3, 6, 1, 2, 1, 5, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutTimeExcds.setDescription("The number of ICMP Time Exceeded messages sent.") icmpOutParmProbs = MibScalar((1, 3, 6, 1, 2, 1, 5, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutParmProbs.setDescription("The number of ICMP Parameter Problem messages\nsent.") icmpOutSrcQuenchs = MibScalar((1, 3, 6, 1, 2, 1, 5, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutSrcQuenchs.setDescription("The number of ICMP Source Quench messages sent.") icmpOutRedirects = MibScalar((1, 3, 6, 1, 2, 1, 5, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutRedirects.setDescription("The number of ICMP Redirect messages sent. For a\nhost, this object will always be zero, since hosts\ndo not send redirects.") icmpOutEchos = MibScalar((1, 3, 6, 1, 2, 1, 5, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutEchos.setDescription("The number of ICMP Echo (request) messages sent.") icmpOutEchoReps = MibScalar((1, 3, 6, 1, 2, 1, 5, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutEchoReps.setDescription("The number of ICMP Echo Reply messages sent.") icmpOutTimestamps = MibScalar((1, 3, 6, 1, 2, 1, 5, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutTimestamps.setDescription("The number of ICMP Timestamp (request) messages\nsent.") icmpOutTimestampReps = MibScalar((1, 3, 6, 1, 2, 1, 5, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutTimestampReps.setDescription("The number of ICMP Timestamp Reply messages\nsent.") icmpOutAddrMasks = MibScalar((1, 3, 6, 1, 2, 1, 5, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutAddrMasks.setDescription("The number of ICMP Address Mask Request messages\nsent.") icmpOutAddrMaskReps = MibScalar((1, 3, 6, 1, 2, 1, 5, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icmpOutAddrMaskReps.setDescription("The number of ICMP Address Mask Reply messages\nsent.") tcp = MibIdentifier((1, 3, 6, 1, 2, 1, 6)) tcpRtoAlgorithm = MibScalar((1, 3, 6, 1, 2, 1, 6, 1), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(4,1,2,3,)).subtype(namedValues=namedval.NamedValues(("other", 1), ("constant", 2), ("rsre", 3), ("vanj", 4), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpRtoAlgorithm.setDescription("The algorithm used to determine the timeout value\nused for retransmitting unacknowledged octets.") tcpRtoMin = MibScalar((1, 3, 6, 1, 2, 1, 6, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpRtoMin.setDescription("The minimum value permitted by a TCP\nimplementation for the retransmission timeout,\nmeasured in milliseconds. More refined semantics\nfor objects of this type depend upon the algorithm\nused to determine the retransmission timeout. In\nparticular, when the timeout algorithm is rsre(3),\nan object of this type has the semantics of the\nLBOUND quantity described in RFC 793.") tcpRtoMax = MibScalar((1, 3, 6, 1, 2, 1, 6, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpRtoMax.setDescription("The maximum value permitted by a TCP\nimplementation for the retransmission timeout,\nmeasured in milliseconds. More refined semantics\nfor objects of this type depend upon the algorithm\nused to determine the retransmission timeout. In\nparticular, when the timeout algorithm is rsre(3),\nan object of this type has the semantics of the\nUBOUND quantity described in RFC 793.") tcpMaxConn = MibScalar((1, 3, 6, 1, 2, 1, 6, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpMaxConn.setDescription("The limit on the total number of TCP connections\nthe entity can support. In entities where the\nmaximum number of connections is dynamic, this\nobject should contain the value -1.") tcpActiveOpens = MibScalar((1, 3, 6, 1, 2, 1, 6, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpActiveOpens.setDescription("The number of times TCP connections have made a\ndirect transition to the SYN-SENT state from the\nCLOSED state.") tcpPassiveOpens = MibScalar((1, 3, 6, 1, 2, 1, 6, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpPassiveOpens.setDescription("The number of times TCP connections have made a\ndirect transition to the SYN-RCVD state from the\nLISTEN state.") tcpAttemptFails = MibScalar((1, 3, 6, 1, 2, 1, 6, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpAttemptFails.setDescription("The number of times TCP connections have made a\ndirect transition to the CLOSED state from either\nthe SYN-SENT state or the SYN-RCVD state, plus the\nnumber of times TCP connections have made a direct\ntransition to the LISTEN state from the SYN-RCVD\nstate.") tcpEstabResets = MibScalar((1, 3, 6, 1, 2, 1, 6, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpEstabResets.setDescription("The number of times TCP connections have made a\ndirect transition to the CLOSED state from either\nthe ESTABLISHED state or the CLOSE-WAIT state.") tcpCurrEstab = MibScalar((1, 3, 6, 1, 2, 1, 6, 9), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpCurrEstab.setDescription("The number of TCP connections for which the\ncurrent state is either ESTABLISHED or CLOSE-\nWAIT.") tcpInSegs = MibScalar((1, 3, 6, 1, 2, 1, 6, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpInSegs.setDescription("The total number of segments received, including\nthose received in error. This count includes\nsegments received on currently established\nconnections.") tcpOutSegs = MibScalar((1, 3, 6, 1, 2, 1, 6, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpOutSegs.setDescription("The total number of segments sent, including\nthose on current connections but excluding those\ncontaining only retransmitted octets.") tcpRetransSegs = MibScalar((1, 3, 6, 1, 2, 1, 6, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpRetransSegs.setDescription("The total number of segments retransmitted - that\nis, the number of TCP segments transmitted\ncontaining one or more previously transmitted\noctets.") tcpConnTable = MibTable((1, 3, 6, 1, 2, 1, 6, 13)) if mibBuilder.loadTexts: tcpConnTable.setDescription("A table containing TCP connection-specific\ninformation.") tcpConnEntry = MibTableRow((1, 3, 6, 1, 2, 1, 6, 13, 1)).setIndexNames((0, "RFC1213-MIB", "tcpConnLocalAddress"), (0, "RFC1213-MIB", "tcpConnLocalPort"), (0, "RFC1213-MIB", "tcpConnRemAddress"), (0, "RFC1213-MIB", "tcpConnRemPort")) if mibBuilder.loadTexts: tcpConnEntry.setDescription("Information about a particular current TCP\nconnection. An object of this type is transient,\nin that it ceases to exist when (or soon after)\nthe connection makes the transition to the CLOSED\nstate.") tcpConnState = MibTableColumn((1, 3, 6, 1, 2, 1, 6, 13, 1, 1), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(4,5,7,11,9,8,12,6,1,10,2,3,)).subtype(namedValues=namedval.NamedValues(("closed", 1), ("closing", 10), ("timeWait", 11), ("deleteTCB", 12), ("listen", 2), ("synSent", 3), ("synReceived", 4), ("established", 5), ("finWait1", 6), ("finWait2", 7), ("closeWait", 8), ("lastAck", 9), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: tcpConnState.setDescription("The state of this TCP connection.\n\nThe only value which may be set by a management\nstation is deleteTCB(12). Accordingly, it is\nappropriate for an agent to return a `badValue'\nresponse if a management station attempts to set\nthis object to any other value.\n\nIf a management station sets this object to the\nvalue deleteTCB(12), then this has the effect of\ndeleting the TCB (as defined in RFC 793) of the\ncorresponding connection on the managed node,\nresulting in immediate termination of the\nconnection.\n\nAs an implementation-specific option, a RST\nsegment may be sent from the managed node to the\nother TCP endpoint (note however that RST segments\nare not sent reliably).") tcpConnLocalAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 6, 13, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpConnLocalAddress.setDescription("The local IP address for this TCP connection. In\nthe case of a connection in the listen state which\nis willing to accept connections for any IP\ninterface associated with the node, the value\n0.0.0.0 is used.") tcpConnLocalPort = MibTableColumn((1, 3, 6, 1, 2, 1, 6, 13, 1, 3), Integer32().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpConnLocalPort.setDescription("The local port number for this TCP connection.") tcpConnRemAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 6, 13, 1, 4), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpConnRemAddress.setDescription("The remote IP address for this TCP connection.") tcpConnRemPort = MibTableColumn((1, 3, 6, 1, 2, 1, 6, 13, 1, 5), Integer32().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpConnRemPort.setDescription("The remote port number for this TCP connection.") tcpInErrs = MibScalar((1, 3, 6, 1, 2, 1, 6, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpInErrs.setDescription("The total number of segments received in error\n(e.g., bad TCP checksums).") tcpOutRsts = MibScalar((1, 3, 6, 1, 2, 1, 6, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tcpOutRsts.setDescription("The number of TCP segments sent containing the\nRST flag.") udp = MibIdentifier((1, 3, 6, 1, 2, 1, 7)) udpInDatagrams = MibScalar((1, 3, 6, 1, 2, 1, 7, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: udpInDatagrams.setDescription("The total number of UDP datagrams delivered to\nUDP users.") udpNoPorts = MibScalar((1, 3, 6, 1, 2, 1, 7, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: udpNoPorts.setDescription("The total number of received UDP datagrams for\nwhich there was no application at the destination\nport.") udpInErrors = MibScalar((1, 3, 6, 1, 2, 1, 7, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: udpInErrors.setDescription("The number of received UDP datagrams that could\nnot be delivered for reasons other than the lack\nof an application at the destination port.") udpOutDatagrams = MibScalar((1, 3, 6, 1, 2, 1, 7, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: udpOutDatagrams.setDescription("The total number of UDP datagrams sent from this\nentity.") udpTable = MibTable((1, 3, 6, 1, 2, 1, 7, 5)) if mibBuilder.loadTexts: udpTable.setDescription("A table containing UDP listener information.") udpEntry = MibTableRow((1, 3, 6, 1, 2, 1, 7, 5, 1)).setIndexNames((0, "RFC1213-MIB", "udpLocalAddress"), (0, "RFC1213-MIB", "udpLocalPort")) if mibBuilder.loadTexts: udpEntry.setDescription("Information about a particular current UDP\nlistener.") udpLocalAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 7, 5, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: udpLocalAddress.setDescription("The local IP address for this UDP listener. In\nthe case of a UDP listener which is willing to\naccept datagrams for any IP interface associated\nwith the node, the value 0.0.0.0 is used.") udpLocalPort = MibTableColumn((1, 3, 6, 1, 2, 1, 7, 5, 1, 2), Integer32().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: udpLocalPort.setDescription("The local port number for this UDP listener.") egp = MibIdentifier((1, 3, 6, 1, 2, 1, 8)) egpInMsgs = MibScalar((1, 3, 6, 1, 2, 1, 8, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpInMsgs.setDescription("The number of EGP messages received without\nerror.") egpInErrors = MibScalar((1, 3, 6, 1, 2, 1, 8, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpInErrors.setDescription("The number of EGP messages received that proved\nto be in error.") egpOutMsgs = MibScalar((1, 3, 6, 1, 2, 1, 8, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpOutMsgs.setDescription("The total number of locally generated EGP\nmessages.") egpOutErrors = MibScalar((1, 3, 6, 1, 2, 1, 8, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpOutErrors.setDescription("The number of locally generated EGP messages not\nsent due to resource limitations within an EGP\nentity.") egpNeighTable = MibTable((1, 3, 6, 1, 2, 1, 8, 5)) if mibBuilder.loadTexts: egpNeighTable.setDescription("The EGP neighbor table.") egpNeighEntry = MibTableRow((1, 3, 6, 1, 2, 1, 8, 5, 1)).setIndexNames((0, "RFC1213-MIB", "egpNeighAddr")) if mibBuilder.loadTexts: egpNeighEntry.setDescription("Information about this entity's relationship with\na particular EGP neighbor.") egpNeighState = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 1), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(4,3,1,5,2,)).subtype(namedValues=namedval.NamedValues(("idle", 1), ("acquisition", 2), ("down", 3), ("up", 4), ("cease", 5), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighState.setDescription("The EGP state of the local system with respect to\nthis entry's EGP neighbor. Each EGP state is\nrepresented by a value that is one greater than\nthe numerical value associated with said state in\nRFC 904.") egpNeighAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighAddr.setDescription("The IP address of this entry's EGP neighbor.") egpNeighAs = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighAs.setDescription("The autonomous system of this EGP peer. Zero\nshould be specified if the autonomous system\nnumber of the neighbor is not yet known.") egpNeighInMsgs = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighInMsgs.setDescription("The number of EGP messages received without error\nfrom this EGP peer.") egpNeighInErrs = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighInErrs.setDescription("The number of EGP messages received from this EGP\npeer that proved to be in error (e.g., bad EGP\nchecksum).") egpNeighOutMsgs = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighOutMsgs.setDescription("The number of locally generated EGP messages to\nthis EGP peer.") egpNeighOutErrs = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighOutErrs.setDescription("The number of locally generated EGP messages not\nsent to this EGP peer due to resource limitations\nwithin an EGP entity.") egpNeighInErrMsgs = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighInErrMsgs.setDescription("The number of EGP-defined error messages received\nfrom this EGP peer.") egpNeighOutErrMsgs = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighOutErrMsgs.setDescription("The number of EGP-defined error messages sent to\nthis EGP peer.") egpNeighStateUps = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighStateUps.setDescription("The number of EGP state transitions to the UP\nstate with this EGP peer.") egpNeighStateDowns = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighStateDowns.setDescription("The number of EGP state transitions from the UP\nstate to any other state with this EGP peer.") egpNeighIntervalHello = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighIntervalHello.setDescription("The interval between EGP Hello command\nretransmissions (in hundredths of a second). This\nrepresents the t1 timer as defined in RFC 904.") egpNeighIntervalPoll = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighIntervalPoll.setDescription("The interval between EGP poll command\nretransmissions (in hundredths of a second). This\nrepresents the t3 timer as defined in RFC 904.") egpNeighMode = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 14), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(1,2,)).subtype(namedValues=namedval.NamedValues(("active", 1), ("passive", 2), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: egpNeighMode.setDescription("The polling mode of this EGP entity, either\npassive or active.") egpNeighEventTrigger = MibTableColumn((1, 3, 6, 1, 2, 1, 8, 5, 1, 15), Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(1,2,)).subtype(namedValues=namedval.NamedValues(("start", 1), ("stop", 2), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: egpNeighEventTrigger.setDescription("A control variable used to trigger operator-\ninitiated Start and Stop events. When read, this\nvariable always returns the most recent value that\negpNeighEventTrigger was set to. If it has not\nbeen set since the last initialization of the\nnetwork management subsystem on the node, it\nreturns a value of `stop'.\n\nWhen set, this variable causes a Start or Stop\nevent on the specified neighbor, as specified on\npages 8-10 of RFC 904. Briefly, a Start event\ncauses an Idle peer to begin neighbor acquisition\nand a non-Idle peer to reinitiate neighbor\nacquisition. A stop event causes a non-Idle peer\nto return to the Idle state until a Start event\noccurs, either via egpNeighEventTrigger or\notherwise.") egpAs = MibScalar((1, 3, 6, 1, 2, 1, 8, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: egpAs.setDescription("The autonomous system number of this EGP entity.") transmission = MibIdentifier((1, 3, 6, 1, 2, 1, 10)) snmp = MibIdentifier((1, 3, 6, 1, 2, 1, 11)) snmpInPkts = MibScalar((1, 3, 6, 1, 2, 1, 11, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInPkts.setDescription("The total number of Messages delivered to the\nSNMP entity from the transport service.") snmpOutPkts = MibScalar((1, 3, 6, 1, 2, 1, 11, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutPkts.setDescription("The total number of SNMP Messages which were\npassed from the SNMP protocol entity to the\ntransport service.") snmpInBadVersions = MibScalar((1, 3, 6, 1, 2, 1, 11, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInBadVersions.setDescription("The total number of SNMP Messages which were\ndelivered to the SNMP protocol entity and were for\nan unsupported SNMP version.") snmpInBadCommunityNames = MibScalar((1, 3, 6, 1, 2, 1, 11, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInBadCommunityNames.setDescription("The total number of SNMP Messages delivered to\nthe SNMP protocol entity which used a SNMP\ncommunity name not known to said entity.") snmpInBadCommunityUses = MibScalar((1, 3, 6, 1, 2, 1, 11, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInBadCommunityUses.setDescription("The total number of SNMP Messages delivered to\nthe SNMP protocol entity which represented an SNMP\noperation which was not allowed by the SNMP\ncommunity named in the Message.") snmpInASNParseErrs = MibScalar((1, 3, 6, 1, 2, 1, 11, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInASNParseErrs.setDescription("The total number of ASN.1 or BER errors\nencountered by the SNMP protocol entity when\ndecoding received SNMP Messages.") snmpInTooBigs = MibScalar((1, 3, 6, 1, 2, 1, 11, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInTooBigs.setDescription("The total number of SNMP PDUs which were\ndelivered to the SNMP protocol entity and for\nwhich the value of the error-status field is\n`tooBig'.") snmpInNoSuchNames = MibScalar((1, 3, 6, 1, 2, 1, 11, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInNoSuchNames.setDescription("The total number of SNMP PDUs which were\ndelivered to the SNMP protocol entity and for\nwhich the value of the error-status field is\n`noSuchName'.") snmpInBadValues = MibScalar((1, 3, 6, 1, 2, 1, 11, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInBadValues.setDescription("The total number of SNMP PDUs which were\ndelivered to the SNMP protocol entity and for\nwhich the value of the error-status field is\n`badValue'.") snmpInReadOnlys = MibScalar((1, 3, 6, 1, 2, 1, 11, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInReadOnlys.setDescription("The total number valid SNMP PDUs which were\ndelivered to the SNMP protocol entity and for\nwhich the value of the error-status field is\n`readOnly'. It should be noted that it is a\nprotocol error to generate an SNMP PDU which\ncontains the value `readOnly' in the error-status\nfield, as such this object is provided as a means\nof detecting incorrect implementations of the\nSNMP.") snmpInGenErrs = MibScalar((1, 3, 6, 1, 2, 1, 11, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInGenErrs.setDescription("The total number of SNMP PDUs which were\ndelivered to the SNMP protocol entity and for\nwhich the value of the error-status field is\n`genErr'.") snmpInTotalReqVars = MibScalar((1, 3, 6, 1, 2, 1, 11, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInTotalReqVars.setDescription("The total number of MIB objects which have been\nretrieved successfully by the SNMP protocol entity\nas the result of receiving valid SNMP Get-Request\nand Get-Next PDUs.") snmpInTotalSetVars = MibScalar((1, 3, 6, 1, 2, 1, 11, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInTotalSetVars.setDescription("The total number of MIB objects which have been\naltered successfully by the SNMP protocol entity\nas the result of receiving valid SNMP Set-Request\nPDUs.") snmpInGetRequests = MibScalar((1, 3, 6, 1, 2, 1, 11, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInGetRequests.setDescription("The total number of SNMP Get-Request PDUs which\nhave been accepted and processed by the SNMP\nprotocol entity.") snmpInGetNexts = MibScalar((1, 3, 6, 1, 2, 1, 11, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInGetNexts.setDescription("The total number of SNMP Get-Next PDUs which have\nbeen accepted and processed by the SNMP protocol\nentity.") snmpInSetRequests = MibScalar((1, 3, 6, 1, 2, 1, 11, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInSetRequests.setDescription("The total number of SNMP Set-Request PDUs which\nhave been accepted and processed by the SNMP\nprotocol entity.") snmpInGetResponses = MibScalar((1, 3, 6, 1, 2, 1, 11, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInGetResponses.setDescription("The total number of SNMP Get-Response PDUs which\nhave been accepted and processed by the SNMP\nprotocol entity.") snmpInTraps = MibScalar((1, 3, 6, 1, 2, 1, 11, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInTraps.setDescription("The total number of SNMP Trap PDUs which have\nbeen accepted and processed by the SNMP protocol\nentity.") snmpOutTooBigs = MibScalar((1, 3, 6, 1, 2, 1, 11, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutTooBigs.setDescription("The total number of SNMP PDUs which were\ngenerated by the SNMP protocol entity and for\nwhich the value of the error-status field is\n`tooBig.'") snmpOutNoSuchNames = MibScalar((1, 3, 6, 1, 2, 1, 11, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutNoSuchNames.setDescription("The total number of SNMP PDUs which were\ngenerated by the SNMP protocol entity and for\nwhich the value of the error-status is\n`noSuchName'.") snmpOutBadValues = MibScalar((1, 3, 6, 1, 2, 1, 11, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutBadValues.setDescription("The total number of SNMP PDUs which were\ngenerated by the SNMP protocol entity and for\nwhich the value of the error-status field is\n`badValue'.") snmpOutGenErrs = MibScalar((1, 3, 6, 1, 2, 1, 11, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutGenErrs.setDescription("The total number of SNMP PDUs which were\ngenerated by the SNMP protocol entity and for\nwhich the value of the error-status field is\n`genErr'.") snmpOutGetRequests = MibScalar((1, 3, 6, 1, 2, 1, 11, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutGetRequests.setDescription("The total number of SNMP Get-Request PDUs which\nhave been generated by the SNMP protocol entity.") snmpOutGetNexts = MibScalar((1, 3, 6, 1, 2, 1, 11, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutGetNexts.setDescription("The total number of SNMP Get-Next PDUs which have\nbeen generated by the SNMP protocol entity.") snmpOutSetRequests = MibScalar((1, 3, 6, 1, 2, 1, 11, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutSetRequests.setDescription("The total number of SNMP Set-Request PDUs which\nhave been generated by the SNMP protocol entity.") snmpOutGetResponses = MibScalar((1, 3, 6, 1, 2, 1, 11, 28), Counter32()).setMaxAccess("readonly") 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") if mibBuilder.loadTexts: snmpEnableAuthenTraps.setDescription("Indicates whether the SNMP agent process is\npermitted to generate authentication-failure\ntraps. The value of this object overrides any\nconfiguration information; as such, it provides a\nmeans whereby all authentication-failure traps may\nbe disabled.\n\nNote that it is strongly recommended that this\nobject be stored in non-volatile memory so that it\nremains constant between re-initializations of the\nnetwork management system.") # Augmentions # Exports # Types mibBuilder.exportSymbols("RFC1213-MIB", DisplayString=DisplayString, PhysAddress=PhysAddress) # Objects mibBuilder.exportSymbols("RFC1213-MIB", mib_2=mib_2, system=system, sysDescr=sysDescr, sysObjectID=sysObjectID, sysUpTime=sysUpTime, sysContact=sysContact, sysName=sysName, sysLocation=sysLocation, sysServices=sysServices, interfaces=interfaces, ifNumber=ifNumber, ifTable=ifTable, ifEntry=ifEntry, ifIndex=ifIndex, ifDescr=ifDescr, ifType=ifType, ifMtu=ifMtu, ifSpeed=ifSpeed, ifPhysAddress=ifPhysAddress, ifAdminStatus=ifAdminStatus, ifOperStatus=ifOperStatus, ifLastChange=ifLastChange, ifInOctets=ifInOctets, ifInUcastPkts=ifInUcastPkts, ifInNUcastPkts=ifInNUcastPkts, ifInDiscards=ifInDiscards, ifInErrors=ifInErrors, ifInUnknownProtos=ifInUnknownProtos, ifOutOctets=ifOutOctets, ifOutUcastPkts=ifOutUcastPkts, ifOutNUcastPkts=ifOutNUcastPkts, ifOutDiscards=ifOutDiscards, ifOutErrors=ifOutErrors, ifOutQLen=ifOutQLen, ifSpecific=ifSpecific, at=at, atTable=atTable, atEntry=atEntry, atIfIndex=atIfIndex, atPhysAddress=atPhysAddress, atNetAddress=atNetAddress, atNetAddressPlaceholder=atNetAddressPlaceholder, ip=ip, ipForwarding=ipForwarding, ipDefaultTTL=ipDefaultTTL, ipInReceives=ipInReceives, ipInHdrErrors=ipInHdrErrors, ipInAddrErrors=ipInAddrErrors, ipForwDatagrams=ipForwDatagrams, ipInUnknownProtos=ipInUnknownProtos, ipInDiscards=ipInDiscards, ipInDelivers=ipInDelivers, ipOutRequests=ipOutRequests, ipOutDiscards=ipOutDiscards, ipOutNoRoutes=ipOutNoRoutes, ipReasmTimeout=ipReasmTimeout, ipReasmReqds=ipReasmReqds, ipReasmOKs=ipReasmOKs, ipReasmFails=ipReasmFails, ipFragOKs=ipFragOKs, ipFragFails=ipFragFails, ipFragCreates=ipFragCreates, ipAddrTable=ipAddrTable, ipAddrEntry=ipAddrEntry, ipAdEntAddr=ipAdEntAddr, ipAdEntIfIndex=ipAdEntIfIndex, ipAdEntNetMask=ipAdEntNetMask, ipAdEntBcastAddr=ipAdEntBcastAddr, ipAdEntReasmMaxSize=ipAdEntReasmMaxSize, ipRouteTable=ipRouteTable, ipRouteEntry=ipRouteEntry, ipRouteDest=ipRouteDest, ipRouteIfIndex=ipRouteIfIndex, ipRouteMetric1=ipRouteMetric1, ipRouteMetric2=ipRouteMetric2, ipRouteMetric3=ipRouteMetric3, ipRouteMetric4=ipRouteMetric4, ipRouteNextHop=ipRouteNextHop, ipRouteType=ipRouteType, ipRouteProto=ipRouteProto, ipRouteAge=ipRouteAge, ipRouteMask=ipRouteMask, ipRouteMetric5=ipRouteMetric5, ipRouteInfo=ipRouteInfo, ipNetToMediaTable=ipNetToMediaTable, ipNetToMediaEntry=ipNetToMediaEntry, ipNetToMediaIfIndex=ipNetToMediaIfIndex, ipNetToMediaPhysAddress=ipNetToMediaPhysAddress, ipNetToMediaNetAddress=ipNetToMediaNetAddress, ipNetToMediaType=ipNetToMediaType, ipRoutingDiscards=ipRoutingDiscards, icmp=icmp, icmpInMsgs=icmpInMsgs, icmpInErrors=icmpInErrors, icmpInDestUnreachs=icmpInDestUnreachs, icmpInTimeExcds=icmpInTimeExcds, icmpInParmProbs=icmpInParmProbs, icmpInSrcQuenchs=icmpInSrcQuenchs, icmpInRedirects=icmpInRedirects, icmpInEchos=icmpInEchos, icmpInEchoReps=icmpInEchoReps, icmpInTimestamps=icmpInTimestamps, icmpInTimestampReps=icmpInTimestampReps, icmpInAddrMasks=icmpInAddrMasks, icmpInAddrMaskReps=icmpInAddrMaskReps, icmpOutMsgs=icmpOutMsgs, icmpOutErrors=icmpOutErrors, icmpOutDestUnreachs=icmpOutDestUnreachs, icmpOutTimeExcds=icmpOutTimeExcds, icmpOutParmProbs=icmpOutParmProbs, icmpOutSrcQuenchs=icmpOutSrcQuenchs, icmpOutRedirects=icmpOutRedirects, icmpOutEchos=icmpOutEchos, icmpOutEchoReps=icmpOutEchoReps, icmpOutTimestamps=icmpOutTimestamps, icmpOutTimestampReps=icmpOutTimestampReps, icmpOutAddrMasks=icmpOutAddrMasks, icmpOutAddrMaskReps=icmpOutAddrMaskReps, tcp=tcp, tcpRtoAlgorithm=tcpRtoAlgorithm, tcpRtoMin=tcpRtoMin, tcpRtoMax=tcpRtoMax, tcpMaxConn=tcpMaxConn, tcpActiveOpens=tcpActiveOpens, tcpPassiveOpens=tcpPassiveOpens, tcpAttemptFails=tcpAttemptFails, tcpEstabResets=tcpEstabResets) mibBuilder.exportSymbols("RFC1213-MIB", tcpCurrEstab=tcpCurrEstab, tcpInSegs=tcpInSegs, tcpOutSegs=tcpOutSegs, tcpRetransSegs=tcpRetransSegs, tcpConnTable=tcpConnTable, tcpConnEntry=tcpConnEntry, tcpConnState=tcpConnState, tcpConnLocalAddress=tcpConnLocalAddress, tcpConnLocalPort=tcpConnLocalPort, tcpConnRemAddress=tcpConnRemAddress, tcpConnRemPort=tcpConnRemPort, tcpInErrs=tcpInErrs, tcpOutRsts=tcpOutRsts, udp=udp, udpInDatagrams=udpInDatagrams, udpNoPorts=udpNoPorts, udpInErrors=udpInErrors, udpOutDatagrams=udpOutDatagrams, udpTable=udpTable, udpEntry=udpEntry, udpLocalAddress=udpLocalAddress, udpLocalPort=udpLocalPort, egp=egp, egpInMsgs=egpInMsgs, egpInErrors=egpInErrors, egpOutMsgs=egpOutMsgs, egpOutErrors=egpOutErrors, egpNeighTable=egpNeighTable, egpNeighEntry=egpNeighEntry, egpNeighState=egpNeighState, egpNeighAddr=egpNeighAddr, egpNeighAs=egpNeighAs, egpNeighInMsgs=egpNeighInMsgs, egpNeighInErrs=egpNeighInErrs, egpNeighOutMsgs=egpNeighOutMsgs, egpNeighOutErrs=egpNeighOutErrs, egpNeighInErrMsgs=egpNeighInErrMsgs, egpNeighOutErrMsgs=egpNeighOutErrMsgs, egpNeighStateUps=egpNeighStateUps, egpNeighStateDowns=egpNeighStateDowns, egpNeighIntervalHello=egpNeighIntervalHello, egpNeighIntervalPoll=egpNeighIntervalPoll, egpNeighMode=egpNeighMode, egpNeighEventTrigger=egpNeighEventTrigger, egpAs=egpAs, transmission=transmission, snmp=snmp, snmpInPkts=snmpInPkts, snmpOutPkts=snmpOutPkts, snmpInBadVersions=snmpInBadVersions, snmpInBadCommunityNames=snmpInBadCommunityNames, snmpInBadCommunityUses=snmpInBadCommunityUses, snmpInASNParseErrs=snmpInASNParseErrs, snmpInTooBigs=snmpInTooBigs, snmpInNoSuchNames=snmpInNoSuchNames, snmpInBadValues=snmpInBadValues, snmpInReadOnlys=snmpInReadOnlys, snmpInGenErrs=snmpInGenErrs, snmpInTotalReqVars=snmpInTotalReqVars, snmpInTotalSetVars=snmpInTotalSetVars, snmpInGetRequests=snmpInGetRequests, snmpInGetNexts=snmpInGetNexts, snmpInSetRequests=snmpInSetRequests, snmpInGetResponses=snmpInGetResponses, snmpInTraps=snmpInTraps, snmpOutTooBigs=snmpOutTooBigs, snmpOutNoSuchNames=snmpOutNoSuchNames, snmpOutBadValues=snmpOutBadValues, snmpOutGenErrs=snmpOutGenErrs, snmpOutGetRequests=snmpOutGetRequests, snmpOutGetNexts=snmpOutGetNexts, snmpOutSetRequests=snmpOutSetRequests, snmpOutGetResponses=snmpOutGetResponses, snmpOutTraps=snmpOutTraps, snmpEnableAuthenTraps=snmpEnableAuthenTraps) PKz:tƉ33%pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py# PySNMP SMI module. Autogenerated from smidump -f python SNMP-COMMUNITY-MIB # by libsmi2pysnmp-0.0.9-alpha at Thu Mar 26 20:58:11 2009, # Python version (2, 4, 4, 'final', 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") ( 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") ( Bits, Integer32, Integer32, IpAddress, ModuleIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, snmpModules, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "Integer32", "IpAddress", "ModuleIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "snmpModules") ( RowStatus, StorageType, ) = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "StorageType") # Objects snmpCommunityMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 18)).setRevisions(("2000-03-06 00:00","1999-05-13 00:00",)) if mibBuilder.loadTexts: snmpCommunityMIB.setOrganization("SNMPv3 Working Group") if mibBuilder.loadTexts: snmpCommunityMIB.setContactInfo("WG-email: snmpv3@lists.tislabs.com\nSubscribe: majordomo@lists.tislabs.com\n In msg body: subscribe snmpv3\n\nChair: Russ Mundy\n TIS Labs at Network Associates\nPostal: 3060 Washington Rd\n Glenwood MD 21738\n USA\nEmail: mundy@tislabs.com\nPhone: +1-301-854-6889\n\n\n\nCo-editor: Rob Frye\n CoSine Communications\nPostal: 1200 Bridge Parkway\n Redwood City, CA 94065\n USA\nE-mail: rfrye@cosinecom.com\nPhone: +1 703 725 1130\n\nCo-editor: David B. Levi\n Nortel Networks\nPostal: 3505 Kesterwood Drive\n Knoxville, TN 37918\nE-mail: dlevi@nortelnetworks.com\nPhone: +1 423 686 0432\n\nCo-editor: Shawn A. Routhier\n Integrated Systems Inc.\nPostal: 333 North Ave 4th Floor\n Wakefield, MA 01880\nE-mail: sar@epilogue.com\nPhone: +1 781 245 0804\n\nCo-editor: Bert Wijnen\n Lucent Technologies\nPostal: Schagen 33\n 3461 GL Linschoten\n Netherlands\nEmail: bwijnen@lucent.com\nPhone: +31-348-407-775") if mibBuilder.loadTexts: snmpCommunityMIB.setDescription("This MIB module defines objects to help support coexistence\nbetween SNMPv1, SNMPv2c, and SNMPv3.") snmpCommunityMIBObjects = MibIdentifier((1, 3, 6, 1, 6, 3, 18, 1)) 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") 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") 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") 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.") snmpCommunityStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 7), StorageType()).setMaxAccess("readcreate") if mibBuilder.loadTexts: snmpCommunityStorageType.setDescription("The storage type for this conceptual row in the\nsnmpCommunityTable. Conceptual rows having the value\n'permanent' need not allow write-access to any\ncolumnar object in the row.") snmpCommunityStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 18, 1, 1, 1, 8), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: snmpCommunityStatus.setDescription("The status of this conceptual row in the snmpCommunityTable.\n\nAn entry in this table is not qualified for activation\nuntil instances of all corresponding columns have been\ninitialized, either through default values, or through\nSet operations. The snmpCommunityName and\nsnmpCommunitySecurityName objects must be explicitly set.\n\nThere is no restriction on setting columns in this table\nwhen the value of snmpCommunityStatus is active(1).") 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") 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,2147483647L),)).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.") snmpTrapCommunity = MibScalar((1, 3, 6, 1, 6, 3, 18, 1, 4), OctetString()).setMaxAccess("notifyonly") if mibBuilder.loadTexts: snmpTrapCommunity.setDescription("The value of the community string field of an SNMPv1\nmessage containing a Trap PDU which is forwarded by a\na proxy forwarder application using an SNMP version\nother than SNMPv1. The value of this object SHOULD\ncontain the value of the community string field from\nthe original SNMPv1 message containing a Trap PDU as\ngenerated by an SNMPv1 agent.") snmpCommunityMIBConformance = MibIdentifier((1, 3, 6, 1, 6, 3, 18, 2)) snmpCommunityMIBCompliances = MibIdentifier((1, 3, 6, 1, 6, 3, 18, 2, 1)) snmpCommunityMIBGroups = MibIdentifier((1, 3, 6, 1, 6, 3, 18, 2, 2)) # Augmentions snmpTargetAddrEntry, = mibBuilder.importSymbols("SNMP-TARGET-MIB", "snmpTargetAddrEntry") snmpTargetAddrEntry.registerAugmentions(("SNMP-COMMUNITY-MIB", "snmpTargetAddrExtEntry")) apply(snmpTargetAddrExtEntry.setIndexNames, snmpTargetAddrEntry.getIndexNames()) # Groups snmpProxyTrapForwardGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 18, 2, 2, 3)).setObjects(("SNMP-COMMUNITY-MIB", "snmpTrapAddress"), ("SNMP-COMMUNITY-MIB", "snmpTrapCommunity"), ) snmpCommunityGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 18, 2, 2, 1)).setObjects(("SNMP-COMMUNITY-MIB", "snmpCommunityStorageType"), ("SNMP-COMMUNITY-MIB", "snmpTargetAddrTMask"), ("SNMP-COMMUNITY-MIB", "snmpCommunityContextEngineID"), ("SNMP-COMMUNITY-MIB", "snmpCommunityStatus"), ("SNMP-COMMUNITY-MIB", "snmpCommunityContextName"), ("SNMP-COMMUNITY-MIB", "snmpCommunitySecurityName"), ("SNMP-COMMUNITY-MIB", "snmpCommunityName"), ("SNMP-COMMUNITY-MIB", "snmpTargetAddrMMS"), ("SNMP-COMMUNITY-MIB", "snmpCommunityTransportTag"), ) # Exports # Module identity mibBuilder.exportSymbols("SNMP-COMMUNITY-MIB", PYSNMP_MODULE_ID=snmpCommunityMIB) # Objects mibBuilder.exportSymbols("SNMP-COMMUNITY-MIB", snmpCommunityMIB=snmpCommunityMIB, snmpCommunityMIBObjects=snmpCommunityMIBObjects, snmpCommunityTable=snmpCommunityTable, snmpCommunityEntry=snmpCommunityEntry, snmpCommunityIndex=snmpCommunityIndex, snmpCommunityName=snmpCommunityName, snmpCommunitySecurityName=snmpCommunitySecurityName, snmpCommunityContextEngineID=snmpCommunityContextEngineID, snmpCommunityContextName=snmpCommunityContextName, snmpCommunityTransportTag=snmpCommunityTransportTag, snmpCommunityStorageType=snmpCommunityStorageType, snmpCommunityStatus=snmpCommunityStatus, snmpTargetAddrExtTable=snmpTargetAddrExtTable, snmpTargetAddrExtEntry=snmpTargetAddrExtEntry, snmpTargetAddrTMask=snmpTargetAddrTMask, snmpTargetAddrMMS=snmpTargetAddrMMS, snmpTrapAddress=snmpTrapAddress, snmpTrapCommunity=snmpTrapCommunity, snmpCommunityMIBConformance=snmpCommunityMIBConformance, snmpCommunityMIBCompliances=snmpCommunityMIBCompliances, snmpCommunityMIBGroups=snmpCommunityMIBGroups) # Groups mibBuilder.exportSymbols("SNMP-COMMUNITY-MIB", snmpProxyTrapForwardGroup=snmpProxyTrapForwardGroup, snmpCommunityGroup=snmpCommunityGroup) PKAq>) ) $pysnmp/smi/mibs/SNMP-USM-AES-MIB.pyc; %Ic @sudklZlZeidddd\ZZZeidd\Zeiddd d d d d d\Z Z Z Z Z ZZe ddddddddddf Zeioeidne dddddddfidfZeioeidneioeidneioeidneiddeeiddededS( (s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStringsSNMP-FRAMEWORK-MIBssnmpPrivProtocolss SNMPv2-SMIsBitss Integer32sModuleIdentitys MibIdentifiersObjectIdentitys TimeTickss snmpModulesiiii iis$The CFB128-AES-128 Privacy Protocol.is2004-06-14 00:00sIETFsfUri Blumenthal Lucent Technologies / Bell Labs 67 Whippany Rd. 14D-318 Whippany, NJ 07981, USA 973-386-2163 uri@bell-labs.com Fabio Maino Andiamo Systems, Inc. 375 East Tasman Drive San Jose, CA 95134, USA 408-853-7530 fmaino@andiamo.com Keith McCloghrie Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706, USA 408-526-5260 kzm@cisco.comsGDefinitions of Object Identities needed for the use of AES by SNMP's User-based Security Model. Copyright (C) The Internet Society (2004). This version of this MIB module is part of RFC 3826; see the RFC itself for full legal notices. Supplementary information may be available on http://www.ietf.org/copyrights/ianamib.html.sSNMP-USM-AES-MIBsPYSNMP_MODULE_IDsusmAesCfb128Protocols snmpUsmAesMIBN(s pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringssnmpPrivProtocolssBitss Integer32sModuleIdentitys MibIdentifiersObjectIdentitys TimeTickss snmpModulessusmAesCfb128Protocols loadTextsssetDescriptions setRevisionss snmpUsmAesMIBssetOrganizationssetContactInfos exportSymbols(s Integer32s OctetStringsusmAesCfb128Protocols MibIdentifiers constraintsBitss TimeTickssModuleIdentityssnmpPrivProtocolssObjectIdentifiers snmpModulessIntegersnamedvalsObjectIdentitys snmpUsmAesMIB((s>build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-USM-AES-MIB.pys?s!9* -   PKz:" g!pysnmp/smi/mibs/PYSNMP-USM-MIB.py# PySNMP SMI module. Autogenerated from smidump -f python PYSNMP-USM-MIB # by libsmi2pysnmp-0.0.9-alpha at Thu Mar 26 20:58:59 2009, # Python version (2, 4, 4, 'final', 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") ( pysnmpModuleIDs, ) = mibBuilder.importSymbols("PYSNMP-MIB", "pysnmpModuleIDs") ( SnmpAdminString, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ( usmUserEntry, ) = mibBuilder.importSymbols("SNMP-USER-BASED-SM-MIB", "usmUserEntry") ( Bits, Integer32, ModuleIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "ModuleIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks") ( RowStatus, ) = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus") # Objects pysnmpUsmMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1)).setRevisions(("2005-05-14 00:00",)) if mibBuilder.loadTexts: pysnmpUsmMIB.setOrganization("The PySNMP project") if mibBuilder.loadTexts: pysnmpUsmMIB.setContactInfo("E-mail: ilya@glas.net\nSubscribe: pysnmp-users-request@lists.sourceforge.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") 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") 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") 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") 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") 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") 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") 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") 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") 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)) pysnmpUsmMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 2, 2)) # Augmentions usmUserEntry, = mibBuilder.importSymbols("SNMP-USER-BASED-SM-MIB", "usmUserEntry") usmUserEntry.registerAugmentions(("PYSNMP-USM-MIB", "pysnmpUsmKeyEntry")) apply(pysnmpUsmKeyEntry.setIndexNames, usmUserEntry.getIndexNames()) # Exports # Module identity mibBuilder.exportSymbols("PYSNMP-USM-MIB", PYSNMP_MODULE_ID=pysnmpUsmMIB) # Objects mibBuilder.exportSymbols("PYSNMP-USM-MIB", pysnmpUsmMIB=pysnmpUsmMIB, pysnmpUsmMIBObjects=pysnmpUsmMIBObjects, pysnmpUsmCfg=pysnmpUsmCfg, pysnmpUsmDiscoverable=pysnmpUsmDiscoverable, pysnmpUsmDiscovery=pysnmpUsmDiscovery, pysnmpUsmSecretTable=pysnmpUsmSecretTable, pysnmpUsmSecretEntry=pysnmpUsmSecretEntry, pysnmpUsmSecretUserName=pysnmpUsmSecretUserName, pysnmpUsmSecretAuthKey=pysnmpUsmSecretAuthKey, pysnmpUsmSecretPrivKey=pysnmpUsmSecretPrivKey, pysnmpUsmSecretStatus=pysnmpUsmSecretStatus, pysnmpUsmUser=pysnmpUsmUser, pysnmpUsmKeyEntry=pysnmpUsmKeyEntry, pysnmpUsmKeyAuthLocalized=pysnmpUsmKeyAuthLocalized, pysnmpUsmKeyPrivLocalized=pysnmpUsmKeyPrivLocalized, pysnmpUsmKeyAuth=pysnmpUsmKeyAuth, pysnmpUsmKeyPriv=pysnmpUsmKeyPriv, pysnmpUsmMIBConformance=pysnmpUsmMIBConformance, pysnmpUsmMIBCompliances=pysnmpUsmMIBCompliances, pysnmpUsmMIBGroups=pysnmpUsmMIBGroups) PKAq>$2  pysnmp/smi/mibs/SNMPv2-TM.pyc; \;Mc@sdkZdkZdklZeidd\Zeidddddd d \ZZZ Z Z Z eid d \Z ee id fidfZe e idfZde efdYZe e idfZe e idfZde efdYZe e idfZdee fdYZe e idfZde efdYZee idfZeeidfZeiddeeiddededed ed!eded"eded#eded$ed%e dS(&N(s constraintsASN1s OctetStrings SNMPv2-SMIsModuleIdentitys MibIdentifiersObjectIdentitys snmpModuless snmpDomainss snmpProxyss SNMPv2-TCsTextualConventionis2002-10-16 00:00isSnmpUDPAddresscBs9tZeieiddZdZdZdZRS(Nis1d.1d.1d.1d/2dcCst|tijoXtdtdti|ddt|dd?d@t|dd@Snt i ||SdS(NcCs||S(N(sxsy(sxsy((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TM.pysscCstti|S(N(schrsstringsatoisx(sx((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TM.pyssis.iii( stypesvaluestypess TupleTypesreducesmapsstringssplitschrs OctetStringsprettyInsself(sselfsvalue((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TM.pysprettyInsXcCst|d oydt|idt|idt|idt|idft|idd>t|id Bf|_n|i|SdS( Ns __tuple_values %s.%s.%s.%siiiiiii(shasattrsselfsords_values_SnmpUDPAddress__tuple_valuesi(sselfsi((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TM.pys __getitem__sy( s__name__s __module__s OctetStrings subtypeSpecs constraintsValueSizeConstraints displayHintsprettyIns __getitem__(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TM.pysSnmpUDPAddresss iisSnmpOSIAddresscBs'tZeieiddZdZRS(NiiUs*1x:/1x:(s__name__s __module__s OctetStrings subtypeSpecs constraintsValueSizeConstraints displayHint(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TM.pysSnmpOSIAddress'sisSnmpNBPAddresscBs!tZeieiddZRS(Niic(s__name__s __module__s OctetStrings subtypeSpecs constraintsValueSizeConstraint(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TM.pysSnmpNBPAddress-sisSnmpIPXAddresscBs'tZeieiddZdZRS(Ni s4x.1x:1x:1x:1x:1x:1x.2d(s__name__s __module__s OctetStrings subtypeSpecs constraintsValueSizeConstraints displayHint(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TM.pysSnmpIPXAddress2ss SNMPv2-TMsPYSNMP_MODULE_IDssnmpv2tms snmpUDPDomainssnmpCLNSDomainssnmpCONSDomains snmpDDPDomains snmpIPXDomains rfc1157Proxys rfc1157Domain(stypessstrings pyasn1.types constraints mibBuilders importSymbolss OctetStringsModuleIdentitys MibIdentifiersObjectIdentitys snmpModuless snmpDomainss snmpProxyssTextualConventionsnames setRevisionsssnmpv2tms snmpUDPDomainsSnmpUDPAddressssnmpCLNSDomainssnmpCONSDomainsSnmpOSIAddresss snmpDDPDomainsSnmpNBPAddresss snmpIPXDomainsSnmpIPXAddresss rfc1157Proxys rfc1157Domains exportSymbols(s rfc1157DomainsSnmpNBPAddresssModuleIdentitys snmpProxyss snmpModuless snmpIPXDomainsSnmpIPXAddresssSnmpUDPAddresss rfc1157Proxys snmpUDPDomains snmpDomainsssnmpCONSDomains OctetStringsstringssnmpv2tmstypess constraints snmpDDPDomainsTextualConventionssnmpCLNSDomains MibIdentifiersSnmpOSIAddresssObjectIdentity((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TM.pys?s2 !"    PKݩz: pysnmp/smi/mibs/PYSNMP-MIB.py# PySNMP SMI module. Autogenerated from smidump -f python PYSNMP-MIB # by libsmi2pysnmp-0.0.9-alpha at Thu Mar 26 20:58:59 2009, # Python version (2, 4, 4, 'final', 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") ( Bits, Integer32, ModuleIdentity, MibIdentifier, TimeTicks, enterprises, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "ModuleIdentity", "MibIdentifier", "TimeTicks", "enterprises") # Objects pysnmp = ModuleIdentity((1, 3, 6, 1, 4, 1, 20408)).setRevisions(("2005-05-14 00:00",)) if mibBuilder.loadTexts: pysnmp.setOrganization("pysnmp.sf.net") if mibBuilder.loadTexts: pysnmp.setContactInfo("email: ilya@glas.net") if mibBuilder.loadTexts: pysnmp.setDescription("Top-level infrastructure of the PySNMP project enterprise MIB tree") pysnmpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 1)) pysnmpExamples = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 2)) pysnmpEnumerations = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3)) pysnmpModuleIDs = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 1)) pysnmpAgentOIDs = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 2)) pysnmpDomains = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 3)) pysnmpNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 4)) pysnmpNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 4, 0)) pysnmpNotificationObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 4, 1)) pysnmpConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 5)) pysnmpCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 5, 1)) pysnmpGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 5, 2)) pysnmpExperimental = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 9999)) # Augmentions # Exports # Module identity mibBuilder.exportSymbols("PYSNMP-MIB", PYSNMP_MODULE_ID=pysnmp) # Objects mibBuilder.exportSymbols("PYSNMP-MIB", pysnmp=pysnmp, pysnmpObjects=pysnmpObjects, pysnmpExamples=pysnmpExamples, pysnmpEnumerations=pysnmpEnumerations, pysnmpModuleIDs=pysnmpModuleIDs, pysnmpAgentOIDs=pysnmpAgentOIDs, pysnmpDomains=pysnmpDomains, pysnmpNotificationPrefix=pysnmpNotificationPrefix, pysnmpNotifications=pysnmpNotifications, pysnmpNotificationObjects=pysnmpNotificationObjects, pysnmpConformance=pysnmpConformance, pysnmpCompliances=pysnmpCompliances, pysnmpGroups=pysnmpGroups, pysnmpExperimental=pysnmpExperimental) PK 5=wN %pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py# 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) try: import socket import os except ImportError: pass import string import time # 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") ( 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") # Types class SnmpAdminString(TextualConvention, OctetString): displayHint = "255t" subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(0,255) class SnmpEngineID(OctetString, TextualConvention): subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(5,32) defaultValue = '\x80\x00\x4f\xb8' + '\x05' try: # Attempt to base engine ID on local IP address defaultValue = defaultValue + string.join( map(lambda x: chr(int(x)), string.split(socket.gethostbyname(socket.gethostname()),'.')), '' ) except: pass try: # Attempt to base engine ID on PID defaultValue = defaultValue + chr(os.getpid() >> 8) + chr(os.getpid() & 0xff) except: pass # ...in any case, use pseudo-random text ID t = int(time.time()) defaultValue = defaultValue + chr(t >> 16 & 0xff) + chr(t >> 8 & 0xff) + chr(t & 0xff) class SnmpEngineTime(Integer32): def clone(self, value=None, tagSet=None, subtypeSpec=None): if value is None and self._value is not None: value = int(time.time())-self._value return Integer32.clone(self, value, tagSet, subtypeSpec) class SnmpMessageProcessingModel(Integer32): subtypeSpec = Integer32.subtypeSpec+constraint.ValueRangeConstraint(0,2147483647L) class SnmpSecurityLevel(Integer): subtypeSpec = Integer.subtypeSpec+constraint.SingleValueConstraint(1,3,2,) namedValues = namedval.NamedValues(("noAuthNoPriv", 1), ("authNoPriv", 2), ("authPriv", 3), ) class SnmpSecurityModel(Integer32): subtypeSpec = Integer32.subtypeSpec+constraint.ValueRangeConstraint(0,2147483647L) # Objects snmpFrameworkMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 10)).setRevisions(("2002-10-14 00:00","1999-01-19 00:00","1997-11-20 00:00",)) if mibBuilder.loadTexts: snmpFrameworkMIB.setOrganization("SNMPv3 Working Group") if mibBuilder.loadTexts: snmpFrameworkMIB.setContactInfo("WG-EMail: snmpv3@lists.tislabs.com\nSubscribe: snmpv3-request@lists.tislabs.com\n\nCo-Chair: Russ Mundy\n Network Associates Laboratories\npostal: 15204 Omega Drive, Suite 300\n Rockville, MD 20850-4601\n USA\nEMail: mundy@tislabs.com\nphone: +1 301-947-7107\n\nCo-Chair &\nCo-editor: David Harrington\n Enterasys Networks\npostal: 35 Industrial Way\n P. O. Box 5005\n Rochester, New Hampshire 03866-5005\n USA\nEMail: dbh@enterasys.com\nphone: +1 603-337-2614\n\nCo-editor: Randy Presuhn\n BMC Software, Inc.\npostal: 2141 North First Street\n San Jose, California 95131\n USA\nEMail: randy_presuhn@bmc.com\nphone: +1 408-546-1006\n\nCo-editor: Bert Wijnen\n Lucent Technologies\npostal: Schagen 33\n 3461 GL Linschoten\n Netherlands\n\n\n\nEMail: bwijnen@lucent.com\nphone: +31 348-680-485\n ") if mibBuilder.loadTexts: snmpFrameworkMIB.setDescription("The SNMP Management Architecture MIB\n\nCopyright (C) The Internet Society (2002). This\nversion of this MIB module is part of RFC 3411;\nsee the RFC itself for full legal notices.") snmpFrameworkAdmin = MibIdentifier((1, 3, 6, 1, 6, 3, 10, 1)) snmpAuthProtocols = ObjectIdentity((1, 3, 6, 1, 6, 3, 10, 1, 1)) if mibBuilder.loadTexts: snmpAuthProtocols.setDescription("Registration point for standards-track\nauthentication protocols used in SNMP Management\nFrameworks.") snmpPrivProtocols = ObjectIdentity((1, 3, 6, 1, 6, 3, 10, 1, 2)) if mibBuilder.loadTexts: snmpPrivProtocols.setDescription("Registration point for standards-track privacy\nprotocols used in SNMP Management Frameworks.") 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, 2147483647L))).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, 2147483647L))).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, 2147483647L))).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)) snmpFrameworkMIBGroups = MibIdentifier((1, 3, 6, 1, 6, 3, 10, 3, 2)) # Augmentions # Groups snmpEngineGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 10, 3, 2, 1)).setObjects(("SNMP-FRAMEWORK-MIB", "snmpEngineID"), ("SNMP-FRAMEWORK-MIB", "snmpEngineBoots"), ("SNMP-FRAMEWORK-MIB", "snmpEngineMaxMessageSize"), ("SNMP-FRAMEWORK-MIB", "snmpEngineTime"), ) # Exports # Module identity mibBuilder.exportSymbols("SNMP-FRAMEWORK-MIB", PYSNMP_MODULE_ID=snmpFrameworkMIB) # Types mibBuilder.exportSymbols("SNMP-FRAMEWORK-MIB", SnmpAdminString=SnmpAdminString, SnmpEngineID=SnmpEngineID, SnmpEngineTime=SnmpEngineTime, SnmpMessageProcessingModel=SnmpMessageProcessingModel, SnmpSecurityLevel=SnmpSecurityLevel, SnmpSecurityModel=SnmpSecurityModel) # Objects mibBuilder.exportSymbols("SNMP-FRAMEWORK-MIB", snmpFrameworkMIB=snmpFrameworkMIB, snmpFrameworkAdmin=snmpFrameworkAdmin, snmpAuthProtocols=snmpAuthProtocols, snmpPrivProtocols=snmpPrivProtocols, snmpFrameworkMIBObjects=snmpFrameworkMIBObjects, snmpEngine=snmpEngine, snmpEngineID=snmpEngineID, snmpEngineBoots=snmpEngineBoots, snmpEngineTime=snmpEngineTime, snmpEngineMaxMessageSize=snmpEngineMaxMessageSize, snmpFrameworkMIBConformance=snmpFrameworkMIBConformance, snmpFrameworkMIBCompliances=snmpFrameworkMIBCompliances, snmpFrameworkMIBGroups=snmpFrameworkMIBGroups) # Groups mibBuilder.exportSymbols("SNMP-FRAMEWORK-MIB", snmpEngineGroup=snmpEngineGroup) PKz:rr#pysnmp/smi/mibs/SNMP-USM-AES-MIB.py# PySNMP SMI module. Autogenerated from smidump -f python SNMP-USM-AES-MIB # by libsmi2pysnmp-0.0.9-alpha at Thu Mar 26 20:58:12 2009, # Python version (2, 4, 4, 'final', 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") ( 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") # Objects usmAesCfb128Protocol = ObjectIdentity((1, 3, 6, 1, 6, 3, 10, 1, 2, 4)) if mibBuilder.loadTexts: usmAesCfb128Protocol.setDescription("The CFB128-AES-128 Privacy Protocol.") snmpUsmAesMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 20)).setRevisions(("2004-06-14 00:00",)) if mibBuilder.loadTexts: snmpUsmAesMIB.setOrganization("IETF") if mibBuilder.loadTexts: snmpUsmAesMIB.setContactInfo("Uri Blumenthal\nLucent Technologies / Bell Labs\n67 Whippany Rd.\n14D-318\nWhippany, NJ 07981, USA\n973-386-2163\nuri@bell-labs.com\n\nFabio Maino\nAndiamo Systems, Inc.\n375 East Tasman Drive\nSan Jose, CA 95134, USA\n408-853-7530\nfmaino@andiamo.com\n\nKeith McCloghrie\nCisco Systems, Inc.\n170 West Tasman Drive\nSan Jose, CA 95134-1706, USA\n\n408-526-5260\nkzm@cisco.com") if mibBuilder.loadTexts: snmpUsmAesMIB.setDescription("Definitions of Object Identities needed for\nthe use of AES by SNMP's User-based Security\nModel.\n\nCopyright (C) The Internet Society (2004).\n\nThis version of this MIB module is part of RFC 3826;\nsee the RFC itself for full legal notices.\nSupplementary information may be available on\nhttp://www.ietf.org/copyrights/ianamib.html.") # Augmentions # Exports # Module identity mibBuilder.exportSymbols("SNMP-USM-AES-MIB", PYSNMP_MODULE_ID=snmpUsmAesMIB) # Objects mibBuilder.exportSymbols("SNMP-USM-AES-MIB", usmAesCfb128Protocol=usmAesCfb128Protocol, snmpUsmAesMIB=snmpUsmAesMIB) PKAq> M__+pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.pyc; %IcJ@sdklZlZeidddd\ZZZeidddd\ZZ Z eid d d \Z Z eid d ddddddddd \ Z ZZZZZZZZZeidddd\ZZZedddddddfidd d!fZeioeid"neioeid#neioeid$neddddddddfZ edddddddddf Z!eioe!id%neddddddddddf i"d&d'd(fZ#eioe#id)nedddddddddddf ei$d*ei%d&d+i&d,Z'eioe'id-neddddddddd.f Z(eioe(id/neddddddddd.df i"d&d'd0fd&d'd1fZ)eioe)id2neddddddddd.ddf e i$d*ei*dd3i&d4Z+eioe+id5neddddddddd.dd.f ei$d*ei%dd+i&d4Z,eioe,id6neddddddddd.ddf ei$d*ei%dd+i&d7Z-eioe-id8neddddddddd.dd9f ei.d:i&d7Z/eioe/id;neddddddddd.dd<f ei&d7Z0eioe0id=neddddddddd9f Z1eioe1id>neddddddddd9df i"d&d'd?fd&d'd@fd&d'dAfd&d'dBfZ2eioe2idCneddddddddd9ddf ei$d*ei%d&d+i&d4Z3eioe3idDneddddddddd9dd.f e i&d4Z4eioe4idEneddddddddd9ddf e i&d4Z5eioe5idFneddddddddd9dd9f ei$d*ei6d.di$dGei7dHdfdId.fi.di&d7Z8eioe8idJneddddddddd9dd<f ei$d*ei%d&d+i.dKi&d7Z9eioe9idLneddddddddd9ddf ei$d*ei%d&d+i.dKi&d7Z:eioe:idMneddddddddd9ddNf ei$d*ei%d&d+i.dKi&d7Z;eioe;idOneddddddddd9ddPf ei.d:i&d7Z<eioe<idQneddddddddd9ddRf ei&d7Z=eioe=idSneddddddddd<f Z>eddddddddd<df ei&dTZ?eioe?idUneddddddddd<d.f Z@eioe@idVneddddddddd<d.df i"d&d'dWfd&d'dXfZAeioeAidYneddddddddd<d.ddf ei$d*ei%dd+i&d4ZBeioeBidZneddddddddd<d.dd.f ei&d4ZCeioeCid[neddddddddd<d.ddf ei$d*ei%d&di.dKi&d7ZDeioeDid\neddddddddd<d.dd9f ei$d*ei6dd.i$dGei7d]dfd^d.fi.di&d7ZEeioeEid_neddddddddd<d.dd<f ei.d:i&d7ZFeioeFidQneddddddddd<d.ddf ei&d7ZGeioeGid`nedddddddd.fZHedddddddd.df ZIedddddddd.d.f ZJe dddddddd.d.df iKd'dafd'dbfd'dcfd'ddfd'd?fd'defd'dffd'dgfd'dhfd'difd'djfd'dkfd'dlfd'd(fd'dmfZLeiMd'dneeiMd'doedpe dqe!dre#d(e'dse(dte)d0e+d1e,d?e-dge/dke0due1dve2d@e3dAe4dBe5dfe8dje9dme:dde;dle<dbe=dwe>dee?dxe@dyeAdWeBdXeCdheDdieEdaeFdceGdzeHd{eId|eJ$eiMd'd}eLd~S((s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStringsSNMP-FRAMEWORK-MIBsSnmpAdminStringsSnmpSecurityLevelsSnmpSecurityModels SNMPv2-CONFsModuleCompliances ObjectGroups SNMPv2-SMIsBitss Integer32sModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModuless SNMPv2-TCs RowStatuss StorageTypes TestAndIncriiiis2002-10-16 00:00s1999-01-20 00:00s1997-11-20 00:00sSNMPv3 Working GroupsWG-email: snmpv3@lists.tislabs.com Subscribe: majordomo@lists.tislabs.com In message body: subscribe snmpv3 Co-Chair: Russ Mundy Network Associates Laboratories postal: 15204 Omega Drive, Suite 300 Rockville, MD 20850-4601 USA email: mundy@tislabs.com phone: +1 301-947-7107 Co-Chair: David Harrington Enterasys Networks Postal: 35 Industrial Way P. O. Box 5004 Rochester, New Hampshire 03866-5005 USA EMail: dbh@enterasys.com Phone: +1 603-337-2614 Co-editor: Bert Wijnen Lucent Technologies postal: Schagen 33 3461 GL Linschoten Netherlands email: bwijnen@lucent.com phone: +31-348-480-685 Co-editor: Randy Presuhn BMC Software, Inc. postal: 2141 North First Street San Jose, CA 95131 USA email: randy_presuhn@bmc.com phone: +1 408-546-1006 Co-editor: Keith McCloghrie Cisco Systems, Inc. postal: 170 West Tasman Drive San Jose, CA 95134-1706 USA email: kzm@cisco.com phone: +1-408-526-5260sThe management information definitions for the View-based Access Control Model for SNMP. Copyright (C) The Internet Society (2002). This version of this MIB module is part of RFC 3415; see the RFC itself for full legal notices.sDThe table of locally available contexts. This table provides information to SNMP Command Generator applications so that they can properly configure the vacmAccessTable to control access to all contexts at the SNMP entity. This table may change dynamically if the SNMP entity allows that contexts are added/deleted dynamically (for instance when its configuration changes). Such changes would happen only if the management instrumentation at that SNMP entity recognizes more (or fewer) contexts. The presence of entries in this table and of entries in the vacmAccessTable are independent. That is, a context identified by an entry in this table is not necessarily referenced by any entries in the vacmAccessTable; and the context(s) referenced by an entry in the vacmAccessTable does not necessarily currently exist and thus need not be identified by an entry in this table. This table must be made accessible via the default context so that Command Responder applications have a standard way of retrieving the information. This table is read-only. It cannot be configured via SNMP.isSNMP-VIEW-BASED-ACM-MIBsvacmContextNames'Information about a particular context.s subtypeSpeci sreadonlysA human readable name identifying a particular context at a particular SNMP entity. The empty contextName (zero length) represents the default context.isThis table maps a combination of securityModel and securityName into a groupName which is used to define an access control policy for a group of principals.svacmSecurityModelsvacmSecurityNamesaAn entry in this table maps the combination of a securityModel and securityName into a groupName.lsnoaccesssThe Security Model, by which the vacmSecurityName referenced by this entry is provided. Note, this object may not take the 'any' (0) value.sThe securityName for the principal, represented in a Security Model independent format, which is mapped by this entry to a groupName.s readcreates8The name of the group to which this entry (e.g., the combination of securityModel and securityName) belongs. This groupName is used as index into the vacmAccessTable to select an access control policy. However, a value in this table does not imply that an instance with the value exists in table vacmAccesTable.is nonVolatilesThe storage type for this conceptual row. Conceptual rows having the value 'permanent' need not allow write-access to any columnar objects in the row.is0The status of this conceptual row. Until instances of all corresponding columns are appropriately configured, the value of the corresponding instance of the vacmSecurityToGroupStatus column is 'notReady'. In particular, a newly created row cannot be made active until a value has been set for vacmGroupName. The RowStatus TC [RFC2579] requires that this DESCRIPTION clause states under which circumstances other objects in this row can be modified: The value of this object has no effect on whether other objects in this conceptual row can be modified.sDThe table of access rights for groups. Each entry is indexed by a groupName, a contextPrefix, a securityModel and a securityLevel. To determine whether access is allowed, one entry from this table needs to be selected and the proper viewName from that entry must be used for access control checking. To select the proper entry, follow these steps: 1) the set of possible matches is formed by the intersection of the following sets of entries: the set of entries with identical vacmGroupName the union of these two sets: - the set with identical vacmAccessContextPrefix - the set of entries with vacmAccessContextMatch value of 'prefix' and matching vacmAccessContextPrefix intersected with the union of these two sets: - the set of entries with identical vacmSecurityModel - the set of entries with vacmSecurityModel value of 'any' intersected with the set of entries with vacmAccessSecurityLevel value less than or equal to the requested securityLevel 2) if this set has only one member, we're done otherwise, it comes down to deciding how to weight the preferences between ContextPrefixes, SecurityModels, and SecurityLevels as follows: a) if the subset of entries with securityModel matching the securityModel in the message is not empty, then discard the rest. b) if the subset of entries with vacmAccessContextPrefix matching the contextName in the message is not empty, then discard the rest c) discard all entries with ContextPrefixes shorter than the longest one remaining in the set d) select the entry with the highest securityLevel Please note that for securityLevel noAuthNoPriv, all groups are really equivalent since the assumption that the securityName has been authenticated does not hold.s vacmGroupNamesvacmAccessContextPrefixsvacmAccessSecurityModelsvacmAccessSecurityLevels#An access right configured in the Local Configuration Datastore (LCD) authorizing access to an SNMP context. Entries in this table can use an instance value for object vacmGroupName even if no entry in table vacmAccessSecurityToGroupTable has a corresponding value for object vacmGroupName.sIn order to gain the access rights allowed by this conceptual row, a contextName must match exactly (if the value of vacmAccessContextMatch is 'exact') or partially (if the value of vacmAccessContextMatch is 'prefix') to the value of the instance of this object.seIn order to gain the access rights allowed by this conceptual row, this securityModel must be in use.ssThe minimum level of security required in order to gain the access rights allowed by this conceptual row. A securityLevel of noAuthNoPriv is less than authNoPriv which in turn is less than authPriv. If multiple entries are equally indexed except for this vacmAccessSecurityLevel index, then the entry which has the highest value for vacmAccessSecurityLevel is selected.s namedValuessexactsprefixsIIf the value of this object is exact(1), then all rows where the contextName exactly matches vacmAccessContextPrefix are selected. If the value of this object is prefix(2), then all rows where the contextName whose starting octets exactly match vacmAccessContextPrefix are selected. This allows for a simple form of wildcarding.ssThe value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes read access. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; if the value is the empty string or if there is no active MIB view having this value of vacmViewTreeFamilyViewName, then no access is granted.sThe value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes write access. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; if the value is the empty string or if there is no active MIB view having this value of vacmViewTreeFamilyViewName, then no access is granted.isThe value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes access for notifications. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; if the value is the empty string or if there is no active MIB view having this value of vacmViewTreeFamilyViewName, then no access is granted.isThe storage type for this conceptual row. Conceptual rows having the value 'permanent' need not allow write-access to any columnar objects in the row.i sThe status of this conceptual row. The RowStatus TC [RFC2579] requires that this DESCRIPTION clause states under which circumstances other objects in this row can be modified: The value of this object has no effect on whether other objects in this conceptual row can be modified.s readwrites_An advisory lock used to allow cooperating SNMP Command Generator applications to coordinate their use of the Set operation in creating or modifying views. When creating a new view or altering an existing view, it is important to understand the potential interactions with other uses of the view. The vacmViewSpinLock should be retrieved. The name of the view to be created should be determined to be unique by the SNMP Command Generator application by consulting the vacmViewTreeFamilyTable. Finally, the named view may be created (Set), including the advisory lock. If another SNMP Command Generator application has altered the views in the meantime, then the spin lock's value will have changed, and so this creation will fail because it will specify the wrong value for the spin lock. Since this is an advisory lock, the use of this lock is not enforced.s Locally held information about families of subtrees within MIB views. Each MIB view is defined by two sets of view subtrees: - the included view subtrees, and - the excluded view subtrees. Every such view subtree, both the included and the excluded ones, is defined in this table. To determine if a particular object instance is in a particular MIB view, compare the object instance's OBJECT IDENTIFIER with each of the MIB view's active entries in this table. If none match, then the object instance is not in the MIB view. If one or more match, then the object instance is included in, or excluded from, the MIB view according to the value of vacmViewTreeFamilyType in the entry whose value of vacmViewTreeFamilySubtree has the most sub-identifiers. If multiple entries match and have the same number of sub-identifiers (when wildcarding is specified with the value of vacmViewTreeFamilyMask), then the lexicographically greatest instance of vacmViewTreeFamilyType determines the inclusion or exclusion. An object instance's OBJECT IDENTIFIER X matches an active entry in this table when the number of sub-identifiers in X is at least as many as in the value of vacmViewTreeFamilySubtree for the entry, and each sub-identifier in the value of vacmViewTreeFamilySubtree matches its corresponding sub-identifier in X. Two sub-identifiers match either if the corresponding bit of the value of vacmViewTreeFamilyMask for the entry is zero (the 'wild card' value), or if they are equal. A 'family' of subtrees is the set of subtrees defined by a particular combination of values of vacmViewTreeFamilySubtree and vacmViewTreeFamilyMask. In the case where no 'wild card' is defined in the vacmViewTreeFamilyMask, the family of subtrees reduces to a single subtree. When creating or changing MIB views, an SNMP Command Generator application should utilize the vacmViewSpinLock to try to avoid collisions. See DESCRIPTION clause of vacmViewSpinLock. When creating MIB views, it is strongly advised that first the 'excluded' vacmViewTreeFamilyEntries are created and then the 'included' entries. When deleting MIB views, it is strongly advised that first the 'included' vacmViewTreeFamilyEntries are deleted and then the 'excluded' entries. If a create for an entry for instance-level access control is received and the implementation does not support instance-level granularity, then an inconsistentName error must be returned.svacmViewTreeFamilyViewNamesvacmViewTreeFamilySubtreesInformation on a particular family of view subtrees included in or excluded from a particular SNMP context's MIB view. Implementations must not restrict the number of families of view subtrees for a given MIB view, except as dictated by resource constraints on the overall number of entries in the vacmViewTreeFamilyTable. If no conceptual rows exist in this table for a given MIB view (viewName), that view may be thought of as consisting of the empty set of view subtrees.s6The human readable name for a family of view subtrees.sThe MIB subtree which when combined with the corresponding instance of vacmViewTreeFamilyMask defines a family of view subtrees.sThe bit mask which, in combination with the corresponding instance of vacmViewTreeFamilySubtree, defines a family of view subtrees. Each bit of this bit mask corresponds to a sub-identifier of vacmViewTreeFamilySubtree, with the most significant bit of the i-th octet of this octet string value (extended if necessary, see below) corresponding to the (8*i - 7)-th sub-identifier, and the least significant bit of the i-th octet of this octet string corresponding to the (8*i)-th sub-identifier, where i is in the range 1 through 16. Each bit of this bit mask specifies whether or not the corresponding sub-identifiers must match when determining if an OBJECT IDENTIFIER is in this family of view subtrees; a '1' indicates that an exact match must occur; a '0' indicates 'wild card', i.e., any sub-identifier value matches. Thus, the OBJECT IDENTIFIER X of an object instance is contained in a family of view subtrees if, for each sub-identifier of the value of vacmViewTreeFamilySubtree, either: the i-th bit of vacmViewTreeFamilyMask is 0, or the i-th sub-identifier of X is equal to the i-th sub-identifier of the value of vacmViewTreeFamilySubtree. If the value of this bit mask is M bits long and there are more than M sub-identifiers in the corresponding instance of vacmViewTreeFamilySubtree, then the bit mask is extended with 1's to be the required length. Note that when the value of this object is the zero-length string, this extension rule results in a mask of all-1's being used (i.e., no 'wild card'), and the family of view subtrees is the one view subtree uniquely identified by the corresponding instance of vacmViewTreeFamilySubtree. Note that masks of length greater than zero length do not need to be supported. In this case this object is made read-only.sincludedsexcludedsIndicates whether the corresponding instances of vacmViewTreeFamilySubtree and vacmViewTreeFamilyMask define a family of view subtrees which is included in or excluded from the MIB view.sThe status of this conceptual row. The RowStatus TC [RFC2579] requires that this DESCRIPTION clause states under which circumstances other objects in this row can be modified: The value of this object has no effect on whether other objects in this conceptual row can be modified.svacmViewTreeFamilyStorageTypesvacmAccessStatussvacmViewTreeFamilyStatussvacmAccessNotifyViewNamesvacmViewSpinLocksvacmAccessContextMatchsvacmSecurityToGroupStorageTypesvacmViewTreeFamilyMasksvacmViewTreeFamilyTypesvacmAccessReadViewNamesvacmSecurityToGroupStatussvacmAccessStorageTypesvacmAccessWriteViewNamesPYSNMP_MODULE_IDs snmpVacmMIBsvacmMIBObjectssvacmContextTablesvacmContextEntrysvacmSecurityToGroupTablesvacmSecurityToGroupEntrysvacmAccessTablesvacmAccessEntrys vacmMIBViewssvacmViewTreeFamilyTablesvacmViewTreeFamilyEntrysvacmMIBConformancesvacmMIBCompliancess vacmMIBGroupssvacmBasicGroupN(Ns pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsSnmpAdminStringsSnmpSecurityLevelsSnmpSecurityModelsModuleCompliances ObjectGroupsBitss Integer32sModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModuless RowStatuss StorageTypes TestAndIncrs setRevisionss snmpVacmMIBs loadTextsssetOrganizationssetContactInfossetDescriptionsvacmMIBObjectssvacmContextTables setIndexNamessvacmContextEntryssubtypesValueSizeConstraints setMaxAccesssvacmContextNamesvacmSecurityToGroupTablesvacmSecurityToGroupEntrysValueRangeConstraintsvacmSecurityModelsvacmSecurityNames vacmGroupNamesclonesvacmSecurityToGroupStorageTypesvacmSecurityToGroupStatussvacmAccessTablesvacmAccessEntrysvacmAccessContextPrefixsvacmAccessSecurityModelsvacmAccessSecurityLevelsSingleValueConstraints NamedValuessvacmAccessContextMatchsvacmAccessReadViewNamesvacmAccessWriteViewNamesvacmAccessNotifyViewNamesvacmAccessStorageTypesvacmAccessStatuss vacmMIBViewssvacmViewSpinLocksvacmViewTreeFamilyTablesvacmViewTreeFamilyEntrysvacmViewTreeFamilyViewNamesvacmViewTreeFamilySubtreesvacmViewTreeFamilyMasksvacmViewTreeFamilyTypesvacmViewTreeFamilyStorageTypesvacmViewTreeFamilyStatussvacmMIBConformancesvacmMIBCompliancess vacmMIBGroupss setObjectssvacmBasicGroups exportSymbols(<sSnmpAdminStringsvacmAccessStatussvacmAccessSecurityLevels MibScalarsvacmAccessContextPrefixsvacmSecurityToGroupEntrys TimeTickss vacmGroupNames vacmMIBViewssModuleIdentitysvacmViewTreeFamilyTables snmpModulessBitssvacmSecurityToGroupTablesvacmAccessWriteViewNames ObjectGroupsvacmSecurityToGroupStorageTypesMibTableColumnsvacmAccessSecurityModelsSnmpSecurityModelsModuleCompliancesvacmAccessContextMatchsMibTablesvacmMIBObjectss snmpVacmMIBsvacmViewTreeFamilyMasks RowStatussvacmViewSpinLocksObjectIdentifiersvacmViewTreeFamilySubtreesnamedvalsvacmBasicGroups OctetStringsvacmViewTreeFamilyStorageTypes MibTableRowsvacmAccessEntrysvacmViewTreeFamilyEntrysvacmAccessReadViewNamesvacmViewTreeFamilyTypesvacmAccessTablesvacmMIBCompliancess TestAndIncrsvacmMIBConformancesIntegersvacmViewTreeFamilyViewNamesvacmContextTablesvacmContextNames Integer32s vacmMIBGroupss constraints StorageTypesvacmSecurityNamesvacmViewTreeFamilyStatussvacmSecurityToGroupStatussvacmAccessNotifyViewNames MibIdentifiersSnmpSecurityLevelsvacmAccessStorageTypesvacmContextEntrysvacmSecurityModel((sEbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.pys?s!!K!3   $' < T ' H T T T E < ' ` T < <  ] ] ] E < '9 * K W ? `  H ? $''PKz: !!pysnmp/smi/mibs/SNMP-MPD-MIB.py# PySNMP SMI module. Autogenerated from smidump -f python SNMP-MPD-MIB # by libsmi2pysnmp-0.0.9-alpha at Thu Mar 26 20:58:11 2009, # Python version (2, 4, 4, 'final', 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") ( 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") # Objects snmpMPDMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 11)).setRevisions(("2002-10-14 00:00","1999-05-04 16:36","1997-09-30 00:00",)) if mibBuilder.loadTexts: snmpMPDMIB.setOrganization("SNMPv3 Working Group") if mibBuilder.loadTexts: snmpMPDMIB.setContactInfo("WG-EMail: snmpv3@lists.tislabs.com\nSubscribe: snmpv3-request@lists.tislabs.com\n\nCo-Chair: Russ Mundy\n Network Associates Laboratories\npostal: 15204 Omega Drive, Suite 300\n Rockville, MD 20850-4601\n USA\n\n\n\nEMail: mundy@tislabs.com\nphone: +1 301-947-7107\n\nCo-Chair &\nCo-editor: David Harrington\n Enterasys Networks\npostal: 35 Industrial Way\n P. O. Box 5005\n Rochester NH 03866-5005\n USA\nEMail: dbh@enterasys.com\nphone: +1 603-337-2614\n\nCo-editor: Jeffrey Case\n SNMP Research, Inc.\npostal: 3001 Kimberlin Heights Road\n Knoxville, TN 37920-9716\n USA\nEMail: case@snmp.com\nphone: +1 423-573-1434\n\nCo-editor: Randy Presuhn\n BMC Software, Inc.\npostal: 2141 North First Street\n San Jose, CA 95131\n USA\nEMail: randy_presuhn@bmc.com\nphone: +1 408-546-1006\n\nCo-editor: Bert Wijnen\n Lucent Technologies\npostal: Schagen 33\n 3461 GL Linschoten\n Netherlands\nEMail: bwijnen@lucent.com\nphone: +31 348-680-485") if mibBuilder.loadTexts: snmpMPDMIB.setDescription("The MIB for Message Processing and Dispatching\n\nCopyright (C) The Internet Society (2002). This\nversion of this MIB module is part of RFC 3412;\nsee the RFC itself for full legal notices.") snmpMPDAdmin = MibIdentifier((1, 3, 6, 1, 6, 3, 11, 1)) snmpMPDMIBObjects = MibIdentifier((1, 3, 6, 1, 6, 3, 11, 2)) snmpMPDStats = MibIdentifier((1, 3, 6, 1, 6, 3, 11, 2, 1)) snmpUnknownSecurityModels = MibScalar((1, 3, 6, 1, 6, 3, 11, 2, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpUnknownSecurityModels.setDescription("The total number of packets received by the SNMP\nengine which were dropped because they referenced a\nsecurityModel that was not known to or supported by\nthe SNMP engine.") snmpInvalidMsgs = MibScalar((1, 3, 6, 1, 6, 3, 11, 2, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInvalidMsgs.setDescription("The total number of packets received by the SNMP\nengine which were dropped because there were invalid\nor inconsistent components in the SNMP message.") snmpUnknownPDUHandlers = MibScalar((1, 3, 6, 1, 6, 3, 11, 2, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpUnknownPDUHandlers.setDescription("The total number of packets received by the SNMP\nengine which were dropped because the PDU contained\nin the packet could not be passed to an application\nresponsible for handling the pduType, e.g. no SNMP\napplication had registered for the proper\ncombination of the contextEngineID and the pduType.") snmpMPDMIBConformance = MibIdentifier((1, 3, 6, 1, 6, 3, 11, 3)) snmpMPDMIBCompliances = MibIdentifier((1, 3, 6, 1, 6, 3, 11, 3, 1)) snmpMPDMIBGroups = MibIdentifier((1, 3, 6, 1, 6, 3, 11, 3, 2)) # Augmentions # Groups snmpMPDGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 11, 3, 2, 1)).setObjects(("SNMP-MPD-MIB", "snmpInvalidMsgs"), ("SNMP-MPD-MIB", "snmpUnknownPDUHandlers"), ("SNMP-MPD-MIB", "snmpUnknownSecurityModels"), ) # Exports # Module identity mibBuilder.exportSymbols("SNMP-MPD-MIB", PYSNMP_MODULE_ID=snmpMPDMIB) # Objects mibBuilder.exportSymbols("SNMP-MPD-MIB", snmpMPDMIB=snmpMPDMIB, snmpMPDAdmin=snmpMPDAdmin, snmpMPDMIBObjects=snmpMPDMIBObjects, snmpMPDStats=snmpMPDStats, snmpUnknownSecurityModels=snmpUnknownSecurityModels, snmpInvalidMsgs=snmpInvalidMsgs, snmpUnknownPDUHandlers=snmpUnknownPDUHandlers, snmpMPDMIBConformance=snmpMPDMIBConformance, snmpMPDMIBCompliances=snmpMPDMIBCompliances, snmpMPDMIBGroups=snmpMPDMIBGroups) # Groups mibBuilder.exportSymbols("SNMP-MPD-MIB", snmpMPDGroup=snmpMPDGroup) PKo> =]11pysnmp/smi/mibs/SNMPv2-TC.pyfrom string import split, digits from pysnmp.smi import error from pyasn1.type import constraint, namedval from pysnmp import debug OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols( 'ASN1', 'OctetString', 'Integer', 'ObjectIdentifier' ) Counter32, Unsigned32, TimeTicks, Counter64 = mibBuilder.importSymbols( 'SNMPv2-SMI', 'Counter32', 'Unsigned32', 'TimeTicks', 'Counter64' ) class TextualConvention: displayHint = '' status = 'current' description = '' reference = '' bits = () __integer = Integer() __counter32 = Counter32() __unsigned32 = Unsigned32() __timeticks = TimeTicks() __counter64 = Counter64() __octetString = OctetString() __objectIdentifier = ObjectIdentifier() def getDisplayHint(self): return self.displayHint def getStatus(self): return self.status def getDescription(self): return self.description def getReference(self): return self.reference def prettyOut(self, value): # override asn1 type method """Implements DISPLAY-HINT evaluation""" if self.displayHint and ( self.__integer.isSuperTypeOf(self) or self.__unsigned32.isSuperTypeOf(self) or self.__timeticks.isSuperTypeOf(self) or self.__counter32.isSuperTypeOf(self) or self.__counter64.isSuperTypeOf(self) ): t, f = apply(lambda t, f=0: (t, f), split(self.displayHint, '-')) if t == 'x': return '0x%x' % value elif t == 'd': try: return '%.*f' % (int(f), float(value)/pow(10, int(f))) except StandardError, why: raise error.SmiError( 'float num evaluation error: %s' % why ) elif t == 'o': return '0%o' % value elif t == 'b': v = value; r = ['B'] while v: r.insert(0, '%d' % (v&0x01)) v = v>>1 return join(r, '') else: raise error.SmiError( 'Unsupported numeric type spec: %s' % t ) elif self.displayHint and self.__octetString.isSuperTypeOf(self): r = '' v = str(value) d = self.displayHint while v and d: # 1 if d[0] == '*': repeatIndicator = repeatCount = int(v[0]) d = d[1:]; v = v[1:] else: repeatCount = 1; repeatIndicator = None # 2 octetLength = '' while d and d[0] in digits: octetLength = octetLength + d[0] d = d[1:] try: octetLength = int(octetLength) except StandardError, why: raise error.SmiError( 'Bad octet length: %s' % octetLength ) if not d: raise error.SmiError( 'Short octet length: %s' % self.displayHint ) # 3 displayFormat = d[0] d = d[1:] # 4 if d and d[0] not in digits and d[0] != '*': displaySep = d[0] d = d[1:] else: displaySep = '' # 5 if d and displaySep and repeatIndicator is not None: repeatTerminator = d[0] displaySep = '' d = d[1:] else: repeatTerminator = None while repeatCount: repeatCount = repeatCount - 1 # 't' stands for UTF-8, does it need any special support? if displayFormat == 'a' or displayFormat == 't': r = r + v[:octetLength] elif displayFormat in ('x', 'd', 'o'): n = 0L; vv = v[:octetLength] while vv: n = n << 8 try: n = n | ord(vv[0]) vv = vv[1:] except StandardError, why: raise error.SmiError( 'Display format eval failure: %s: %s' % (vv, why) ) if displayFormat == 'x': r = r + '%02x' % n elif displayFormat == 'o': r = r + '%03o' % n else: r = r + '%d' % n else: raise error.SmiError( 'Unsupported display format char: %s' % \ displayFormat ) if v and repeatTerminator: r = r + repeatTerminator v = v[octetLength:] if v and displaySep: r = r + displaySep if not d: d = self.displayHint # if d: # raise error.SmiError( # 'Unparsed display hint left: %s' % d # ) return r elif self.displayHint and self.__objectIdentifier.isSuperTypeOf(self): return str(value) elif self.__octetString.isSuperTypeOf(self): return repr(value) else: return str(value) # elif self.bits: # try: # return self.bits[value] # except StandardError, why: # raise error.SmiError( # 'Enumeratin resolution failure for %s: %s' % (self, why) # ) # XXX # def prettyIn(self, value): # # XXX parse TC syntax # return str(value) class DisplayString(TextualConvention, OctetString): subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(0,255) displayHint = "255a" class PhysAddress(TextualConvention, OctetString): displayHint = "1x:" class MacAddress(TextualConvention, OctetString): subtypeSpec = OctetString.subtypeSpec+constraint.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)) class TestAndIncr(Integer, TextualConvention): subtypeSpec = Integer.subtypeSpec+constraint.ValueRangeConstraint(0, 2147483647L) defaultValue = 0 def smiWrite(self, name, value, idx): if value != self: raise error.InconsistentValueError(idx=idx, name=name) value = value + 1 if value > 2147483646: value = 0 return self.clone(value) class AutonomousType(ObjectIdentifier, TextualConvention): pass class InstancePointer(ObjectIdentifier, TextualConvention): status = 'obsolete' class VariablePointer(ObjectIdentifier, TextualConvention): pass class RowPointer(ObjectIdentifier, TextualConvention): pass 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( ('notExists', 0), ('active', 1), ('notInService', 2), ('notReady', 3), ('createAndGo', 4), ('createAndWait', 5), ('destroy', 6) ) # Known row states stNotExists, stActive, stNotInService, stNotReady, \ stCreateAndGo, stCreateAndWait, stDestroy = range(7) # States transition matrix (see RFC-1903) stateMatrix = { # (new-state, current-state) -> (error, new-state) ( stCreateAndGo, stNotExists ): ( error.RowCreationWanted, stActive ), ( stCreateAndGo, stNotReady ): ( error.InconsistentValueError, stNotReady ), ( stCreateAndGo, stNotInService ): ( error.InconsistentValueError, stNotInService ), ( stCreateAndGo, stActive ): ( error.InconsistentValueError, stActive ), # ( stCreateAndWait, stNotExists ): ( error.RowCreationWanted, stActive ), ( stCreateAndWait, stNotReady ): ( error.InconsistentValueError, stNotReady ), ( stCreateAndWait, stNotInService ): ( error.InconsistentValueError, stNotInService ), ( stCreateAndWait, stActive ): ( error.InconsistentValueError, stActive ), # ( stActive, stNotExists ): ( error.InconsistentValueError, stNotExists ), ( stActive, stNotReady ): ( error.InconsistentValueError, stNotReady ), ( stActive, stNotInService ): ( None, stActive ), ( stActive, stActive ): ( None, stActive ), # ( stNotInService, stNotExists ): ( error.InconsistentValueError, stNotExists ), ( stNotInService, stNotReady ): ( error.InconsistentValueError, stNotReady ), ( stNotInService, stNotInService ): ( None, stNotInService ), ( stNotInService, stActive ): ( None, stActive ), # ( stDestroy, stNotExists ): ( error.RowDestructionWanted, stNotExists ), ( stDestroy, stNotReady ): ( error.RowDestructionWanted, stNotExists ), ( stDestroy, stNotInService ): ( error.RowDestructionWanted, stNotExists ), ( stDestroy, stActive ): ( error.RowDestructionWanted, stNotExists ), # This is used on instantiation ( stNotExists, stNotExists ): ( None, stNotExists ) } defaultValue = stNotExists pendingError = None def smiWrite(self, name, value, idx): # Run through states transition matrix, resolve new instance value err, val = self.stateMatrix.get( (self.clone(value), int(self)), (error.MibOperationError, None) ) debug.logger & debug.flagIns and debug.logger('RowStatus state resolution: %s, %s -> %s, %s' % (value, int(self), err, val)) if val is None: val = self else: val = self.clone(val) if err is not None: err = err( msg='Exception at row state transition %s->%s' % (self, value), idx=idx ) val.smiSetPendingError(err) return val def smiCreate(self, name, value, idx): return self.smiWrite(name, value, idx) def smiRaisePendingError(self): if self.pendingError: err, self.pendingError = self.pendingError, None raise err def smiSetPendingError(self, err): self.pendingError = err class TimeStamp(TimeTicks, TextualConvention): pass class TimeInterval(Integer, TextualConvention): subtypeSpec = Integer.subtypeSpec+constraint.ValueRangeConstraint(0, 2147483647L) class DateAndTime(TextualConvention, OctetString): subtypeSpec = OctetString.subtypeSpec+constraint.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( ('other', 1), ('volatile', 2), ('nonVolatile', 3), ('permanent', 4), ('readOnly', 5) ) class TDomain(ObjectIdentifier, TextualConvention): pass class TAddress(OctetString, TextualConvention): subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(1, 255) mibBuilder.exportSymbols( 'SNMPv2-TC', TextualConvention=TextualConvention, DisplayString=DisplayString, PhysAddress=PhysAddress, MacAddress=MacAddress, TruthValue=TruthValue, TestAndIncr=TestAndIncr, AutonomousType=AutonomousType, InstancePointer=InstancePointer, VariablePointer=VariablePointer, RowPointer=RowPointer, RowStatus=RowStatus, TimeStamp=TimeStamp, TimeInterval=TimeInterval, DateAndTime=DateAndTime, StorageType=StorageType, TDomain=TDomain, TAddress=TAddress ) PK~=v5ȯpysnmp/smi/mibs/SNMPv2-CONF.pyMibNode, = mibBuilder.importSymbols('SNMPv2-SMI', 'MibNode') class ObjectGroup(MibNode): def getObjects(self): return getattr(self, 'objects', ()) def setObjects(self, *args): self.objects = args return self def getDescription(self): return getattr(self, 'description', '') def setDescription(self, v): self.description = v return self def asn1Print(self): return '\ OBJECT-GROUP\n\ OBJECTS { %s }\n\ DESCRIPTION \"%s\"\ ' % (reduce(lambda x,y: '%s, %s' % (x[1],y[1]), self.getObjects(), ("","")), self.getDescription()) class NotificationGroup(MibNode): def getObjects(self): return getattr(self, 'objects', ()) def setObjects(self, *args): self.objects = args return self def getDescription(self): return getattr(self, 'description', '') def setDescription(self, v): self.description = v return self def asn1Print(self): return '\ NOTIFICATION-GROUP\n\ NOTIFICATIONS { %s }\n\ DESCRIPTION \"%s\"\ ' % (reduce(lambda x,y: '%s, %s' % (x[1],y[1]), self.getObjects(), ("","")), self.getDescription()) class ModuleCompliance(MibNode): def getObjects(self): return getattr(self, 'objects', ()) def setObjects(self, *args): self.objects = args return self def getDescription(self): return getattr(self, 'description', '') def setDescription(self, v): self.description = v return self def asn1Print(self): return '\ MODULE-COMPLIANCE\n\ OBJECT { %s } \n\ DESCRIPTION \"%s\"\n\ ' % (reduce(lambda x,y: '%s, %s' % (x[1],y[1]), self.getObjects(), ("","")), self.getDescription()) class AgentCapabilities(MibNode): def getDescription(self): return getattr(self, 'description', '') def setDescription(self, v): self.description = v return self def asn1Print(self): return '\ AGENT-CAPABILITIES\n\ DESCRIPTION \"%s\"\n\ ' % self.getDescription() mibBuilder.exportSymbols('SNMPv2-CONF', ObjectGroup=ObjectGroup, NotificationGroup=NotificationGroup, ModuleCompliance=ModuleCompliance, AgentCapabilities=AgentCapabilities) PKAq>G77)pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pyc; LKc&@sdkZdkZdklZlZeidddd\ZZZ eidddd d d d d \Z Z Z Z ZZZeidd\Zde fdYZdee fdYZdee fdYZdee fdYZdee fdYZdee fdYZdee fdYZdefdYZd efd!YZe d"d#d$d"d%d"d&fid'fZeioeid(neioeid)neioei d*ne d"d#d$d"d%d"d&d"fZ!ed"d#d$d"d%d"d&d"d"f Z"eioe"i d+ned"d#d$d"d%d"d&d"d%f Z#eioe#i d,ned"d#d$d"d%d"d&d"d#f Z$eioe$i d-ned"d#d$d"d%d"d&d"d.f Z%eioe%i d/ned"d#d$d"d%d"d&d"d0f Z&eioe&i d1ned"d#d$d"d%d"d&d"d$f Z'eioe'i d2ned"d#d$d"d%d"d&d"d3f Z(eioe(i d4ned"d#d$d"d%d"d&d"d5f Z)eioe)i d6ned"d#d$d"d%d"d&d"d7f Z*eioe*i d8ned"d#d$d"d%d"d&d"d9f Z+eioe+i d:ned"d#d$d"d%d"d&d"d;f Z,eioe,i d<ned"d#d$d"d%d"d&d"d=f Z-eioe-i d>ned"d#d$d"d%d"d&d"d?f Z.eioe.i d@ned"d#d$d"d%d"d&d"dAf Z/eioe/i dBned"d#d$d"d%d"d&d"dCf Z0eioe0i dDned"d#d$d"d%d"d&d"dEf Z1eioe1i dFnei2dGdHeei2dGdedededededededed e ei2dGdIedJe!dKe"dLe#dMe$dNe%dOe&dPe'dQe(dRe)dSe*dTe+dUe,dVe-dWe.dXe/dYe0dZe1dS([N(s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStrings SNMPv2-SMIsBitss Integer32sModuleIdentitys MibIdentifiersObjectIdentitys TimeTickssmib-2s SNMPv2-TCsTextualConventionsTransportAddresscBs!tZeieiddZRS(Nii(s__name__s __module__s OctetStrings subtypeSpecs constraintsValueSizeConstraint(((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pysTransportAddressssTransportAddressDnscBs'tZdZeieiddZRS(Ns1aii(s__name__s __module__s displayHints OctetStrings subtypeSpecs constraintsValueSizeConstraint(((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pysTransportAddressDnsssTransportAddressIPv4cBs?tZdZeieiddZdZdZdZ RS(Ns1d.1d.1d.1d:2dicCst|tijoXtdtdti|ddt|dd?d@t|dd@Snt i ||SdS(NcCs||S(N(sxsy(sxsy((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pys#scCstti|S(N(schrsstringsatoisx(sx((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pys#sis.iii( stypesvaluestypess TupleTypesreducesmapsstringssplitschrs OctetStringsprettyInsself(sselfsvalue((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pysprettyIn!sXcCszt|d oZtitd|id dt|idd!d>t|idd!Bf|_n|i|SdS(Ns __tuple_valuecCstt|S(N(sstrsordsx(sx((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pys+sis.iii( shasattrsselfsstringsjoinsmaps_valuesords"_TransportAddressIPv4__tuple_valuesi(sselfsi((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pys __getitem__(sZ( s__name__s __module__s displayHints OctetStrings subtypeSpecs constraintsValueSizeConstraints fixedLengthsprettyIns __getitem__(((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pysTransportAddressIPv4s  sTransportAddressIPv4zcBs-tZdZeieiddZdZRS(Ns1d.1d.1d.1d%4d:2di (s__name__s __module__s displayHints OctetStrings subtypeSpecs constraintsValueSizeConstraints fixedLength(((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pysTransportAddressIPv4z0ssTransportAddressIPv6cBs?tZdZeieiddZdZdZdZ RS(Ns 0a[2x:2x:2x:2x:2x:2x:2x:2x]0a:2dicCsmt|tijoCtiti|dt|dd?d@t|dd@Snti ||SdS(Niiii( stypesvaluestypess TupleTypessockets inet_ptonsAF_INET6schrs OctetStringsprettyInsself(sselfsvalue((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pysprettyIn;sCcCswt|d oWtiti|id t|idd!d>t|idd!Bddf|_n|i|SdS(Ns __tuple_valueiiiii( shasattrsselfssockets inet_ntopsAF_INET6s_valuesords"_TransportAddressIPv6__tuple_valuesi(sselfsi((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pys __getitem__BsW( s__name__s __module__s displayHints OctetStrings subtypeSpecs constraintsValueSizeConstraints fixedLengthsprettyIns __getitem__(((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pysTransportAddressIPv66s  sTransportAddressIPv6zcBs-tZdZeieiddZdZRS(Ns#0a[2x:2x:2x:2x:2x:2x:2x:2x%4d]0a:2di(s__name__s __module__s displayHints OctetStrings subtypeSpecs constraintsValueSizeConstraints fixedLength(((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pysTransportAddressIPv6zKssTransportAddressLocalcBs'tZdZeieiddZRS(Ns1aii(s__name__s __module__s displayHints OctetStrings subtypeSpecs constraintsValueSizeConstraint(((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pysTransportAddressLocalQssTransportAddressTypecBstZeieiddddddddd d d d d ddddZeiddfddfddfdd fddfddfddfdd fdd fddfdd fdd fddfddfd dfd!dfd"dfZRS(#Ni i iiiiiii iiiii iii sunknownsudpIpv4ssctpIpv6s sctpIpv4zs sctpIpv6zslocalsudpDnsstcpDnsssctpDnssudpIpv6sudpIpv4zsudpIpv6zstcpIpv4stcpIpv6stcpIpv4zstcpIpv6zssctpIpv4( s__name__s __module__sIntegers subtypeSpecs constraintsSingleValueConstraintsnamedvals NamedValuess namedValues(((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pysTransportAddressTypeVsFsTransportDomaincBstZRS(N(s__name__s __module__(((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pysTransportDomain[siiiiids2002-11-01 00:00s#IETF Operations and Management AreasJuergen Schoenwaelder (Editor) TU Braunschweig Bueltenweg 74/75 38106 Braunschweig, Germany Phone: +49 531 391-3289 EMail: schoenw@ibr.cs.tu-bs.de Send comments to .sThis MIB module provides commonly used transport address definitions. Copyright (C) The Internet Society (2002). This version of this MIB module is part of RFC 3419; see the RFC itself for full legal notices.sThe UDP over IPv4 transport domain. The corresponding transport address is of type TransportAddressIPv4 for global IPv4 addresses.sThe UDP over IPv6 transport domain. The corresponding transport address is of type TransportAddressIPv6 for global IPv6 addresses.sThe UDP over IPv4 transport domain. The corresponding transport address is of type TransportAddressIPv4z for scoped IPv4 addresses with a zone index.isThe UDP over IPv6 transport domain. The corresponding transport address is of type TransportAddressIPv6z for scoped IPv6 addresses with a zone index.isThe TCP over IPv4 transport domain. The corresponding transport address is of type TransportAddressIPv4 for global IPv4 addresses.sThe TCP over IPv6 transport domain. The corresponding transport address is of type TransportAddressIPv6 for global IPv6 addresses.isThe TCP over IPv4 transport domain. The corresponding transport address is of type TransportAddressIPv4z for scoped IPv4 addresses with a zone index.isThe TCP over IPv6 transport domain. The corresponding transport address is of type TransportAddressIPv6z for scoped IPv6 addresses with a zone index.i sThe SCTP over IPv4 transport domain. The corresponding transport address is of type TransportAddressIPv4 for global IPv4 addresses. This transport domain usually represents the primary address on multihomed SCTP endpoints.i sThe SCTP over IPv6 transport domain. The corresponding transport address is of type TransportAddressIPv6 for global IPv6 addresses. This transport domain usually represents the primary address on multihomed SCTP endpoints.i sThe SCTP over IPv4 transport domain. The corresponding transport address is of type TransportAddressIPv4z for scoped IPv4 addresses with a zone index. This transport domain usually represents the primary address on multihomed SCTP endpoints.i sThe SCTP over IPv6 transport domain. The corresponding transport address is of type TransportAddressIPv6z for scoped IPv6 addresses with a zone index. This transport domain usually represents the primary address on multihomed SCTP endpoints.i sThe Posix Local IPC transport domain. The corresponding transport address is of type TransportAddressLocal. The Posix Local IPC transport domain incorporates the well-known UNIX domain sockets.isThe UDP transport domain using fully qualified domain names. The corresponding transport address is of type TransportAddressDns.isThe TCP transport domain using fully qualified domain names. The corresponding transport address is of type TransportAddressDns.isThe SCTP transport domain using fully qualified domain names. The corresponding transport address is of type TransportAddressDns.sTRANSPORT-ADDRESS-MIBsPYSNMP_MODULE_IDstransportAddressMIBstransportDomainsstransportDomainUdpIpv4stransportDomainUdpIpv6stransportDomainUdpIpv4zstransportDomainUdpIpv6zstransportDomainTcpIpv4stransportDomainTcpIpv6stransportDomainTcpIpv4zstransportDomainTcpIpv6zstransportDomainSctpIpv4stransportDomainSctpIpv6stransportDomainSctpIpv4zstransportDomainSctpIpv6zstransportDomainLocalstransportDomainUdpDnsstransportDomainTcpDnsstransportDomainSctpDns(3ssocketstypess pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsBitss Integer32sModuleIdentitys MibIdentifiersObjectIdentitys TimeTickssmib_2sTextualConventionsTransportAddresssTransportAddressDnssTransportAddressIPv4sTransportAddressIPv4zsTransportAddressIPv6sTransportAddressIPv6zsTransportAddressLocalsTransportAddressTypesTransportDomains setRevisionsstransportAddressMIBs loadTextsssetOrganizationssetContactInfossetDescriptionstransportDomainsstransportDomainUdpIpv4stransportDomainUdpIpv6stransportDomainUdpIpv4zstransportDomainUdpIpv6zstransportDomainTcpIpv4stransportDomainTcpIpv6stransportDomainTcpIpv4zstransportDomainTcpIpv6zstransportDomainSctpIpv4stransportDomainSctpIpv6stransportDomainSctpIpv4zstransportDomainSctpIpv6zstransportDomainLocalstransportDomainUdpDnsstransportDomainTcpDnsstransportDomainSctpDnss exportSymbols(*stransportDomainSctpDnssmib_2stransportDomainUdpDnss TimeTicksstransportDomainUdpIpv6zstransportDomainTcpIpv4zsModuleIdentitystransportDomainTcpIpv6zsBitsstransportDomainUdpIpv6stransportDomainUdpIpv4sTransportAddresssTransportAddressIPv4sTransportAddressIPv6sTransportAddressTypesTransportDomainstransportDomainUdpIpv4zstransportDomainLocalsObjectIdentifiersnamedvals OctetStringstransportDomainSctpIpv4zsTransportAddressLocalstransportDomainSctpIpv6zstransportAddressMIBstransportDomainTcpDnssIntegerstypess Integer32sTransportAddressDnsssockets constraintsTextualConventionstransportDomainTcpIpv6stransportDomainsstransportDomainTcpIpv4s MibIdentifierstransportDomainSctpIpv6stransportDomainSctpIpv4sTransportAddressIPv6zsObjectIdentitysTransportAddressIPv4z((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pys?s  !9-   $' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' CPKnr2ĎCCpysnmp/smi/mibs/ASN1.py# ASN.1 objects used in SNMP 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 ) PKAq><+ pysnmp/smi/mibs/SNMP-MPD-MIB.pyc; %Ic@sdklZlZeidddd\ZZZeiddd\ZZ eidd d d d d dddddd \ Z Z Z Z ZZZZZZZe dddddddfidddfZeioeidneioeidneioeidneddddddddfZeddddddddfZedddddddddf Zeddddddddddf e idZeioeid neddddddddddf e idZ eioe id!neddddddddddf e idZ!eioe!id"neddddddddfZ"edddddddddf Z#edddddddddf Z$e ddddddddddf i%d#d$fd#d%fd#d&fZ&ei'd#d'eei'd#d(ed)ed*ed+ed&ed$e d%e!d,e"d-e#d.e$ ei'd#d/e&d0S(1(s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStrings SNMPv2-CONFsModuleCompliances ObjectGroups SNMPv2-SMIsBitss Counter32s Integer32sModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModulesiiii s2002-10-14 00:00s1999-05-04 16:36s1997-09-30 00:00sSNMPv3 Working GroupsyWG-EMail: snmpv3@lists.tislabs.com Subscribe: snmpv3-request@lists.tislabs.com Co-Chair: Russ Mundy Network Associates Laboratories postal: 15204 Omega Drive, Suite 300 Rockville, MD 20850-4601 USA EMail: mundy@tislabs.com phone: +1 301-947-7107 Co-Chair & Co-editor: David Harrington Enterasys Networks postal: 35 Industrial Way P. O. Box 5005 Rochester NH 03866-5005 USA EMail: dbh@enterasys.com phone: +1 603-337-2614 Co-editor: Jeffrey Case SNMP Research, Inc. postal: 3001 Kimberlin Heights Road Knoxville, TN 37920-9716 USA EMail: case@snmp.com phone: +1 423-573-1434 Co-editor: Randy Presuhn BMC Software, Inc. postal: 2141 North First Street San Jose, CA 95131 USA EMail: randy_presuhn@bmc.com phone: +1 408-546-1006 Co-editor: Bert Wijnen Lucent Technologies postal: Schagen 33 3461 GL Linschoten Netherlands EMail: bwijnen@lucent.com phone: +31 348-680-485sThe MIB for Message Processing and Dispatching Copyright (C) The Internet Society (2002). This version of this MIB module is part of RFC 3412; see the RFC itself for full legal notices.isreadonlysThe total number of packets received by the SNMP engine which were dropped because they referenced a securityModel that was not known to or supported by the SNMP engine.sThe total number of packets received by the SNMP engine which were dropped because there were invalid or inconsistent components in the SNMP message.s)The total number of packets received by the SNMP engine which were dropped because the PDU contained in the packet could not be passed to an application responsible for handling the pduType, e.g. no SNMP application had registered for the proper combination of the contextEngineID and the pduType.s SNMP-MPD-MIBssnmpInvalidMsgsssnmpUnknownPDUHandlersssnmpUnknownSecurityModelssPYSNMP_MODULE_IDs snmpMPDMIBs snmpMPDAdminssnmpMPDMIBObjectss snmpMPDStatsssnmpMPDMIBConformancessnmpMPDMIBCompliancesssnmpMPDMIBGroupss snmpMPDGroupN((s pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsModuleCompliances ObjectGroupsBitss Counter32s Integer32sModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModuless setRevisionss snmpMPDMIBs loadTextsssetOrganizationssetContactInfossetDescriptions snmpMPDAdminssnmpMPDMIBObjectss snmpMPDStatss setMaxAccessssnmpUnknownSecurityModelsssnmpInvalidMsgsssnmpUnknownPDUHandlersssnmpMPDMIBConformancessnmpMPDMIBCompliancesssnmpMPDMIBGroupss setObjectss snmpMPDGroups exportSymbols(s MibScalars snmpMPDMIBs TimeTickss snmpMPDStatssModuleIdentitys snmpModulessBitsssnmpMPDMIBCompliancess ObjectGroupsMibTableColumnsModuleCompliancesMibTables snmpMPDAdminssnmpMPDMIBGroupsssnmpInvalidMsgsssnmpMPDMIBObjectsssnmpUnknownPDUHandlerssnamedvalsObjectIdentifiers OctetStrings MibTableRowsIntegers snmpMPDGroups Integer32ssnmpUnknownSecurityModelss constraints MibIdentifierssnmpMPDMIBConformances Counter32((s:build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-MPD-MIB.pys?s:!Q3   $$'9 9 9 $''KIPKAq>hM99)pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.pyc; %Ic2@s dklZlZeidddd\ZZZeidd\Zeiddd d d d d d d dddd \ Z Z Z Z Z Z Z ZZZZZeiddd\ZZeiddddddddddd \ ZZZZZZZZZZeid d!d"\ZZ ed#d$d%d#d%d$d&fi!d'd(d)fZ"ei#oe"i$d*nei#oe"i%d+nei#oe"i&d,ned#d$d%d#d%d$d&d#fZ'ed#d$d%d#d%d$d&d#d#f Z(ei#oe(i&d-ned#d$d%d#d%d$d&d#d#d#f i)d#d.d/fZ*ei#oe*i&d0ned#d$d%d#d%d$d&d#d#d#d#f ei+d1ei,d#d2i-d3Z.ei#oe.i&d4ned#d$d%d#d%d$d&d#d#d#d5f e i/d6i-d7Z0ei#oe0i&d8ned#d$d%d#d%d$d&d#d#d#d$f ei+d1ei1d5d#i+d9ei2d:d#fd;d5fi/d#i-d7Z3ei#oe3i&d<ned#d$d%d#d%d$d&d#d#d#d=f e i/d>i-d7Z4ei#oe4i&d?ned#d$d%d#d%d$d&d#d#d#d@f ei-d7Z5ei#oe5i&dAned#d$d%d#d%d$d&d#d5f Z6ei#oe6i&dBned#d$d%d#d%d$d&d#d5d#f i)d#dd fZ7ei#oe7i&dCned#d$d%d#d%d$d&d#d5d#d#f ei+d1ei,d#d2i-d7Z8ei#oe8i&dDned#d$d%d#d%d$d&d#d5d#d5f e i/d>i-d7Z9ei#oe9i&d?ned#d$d%d#d%d$d&d#d5d#d$f ei-d7Z:ei#oe:i&dEned#d$d%d#d%d$d&d#d$f Z;ei#oe;i&dFned#d$d%d#d%d$d&d#d$d#f i)dGd.dHfd#d.dIfZ<ei#oe<i&dJned#d$d%d#d%d$d&d#d$d#d#f ei-d3Z=ei#oe=i&dKned#d$d%d#d%d$d&d#d$d#d5f ei+d1ei,dGdLi/d6i-d7Z>ei#oe>i&dMned#d$d%d#d%d$d&d#d$d#d$f ei+d1ei1d#d5i+d9ei2dNd#fdOd5fi/d#i-d7Z?ei#oe?i&dPned#d$d%d#d%d$d&d#d$d#d=f e i/d>i-d7Z@ei#oe@i&dQned#d$d%d#d%d$d&d#d$d#d@f ei-d7ZAei#oeAi&dAned#d$d%d#d%d$d&d$fZBed#d$d%d#d%d$d&d$d#f ZCed#d$d%d#d%d$d&d$d5f ZDed#d$d%d#d%d$d&d$d5d5f iEd.dRfd.dSfd.dHfd.dTfd.dUfd.dVfd.dWfZFed#d$d%d#d%d$d&d$d5d#f iEd.dXfd.dYfd.dZfd.d[fZGeiHd.d\e"eiHd.d]e"d^e'd_e(d`e*d/e.dXe0d[e3dZe4dYe5dae6dbe7dHe8dSe9dWe:dce;dde<dIe=dVe>dTe?dUe@dReAdeeBdfeCdgeDeiHd.dheFdieGdjS(k(s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStringsSNMP-FRAMEWORK-MIBsSnmpAdminStringsSNMP-TARGET-MIBs SnmpTagValuessnmpTargetBasicGroupssnmpTargetParamsMPModelssnmpTargetParamsNamessnmpTargetParamsRowStatusssnmpTargetParamsSecurityLevelssnmpTargetParamsSecurityModelssnmpTargetParamsSecurityNamessnmpTargetParamsStorageTypessnmpTargetResponseGroups SNMPv2-CONFsModuleCompliances ObjectGroups SNMPv2-SMIsBitss Integer32sModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModuless SNMPv2-TCs RowStatuss StorageTypeiiii s2002-10-14 00:00s1998-08-04 00:00s1997-07-14 00:00sIETF SNMPv3 Working GroupsWG-email: snmpv3@lists.tislabs.com Subscribe: majordomo@lists.tislabs.com In message body: subscribe snmpv3 Co-Chair: Russ Mundy Network Associates Laboratories Postal: 15204 Omega Drive, Suite 300 Rockville, MD 20850-4601 USA EMail: mundy@tislabs.com Phone: +1 301-947-7107 Co-Chair: David Harrington Enterasys Networks Postal: 35 Industrial Way P. O. Box 5004 Rochester, New Hampshire 03866-5005 USA EMail: dbh@enterasys.com Phone: +1 603-337-2614 Co-editor: David B. Levi Nortel Networks Postal: 3505 Kesterwood Drive Knoxville, Tennessee 37918 EMail: dlevi@nortelnetworks.com Phone: +1 865 686 0432 Co-editor: Paul Meyer Secure Computing Corporation Postal: 2675 Long Lake Road Roseville, Minnesota 55113 EMail: paul_meyer@securecomputing.com Phone: +1 651 628 1592 Co-editor: Bob Stewart Retireds)This MIB module defines MIB objects which provide mechanisms to remotely configure the parameters used by an SNMP entity for the generation of notifications. Copyright (C) The Internet Society (2002). This version of this MIB module is part of RFC 3413; see the RFC itself for full legal notices.sThis table is used to select management targets which should receive notifications, as well as the type of notification which should be sent to each selected management target.sSNMP-NOTIFICATION-MIBssnmpNotifyNamesAn entry in this table selects a set of management targets which should receive notifications, as well as the type of notification which should be sent to each selected management target. Entries in the snmpNotifyTable are created and deleted using the snmpNotifyRowStatus object.s subtypeSpeci snoaccesssRThe locally arbitrary, but unique identifier associated with this snmpNotifyEntry.iss readcreates5This object contains a single tag value which is used to select entries in the snmpTargetAddrTable. Any entry in the snmpTargetAddrTable which contains a tag value which is equal to the value of an instance of this object is selected. If this object contains a value of zero length, no entries are selected.s namedValuesstrapsinformsThis object determines the type of notification to be generated for entries in the snmpTargetAddrTable selected by the corresponding instance of snmpNotifyTag. This value is only used when generating notifications, and is ignored when using the snmpTargetAddrTable for other purposes. If the value of this object is trap(1), then any messages generated for selected rows will contain Unconfirmed-Class PDUs. If the value of this object is inform(2), then any messages generated for selected rows will contain Confirmed-Class PDUs. Note that if an SNMP entity only supports generation of Unconfirmed-Class PDUs (and not Confirmed-Class PDUs), then this object may be read-only.is nonVolatilesThe storage type for this conceptual row. Conceptual rows having the value 'permanent' need not allow write-access to any columnar objects in the row.isThe status of this conceptual row. To create a row in this table, a manager must set this object to either createAndGo(4) or createAndWait(5).siThis table is used to associate a notification filter profile with a particular set of target parameters.sAn entry in this table indicates the name of the filter profile to be used when generating notifications using the corresponding entry in the snmpTargetParamsTable. Entries in the snmpNotifyFilterProfileTable are created and deleted using the snmpNotifyFilterProfileRowStatus object.sThe name of the filter profile to be used when generating notifications using the corresponding entry in the snmpTargetAddrTable.sThe status of this conceptual row. To create a row in this table, a manager must set this object to either createAndGo(4) or createAndWait(5). Until instances of all corresponding columns are appropriately configured, the value of the corresponding instance of the snmpNotifyFilterProfileRowStatus column is 'notReady'. In particular, a newly created row cannot be made active until the corresponding instance of snmpNotifyFilterProfileName has been set.sThe table of filter profiles. Filter profiles are used to determine whether particular management targets should receive particular notifications. When a notification is generated, it must be compared with the filters associated with each management target which is configured to receive notifications, in order to determine whether it may be sent to each such management target. A more complete discussion of notification filtering can be found in section 6. of [SNMP-APPL].issnmpNotifyFilterProfileNamessnmpNotifyFilterSubtreesAn element of a filter profile. Entries in the snmpNotifyFilterTable are created and deleted using the snmpNotifyFilterRowStatus object.sThe MIB subtree which, when combined with the corresponding instance of snmpNotifyFilterMask, defines a family of subtrees which are included in or excluded from the filter profile.isThe bit mask which, in combination with the corresponding instance of snmpNotifyFilterSubtree, defines a family of subtrees which are included in or excluded from the filter profile. Each bit of this bit mask corresponds to a sub-identifier of snmpNotifyFilterSubtree, with the most significant bit of the i-th octet of this octet string value (extended if necessary, see below) corresponding to the (8*i - 7)-th sub-identifier, and the least significant bit of the i-th octet of this octet string corresponding to the (8*i)-th sub-identifier, where i is in the range 1 through 16. Each bit of this bit mask specifies whether or not the corresponding sub-identifiers must match when determining if an OBJECT IDENTIFIER matches this family of filter subtrees; a '1' indicates that an exact match must occur; a '0' indicates 'wild card', i.e., any sub-identifier value matches. Thus, the OBJECT IDENTIFIER X of an object instance is contained in a family of filter subtrees if, for each sub-identifier of the value of snmpNotifyFilterSubtree, either: the i-th bit of snmpNotifyFilterMask is 0, or the i-th sub-identifier of X is equal to the i-th sub-identifier of the value of snmpNotifyFilterSubtree. If the value of this bit mask is M bits long and there are more than M sub-identifiers in the corresponding instance of snmpNotifyFilterSubtree, then the bit mask is extended with 1's to be the required length. Note that when the value of this object is the zero-length string, this extension rule results in a mask of all-1's being used (i.e., no 'wild card'), and the family of filter subtrees is the one subtree uniquely identified by the corresponding instance of snmpNotifyFilterSubtree.sincludedsexcludedsThis object indicates whether the family of filter subtrees defined by this entry are included in or excluded from a filter. A more detailed discussion of the use of this object can be found in section 6. of [SNMP-APPL].sThe storage type for this conceptual row. Conceptual rows having the value 'permanent' need not allow write-access to any columnar objects in the row.ssnmpNotifyFilterRowStatusssnmpNotifyFilterProfileStorTypessnmpNotifyFilterTypessnmpNotifyFilterStorageTypessnmpNotifyFilterMasks snmpNotifyFilterProfileRowStatuss snmpNotifyTagssnmpNotifyRowStatusssnmpNotifyStorageTypessnmpNotifyTypesPYSNMP_MODULE_IDssnmpNotificationMIBssnmpNotifyObjectsssnmpNotifyTablessnmpNotifyEntryssnmpNotifyFilterProfileTablessnmpNotifyFilterProfileEntryssnmpNotifyFilterTablessnmpNotifyFilterEntryssnmpNotifyConformancessnmpNotifyCompliancesssnmpNotifyGroupsssnmpNotifyFilterGroupssnmpNotifyGroupN(Is pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsSnmpAdminStrings SnmpTagValuessnmpTargetBasicGroupssnmpTargetParamsMPModelssnmpTargetParamsNamessnmpTargetParamsRowStatusssnmpTargetParamsSecurityLevelssnmpTargetParamsSecurityModelssnmpTargetParamsSecurityNamessnmpTargetParamsStorageTypessnmpTargetResponseGroupsModuleCompliances ObjectGroupsBitss Integer32sModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModuless RowStatuss StorageTypes setRevisionsssnmpNotificationMIBs loadTextsssetOrganizationssetContactInfossetDescriptionssnmpNotifyObjectsssnmpNotifyTables setIndexNamesssnmpNotifyEntryssubtypesValueSizeConstraints setMaxAccessssnmpNotifyNamesclones snmpNotifyTagsSingleValueConstraints NamedValuesssnmpNotifyTypessnmpNotifyStorageTypessnmpNotifyRowStatusssnmpNotifyFilterProfileTablessnmpNotifyFilterProfileEntryssnmpNotifyFilterProfileNamessnmpNotifyFilterProfileStorTypes snmpNotifyFilterProfileRowStatusssnmpNotifyFilterTablessnmpNotifyFilterEntryssnmpNotifyFilterSubtreessnmpNotifyFilterMaskssnmpNotifyFilterTypessnmpNotifyFilterStorageTypessnmpNotifyFilterRowStatusssnmpNotifyConformancessnmpNotifyCompliancesssnmpNotifyGroupss setObjectsssnmpNotifyFilterGroupssnmpNotifyGroups exportSymbols(8ssnmpNotifyNamesSnmpAdminStrings MibScalars MibIdentifiers TimeTickssModuleIdentitys snmpModulesssnmpNotifyFilterStorageTypessnmpNotifyCompliancesssnmpTargetParamsNamessnmpNotifyFilterMaskssnmpTargetBasicGroupssnmpTargetParamsSecurityLevelssnmpTargetParamsSecurityModelssnmpNotifyFilterRowStatuss ObjectGroupsMibTableColumnsBitsssnmpNotifyFilterEntrysMibTablessnmpNotifyFilterSubtreessnmpNotifyConformancessnmpNotifyRowStatuss RowStatusssnmpNotifyTablessnmpTargetParamsStorageTypesIntegerssnmpNotifyFilterProfileTablessnmpNotifyGroupsssnmpTargetParamsRowStatusssnmpNotifyEntrys SnmpTagValues OctetStrings MibTableRowssnmpNotifyFilterProfileNamessnmpNotifyGroupssnmpTargetParamsMPModelssnmpNotifyFilterProfileEntryssnmpNotifyFilterTypessnmpNotifyObjectsssnmpTargetParamsSecurityNames snmpNotifyTagssnmpNotificationMIBssnmpNotifyStorageTypes Integer32ssnmpNotifyFilterProfileStorTypessnmpNotifyTypes constraintssnmpTargetResponseGroupsnamedvalssnmpNotifyFilterGroupssnmpNotifyFilterTables StorageTypesObjectIdentifiersModuleCompliances snmpNotifyFilterProfileRowStatus((sCbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.pys?s!WK3   $' < T E  E < ' < T E < ' H < ]  E < $''oTPKAq>jd77pysnmp/smi/mibs/SNMPv2-TC.pyc; Mc$@sdklZlZdklZdklZlZdkl Z e i dddd\Z Z Ze i dd d d d \ZZZZd fdYZdee fdYZdee fdYZdee fdYZde efdYZde efdYZdeefdYZdeefdYZdeefdYZdeefd YZd!e efd"YZd#eefd$YZd%e efd&YZd'ee fd(YZ d)e efd*YZ!d+eefd,YZ"d-e efd.YZ#e i$d/d edededededededededed!ed#ed%ed'e d)e!d+e"d-e#d0S(1(ssplitsdigits(serror(s constraintsnamedval(sdebugsASN1s OctetStringsIntegersObjectIdentifiers SNMPv2-SMIs Counter32s Unsigned32s TimeTickss Counter64sTextualConventioncBstZdZdZdZdZfZeZe Z e Z e ZeZeZeZdZdZdZdZdZRS(NsscurrentcCs |iSdS(N(sselfs displayHint(sself((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pysgetDisplayHintscCs |iSdS(N(sselfsstatus(sself((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys getStatusscCs |iSdS(N(sselfs description(sself((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pysgetDescriptionscCs |iSdS(N(sselfs reference(sself((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys getReferencescCsc|io\|ii|pI|ii|p6|ii|p#|ii|p|ii|o;tddt |id\} } | djo d|Sq_| djo`y1dt | t|tdt | fSWqtj o}tid |qXq_| d jo d |Sq_| d joQ|}d g} x.|o&| idd|d@|d?}qNWt| dSq_tid| n|io|ii|oHd} t|}|i} x"|o| o| ddjo,t |d}}| d} |d}n d}t}d}x5| o| dtjo|| d}| d} q?Wyt |}Wn(tj o}tid|nX| otid|in| d}| d} | o| dtjo| ddjo| d}| d} nd}| o|o |tj o| d}d}| d} nt}x]|oU|d}|djp |djo| || } n|ddd fjod} || }xi|oa| d>} y"| t%|dB} |d}Wqtj o"}tid||fqXqW|djo| d| } q|d jo| d| } q| d| } ntid||o|o| |} n||}qnW|o|o| |} n| o |i} qqW| SnW|io|i&i|ot|Sn,|ii|ot'|Sn t|SdS(s"Implements DISPLAY-HINT evaluationicCs ||fS(N(stsf(stsf((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys(ss-sxs0x%xsds%.*fi sfloat num evaluation error: %ssos0%osbsBs%diss!Unsupported numeric type spec: %ss*sBad octet length: %ssShort octet length: %ssastlis#Display format eval failure: %s: %ss%02xs%03os#Unsupported display format char: %sN((sselfs displayHints_TextualConvention__integers isSuperTypeOfs_TextualConvention__unsigned32s_TextualConvention__timetickss_TextualConvention__counter32s_TextualConvention__counter64sapplyssplitstsfsvaluesintsfloatspows StandardErrorswhyserrorsSmiErrorsvsrsinsertsjoins_TextualConvention__octetStringsstrsdsrepeatIndicators repeatCountsNones octetLengthsdigitss displayFormats displaySepsrepeatTerminatorsnsvvsords$_TextualConvention__objectIdentifiersrepr(sselfsvalues repeatCounts displayFormatsvvsrepeatIndicators displaySepsrepeatTerminatorswhysdsfsnsrstsvs octetLength((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys prettyOutsi'   1        )    #  (s__name__s __module__s displayHintsstatuss descriptions referencesbitssIntegers_TextualConvention__integers Counter32s_TextualConvention__counter32s Unsigned32s_TextualConvention__unsigned32s TimeTickss_TextualConvention__timetickss Counter64s_TextualConvention__counter64s OctetStrings_TextualConvention__octetStringsObjectIdentifiers$_TextualConvention__objectIdentifiersgetDisplayHints getStatussgetDescriptions getReferences prettyOut(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pysTextualConvention s"           s DisplayStringcBs'tZeieiddZdZRS(Niis255a(s__name__s __module__s OctetStrings subtypeSpecs constraintsValueSizeConstraints displayHint(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys DisplayStringss PhysAddresscBstZdZRS(Ns1x:(s__name__s __module__s displayHint(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys PhysAddressss MacAddresscBs-tZeieiddZdZdZRS(Nis1x:(s__name__s __module__s OctetStrings subtypeSpecs constraintsValueSizeConstraints displayHints fixedLength(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys MacAddressss TruthValuecBs?tZeieiddZeiddfddfZRS(Niistruesfalse( s__name__s __module__sIntegers subtypeSpecs constraintsSingleValueConstraintsnamedvals NamedValuess namedValues(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys TruthValuess TestAndIncrcBs0tZeieiddZdZdZRS(NilcCs[||jotid|d|n|d}|djo d}n|i|SdS(Nsidxsnameiii(svaluesselfserrorsInconsistentValueErrorsidxsnamesclone(sselfsnamesvaluesidx((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pyssmiWrites     (s__name__s __module__sIntegers subtypeSpecs constraintsValueRangeConstraints defaultValuessmiWrite(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys TestAndIncrssAutonomousTypecBstZRS(N(s__name__s __module__(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pysAutonomousTypessInstancePointercBstZdZRS(Nsobsolete(s__name__s __module__sstatus(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pysInstancePointerssVariablePointercBstZRS(N(s__name__s __module__(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pysVariablePointerss RowPointercBstZRS(N(s__name__s __module__(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys RowPointerss RowStatusc BstZdZeieidddddddZeiddfd dfd dfd dfd dfd dfddfZ e d\Z Z Z ZZZZhee feie f<eefeief<ee feie f<ee feie f<ee feie f<eefeief<ee feie f<ee feie f<e e feie f<e efeief<e e fee f<e e fee f<e e feie f<e efeief<e e fee f<e e fee f<ee feie f<eefeie f<ee feie f<ee feie f<e e fee f %s, %ssmsgs(Exception at row state transition %s->%ssidx(sselfs stateMatrixsgetsclonesvaluesintserrorsMibOperationErrorsNoneserrsvalsdebugsloggersflagInssidxssmiSetPendingError(sselfsnamesvaluesidxserrsval((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pyssmiWrite s94    cCs|i|||SdS(N(sselfssmiWritesnamesvaluesidx(sselfsnamesvaluesidx((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys smiCreate2scCs0|io"|itf\}|_|ndS(N(sselfs pendingErrorsNoneserr(sselfserr((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pyssmiRaisePendingError5s cCs ||_dS(N(serrsselfs pendingError(sselfserr((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pyssmiSetPendingError9s(s__name__s __module__s__doc__sIntegers subtypeSpecs constraintsSingleValueConstraintsnamedvals NamedValuess namedValuessranges stNotExistssstActivesstNotInServices stNotReadys stCreateAndGosstCreateAndWaits stDestroyserrorsRowCreationWantedsInconsistentValueErrorsNonesRowDestructionWanteds stateMatrixs defaultValues pendingErrorssmiWrites smiCreatessmiRaisePendingErrorssmiSetPendingError(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys RowStatuss (*!!G   s TimeStampcBstZRS(N(s__name__s __module__(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys TimeStamp<ss TimeIntervalcBs!tZeieiddZRS(Nil(s__name__s __module__sIntegers subtypeSpecs constraintsValueRangeConstraint(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys TimeInterval>ss DateAndTimecBs'tZeieiddZdZRS(Nii s2d-1d-1d,1d:1d:1d.1d,1a1d:1d(s__name__s __module__s OctetStrings subtypeSpecs constraintsValueSizeConstraints displayHint(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys DateAndTimeAss StorageTypecBsctZeieidddddZeiddfddfddfd dfd dfZRS( Niiiiisothersvolatiles nonVolatiles permanentsreadOnly( s__name__s __module__sIntegers subtypeSpecs constraintsSingleValueConstraintsnamedvals NamedValuess namedValues(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys StorageTypeEs"!sTDomaincBstZRS(N(s__name__s __module__(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pysTDomainLssTAddresscBs!tZeieiddZRS(Nii(s__name__s __module__s OctetStrings subtypeSpecs constraintsValueSizeConstraint(((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pysTAddressNss SNMPv2-TCN(%sstringssplitsdigitss pysnmp.smiserrors pyasn1.types constraintsnamedvalspysnmpsdebugs mibBuilders importSymbolss OctetStringsIntegersObjectIdentifiers Counter32s Unsigned32s TimeTickss Counter64sTextualConventions DisplayStrings PhysAddresss MacAddresss TruthValues TestAndIncrsAutonomousTypesInstancePointersVariablePointers RowPointers RowStatuss TimeStamps TimeIntervals DateAndTimes StorageTypesTDomainsTAddresss exportSymbols(sAutonomousTypes TruthValues TimeTickss PhysAddresss MacAddresssVariablePointers DateAndTimes RowStatusssplits DisplayStringsIntegersnamedvals TimeIntervals OctetStrings RowPointers TimeStamps Counter64s Unsigned32s TestAndIncrsInstancePointersdigitss constraints StorageTypesTextualConventionsObjectIdentifierserrorsdebugsTAddresss Counter32sTDomain((s7build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-TC.pys?s:  !' s  PKAq> pysnmp/smi/mibs/PYSNMP-MIB.pyc; "Ic@sFdklZlZeidddd\ZZZeiddddd d d \ZZ Z Z Z Z e d d dd dd dfidfZeioeidneioeidneioeidne d d dd dd dd fZe d d dd dd ddfZe d d dd dd dd fZe d d dd dd dd d f Ze d d dd dd dd df Ze d d dd dd dd d f Ze d d dd dd ddfZe d d dd dd dddf Ze d d dd dd ddd f Ze d d dd dd ddfZe d d dd dd ddd f Ze d d dd dd dddf Ze d d dd dd ddfZ ei!ddeei!ddededededed ed!ed"ed#ed$ed%ed&ed'ed(e d)S(*(s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStrings SNMPv2-SMIsBitss Integer32sModuleIdentitys MibIdentifiers TimeTickss enterprisesiiiiiOs2005-05-14 00:00s pysnmp.sf.netsemail: ilya@glas.netsBTop-level infrastructure of the PySNMP project enterprise MIB treeiiii's PYSNMP-MIBsPYSNMP_MODULE_IDspysnmps pysnmpObjectsspysnmpExamplesspysnmpEnumerationsspysnmpModuleIDsspysnmpAgentOIDss pysnmpDomainsspysnmpNotificationPrefixspysnmpNotificationsspysnmpNotificationObjectsspysnmpConformancespysnmpCompliancess pysnmpGroupsspysnmpExperimentalN("s pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsBitss Integer32sModuleIdentitys MibIdentifiers TimeTickss enterprisess setRevisionsspysnmps loadTextsssetOrganizationssetContactInfossetDescriptions pysnmpObjectsspysnmpExamplesspysnmpEnumerationsspysnmpModuleIDsspysnmpAgentOIDss pysnmpDomainsspysnmpNotificationPrefixspysnmpNotificationsspysnmpNotificationObjectsspysnmpConformancespysnmpCompliancess pysnmpGroupsspysnmpExperimentals exportSymbols(spysnmpNotificationPrefixs pysnmpDomainsspysnmpExperimentals TimeTicksspysnmpAgentOIDsspysnmpEnumerationssBitss pysnmpGroupssObjectIdentifiersnamedvals OctetStringspysnmpExampless enterprisesspysnmpNotificationObjectssIntegers pysnmpObjectsspysnmps Integer32sModuleIdentitys constraintspysnmpCompliancesspysnmpConformancespysnmpModuleIDss MibIdentifierspysnmpNotifications((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/PYSNMP-MIB.pys?s0!3-   $$$'''$''$''$PKAq>t>>#pysnmp/smi/mibs/SNMP-TARGET-MIB.pyc; %Ic:@s dklZlZeidddd\ZZZeiddddd \ZZ Z Z eid d d \Z Z eid dddddddddddd \ ZZZZZZZZZZZZeidddddddd \ZZZZZZZd!eefd"YZ d#eefd$YZ!ed%d&d'd%d'd&d(fi"d)d*d+fZ#ei$oe#i%d,nei$oe#i&d-nei$oe#i'd.ned%d&d'd%d'd&d(d%fZ(ed%d&d'd%d'd&d(d%d%f ei)d/Z*ei$oe*i'd0ned%d&d'd%d'd&d(d%d1f Z+ei$oe+i'd2ned%d&d'd%d'd&d(d%d1d%f i,d%d3d4fZ-ei$oe-i'd5ned%d&d'd%d'd&d(d%d1d%d%f ei.d6ei/d%d7i)d8Z0ei$oe0i'd9ned%d&d'd%d'd&d(d%d1d%d1f ei)d:Z1ei$oe1i'd;ned%d&d'd%d'd&d(d%d1d%d&f ei)d:Z2ei$oe2i'd<ned%d&d'd%d'd&d(d%d1d%d=f ei3d>i)d:Z4ei$oe4i'd?ned%d&d'd%d'd&d(d%d1d%d@f ei.d6ei5dAdBi3d&i)d:Z6ei$oe6i'dCned%d&d'd%d'd&d(d%d1d%d'f e i3dDi)d:Z7ei$oe7i'dEned%d&d'd%d'd&d(d%d1d%dFf ei.d6ei/d%d7i)d:Z8ei$oe8i'dGned%d&d'd%d'd&d(d%d1d%dHf ei3dIi)d:Z9ei$oe9i'dJned%d&d'd%d'd&d(d%d1d%dKf ei)d:Z:ei$oe:i'dLned%d&d'd%d'd&d(d%d&f Z;ei$oe;i'dMned%d&d'd%d'd&d(d%d&d%f i,d%d3dNfZ<ei$oe<i'dOned%d&d'd%d'd&d(d%d&d%d%f ei.d6ei/d%d7i)d8Z=ei$oe=i'dPned%d&d'd%d'd&d(d%d&d%d1f e i)d:Z>ei$oe>i'dQned%d&d'd%d'd&d(d%d&d%d&f e i.d6ei5d%dRi)d:Z?ei$oe?i'dSned%d&d'd%d'd&d(d%d&d%d=f ei)d:Z@ei$oe@i'dTned%d&d'd%d'd&d(d%d&d%d@f e i)d:ZAei$oeAi'dUned%d&d'd%d'd&d(d%d&d%d'f ei3dIi)d:ZBei$oeBi'dJned%d&d'd%d'd&d(d%d&d%dFf ei)d:ZCei$oeCi'dVned%d&d'd%d'd&d(d%d=f ei)dWZDei$oeDi'dXned%d&d'd%d'd&d(d%d@f ei)dWZEei$oeEi'dYned%d&d'd%d'd&d(d&fZFed%d&d'd%d'd&d(d&d%f ZGed%d&d'd%d'd&d(d&d1f ZHe d%d&d'd%d'd&d(d&d1d1f iId3dZfd3d[fZJe d%d&d'd%d'd&d(d&d1d&f iId3d\fd3d]fZKe d%d&d'd%d'd&d(d&d1d%f iId3d^fd3d_fd3d`fd3dafd3dbfd3dcfd3ddfd3defd3dffd3dgfd3dhfd3difd3djf ZLeiMd3dke#eiMd3d!e d#e!eiMd3dle#dme(dhe*dne+doe-d4e0d^e1dee2d[e4dZe6dge7d_e8dbe9dde:dpe;dqe<dNe=dae>dje?dce@dieAdfeBd`eCd\eDd]eEdreFdseGdteHeiMd3dueJdveKdweLdxS(y(s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStringsSNMP-FRAMEWORK-MIBsSnmpAdminStringsSnmpMessageProcessingModelsSnmpSecurityLevelsSnmpSecurityModels SNMPv2-CONFsModuleCompliances ObjectGroups SNMPv2-SMIsBitss Counter32s Integer32sModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModuless SNMPv2-TCs RowStatuss StorageTypesTAddresssTDomainsTextualConventions TestAndIncrs TimeIntervals SnmpTagListcBs'tZdZeieiddZRS(Ns255tii(s__name__s __module__s displayHints OctetStrings subtypeSpecs constraintsValueSizeConstraint(((s=build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-TARGET-MIB.pys SnmpTagListss SnmpTagValuecBs'tZdZeieiddZRS(Ns255tii(s__name__s __module__s displayHints OctetStrings subtypeSpecs constraintsValueSizeConstraint(((s=build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-TARGET-MIB.pys SnmpTagValuesiiii s2002-10-14 00:00s1998-08-04 00:00s1997-07-14 00:00sIETF SNMPv3 Working GroupsWG-email: snmpv3@lists.tislabs.com Subscribe: majordomo@lists.tislabs.com In message body: subscribe snmpv3 Co-Chair: Russ Mundy Network Associates Laboratories Postal: 15204 Omega Drive, Suite 300 Rockville, MD 20850-4601 USA EMail: mundy@tislabs.com Phone: +1 301-947-7107 Co-Chair: David Harrington Enterasys Networks Postal: 35 Industrial Way P. O. Box 5004 Rochester, New Hampshire 03866-5005 USA EMail: dbh@enterasys.com Phone: +1 603-337-2614 Co-editor: David B. Levi Nortel Networks Postal: 3505 Kesterwood Drive Knoxville, Tennessee 37918 EMail: dlevi@nortelnetworks.com Phone: +1 865 686 0432 Co-editor: Paul Meyer Secure Computing Corporation Postal: 2675 Long Lake Road Roseville, Minnesota 55113 EMail: paul_meyer@securecomputing.com Phone: +1 651 628 1592 Co-editor: Bob Stewart Retireds)This MIB module defines MIB objects which provide mechanisms to remotely configure the parameters used by an SNMP entity for the generation of SNMP messages. Copyright (C) The Internet Society (2002). This version of this MIB module is part of RFC 3413; see the RFC itself for full legal notices.s readwritesThis object is used to facilitate modification of table entries in the SNMP-TARGET-MIB module by multiple managers. In particular, it is useful when modifying the value of the snmpTargetAddrTagList object. The procedure for modifying the snmpTargetAddrTagList object is as follows: 1. Retrieve the value of snmpTargetSpinLock and of snmpTargetAddrTagList. 2. Generate a new value for snmpTargetAddrTagList. 3. Set the value of snmpTargetSpinLock to the retrieved value, and the value of snmpTargetAddrTagList to the new value. If the set fails for the snmpTargetSpinLock object, go back to step 1.isMA table of transport addresses to be used in the generation of SNMP messages.sSNMP-TARGET-MIBssnmpTargetAddrNamesA transport address to be used in the generation of SNMP operations. Entries in the snmpTargetAddrTable are created and deleted using the snmpTargetAddrRowStatus object.s subtypeSpeci snoaccesssVThe locally arbitrary, but unique identifier associated with this snmpTargetAddrEntry.s readcreatesgThis object indicates the transport type of the address contained in the snmpTargetAddrTAddress object.sThis object contains a transport address. The format of this address depends on the value of the snmpTargetAddrTDomain object.iisThis object should reflect the expected maximum round trip time for communicating with the transport address defined by this row. When a message is sent to this address, and a response (if one is expected) is not received within this time period, an implementation may assume that the response will not be delivered. Note that the time interval that an application waits for a response may actually be derived from the value of this object. The method for deriving the actual time interval is implementation dependent. One such method is to derive the expected round trip time based on a particular retransmission algorithm and on the number of timeouts which have occurred. The type of message may also be considered when deriving expected round trip times for retransmissions. For example, if a message is being sent with a securityLevel that indicates both authentication and privacy, the derived value may be increased to compensate for extra processing time spent during authentication and encryption processing.iiisThis object specifies a default number of retries to be attempted when a response is not received for a generated message. An application may provide its own retry count, in which case the value of this object is ignored.ssoThis object contains a list of tag values which are used to select target addresses for a particular operation.isThe value of this object identifies an entry in the snmpTargetParamsTable. The identified entry contains SNMP parameters to be used when generating messages to be sent to this transport address.is nonVolatilesThe storage type for this conceptual row. Conceptual rows having the value 'permanent' need not allow write-access to any columnar objects in the row.i sThe status of this conceptual row. To create a row in this table, a manager must set this object to either createAndGo(4) or createAndWait(5). Until instances of all corresponding columns are appropriately configured, the value of the corresponding instance of the snmpTargetAddrRowStatus column is 'notReady'. In particular, a newly created row cannot be made active until the corresponding instances of snmpTargetAddrTDomain, snmpTargetAddrTAddress, and snmpTargetAddrParams have all been set. The following objects may not be modified while the value of this object is active(1): - snmpTargetAddrTDomain - snmpTargetAddrTAddress An attempt to set these objects while the value of snmpTargetAddrRowStatus is active(1) will result in an inconsistentValue error.sQA table of SNMP target information to be used in the generation of SNMP messages.ssnmpTargetParamsNamesA set of SNMP target information. Entries in the snmpTargetParamsTable are created and deleted using the snmpTargetParamsRowStatus object.sXThe locally arbitrary, but unique identifier associated with this snmpTargetParamsEntry.sWThe Message Processing Model to be used when generating SNMP messages using this entry.lsThe Security Model to be used when generating SNMP messages using this entry. An implementation may choose to return an inconsistentValue error if an attempt is made to set this variable to a value for a security model which the implementation does not support.sqThe securityName which identifies the Principal on whose behalf SNMP messages will be generated using this entry.sPThe Level of Security to be used when generating SNMP messages using this entry.sThe status of this conceptual row. To create a row in this table, a manager must set this object to either createAndGo(4) or createAndWait(5). Until instances of all corresponding columns are appropriately configured, the value of the corresponding instance of the snmpTargetParamsRowStatus column is 'notReady'. In particular, a newly created row cannot be made active until the corresponding snmpTargetParamsMPModel, snmpTargetParamsSecurityModel, snmpTargetParamsSecurityName, and snmpTargetParamsSecurityLevel have all been set. The following objects may not be modified while the value of this object is active(1): - snmpTargetParamsMPModel - snmpTargetParamsSecurityModel - snmpTargetParamsSecurityName - snmpTargetParamsSecurityLevel An attempt to set these objects while the value of snmpTargetParamsRowStatus is active(1) will result in an inconsistentValue error.sreadonlysThe total number of packets received by the SNMP engine which were dropped because the context contained in the message was unavailable.sThe total number of packets received by the SNMP engine which were dropped because the context contained in the message was unknown.ssnmpTargetAddrRetryCountssnmpTargetAddrTimeoutssnmpUnavailableContextsssnmpUnknownContextsssnmpTargetAddrTDomainssnmpTargetAddrParamsssnmpTargetParamsRowStatusssnmpTargetParamsMPModelssnmpTargetAddrStorageTypessnmpTargetParamsSecurityNamessnmpTargetAddrRowStatusssnmpTargetAddrTAddressssnmpTargetParamsStorageTypessnmpTargetAddrTagListssnmpTargetSpinLockssnmpTargetParamsSecurityLevelssnmpTargetParamsSecurityModelsPYSNMP_MODULE_IDs snmpTargetMIBssnmpTargetObjectsssnmpTargetAddrTablessnmpTargetAddrEntryssnmpTargetParamsTablessnmpTargetParamsEntryssnmpTargetConformancessnmpTargetCompliancesssnmpTargetGroupsssnmpTargetResponseGroupssnmpTargetCommandResponderGroupssnmpTargetBasicGroupN(Ns pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsSnmpAdminStringsSnmpMessageProcessingModelsSnmpSecurityLevelsSnmpSecurityModelsModuleCompliances ObjectGroupsBitss Counter32s Integer32sModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModuless RowStatuss StorageTypesTAddresssTDomainsTextualConventions TestAndIncrs TimeIntervals SnmpTagLists SnmpTagValues setRevisionss snmpTargetMIBs loadTextsssetOrganizationssetContactInfossetDescriptionssnmpTargetObjectss setMaxAccessssnmpTargetSpinLockssnmpTargetAddrTables setIndexNamesssnmpTargetAddrEntryssubtypesValueSizeConstraintssnmpTargetAddrNamessnmpTargetAddrTDomainssnmpTargetAddrTAddresssclonessnmpTargetAddrTimeoutsValueRangeConstraintssnmpTargetAddrRetryCountssnmpTargetAddrTagListssnmpTargetAddrParamsssnmpTargetAddrStorageTypessnmpTargetAddrRowStatusssnmpTargetParamsTablessnmpTargetParamsEntryssnmpTargetParamsNamessnmpTargetParamsMPModelssnmpTargetParamsSecurityModelssnmpTargetParamsSecurityNamessnmpTargetParamsSecurityLevelssnmpTargetParamsStorageTypessnmpTargetParamsRowStatusssnmpUnavailableContextsssnmpUnknownContextsssnmpTargetConformancessnmpTargetCompliancesssnmpTargetGroupss setObjectsssnmpTargetResponseGroupssnmpTargetCommandResponderGroupssnmpTargetBasicGroups exportSymbols(>sSnmpAdminStringssnmpTargetAddrTDomains MibScalarssnmpTargetAddrRetryCountssnmpTargetObjectss TimeTicksssnmpTargetGroupsssnmpTargetAddrNamessnmpUnknownContextssModuleIdentityssnmpTargetParamsNames snmpModulesssnmpTargetResponseGroupsBitsssnmpTargetParamsSecurityLevelssnmpTargetParamsSecurityModels ObjectGroupsMibTableColumnsSnmpSecurityModelsModuleCompliancesMibTablessnmpTargetAddrStorageTypessnmpTargetAddrEntrys RowStatusssnmpTargetAddrTimeoutssnmpTargetParamsStorageTypessnmpTargetCompliancessObjectIdentifiers SnmpTagListsnamedvalssnmpTargetCommandResponderGroups SnmpTagValues TimeIntervals OctetStrings MibTableRowssnmpTargetAddrTables snmpTargetMIBsSnmpMessageProcessingModelssnmpTargetParamsMPModels TestAndIncrssnmpTargetParamsSecurityNamessnmpTargetAddrRowStatusssnmpTargetAddrTAddressssnmpTargetParamsEntrysIntegerssnmpUnavailableContextsssnmpTargetBasicGroupssnmpTargetSpinLocks Integer32ssnmpTargetAddrTagListssnmpTargetParamsTables constraints StorageTypessnmpTargetParamsRowStatussTextualConventionssnmpTargetAddrParamss MibIdentifiersSnmpSecurityLevelssnmpTargetConformancesTAddresss Counter32sTDomain((s=build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-TARGET-MIB.pys?s!'W93   $6 ' < T < < E ] E T E < ' < T < T < < E < 6 6 $''BBPKz:01zii*pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py# PySNMP SMI module. Autogenerated from smidump -f python SNMP-VIEW-BASED-ACM-MIB # by libsmi2pysnmp-0.0.9-alpha at Thu Mar 26 20:58:12 2009, # Python version (2, 4, 4, 'final', 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") ( 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") ( RowStatus, StorageType, TestAndIncr, ) = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "StorageType", "TestAndIncr") # Objects snmpVacmMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 16)).setRevisions(("2002-10-16 00:00","1999-01-20 00:00","1997-11-20 00:00",)) if mibBuilder.loadTexts: snmpVacmMIB.setOrganization("SNMPv3 Working Group") if mibBuilder.loadTexts: snmpVacmMIB.setContactInfo("WG-email: snmpv3@lists.tislabs.com\nSubscribe: majordomo@lists.tislabs.com\n In message body: subscribe snmpv3\n\nCo-Chair: Russ Mundy\n Network Associates Laboratories\npostal: 15204 Omega Drive, Suite 300\n Rockville, MD 20850-4601\n USA\nemail: mundy@tislabs.com\nphone: +1 301-947-7107\n\nCo-Chair: David Harrington\n Enterasys Networks\nPostal: 35 Industrial Way\n P. O. Box 5004\n Rochester, New Hampshire 03866-5005\n USA\nEMail: dbh@enterasys.com\nPhone: +1 603-337-2614\n\nCo-editor: Bert Wijnen\n Lucent Technologies\npostal: Schagen 33\n 3461 GL Linschoten\n Netherlands\nemail: bwijnen@lucent.com\nphone: +31-348-480-685\n\nCo-editor: Randy Presuhn\n BMC Software, Inc.\n\n\n\npostal: 2141 North First Street\n San Jose, CA 95131\n USA\nemail: randy_presuhn@bmc.com\nphone: +1 408-546-1006\n\nCo-editor: Keith McCloghrie\n Cisco Systems, Inc.\npostal: 170 West Tasman Drive\n San Jose, CA 95134-1706\n USA\nemail: kzm@cisco.com\nphone: +1-408-526-5260") if mibBuilder.loadTexts: snmpVacmMIB.setDescription("The management information definitions for the\nView-based Access Control Model for SNMP.\n\nCopyright (C) The Internet Society (2002). This\nversion of this MIB module is part of RFC 3415;\nsee the RFC itself for full legal notices.") vacmMIBObjects = MibIdentifier((1, 3, 6, 1, 6, 3, 16, 1)) 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") 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, 2147483647L))).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") 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") 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.") vacmSecurityToGroupStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 5), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmSecurityToGroupStatus.setDescription("The status of this conceptual row.\n\nUntil instances of all corresponding columns are\nappropriately configured, the value of the\n\n\n\ncorresponding instance of the vacmSecurityToGroupStatus\ncolumn is 'notReady'.\n\nIn particular, a newly created row cannot be made\nactive until a value has been set for vacmGroupName.\n\nThe RowStatus TC [RFC2579] requires that this\nDESCRIPTION clause states under which circumstances\nother objects in this row can be modified:\n\nThe value of this object has no effect on whether\nother objects in this conceptual row can be modified.") 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") 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") 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") 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") 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") 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.") vacmAccessStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 9), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmAccessStatus.setDescription("The status of this conceptual row.\n\nThe RowStatus TC [RFC2579] requires that this\nDESCRIPTION clause states under which circumstances\nother objects in this row can be modified:\n\nThe value of this object has no effect on whether\nother objects in this conceptual row can be modified.") vacmMIBViews = MibIdentifier((1, 3, 6, 1, 6, 3, 16, 1, 5)) vacmViewSpinLock = MibScalar((1, 3, 6, 1, 6, 3, 16, 1, 5, 1), TestAndIncr()).setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmViewSpinLock.setDescription("An advisory lock used to allow cooperating SNMP\nCommand Generator applications to coordinate their\nuse of the Set operation in creating or modifying\nviews.\n\nWhen creating a new view or altering an existing\nview, it is important to understand the potential\ninteractions with other uses of the view. The\nvacmViewSpinLock should be retrieved. The name of\nthe view to be created should be determined to be\nunique by the SNMP Command Generator application by\nconsulting the vacmViewTreeFamilyTable. Finally,\nthe named view may be created (Set), including the\nadvisory lock.\nIf another SNMP Command Generator application has\naltered the views in the meantime, then the spin\nlock's value will have changed, and so this creation\nwill fail because it will specify the wrong value for\nthe spin lock.\n\nSince this is an advisory lock, the use of this lock\nis not enforced.") 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") 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") 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") 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.") vacmViewTreeFamilyStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmViewTreeFamilyStatus.setDescription("The status of this conceptual row.\n\n\n\nThe RowStatus TC [RFC2579] requires that this\nDESCRIPTION clause states under which circumstances\nother objects in this row can be modified:\n\nThe value of this object has no effect on whether\nother objects in this conceptual row can be modified.") vacmMIBConformance = MibIdentifier((1, 3, 6, 1, 6, 3, 16, 2)) vacmMIBCompliances = MibIdentifier((1, 3, 6, 1, 6, 3, 16, 2, 1)) vacmMIBGroups = MibIdentifier((1, 3, 6, 1, 6, 3, 16, 2, 2)) # Augmentions # Groups vacmBasicGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 16, 2, 2, 1)).setObjects(("SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilyStorageType"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessStatus"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilyStatus"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessNotifyViewName"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmGroupName"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmViewSpinLock"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessContextMatch"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmSecurityToGroupStorageType"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilyMask"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilyType"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessReadViewName"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmSecurityToGroupStatus"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessStorageType"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmContextName"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessWriteViewName"), ) # Exports # Module identity mibBuilder.exportSymbols("SNMP-VIEW-BASED-ACM-MIB", PYSNMP_MODULE_ID=snmpVacmMIB) # Objects mibBuilder.exportSymbols("SNMP-VIEW-BASED-ACM-MIB", snmpVacmMIB=snmpVacmMIB, vacmMIBObjects=vacmMIBObjects, vacmContextTable=vacmContextTable, vacmContextEntry=vacmContextEntry, vacmContextName=vacmContextName, vacmSecurityToGroupTable=vacmSecurityToGroupTable, vacmSecurityToGroupEntry=vacmSecurityToGroupEntry, vacmSecurityModel=vacmSecurityModel, vacmSecurityName=vacmSecurityName, vacmGroupName=vacmGroupName, vacmSecurityToGroupStorageType=vacmSecurityToGroupStorageType, vacmSecurityToGroupStatus=vacmSecurityToGroupStatus, vacmAccessTable=vacmAccessTable, vacmAccessEntry=vacmAccessEntry, vacmAccessContextPrefix=vacmAccessContextPrefix, vacmAccessSecurityModel=vacmAccessSecurityModel, vacmAccessSecurityLevel=vacmAccessSecurityLevel, vacmAccessContextMatch=vacmAccessContextMatch, vacmAccessReadViewName=vacmAccessReadViewName, vacmAccessWriteViewName=vacmAccessWriteViewName, vacmAccessNotifyViewName=vacmAccessNotifyViewName, vacmAccessStorageType=vacmAccessStorageType, vacmAccessStatus=vacmAccessStatus, vacmMIBViews=vacmMIBViews, vacmViewSpinLock=vacmViewSpinLock, vacmViewTreeFamilyTable=vacmViewTreeFamilyTable, vacmViewTreeFamilyEntry=vacmViewTreeFamilyEntry, vacmViewTreeFamilyViewName=vacmViewTreeFamilyViewName, vacmViewTreeFamilySubtree=vacmViewTreeFamilySubtree, vacmViewTreeFamilyMask=vacmViewTreeFamilyMask, vacmViewTreeFamilyType=vacmViewTreeFamilyType, vacmViewTreeFamilyStorageType=vacmViewTreeFamilyStorageType, vacmViewTreeFamilyStatus=vacmViewTreeFamilyStatus, vacmMIBConformance=vacmMIBConformance, vacmMIBCompliances=vacmMIBCompliances, vacmMIBGroups=vacmMIBGroups) # Groups mibBuilder.exportSymbols("SNMP-VIEW-BASED-ACM-MIB", vacmBasicGroup=vacmBasicGroup) PKAq>\m&&&pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pyc; &ΘLc@sydkZdkZWnej onXdkZdkZdklZlZei dddd\Z Z Z ei ddd\Z Zei d d d d d ddddddd \ ZZZZZZZZZZZei dd\Zdee fdYZde efdYZdefdYZdefdYZde fd YZd!efd"YZ ed#d$d%d#d%d$d&fi!d'd(d)fZ"ei#oe"i$d*nei#oe"i%d+nei#oe"i&d,ned#d$d%d#d%d$d&d#fZ'ed#d$d%d#d%d$d&d#d#f Z(ei#oe(i&d-ned#d$d%d#d%d$d&d#d.f Z)ei#oe)i&d/ned#d$d%d#d%d$d&d.fZ*ed#d$d%d#d%d$d&d.d#f Z+ed#d$d%d#d%d$d&d.d#d#f ei,d0Z-ei#oe-i&d1ned#d$d%d#d%d$d&d.d#d.f ei.d2ei/d#d3i,d0Z0ei#oe0i&d4ned#d$d%d#d%d$d&d.d#d$f ei.d2ei/d5d3i,d0i1d6Z2ei#oe2i&d7ned#d$d%d#d%d$d&d.d#d8f ei.d2ei/d9d3i,d0Z3ei#oe3i&d:ned#d$d%d#d%d$d&d$fZ4ed#d$d%d#d%d$d&d$d#f Z5ed#d$d%d#d%d$d&d$d.f Z6ed#d$d%d#d%d$d&d$d.d#f i7d;d<fd;d=fd;d>fd;d?fZ8ei9d;d@e"ei9d;dededededed!e ei9d;dAe"dBe'dCe(dDe)dEe*dFe+d<e-d=e0d?e2d>e3dGe4dHe5dIe6 ei9d;dJe8dS(KN(s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStrings SNMPv2-CONFsModuleCompliances ObjectGroups SNMPv2-SMIsBitss Integer32sModuleIdentitys MibIdentifiersObjectIdentitys MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModuless SNMPv2-TCsTextualConventionsSnmpAdminStringcBs'tZdZeieiddZRS(Ns255tii(s__name__s __module__s displayHints OctetStrings subtypeSpecs constraintsValueSizeConstraint(((s@build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pysSnmpAdminStringss SnmpEngineIDcBstZeieiddZddZyAeeie dei e i e i ddZWnnXy2eeeid?eeid @ZWnnXeeiZeeed ?d @eed?d @eed @ZRS( Nii sOscCstt|S(N(schrsintsx(sx((s@build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pys$ss.siii(s__name__s __module__s OctetStrings subtypeSpecs constraintsValueSizeConstraints defaultValuesstringsjoinsmapssplitssockets gethostbynames gethostnameschrsossgetpidsintstimest(((s@build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pys SnmpEngineIDs !2sSnmpEngineTimecBstZeeedZRS(NcCsT|tjo |itj otti|i}nti||||SdS(N( svaluesNonesselfs_valuesintstimes Integer32sclonestagSets subtypeSpec(sselfsvaluestagSets subtypeSpec((s@build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pysclone4s(s__name__s __module__sNonesclone(((s@build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pysSnmpEngineTime3ssSnmpMessageProcessingModelcBs!tZeieiddZRS(Nil(s__name__s __module__s Integer32s subtypeSpecs constraintsValueRangeConstraint(((s@build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pysSnmpMessageProcessingModel9ssSnmpSecurityLevelcBsKtZeieidddZeiddfddfddfZRS(Niiis noAuthNoPrivs authNoPrivsauthPriv( s__name__s __module__sIntegers subtypeSpecs constraintsSingleValueConstraintsnamedvals NamedValuess namedValues(((s@build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pysSnmpSecurityLevel<ssSnmpSecurityModelcBs!tZeieiddZRS(Nil(s__name__s __module__s Integer32s subtypeSpecs constraintsValueRangeConstraint(((s@build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pysSnmpSecurityModel@siiii s2002-10-14 00:00s1999-01-19 00:00s1997-11-20 00:00sSNMPv3 Working GroupsWG-EMail: snmpv3@lists.tislabs.com Subscribe: snmpv3-request@lists.tislabs.com Co-Chair: Russ Mundy Network Associates Laboratories postal: 15204 Omega Drive, Suite 300 Rockville, MD 20850-4601 USA EMail: mundy@tislabs.com phone: +1 301-947-7107 Co-Chair & Co-editor: David Harrington Enterasys Networks postal: 35 Industrial Way P. O. Box 5005 Rochester, New Hampshire 03866-5005 USA EMail: dbh@enterasys.com phone: +1 603-337-2614 Co-editor: Randy Presuhn BMC Software, Inc. postal: 2141 North First Street San Jose, California 95131 USA EMail: randy_presuhn@bmc.com phone: +1 408-546-1006 Co-editor: Bert Wijnen Lucent Technologies postal: Schagen 33 3461 GL Linschoten Netherlands EMail: bwijnen@lucent.com phone: +31 348-680-485 sThe SNMP Management Architecture MIB Copyright (C) The Internet Society (2002). This version of this MIB module is part of RFC 3411; see the RFC itself for full legal notices.scRegistration point for standards-track authentication protocols used in SNMP Management Frameworks.is\Registration point for standards-track privacy protocols used in SNMP Management Frameworks.sreadonlysAn SNMP engine's administratively-unique identifier. This information SHOULD be stored in non-volatile storage so that it remains constant across re-initializations of the SNMP engine.s subtypeSpeclslThe number of times that the SNMP engine has (re-)initialized itself since snmpEngineID was last configured.issecondssThe number of seconds since the value of the snmpEngineBoots object last changed. When incrementing this object's value would cause it to exceed its maximum, snmpEngineBoots is incremented as if a re-initialization had occurred, and this object's value consequently reverts to zero.iisThe maximum length in octets of an SNMP message which this SNMP engine can send or receive and process, determined as the minimum of the maximum message size values supported among all of the transports available to and supported by the engine.sSNMP-FRAMEWORK-MIBs snmpEngineIDssnmpEngineBootsssnmpEngineMaxMessageSizessnmpEngineTimesPYSNMP_MODULE_IDssnmpFrameworkMIBssnmpFrameworkAdminssnmpAuthProtocolsssnmpPrivProtocolsssnmpFrameworkMIBObjectss snmpEnginessnmpFrameworkMIBConformancessnmpFrameworkMIBCompliancesssnmpFrameworkMIBGroupsssnmpEngineGroup(:ssocketsoss ImportErrorsstringstimes pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsModuleCompliances ObjectGroupsBitss Integer32sModuleIdentitys MibIdentifiersObjectIdentitys MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModulessTextualConventionsSnmpAdminStrings SnmpEngineIDsSnmpEngineTimesSnmpMessageProcessingModelsSnmpSecurityLevelsSnmpSecurityModels setRevisionsssnmpFrameworkMIBs loadTextsssetOrganizationssetContactInfossetDescriptionssnmpFrameworkAdminssnmpAuthProtocolsssnmpPrivProtocolsssnmpFrameworkMIBObjectss snmpEngines setMaxAccesss snmpEngineIDssubtypesValueRangeConstraintssnmpEngineBootsssetUnitsssnmpEngineTimessnmpEngineMaxMessageSizessnmpFrameworkMIBConformancessnmpFrameworkMIBCompliancesssnmpFrameworkMIBGroupss setObjectsssnmpEngineGroups exportSymbols(+sSnmpAdminStringssnmpFrameworkMIBConformances MibScalarssnmpEngineTimes TimeTickssModuleIdentitys SnmpEngineIDs snmpModulesssnmpFrameworkMIBObjectssBitsssnmpFrameworkAdminssnmpEngineGroups ObjectGroupssnmpFrameworkMIBCompliancessMibTableColumnssnmpEngineMaxMessageSizesSnmpSecurityModelsModuleCompliancesMibTablesObjectIdentifiersnamedvals OctetStrings MibTableRowsstringsSnmpMessageProcessingModelssnmpAuthProtocolsssnmpEngineBootsssnmpPrivProtocolss snmpEnginesIntegerssnmpFrameworkMIBs Integer32ssockets constraintsSnmpEngineTimesTextualConventions snmpEngineIDs MibIdentifiersSnmpSecurityLevelstimesossObjectIdentityssnmpFrameworkMIBGroups((s@build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pys?sj    !Q3   $' ' $'9 Q Z Q $''T1[PK]7>EMSSpysnmp/smi/mibs/SNMPv2-SMI.pyimport string from pysnmp.smi.indices import OidOrderedDict from pysnmp.smi import exval, error from pysnmp.proto import rfc1902 from pyasn1.type import constraint from pyasn1.error import ValueConstraintError, PyAsn1Error from pysnmp import cache, debug ( Integer, ObjectIdentifier, Null ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "Null") # syntax of objects OctetString = rfc1902.OctetString Bits = rfc1902.Bits Integer32 = rfc1902.Integer32 IpAddress = rfc1902.IpAddress Counter32 = rfc1902.Counter32 Gauge32 = rfc1902.Gauge32 Unsigned32 = rfc1902.Unsigned32 TimeTicks = rfc1902.TimeTicks Opaque = rfc1902.Opaque Counter64 = rfc1902.Counter64 class ExtUTCTime(OctetString): subtypeSpec = OctetString.subtypeSpec+constraint.ConstraintsUnion(constraint.ValueSizeConstraint(11,11), constraint.ValueSizeConstraint(13,13)) # MIB tree foundation classes class MibNode: label = '' def __init__(self, name): self.name = name def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self.name) def getName(self): return self.name def getLabel(self): return self.label def setLabel(self, label): self.label = label return self def clone(self, name=None): myClone = self.__class__(self.name) if name is not None: myClone.name = name if self.label is not None: myClone.label = self.label return myClone # definitions for information modules class ModuleIdentity(MibNode): def getLastUpdated(self): return getattr(self, 'lastUpdated', '') def setLastUpdated(self, v): self.lastUpdated = v return self def getOrganization(self): return getattr(self, 'organization', '') def setOrganization(self, v): self.organization = v return self def getContactInfo(self): return getattr(self, 'contactInfo', '') def setContactInfo(self, v): self.contactInfo = v return self def getDescription(self): return getattr(self, 'description', '') def setDescription(self, v): self.description = v return self def getRevisions(self): return getattr(self, 'revisions', ()) def setRevisions(self, args): self.revisions = args return self def asn1Print(self): return '\ MODULE-IDENTITY\n\ LAST-UPDATED %s\n\ ORGANIZATION \"%s\"\n\ CONTACT-INFO \"%s\"\n\ DESCRIPTION \"%s\"\n\ %s\ ' % (self.getLastUpdated(), self.getOrganization(), self.getContactInfo(), self.getDescription(), string.join(map(lambda x: "REVISION \"%s\"\n" % x, self.getRevisions()))) class ObjectIdentity(MibNode): def getStatus(self): return getattr(self, 'status', 'current') def setStatus(self, v): self.status = v return self def getDescription(self): return getattr(self, 'description', '') def setDescription(self, v): self.description = v return self def getReference(self): return getattr(self, 'reference', '') def setReference(self, v): self.reference = v return self def asn1Print(self): return '\ OBJECT-IDENTITY\n\ STATUS %s\n\ DESCRIPTION \"%s\"\n\ REFERENCE \"%s\"\ ' % (self.getStatus(), self.getDescription(), self.getReference()) # definition for objects class NotificationType(MibNode): def getObjects(self): return getattr(self, 'objects', ()) def setObjects(self, *args): self.objects = args return self def getStatus(self): return getattr(self, 'status', 'current') def setStatus(self, v): self.status = v return self def getDescription(self): return getattr(self, 'description', '') def setDescription(self, v): self.description = v return self def getRevisions(self): return getattr(self, 'revisions', ()) def setRevisions(self, args): self.revisions = args return self def asn1Print(self): return '\ NOTIFICATION-TYPE\n\ OBJECTS { %s }\n\ STATUS %s\n\ DESCRIPTION \"%s\"\n\ %s\ ' % (reduce(lambda x,y: '%s, %s' % (x[1],y[1]), self.getObjects(), ("","")), self.getStatus(), self.getDescription(), string.join(map(lambda x: "REVISION \"%s\"\n" % x, self.getRevisions()))) class MibIdentifier(MibNode): def asn1Print(self): return 'OBJECT IDENTIFIER' class ObjectType(MibNode): maxAccess = None def __init__(self, name, syntax=None): MibNode.__init__(self, name) self.syntax = syntax # XXX def __cmp__(self, other): return cmp(self.syntax, other) def __repr__(self): return '%s(%s, %s)' % ( self.__class__.__name__, self.name, self.syntax ) def getSyntax(self): return self.syntax def getUnits(self): return getattr(self, 'units', '') def setUnits(self, v): self.units = v return self def getMaxAccess(self): return getattr(self, 'maxAccess', 'not-accessible') def setMaxAccess(self, v): self.maxAccess = v return self def getStatus(self): return getattr(self, 'status', 'current') def setStatus(self, v): self.status = v return self def getDescription(self): return getattr(self, 'description', '') def setDescription(self, v): self.description = v return self def getReference(self): return getattr(self, 'reference', '') def setReference(self, v): self.reference = v return self def asn1Print(self): return '\ OBJECT-TYPE\n\ SYNTAX %s\n\ UNITS \"%s\"\n\ MAX-ACCESS %s\n\ STATUS %s\n\ DESCRIPTION \"%s\"\n\ REFERENCE \"%s\"\ ' % (self.getSyntax().__class__.__name__, self.getUnits(), self.getMaxAccess(), self.getStatus(), self.getDescription(), self.getReference()) class MibTree(ObjectType): branchVersionId = 0L # increments on tree structure change XXX maxAccess = 'not-accessible' def __init__(self, name, syntax=None): ObjectType.__init__(self, name, syntax) self._vars = OidOrderedDict() # Subtrees registration def registerSubtrees(self, *subTrees): """Register subtrees at this tree. Subtrees are always attached at the level of this tree, not subtrees.""" for subTree in subTrees: if subTree.name in self._vars: raise error.SmiError( 'MIB subtree %s already registered at %s' % (subTree.name, self) ) self._vars[subTree.name] = subTree MibTree.branchVersionId = MibTree.branchVersionId + 1 def unregisterSubtrees(self, *names): """Detach subtrees from this tree""" for name in names: # This may fail if you fill a table by exporting MibScalarInstances # but later drop them through SNMP. if name not in self._vars: raise error.SmiError( 'MIB subtree %s not registered at %s' % (name, self) ) del self._vars[name] MibTree.branchVersionId = MibTree.branchVersionId + 1 # Tree traversal def getBranch(self, name, idx): """Return a branch of this tree where the 'name' OID may reside""" for keyLen in self._vars.getKeysLens(): subName = name[:keyLen] if subName in self._vars: return self._vars[subName] raise error.NoSuchObjectError(name=name, idx=idx) def getNode(self, name, idx=None): """Return tree node found by name""" if name == self.name: return self else: return self.getBranch(name, idx).getNode(name, idx) def getNextNode(self, name, idx=None): """Return tree node next to name""" try: nextNode = self.getBranch(name, idx) except error.NoSuchObjectError: # Start from the beginning if self._vars and name <= self._vars.keys()[0]: return self._vars[self._vars.keys()[0]] else: # Try following the white rabbit at our level try: return self._vars[self._vars.nextKey(name)] except KeyError: raise error.NoSuchObjectError(idx=idx, name=name) else: try: return nextNode.getNextNode(name, idx) except error.NoSuchObjectError: try: return self._vars[self._vars.nextKey(nextNode.name)] except KeyError: raise error.NoSuchObjectError(idx=idx, name=name) # MIB instrumentation # Read operation def readTest(self, name, val, idx, (acFun, acCtx)): if name == self.name: if acFun and \ self.maxAccess != 'readonly' and \ self.maxAccess != 'readwrite' and \ self.maxAccess != 'readcreate' or \ acFun and acFun(name, self.syntax, idx, 'read', acCtx): raise error.NoAccessError(idx=idx, name=name) else: try: node = self.getBranch(name, idx) except error.NoSuchObjectError: return # missing object is not an error here node.readTest(name, val, idx, (acFun, acCtx)) def readGet(self, name, val, idx, (acFun, acCtx)): try: node = self.getBranch(name, idx) except error.NoSuchObjectError: return name, exval.noSuchInstance else: return node.readGet(name, val, idx, (acFun, acCtx)) # Read next operation is subtree-specific def readTestNext(self, name, val, idx, (acFun, acCtx)): nextName = name while 1: # XXX linear search here try: nextName = self.getNextNode(nextName, idx).name except error.NoSuchObjectError: return # missing object is not an error here try: return self.readTest(nextName, val, idx, (acFun, acCtx)) except error.NoAccessError: continue def readGetNext(self, name, val, idx, (acFun, acCtx)): nextName = name while 1: try: nextName = self.getNextNode(nextName, idx).name except error.NoSuchObjectError: return name, exval.endOfMib try: self.readTest(nextName, val, idx, (acFun, acCtx)) # XXX except error.NoAccessError: continue else: return self.readGet(nextName, val, idx, (acFun, acCtx)) # Write operation def writeTest(self, name, val, idx, (acFun, acCtx)): if name == self.name: # Make sure variable is writable if acFun and \ self.maxAccess != 'readwrite' and \ self.maxAccess != 'readcreate' or \ acFun and acFun(name, self.syntax, idx, 'write', acCtx): raise error.NotWritableError(idx=idx, name=name) else: node = self.getBranch(name, idx) node.writeTest(name, val, idx, (acFun, acCtx)) def writeCommit(self, name, val, idx, (acFun, acCtx)): self.getBranch(name, idx).writeCommit(name, val, idx, (acFun, acCtx)) def writeCleanup(self, name, val, idx, (acFun, acCtx)): self.getBranch(name, idx).writeCleanup(name, val, idx, (acFun, acCtx)) def writeUndo(self, name, val, idx, (acFun, acCtx)): self.getBranch(name, idx).writeUndo(name, val, idx, (acFun, acCtx)) class MibScalar(MibTree): """Scalar MIB variable. Implements access control checking.""" maxAccess = 'readonly' # MIB instrumentation methods # Read operation def readTest(self, name, val, idx, (acFun, acCtx)): if name == self.name: raise error.NoAccessError(idx=idx, name=name) else: MibTree.readTest(self, name, val, idx, (acFun, acCtx)) # If instance exists, check permissions if acFun and \ self.maxAccess != 'readonly' and \ self.maxAccess != 'readwrite' and \ self.maxAccess != 'readcreate' or \ acFun and acFun(name, self.syntax, idx, 'read', acCtx): raise error.NoAccessError(idx=idx, name=name) # Two-phase commit implementation def writeTest(self, name, val, idx, (acFun, acCtx)): if name == self.name: raise error.NoAccessError(idx=idx, name=name) else: MibTree.writeTest(self, name, val, idx, (acFun, acCtx)) # If instance exists, check permissions if acFun and \ self.maxAccess != 'readwrite' and \ self.maxAccess != 'readcreate' or \ acFun and acFun(name, self.syntax, idx, 'write', acCtx): raise error.NotWritableError(idx=idx, name=name) class MibScalarInstance(MibTree): """Scalar MIB variable instance. Implements read/write operations.""" def __init__(self, typeName, instId, syntax): MibTree.__init__(self, typeName+instId, syntax) self.typeName = typeName self.instId = instId self.__oldSyntax = None def getNode(self, name, idx=None): # Recursion terminator if name == self.name: return self raise error.NoSuchInstanceError(idx=idx, name=name) def getNextNode(self, name, idx=None): raise error.NoSuchInstanceError(idx=idx, name=name) # MIB instrumentation methods # Read operation def readTest(self, name, val, idx, (acFun, acCtx)): if name != self.name: raise error.NoSuchObjectError(idx=idx, name=name) def readGet(self, name, val, idx, (acFun, acCtx)): # Return current variable (name, value). This is the only API method # capable of returning anything! if name == self.name: debug.logger & debug.flagIns and debug.logger('readGet: %s=%s' % (self.name, repr(self.syntax))) return self.name, self.syntax.clone() else: raise error.NoSuchObjectError(idx=idx, name=name) # Write operation: two-phase commit def writeTest(self, name, val, idx, (acFun, acCtx)): # Make sure write's allowed if name == self.name: if hasattr(self.syntax, 'smiWrite'): self.__newSyntax = self.syntax.smiWrite(name, val, idx) else: self.__newSyntax = self.syntax.clone(val) if hasattr(self.__newSyntax, 'smiRaisePendingError'): self.__newSyntax.smiRaisePendingError() else: raise error.NoSuchObjectError(idx=idx, name=name) def writeCommit(self, name, val, idx, (acFun, acCtx)): # Backup original value if self.__oldSyntax is None: self.__oldSyntax = self.syntax # Commit new value self.syntax = self.__newSyntax def writeCleanup(self, name, val, idx, (acFun, acCtx)): debug.logger & debug.flagIns and debug.logger('writeCleanup: %s=%s' % (name, repr(val))) # Drop previous value self.__newSyntax = self.__oldSyntax = None def writeUndo(self, name, val, idx, (acFun, acCtx)): # Revive previous value self.syntax = self.__oldSyntax self.__newSyntax = self.__oldSyntax = None # Table column instance specifics # Create operation def createTest(self, name, val, idx, (acFun, acCtx)): if name == self.name: if hasattr(self.syntax, 'smiCreate'): self.__newSyntax = self.syntax.smiCreate(name, val, idx) else: self.__newSyntax = self.syntax.clone(val) else: raise error.NoSuchObjectError(idx=idx, name=name) def createCommit(self, name, val, idx, (acFun, acCtx)): if val is not None: self.writeCommit(name, val, idx, (acFun, acCtx)) def createCleanup(self, name, val, idx, (acFun, acCtx)): debug.logger & debug.flagIns and debug.logger('createCleanup: %s=%s' % (name, repr(val))) if val is not None: self.writeCleanup(name, val, idx, (acFun, acCtx)) def createUndo(self, name, val, idx, (acFun, acCtx)): if val is not None: self.writeUndo(name, val, idx, (acFun, acCtx)) # Destroy operation def destroyTest(self, name, val, idx, (acFun, acCtx)): if name == self.name: if hasattr(self.syntax, 'smiDestroy'): self.__newSyntax = self.syntax.smiDestoy(name, val) else: self.__newSyntax = self.syntax.clone(val) else: raise error.NoSuchObjectError(idx=idx, name=name) def destroyCommit(self, name, val, idx, (acFun, acCtx)): pass def destroyCleanup(self, name, val, idx, (acFun, acCtx)): pass def destroyUndo(self, name, val, idx, (acFun, acCtx)): pass # Conceptual table classes class MibTableColumn(MibScalar): """MIB table column. Manages a set of column instance variables""" protoInstance = MibScalarInstance def __init__(self, name, syntax): MibScalar.__init__(self, name, syntax) self.__createdInstances = {}; self.__destroyedInstances = {} self.__rowOpWanted = {} self.__valIdx = {} # column instance value to OID index self.__valIdxId = -1 # No branches here, terminal OIDs only def getBranch(self, name, idx): if name in self._vars: return self._vars[name] raise error.NoSuchObjectError(name=name, idx=idx) def getNode(self, name, idx=None): try: return MibScalar.getNode(self, name, idx=None) except error.NoSuchObjectError: raise error.NoSuchInstanceError(idx=idx, name=name) def getNextNode(self, name, idx=None): try: return MibScalar.getNextNode(self, name, idx=None) except error.NoSuchObjectError: raise error.NoSuchInstanceError(idx=idx, name=name) def setProtoInstance(self, protoInstance): self.protoInstance = protoInstance # Value to instances map def getNextNodeWithValue(self, name, value): if not self.__valIdx or self.__valIdxId != self.branchVersionId: # Build a value->oid index node = self while 1: try: node = self.getNextNode(node.name) except error.NoSuchInstanceError: break if node.syntax not in self.__valIdx: self.__valIdx[node.syntax] = OidOrderedDict() self.__valIdx[node.syntax][node.name] = 1 debug.logger & debug.flagIns and debug.logger('value index rebuilt at %s, %s entries' % (self.name,len(self.__valIdx))) # Sync to tree version self.__valIdxId = self.branchVersionId if value in self.__valIdx: try: return self.getNode( self.__valIdx[value].nextKey(name) ) except KeyError: raise error.NoSuchInstanceError(name=name) else: raise error.NoSuchInstanceError(name=name) # Column creation (this should probably be converted into some state # machine for clarity). Also, it might be a good idea to inidicate # defaulted cols creation in a clearer way than just a val == None. def createTest(self, name, val, idx, (acFun, acCtx)): # Make sure creation allowed, create a new column instance but # do not replace the old one if name == self.name: raise error.NoAccessError(idx=idx, name=name) if acFun and \ val is not None and \ self.maxAccess != 'readcreate' or \ acFun and acFun(name, self.syntax, idx, 'write', acCtx): debug.logger & debug.flagACL and debug.logger('createTest: %s=%s %s at %s' % (name, repr(val), self.maxAccess, self.name)) raise error.NoCreationError(idx=idx, name=name) # Create instances if either it does not yet exist (row creation) # or a value is passed (multiple OIDs in SET PDU) if val is None and name in self.__createdInstances: return self.__createdInstances[name] = self.protoInstance( self.name, name[len(self.name):], self.syntax.clone() ) self.__createdInstances[name].createTest( name, val, idx, (acFun, acCtx) ) def createCommit(self, name, val, idx, (acFun, acCtx)): # Commit new instance value if name in self._vars: # XXX if name in self.__createdInstances: self._vars[name].createCommit(name, val, idx, (acFun, acCtx)) return self.__createdInstances[name].createCommit( name, val, idx, (acFun, acCtx) ) # ...commit new column instance self._vars[name], self.__createdInstances[name] = \ self.__createdInstances[name], self._vars.get(name) def createCleanup(self, name, val, idx, (acFun, acCtx)): # Drop by-value index self.__valIdx.clear() # Drop previous column instance if name in self.__createdInstances: if self.__createdInstances[name] is not None: self.__createdInstances[name].createCleanup( name, val, idx, (acFun, acCtx) ) del self.__createdInstances[name] elif name in self._vars: self._vars[name].createCleanup(name, val, idx, (acFun, acCtx)) def createUndo(self, name, val, idx, (acFun, acCtx)): # Set back previous column instance, drop the new one if name in self.__createdInstances: self._vars[name] = self.__createdInstances[name] del self.__createdInstances[name] # Remove new instance on rollback if self._vars[name] is None: del self._vars[name] else: # Catch half-created instances (hackerish) try: self._vars[name] == 0 except PyAsn1Error: del self._vars[name] else: self._vars[name].createUndo(name, val, idx, (acFun, acCtx)) # Column destruction def destroyTest(self, name, val, idx, (acFun, acCtx)): # Make sure destruction is allowed if name == self.name: raise error.NoAccessError(idx=idx, name=name) if name not in self._vars: return if acFun and \ val is not None and \ self.maxAccess != 'readcreate' or \ acFun and acFun(name, self.syntax, idx, 'write', acCtx): raise error.NoAccessError(idx=idx, name=name) self._vars[name].destroyTest( name, val, idx, (acFun, acCtx) ) def destroyCommit(self, name, val, idx, (acFun, acCtx)): # Make a copy of column instance and take it off the tree if name in self._vars: self._vars[name].destroyCommit( name, val, idx, (acFun, acCtx) ) self.__destroyedInstances[name] = self._vars[name] del self._vars[name] def destroyCleanup(self, name, val, idx, (acFun, acCtx)): # Drop by-value index self.__valIdx.clear() # Drop instance copy if name in self.__destroyedInstances: self.__destroyedInstances[name].destroyCleanup( name, val, idx, (acFun, acCtx) ) debug.logger & debug.flagIns and debug.logger('destroyCleanup: %s=%s' % (name, repr(val))) del self.__destroyedInstances[name] def destroyUndo(self, name, val, idx, (acFun, acCtx)): # Set back column instance if name in self.__destroyedInstances: self._vars[name] = self.__destroyedInstances[name] self._vars[name].destroyUndo( name, val, idx, (acFun, acCtx) ) del self.__destroyedInstances[name] # Set/modify column def writeTest(self, name, val, idx, (acFun, acCtx)): # Besides common checks, request row creation on no-instance try: # First try the instance MibScalar.writeTest( self, name, val, idx, (acFun, acCtx) ) # ...otherwise proceed with creating new column except (error.NoSuchObjectError, error.RowCreationWanted): self.__rowOpWanted[name] = error.RowCreationWanted() self.createTest(name, val, idx, (acFun, acCtx)) except error.RowDestructionWanted: self.__rowOpWanted[name] = error.RowDestructionWanted() self.destroyTest(name, val, idx, (acFun, acCtx)) if name in self.__rowOpWanted: debug.logger & debug.flagIns and debug.logger('%s flagged by %s=%s' % (self.__rowOpWanted[name], name, repr(val))) raise self.__rowOpWanted[name] def __delegateWrite(self, subAction, name, val, idx, (acFun, acCtx)): if name not in self.__rowOpWanted: getattr(MibScalar, 'write'+subAction)( self, name, val, idx, (acFun, acCtx) ) return if isinstance(self.__rowOpWanted[name], error.RowCreationWanted): getattr(self, 'create'+subAction)( name, val, idx, (acFun, acCtx) ) if isinstance(self.__rowOpWanted[name], error.RowDestructionWanted): getattr(self, 'destroy'+subAction)( name, val, idx, (acFun, acCtx) ) def writeCommit(self, name, val, idx, (acFun, acCtx)): self.__delegateWrite( 'Commit', name, val, idx, (acFun, acCtx) ) if name in self.__rowOpWanted: raise self.__rowOpWanted[name] def writeCleanup(self, name, val, idx, (acFun, acCtx)): # Drop by-value index self.__valIdx.clear() self.__delegateWrite( 'Cleanup', name, val, idx, (acFun, acCtx) ) if name in self.__rowOpWanted: e = self.__rowOpWanted[name] del self.__rowOpWanted[name] debug.logger & debug.flagIns and debug.logger('%s dropped by %s=%s' % (e, name, repr(val))) raise e def writeUndo(self, name, val, idx, (acFun, acCtx)): self.__delegateWrite( 'Undo', name, val, idx, (acFun, acCtx) ) if name in self.__rowOpWanted: e = self.__rowOpWanted[name] del self.__rowOpWanted[name] debug.logger & debug.flagIns and debug.logger('%s dropped by %s=%s' % (e, name, repr(val))) raise e class MibTableRow(MibTree): """MIB table row (SMI 'Entry'). Manages a set of table columns. Implements row creation/destruction. """ def __init__(self, name): MibTree.__init__(self, name) self.__idToIdxCache = cache.Cache() self.__idxToIdCache = cache.Cache() self.indexNames = () self.augmentingRows = {} # Table indices resolution. Handle almost all possible rfc1902 types # explicitly rather than by means of isSuperTypeOf() method because # some subtypes may be implicitly tagged what renders base tag # unavailable. __intBaseTag = Integer.tagSet.getBaseTag() __strBaseTag = OctetString.tagSet.getBaseTag() __oidBaseTag = ObjectIdentifier.tagSet.getBaseTag() __ipaddrTagSet = IpAddress.tagSet __bitsBaseTag = Bits.tagSet.getBaseTag() def setFromName(self, obj, value, impliedFlag=None): if not value: raise error.SmiError('Short OID for index %s' % repr(obj)) baseTag = obj.getTagSet().getBaseTag() if baseTag == self.__intBaseTag: return obj.clone(value[0]), value[1:] elif self.__ipaddrTagSet.isSuperTagSetOf(obj.getTagSet()): return obj.clone(string.join(map(str, value[:4]), '.')), value[4:] elif baseTag == self.__strBaseTag: # rfc1902, 7.7 if impliedFlag: s = '' for c in value: s = s + chr(c) return obj.clone(s), () elif obj.isFixedLength(): l = obj.getFixedLength() s = '' for c in value[:l]: s = s + chr(c) return obj.clone(s), value[l:] else: s = '' for c in value[1:value[0]+1]: s = s + chr(c) return obj.clone(s), value[value[0]+1:] elif baseTag == self.__oidBaseTag: if impliedFlag: return obj.clone(value), () else: return obj.clone(value[1:value[0]+1]), value[value[0]+1:] # rfc2578, 7.1 elif baseTag == self.__bitsBaseTag: s = '' for c in valuevalue[1:value[0]+1]: s = s + chr(c) return obj.clone(s), value[value[0]+1:] else: raise error.SmiError('Unknown value type for index %s' % repr(obj)) def getAsName(self, obj, impliedFlag=None): baseTag = obj.getTagSet().getBaseTag() if baseTag == self.__intBaseTag: return (int(obj),) elif self.__ipaddrTagSet.isSuperTagSetOf(obj.getTagSet()): return tuple(map(ord, obj)) elif baseTag == self.__strBaseTag: if impliedFlag or obj.isFixedLength(): initial = () else: initial = (len(obj),) for c in str(obj): initial = initial + (ord(c),) return initial elif baseTag == self.__oidBaseTag: if impliedFlag: return tuple(obj) else: return (len(self.name),) + tuple(obj) # rfc2578, 7.1 elif baseTag == self.__bitsBaseTag: return reduce( lambda x,y: x+(y,), map(lambda x: ord(x), obj),(len(obj),) ) else: raise error.SmiError('Unknown value type for index %s' % repr(obj)) # Fate sharing mechanics def announceManagementEvent(self, action, name, val, idx, (acFun, acCtx)): # Convert OID suffix into index vals instId = name[len(self.name)+1:] baseIndices = [] for impliedFlag, modName, symName in self.indexNames: mibObj, = mibBuilder.importSymbols(modName, symName) syntax, instId = self.setFromName( mibObj.syntax, instId, impliedFlag ) if self.name == mibObj.name[:-1]: baseIndices.append((mibObj.name, syntax)) if instId: raise error.SmiError( 'Excessive instance identifier sub-OIDs left at %s: %s' % (self, instId) ) if not baseIndices: return for modName, mibSym in self.augmentingRows.keys(): mibObj, = mibBuilder.importSymbols(modName, mibSym) debug.logger & debug.flagIns and debug.logger('announceManagementEvent %s to %s' % (action, mibObj)) mibObj.receiveManagementEvent( action, baseIndices, val, idx, (acFun, acCtx) ) def receiveManagementEvent( self, action, baseIndices, val, idx, (acFun, acCtx) ): # The default implementation supports one-to-one rows dependency newSuffix = () # Resolve indices intersection for impliedFlag, modName, symName in self.indexNames: mibObj, = mibBuilder.importSymbols(modName, symName) for name, syntax in baseIndices: if name == mibObj.name: newSuffix = newSuffix + self.getAsName(syntax, impliedFlag) if newSuffix: debug.logger & debug.flagIns and debug.logger('receiveManagementEvent %s for suffix %s' % (action, newSuffix)) self.__manageColumns(action, (), newSuffix, val, idx, (acFun, acCtx)) def registerAugmentions(self, *names): for modName, symName in names: if (modName, symName) in self.augmentingRows: raise error.SmiError( 'Row %s already augmented by %s::%s' % \ (self.name, modName, symName) ) self.augmentingRows[(modName, symName)] = 1 return self def setIndexNames(self, *names): for name in names: self.indexNames = self.indexNames + (name,) return self def getIndexNames(self): return self.indexNames def __manageColumns(self, action, excludeName, nameSuffix, val, idx, (acFun, acCtx)): # Build a map of index names and values for automatic initialization indexVals = {}; instId = nameSuffix for impliedFlag, modName, symName in self.indexNames: mibObj, = mibBuilder.importSymbols(modName, symName) syntax, instId = self.setFromName( mibObj.syntax, instId, impliedFlag ) indexVals[mibObj.name] = syntax for name, var in self._vars.items(): if name == excludeName: continue if name in indexVals: getattr(var, action)(name + nameSuffix, indexVals[name], idx, (None, None)) else: getattr(var, action)(name + nameSuffix, val, idx, (acFun, acCtx)) debug.logger & debug.flagIns and debug.logger('__manageColumns: action %s name %s suffix %s %svalue %s' % (action, name, nameSuffix, name in indexVals and "index " or "", repr(indexVals.get(name, val)))) def __delegate(self, subAction, name, val, idx, (acFun, acCtx)): # Relay operation request to column, expect row operation request. try: getattr(self.getBranch(name, idx), 'write'+subAction)( name, val, idx, (acFun, acCtx) ) except error.RowCreationWanted, why: self.__manageColumns( 'create'+subAction, name[:len(self.name)+1], name[len(self.name)+1:], None, idx, (acFun, acCtx) ) self.announceManagementEvent( 'create'+subAction, name, None, idx, (acFun, acCtx) ) except error.RowDestructionWanted, why: self.__manageColumns( 'destroy'+subAction, name[:len(self.name)+1], name[len(self.name)+1:], None, idx, (acFun, acCtx) ) self.announceManagementEvent( 'destroy'+subAction, name, None, idx, (acFun,acCtx) ) def writeTest(self, name, val, idx, (acFun, acCtx)): self.__delegate('Test', name, val, idx, (acFun, acCtx)) def writeCommit(self, name, val, idx, (acFun, acCtx)): self.__delegate('Commit', name, val, idx, (acFun, acCtx)) def writeCleanup(self, name, val, idx, (acFun, acCtx)): self.__delegate('Cleanup', name, val, idx, (acFun, acCtx)) def writeUndo(self, name, val, idx, (acFun, acCtx)): self.__delegate('Undo', name, val, idx, (acFun, acCtx)) # Table row management # Table row access by instance name def getInstName(self, colId, instId): return self.name + (colId,) + instId # Table index management def getIndicesFromInstId(self, instId): """Return index values for instance identification""" if instId in self.__idToIdxCache: return self.__idToIdxCache[instId] indices = [] for impliedFlag, modName, symName in self.indexNames: mibObj, = mibBuilder.importSymbols(modName, symName) syntax, instId = self.setFromName(mibObj.syntax, instId, impliedFlag) indices.append(syntax) # to avoid cyclic refs if instId: raise error.SmiError( 'Excessive instance identifier sub-OIDs left at %s: %s' % (self, instId) ) indices = tuple(indices) self.__idToIdxCache[instId] = indices return indices def getInstIdFromIndices(self, *indices): """Return column instance identification from indices""" if indices in self.__idxToIdCache: return self.__idxToIdCache[indices] idx = 0; idxLen = len(indices); instId = () for impliedFlag, modName, symName in self.indexNames: mibObj, = mibBuilder.importSymbols(modName, symName) if idx < idxLen: instId = instId + self.getAsName( mibObj.syntax.clone(indices[idx]), impliedFlag ) else: break idx = idx + 1 self.__idxToIdCache[indices] = instId return instId # Table access by index def getInstNameByIndex(self, colId, *indices): """Build column instance name from components""" return self.name + (colId,) + apply( self.getInstIdFromIndices, indices ) def getInstNamesByIndex(self, *indices): """Build column instance names from indices""" instNames = [] for columnName in self._vars.keys(): instNames.append( apply(self.getInstNameByIndex, (columnName[-1],) + indices) ) return tuple(instNames) class MibTable(MibTree): """MIB table. Manages a set of TableRow's""" def __init__(self, name): MibTree.__init__(self, name) zeroDotZero = ObjectIdentity((0,0)) #dot = MibTree() iso = MibTree((1,)) org = MibIdentifier(iso.name + (3,)) dod = MibIdentifier(org.name + (6,)) internet = MibIdentifier(dod.name + (1,)) directory = MibIdentifier(internet.name + (1,)) mgmt = MibIdentifier(internet.name + (2,)) mib_2 = MibIdentifier(mgmt.name + (1,)); mib_2.label = 'mib-2' transmission = MibIdentifier(mib_2.name + (10,)) experimental = MibIdentifier(internet.name + (3,)) private = MibIdentifier(internet.name + (4,)) enterprises = MibIdentifier(private.name + (1,)) security = MibIdentifier(internet.name + (5,)) snmpV2 = MibIdentifier(internet.name + (6,)) snmpDomains = MibIdentifier(snmpV2.name + (1,)) snmpProxys = MibIdentifier(snmpV2.name +(2,)) snmpModules = MibIdentifier(snmpV2.name +(3,)) mibBuilder.exportSymbols( 'SNMPv2-SMI', Integer32=Integer32, Bits=Bits, IpAddress=IpAddress, Counter32=Counter32, Gauge32=Gauge32, Unsigned32=Unsigned32, TimeTicks=TimeTicks, Opaque=Opaque, Counter64=Counter64, ExtUTCTime=ExtUTCTime, MibNode=MibNode, ModuleIdentity=ModuleIdentity, ObjectIdentity=ObjectIdentity, NotificationType=NotificationType, MibScalar=MibScalar, MibScalarInstance=MibScalarInstance, MibIdentifier=MibIdentifier, MibTree=MibTree, MibTableColumn=MibTableColumn, MibTableRow=MibTableRow, MibTable=MibTable, zeroDotZero=zeroDotZero, iso=iso, org=org, dod=dod, internet=internet, directory=directory, mgmt=mgmt, mib_2=mib_2, transmission=transmission, experimental=experimental, private=private, enterprises=enterprises, security=security, snmpV2=snmpV2, snmpDomains=snmpDomains, snmpProxys=snmpProxys, snmpModules=snmpModules ) # XXX # getAsName/setFromName goes out of MibRow? # revisit getNextNode() -- needs optimization PKAq>7\BBpysnmp/smi/mibs/RFC1213-MIB.pyc; %Ic@sIdklZlZeidddd\ZZZeidd\Zeiddd d d d d d ddddddd\Z Z Z Z Z Z ZZZZZZZZdefdYZdefdYZeddddddfidZedddddddfZeddddddddfeideiddid Zeioeid!neddddddddfeid Z eioe id"neddddddddfeid Z!eioe!id#nedddddddd$feideiddid%Z"eioe"id&nedddddddd'feideiddid%Z#eioe#id(neddddddddfeideiddid%Z$eioe$id)nedddddddd*fe idei%dd+id Z&eioe&id,nedddddddfZ'eddddddddfe id Z(eioe(id-neddddddddfZ)eioe)id.nedddddddddf i*dd/d0fZ+eioe+id1neddddddddddf e id Z,eioe,id2neddddddddddf eideiddid Z-eioe-id3neddddddddddf eidei.d4d5d6d'd7d8d$d9d:d;d<d*dd=d>d?d@dAddBdCdDdEdFdGdHdIddJddKdL idMei/dNdfdOdKfdPdFfdQd:fdRdEfdSd@fdTdDfdUd>fdVd=fdWdIfdXdCfdYdfdZdAfd[dBfd\d4fd]d8fd^d6fd_dGfd`d;fdadJfdbd9fdcdLfdddfded7fdfd<fdgd5fdhd$fdid'fdjdfdkd*fdld?fdmdHf id Z0eioe0idnnedddddddddd$f e id Z1eioe1idonedddddddddd'f e id Z2eioe2idpneddddddddddf eid Z3eioe3idqnedddddddddd*f eidei.dddidMei/drdfdsdfdtdfid%Z4eioe4idunedddddddddd?f eidei.dddidMei/drdfdsdfdtdfid Z5eioe5idvneddddddddddHf eid Z6eioe6idwneddddddddddKf e id Z7eioe7idxneddddddddddFf e id Z8eioe8idynedddddddddd:f e id Z9eioe9idzneddddddddddEf e id Z:eioe:id{nedddddddddd@f e id Z;eioe;id|neddddddddddDf e id Z<eioe<id}nedddddddddd>f e id Z=eioe=id~nedddddddddd=f e id Z>eioe>idneddddddddddIf e id Z?eioe?idneddddddddddCf e id Z@eioe@idneddddddddddAf e id ZAeioeAidneddddddddddBf e id ZBeioeBidnedddddddddd4f eid ZCeioeCidnedddddddfZDeddddddddfZEeioeEidnedddddddddf i*dd/dfdd/dfdd/dfZFeioeFidneddddddddddf e id%ZGeioeGidneddddddddddf eid%ZHeioeHidneddddddddddf e id%ZIeioeIidneddddddddddf edidZJeddddddd$fZKeddddddd$dfeidei.ddidMei/ddfddfid%ZLeioeLidneddddddd$dfe id%ZMeioeMidneddddddd$dfe id ZNeioeNidneddddddd$d$fe id ZOeioeOidneddddddd$d'fe id ZPeioePidneddddddd$dfe id ZQeioeQidneddddddd$d*fe id ZReioeRidneddddddd$d?fe id ZSeioeSidneddddddd$dHfe id ZTeioeTidneddddddd$dKfe id ZUeioeUidneddddddd$dFfe id ZVeioeVidneddddddd$d:fe id ZWeioeWidneddddddd$dEfe id ZXeioeXidneddddddd$d@fe id ZYeioeYidneddddddd$dDfe id ZZeioeZidneddddddd$d>fe id Z[eioe[idneddddddd$d=fe id Z\eioe\idneddddddd$dIfe id Z]eioe]idneddddddd$dCfe id Z^eioe^idneddddddd$dAfZ_eioe_idneddddddd$dAdf i*dd/dfZ`eioe`idneddddddd$dAddf e id Zaeioeaidneddddddd$dAddf e id Zbeioebidneddddddd$dAddf e id Zceioecidneddddddd$dAdd$f e id Zdeioedidneddddddd$dAdd'f e idei%ddid Zeeioeeidneddddddd$dBfZfeioefidneddddddd$dBdf i*dd/dfZgeioegidneddddddd$dBddf e id%Zheioehidneddddddd$dBddf e id%Zieioeiidneddddddd$dBddf e id%Zjeioejidneddddddd$dBdd$f e id%Zkeioekidneddddddd$dBdd'f e id%Zleioelidneddddddd$dBddf e id%Zmeioemidneddddddd$dBdd*f e id%Zneioenidneddddddd$dBdd?f eidei.d$dddidMei/dNdfddfddfdd$fid%Zoeioeoidneddddddd$dBddHf eidei.d@d:ddEd'd?dKdFddHd$dd*didMei/dNdfddKfddFfdd:fddEfdd@fddfddfdd$fdd'fddfdd*fdd?fddHfid Zpeioepidneddddddd$dBddKf e id%Zqeioeqidneddddddd$dBddFf e id%Zreioeridneddddddd$dBdd:f e id%Zseioesidneddddddd$dBddEf eid Zteioetidneddddddd$d4fZueioeuidneddddddd$d4df i*dd/dfdd/dfZveioevidneddddddd$d4ddf e id%Zweioewidneddddddd$d4ddf eid%Zxeioexidneddddddd$d4ddf e id%Zyeioeyidneddddddd$d4dd$f eidei.d$dddidMei/dNdfddfddfdd$fid%Zzeioezidneddddddd$d8fe id Z{eioe{idneddddddd'fZ|eddddddd'dfe id Z}eioe}idneddddddd'dfe id Z~eioe~idneddddddd'dfe id Zeioeidneddddddd'd$fe id Zeioeidneddddddd'd'fe id Zeioeidneddddddd'dfe id Zeioeidneddddddd'd*fe id Zeioeidneddddddd'd?fe id Zeioeidneddddddd'dHfe id Zeioeidneddddddd'dKfe id Zeioeidneddddddd'dFfe id Zeioeidneddddddd'd:fe id Zeioeidneddddddd'dEfe id Zeioeidneddddddd'd@fe id Zeioeidneddddddd'dDfe id Zeioeidneddddddd'd>fe id Zeioeidneddddddd'd=fe id Zeioeidneddddddd'dIfe id Zeioeidneddddddd'dCfe id Zeioeidneddddddd'dAfe id Zeioeidneddddddd'dBfe id Zeioeidneddddddd'd4fe id Zeioeidneddddddd'd8fe id Zeioeidneddddddd'd6fe id Zeioeidneddddddd'dGfe id Zeioeidneddddddd'd;fe id ZeioeidnedddddddfZeddddddddfeidei.d$dddidMei/dNdfddfddfdd$fid Zeioeidneddddddddfe id Zeioeidneddddddddfe id Zeioeidnedddddddd$fe id Zeioeidnedddddddd'fe id Zeioeidneddddddddfe id Zeioeidnedddddddd*fe id Zeioeidnedddddddd?fe id ZeioeidneddddddddHfe id ZeioeidneddddddddKfe id ZeioeidneddddddddFfe id Zeioeidnedddddddd:fe id ZeioeidneddddddddEfZeioeidneddddddddEdf i*dd/dfdd/dfdd/dfdd/dfZeioeidneddddddddEddf eidei.d$d'd*dFdHd?d:dddKdd idMei/ddfddKfddFfdd:fddfddfd d$fd d'fd dfd d*fd d?fddHf id%ZeioeidneddddddddEddf e id ZeioeidneddddddddEddf e idei%ddid ZeioeidneddddddddEdd$f e id ZeioeidneddddddddEdd'f e idei%ddid Zeioeidnedddddddd@fe id ZeioeidneddddddddDfe id Zeioeidneddddddd*fZeddddddd*dfe id Zeioeidneddddddd*dfe id Zeioeidneddddddd*dfe id Zeioeidneddddddd*d$fe id Zeioeidneddddddd*d'fZeioeidneddddddd*d'df i*dd/dfdd/dfZeioeidneddddddd*d'ddf e id Zeioeidneddddddd*d'ddf e idei%ddid Zeioeidneddddddd?fZeddddddd?dfe id Zeioeid neddddddd?dfe id Zeioeid!neddddddd?dfe id Zeioeid"neddddddd?d$fe id Zeioeid#neddddddd?d'fZeioeid$neddddddd?d'df i*dd/d%fZeioeid&neddddddd?d'ddf eidei.d$ddd'didMei/d'dfd(dfdsdfdrd$fd)d'fid Zeioeid*neddddddd?d'ddf e id Zeioeid+neddddddd?d'ddf e id Zeioeid,neddddddd?d'dd$f e id Zeioeid-neddddddd?d'dd'f e id Zeioeid.neddddddd?d'ddf e id Zeioeid/neddddddd?d'dd*f e id Zeioeid0neddddddd?d'dd?f e id Zeioeid1neddddddd?d'ddHf e id Zeioeid2neddddddd?d'ddKf e id Zeioeid3neddddddd?d'ddFf e id Zeioeid4neddddddd?d'dd:f e id Zeioeid5neddddddd?d'ddEf e id Zeioeid6neddddddd?d'dd@f eidei.ddidMei/d7dfd8dfid Zeioeid9neddddddd?d'ddDf eidei.ddidMei/d:dfd;dfid%Zeioeid<neddddddd?dfe id Zeioeid=nedddddddKfZedddddddFfZedddddddFdfe id Zeioeid>nedddddddFdfe id Zeioeid?nedddddddFdfe id Zeioeid@nedddddddFd$fe id ZeioeidAnedddddddFd'fe id ZeioeidBnedddddddFdfe id ZeioeidCnedddddddFd?fe id ZeioeidDnedddddddFdHfe id ZeioeidEnedddddddFdKfe id ZeioeidFnedddddddFdFfe id ZeioeidGnedddddddFd:fe id ZeioeidHnedddddddFdEfe id ZeioeidInedddddddFd@fe id ZeioeidJnedddddddFdDfe id ZeioeidKnedddddddFd>fe id ZeioeidLnedddddddFd=fe id ZeioeidMnedddddddFdIfe id ZeioeidNnedddddddFdCfe id ZeioeidOnedddddddFdAfe id ZeioeidPnedddddddFdBfe id ZeioeidQnedddddddFd4fe id ZeioeidRnedddddddFd6fe id ZeioeidSnedddddddFdGfe id ZeioeidTnedddddddFd;fe id ZeioeidUnedddddddFdJfe id ZeioeidVnedddddddFd9fe id ZeioeidWnedddddddFdLfe id ZeioeidXnedddddddFd7feidei.ddidMei/dYdfdZdfid%Zeioeid[neid/dedeeid/d\ed]ed^ed_e d`e!dae"dbe#dce$dde&dee'dfe(dge)dhe+d0e,die-dje0dke1dle2dme3dne4doe5dpe6dqe7dre8dse9dte:due;dve<dwe=dxe>dye?dze@d{eAd|eBd}eCd~eDdeEdeFdeGdeHdeIdeJdeKdeLdeMdeNdeOdePdeQdeRdeSdeTdeUdeVdeWdeXdeYdeZde[de\de]de^de_de`deadebdecdeddeedefdegdehdeidejdekdeldemdendeodepdeqderdesdetdeudevdewdexdeydezde{de|de}de~dededededededededededededededededededededededededededededededededeeid/dedededededededededededededededededededededededededededededed%ededededededededededededededededededededededededededededededededed ed ed ed ed edededededededeKdS((s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStrings RFC1155-SMIsNetworkAddresss SNMPv2-SMIsBitss Counter32sGauge32s Integer32s IpAddresss MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickssmgmts DisplayStringcBstZRS(N(s__name__s __module__(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/RFC1213-MIB.pys DisplayStringss PhysAddresscBstZRS(N(s__name__s __module__(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/RFC1213-MIB.pys PhysAddresssiiiismib-2s subtypeSpeciisreadonlysA textual description of the entity. This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software. It is mandatory that this only contain printable ASCII characters.sThe vendor's authoritative identification of the network management subsystem contained in the entity. This value is allocated within the SMI enterprises subtree (1.3.6.1.4.1) and provides an easy and unambiguous means for determining `what kind of box' is being managed. For example, if vendor `Flintstones, Inc.' was assigned the subtree 1.3.6.1.4.1.4242, it could assign the identifier 1.3.6.1.4.1.4242.1.1 to its `Fred Router'.spThe time (in hundredths of a second) since the network management portion of the system was last re-initialized.is readwritesThe textual identification of the contact person for this managed node, together with information on how to contact this person.isxAn administratively-assigned name for this managed node. By convention, this is the node's fully-qualified domain name.sIThe physical location of this node (e.g., `telephone closet, 3rd floor').iisA value which indicates the set of services that this entity primarily offers. The value is a sum. This sum initially takes the value zero, Then, for each layer, L, in the range 1 through 7, that this node performs transactions for, 2 raised to (L - 1) is added to the sum. For example, a node which performs primarily routing functions would have a value of 4 (2^(3-1)). In contrast, a node which is a host offering application services would have a value of 72 (2^(4-1) + 2^(7-1)). Note that in the context of the Internet suite of protocols, values should be calculated accordingly: layer functionality 1 physical (e.g., repeaters) 2 datalink/subnetwork (e.g., bridges) 3 internet (e.g., IP gateways) 4 end-to-end (e.g., IP hosts) 7 applications (e.g., mail relays) For systems including OSI protocols, layers 5 and 6 may also be counted.s\The number of network interfaces (regardless of their current state) present on this system.sVA list of interface entries. The number of entries is given by the value of ifNumber.s RFC1213-MIBsifIndexscAn interface entry containing objects at the subnetwork layer and below for a particular interface.sA unique value for each interface. Its value ranges between 1 and the value of ifNumber. The value for each interface must remain constant at least from one re-initialization of the entity's network management system to the next re- initialization.sA textual string containing information about the interface. This string should include the name of the manufacturer, the product name and the version of the hardware interface.ii iiiii iiiiiiiiiii i ii iii is namedValuessothers iso88026-mansstarLansproteon-10Mbitsproteon-80Mbits hyperchannelsfddislapbssdlcsds1se1s regular1822s basicISDNs primaryISDNspropPointToPointSerialspppssoftwareLoopbackseonsethernet-3Mbitsnsipsslipsultrashdh1822sds3ssips frame-relaysddn-x25s rfc877-x25sethernet-csmacdsiso88023-csmacdsiso88024-tokenBussiso88025-tokenRingsThe type of interface, distinguished according to the physical/link protocol(s) immediately `below' the network layer in the protocol stack.sThe size of the largest datagram which can be sent/received on the interface, specified in octets. For interfaces that are used for transmitting network datagrams, this is the size of the largest network datagram that can be sent on the interface.sAn estimate of the interface's current bandwidth in bits per second. For interfaces which do not vary in bandwidth or for those where no accurate estimation can be made, this object should contain the nominal bandwidth.sThe interface's address at the protocol layer immediately `below' the network layer in the protocol stack. For interfaces which do not have such an address (e.g., a serial line), this object should contain an octet string of zero length.supsdownstestingsnThe desired state of the interface. The testing(3) state indicates that no operational packets can be passed.syThe current operational state of the interface. The testing(3) state indicates that no operational packets can be passed.sThe value of sysUpTime at the time the interface entered its current operational state. If the current state was entered prior to the last re- initialization of the local network management subsystem, then this object contains a zero value.sSThe total number of octets received on the interface, including framing characters.sNThe number of subnetwork-unicast packets delivered to a higher-layer protocol.s}The number of non-unicast (i.e., subnetwork- broadcast or subnetwork-multicast) packets delivered to a higher-layer protocol.sThe number of inbound packets which were chosen to be discarded even though no errors had been detected to prevent their being deliverable to a higher-layer protocol. One possible reason for discarding such a packet could be to free up buffer space.svThe number of inbound packets that contained errors preventing them from being deliverable to a higher-layer protocol.stThe number of packets received via the interface which were discarded because of an unknown or unsupported protocol.sZThe total number of octets transmitted out of the interface, including framing characters.sThe total number of packets that higher-level protocols requested be transmitted to a subnetwork-unicast address, including those that were discarded or not sent.sThe total number of packets that higher-level protocols requested be transmitted to a non- unicast (i.e., a subnetwork-broadcast or subnetwork-multicast) address, including those that were discarded or not sent.sThe number of outbound packets which were chosen to be discarded even though no errors had been detected to prevent their being transmitted. One possible reason for discarding such a packet could be to free up buffer space.sOThe number of outbound packets that could not be transmitted because of errors.s3The length of the output packet queue (in packets).sA reference to MIB definitions specific to the particular media being used to realize the interface. For example, if the interface is realized by an ethernet, then the value of this object refers to a document defining objects specific to ethernet. If this information is not present, its value should be set to the OBJECT IDENTIFIER { 0 0 }, which is a syntatically valid object identifier, and any conformant implementation of ASN.1 and BER must be able to generate and recognize this value.sEThe Address Translation tables contain the NetworkAddress to `physical' address equivalences. Some interfaces do not use translation tables for determining address equivalences (e.g., DDN-X.25 has an algorithmic method); if all interfaces are of this type, then the Address Translation table is empty, i.e., has zero entries.s atIfIndexsatNetAddressPlaceholders atNetAddresssIEach entry contains one NetworkAddress to `physical' address equivalence.sThe interface on which this entry's equivalence is effective. The interface identified by a particular value of this index is the same interface as identified by the same value of ifIndex.sThe media-dependent `physical' address. Setting this object to a null string (one of zero length) has the effect of invaliding the corresponding entry in the atTable object. That is, it effectively dissasociates the interface identified with said entry from the mapping identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries not currently in use. Proper interpretation of such entries requires examination of the relevant atPhysAddress object.sbThe NetworkAddress (e.g., the IP address) corresponding to the media-dependent `physical' address.i 'snot-accessibles forwardingsnot-forwardingsThe indication of whether this entity is acting as an IP gateway in respect to the forwarding of datagrams received by, but not addressed to, this entity. IP gateways forward datagrams. IP hosts do not (except those source-routed via the host). Note that for some managed nodes, this object may take on only a subset of the values possible. Accordingly, it is appropriate for an agent to return a `badValue' response if a management station attempts to change this object to an inappropriate value.sThe default value inserted into the Time-To-Live field of the IP header of datagrams originated at this entity, whenever a TTL value is not supplied by the transport layer protocol.s`The total number of input datagrams received from interfaces, including those received in error.sThe number of input datagrams discarded due to errors in their IP headers, including bad checksums, version number mismatch, other format errors, time-to-live exceeded, errors discovered in processing their IP options, etc.sThe number of input datagrams discarded because the IP address in their IP header's destination field was not a valid address to be received at this entity. This count includes invalid addresses (e.g., 0.0.0.0) and addresses of unsupported Classes (e.g., Class E). For entities which are not IP Gateways and therefore do not forward datagrams, this counter includes datagrams discarded because the destination address was not a local address.swThe number of input datagrams for which this entity was not their final IP destination, as a result of which an attempt was made to find a route to forward them to that final destination. In entities which do not act as IP Gateways, this counter will include only those packets which were Source-Routed via this entity, and the Source- Route option processing was successful.s|The number of locally-addressed datagrams received successfully but discarded because of an unknown or unsupported protocol.sThe number of input IP datagrams for which no problems were encountered to prevent their continued processing, but which were discarded (e.g., for lack of buffer space). Note that this counter does not include any datagrams discarded while awaiting re-assembly.saThe total number of input datagrams successfully delivered to IP user-protocols (including ICMP).sThe total number of IP datagrams which local IP user-protocols (including ICMP) supplied to IP in requests for transmission. Note that this counter does not include any datagrams counted in ipForwDatagrams.s@The number of output IP datagrams for which no problem was encountered to prevent their transmission to their destination, but which were discarded (e.g., for lack of buffer space). Note that this counter would include datagrams counted in ipForwDatagrams if any such packets met this (discretionary) discard criterion.sHThe number of IP datagrams discarded because no route could be found to transmit them to their destination. Note that this counter includes any packets counted in ipForwDatagrams which meet this `no-route' criterion. Note that this includes any datagarms which a host cannot route because all of its default gateways are down.srThe maximum number of seconds which received fragments are held while they are awaiting reassembly at this entity.sRThe number of IP fragments received which needed to be reassembled at this entity.s6The number of IP datagrams successfully re- assembled.s?The number of failures detected by the IP re- assembly algorithm (for whatever reason: timed out, errors, etc). Note that this is not necessarily a count of discarded IP fragments since some algorithms (notably the algorithm in RFC 815) can lose track of the number of fragments by combining them as they are received.sQThe number of IP datagrams that have been successfully fragmented at this entity.sThe number of IP datagrams that have been discarded because they needed to be fragmented at this entity but could not be, e.g., because their Don't Fragment flag was set.siThe number of IP datagram fragments that have been generated as a result of fragmentation at this entity.sKThe table of addressing information relevant to this entity's IP addresses.s ipAdEntAddrsAThe addressing information for one of this entity's IP addresses.sEThe IP address to which this entry's addressing information pertains.sThe index value which uniquely identifies the interface to which this entry is applicable. The interface identified by a particular value of this index is the same interface as identified by the same value of ifIndex.sThe subnet mask associated with the IP address of this entry. The value of the mask is an IP address with all the network bits set to 1 and all the hosts bits set to 0.sThe value of the least-significant bit in the IP broadcast address used for sending datagrams on the (logical) interface associated with the IP address of this entry. For example, when the Internet standard all-ones broadcast address is used, the value will be 1. This value applies to both the subnet and network broadcasts addresses used by the entity on this (logical) interface.isThe size of the largest IP datagram which this entity can re-assemble from incoming IP fragmented datagrams received on this interface.sThis entity's IP Routing table.s ipRouteDests$A route to a particular destination.s0The destination IP address of this route. An entry with a value of 0.0.0.0 is considered a default route. Multiple routes to a single destination can appear in the table, but access to such multiple entries is dependent on the table- access mechanisms defined by the network management protocol in use.sThe index value which uniquely identifies the local interface through which the next hop of this route should be reached. The interface identified by a particular value of this index is the same interface as identified by the same value of ifIndex.sThe primary routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's ipRouteProto value. If this metric is not used, its value should be set to -1.sAn alternate routing metric for this route. The semantics of this metric are determined by the routing-protocol specified in the route's ipRouteProto value. If this metric is not used, its value should be set to -1.sThe IP address of the next hop of this route. (In the case of a route bound to an interface which is realized via a broadcast media, the value of this field is the agent's IP address on that interface.)sinvalidsdirectsindirectsThe type of route. Note that the values direct(3) and indirect(4) refer to the notion of direct and indirect routing in the IP architecture. Setting this object to the value invalid(2) has the effect of invalidating the corresponding entry in the ipRouteTable object. That is, it effectively dissasociates the destination identified with said entry from the route identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries not currently in use. Proper interpretation of such entries requires examination of the relevant ipRouteType object.ses-iss ciscoIgrps bbnSpfIgpsospfsbgpslocalsnetmgmtsicmpsegpsggpshellosripsis-issThe routing mechanism via which this route was learned. Inclusion of values for gateway routing protocols is not intended to imply that hosts should support those protocols.sThe number of seconds since this route was last updated or otherwise determined to be correct. Note that no semantics of `too old' can be implied except through knowledge of the routing protocol by which the route was learned.sIndicate the mask to be logical-ANDed with the destination address before being compared to the value in the ipRouteDest field. For those systems that do not support arbitrary subnet masks, an agent constructs the value of the ipRouteMask by determining whether the value of the correspondent ipRouteDest field belong to a class-A, B, or C network, and then using one of: mask network 255.0.0.0 class-A 255.255.0.0 class-B 255.255.255.0 class-C If the value of the ipRouteDest is 0.0.0.0 (a default route), then the mask value is also 0.0.0.0. It should be noted that all IP routing subsystems implicitly use this mechanism.sA reference to MIB definitions specific to the particular routing protocol which is responsible for this route, as determined by the value specified in the route's ipRouteProto value. If this information is not present, its value should be set to the OBJECT IDENTIFIER { 0 0 }, which is a syntatically valid object identifier, and any conformant implementation of ASN.1 and BER must be able to generate and recognize this value.sZThe IP Address Translation table used for mapping from IP addresses to physical addresses.sipNetToMediaIfIndexsipNetToMediaNetAddresssDEach entry contains one IpAddress to `physical' address equivalence.s'The media-dependent `physical' address.sGThe IpAddress corresponding to the media- dependent `physical' address.sdynamicsstaticsqThe type of mapping. Setting this object to the value invalid(2) has the effect of invalidating the corresponding entry in the ipNetToMediaTable. That is, it effectively dissasociates the interface identified with said entry from the mapping identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries not currently in use. Proper interpretation of such entries requires examination of the relevant ipNetToMediaType object.sThe number of routing entries which were chosen to be discarded even though they are valid. One possible reason for discarding such an entry could be to free-up buffer space for other routing entries.sThe total number of ICMP messages which the entity received. Note that this counter includes all those counted by icmpInErrors.sThe number of ICMP messages which the entity received but determined as having ICMP-specific errors (bad ICMP checksums, bad length, etc.).s=The number of ICMP Destination Unreachable messages received.s3The number of ICMP Time Exceeded messages received.s7The number of ICMP Parameter Problem messages received.s3The number of ICMP Source Quench messages received.s.The number of ICMP Redirect messages received.s4The number of ICMP Echo (request) messages received.s0The number of ICMP Echo Reply messages received.s9The number of ICMP Timestamp (request) messages received.s5The number of ICMP Timestamp Reply messages received.s:The number of ICMP Address Mask Request messages received.s8The number of ICMP Address Mask Reply messages received.sThe total number of ICMP messages which this entity attempted to send. Note that this counter includes all those counted by icmpOutErrors.scThe number of ICMP messages which this entity did not send due to problems discovered within ICMP such as a lack of buffers. This value should not include errors discovered outside the ICMP layer such as the inability of IP to route the resultant datagram. In some implementations there may be no types of error which contribute to this counter's value.s9The number of ICMP Destination Unreachable messages sent.s/The number of ICMP Time Exceeded messages sent.s3The number of ICMP Parameter Problem messages sent.s/The number of ICMP Source Quench messages sent.s{The number of ICMP Redirect messages sent. For a host, this object will always be zero, since hosts do not send redirects.s0The number of ICMP Echo (request) messages sent.s,The number of ICMP Echo Reply messages sent.s5The number of ICMP Timestamp (request) messages sent.s1The number of ICMP Timestamp Reply messages sent.s6The number of ICMP Address Mask Request messages sent.s4The number of ICMP Address Mask Reply messages sent.sconstantsrsresvanjs`The algorithm used to determine the timeout value used for retransmitting unacknowledged octets.ssThe minimum value permitted by a TCP implementation for the retransmission timeout, measured in milliseconds. More refined semantics for objects of this type depend upon the algorithm used to determine the retransmission timeout. In particular, when the timeout algorithm is rsre(3), an object of this type has the semantics of the LBOUND quantity described in RFC 793.ssThe maximum value permitted by a TCP implementation for the retransmission timeout, measured in milliseconds. More refined semantics for objects of this type depend upon the algorithm used to determine the retransmission timeout. In particular, when the timeout algorithm is rsre(3), an object of this type has the semantics of the UBOUND quantity described in RFC 793.sThe limit on the total number of TCP connections the entity can support. In entities where the maximum number of connections is dynamic, this object should contain the value -1.snThe number of times TCP connections have made a direct transition to the SYN-SENT state from the CLOSED state.snThe number of times TCP connections have made a direct transition to the SYN-RCVD state from the LISTEN state.sThe number of times TCP connections have made a direct transition to the CLOSED state from either the SYN-SENT state or the SYN-RCVD state, plus the number of times TCP connections have made a direct transition to the LISTEN state from the SYN-RCVD state.sThe number of times TCP connections have made a direct transition to the CLOSED state from either the ESTABLISHED state or the CLOSE-WAIT state.s_The number of TCP connections for which the current state is either ESTABLISHED or CLOSE- WAIT.sThe total number of segments received, including those received in error. This count includes segments received on currently established connections.sThe total number of segments sent, including those on current connections but excluding those containing only retransmitted octets.sThe total number of segments retransmitted - that is, the number of TCP segments transmitted containing one or more previously transmitted octets.s7A table containing TCP connection-specific information.stcpConnLocalAddressstcpConnLocalPortstcpConnRemAddressstcpConnRemPortsInformation about a particular current TCP connection. An object of this type is transient, in that it ceases to exist when (or soon after) the connection makes the transition to the CLOSED state.sclosedsclosingstimeWaits deleteTCBslistenssynSents synReceiveds establishedsfinWait1sfinWait2s closeWaitslastAcksThe state of this TCP connection. The only value which may be set by a management station is deleteTCB(12). Accordingly, it is appropriate for an agent to return a `badValue' response if a management station attempts to set this object to any other value. If a management station sets this object to the value deleteTCB(12), then this has the effect of deleting the TCB (as defined in RFC 793) of the corresponding connection on the managed node, resulting in immediate termination of the connection. As an implementation-specific option, a RST segment may be sent from the managed node to the other TCP endpoint (note however that RST segments are not sent reliably).sThe local IP address for this TCP connection. In the case of a connection in the listen state which is willing to accept connections for any IP interface associated with the node, the value 0.0.0.0 is used.s.The local port number for this TCP connection.s.The remote IP address for this TCP connection.s/The remote port number for this TCP connection.sIThe total number of segments received in error (e.g., bad TCP checksums).s8The number of TCP segments sent containing the RST flag.s9The total number of UDP datagrams delivered to UDP users.sfThe total number of received UDP datagrams for which there was no application at the destination port.sThe number of received UDP datagrams that could not be delivered for reasons other than the lack of an application at the destination port.s8The total number of UDP datagrams sent from this entity.s,A table containing UDP listener information.sudpLocalAddresss udpLocalPorts4Information about a particular current UDP listener.sThe local IP address for this UDP listener. In the case of a UDP listener which is willing to accept datagrams for any IP interface associated with the node, the value 0.0.0.0 is used.s,The local port number for this UDP listener.s2The number of EGP messages received without error.s?The number of EGP messages received that proved to be in error.s3The total number of locally generated EGP messages.sgThe number of locally generated EGP messages not sent due to resource limitations within an EGP entity.sThe EGP neighbor table.s egpNeighAddrsLInformation about this entity's relationship with a particular EGP neighbor.sidles acquisitionsceasesThe EGP state of the local system with respect to this entry's EGP neighbor. Each EGP state is represented by a value that is one greater than the numerical value associated with said state in RFC 904.s,The IP address of this entry's EGP neighbor.sThe autonomous system of this EGP peer. Zero should be specified if the autonomous system number of the neighbor is not yet known.sEThe number of EGP messages received without error from this EGP peer.skThe number of EGP messages received from this EGP peer that proved to be in error (e.g., bad EGP checksum).s>The number of locally generated EGP messages to this EGP peer.sxThe number of locally generated EGP messages not sent to this EGP peer due to resource limitations within an EGP entity.sEThe number of EGP-defined error messages received from this EGP peer.s?The number of EGP-defined error messages sent to this EGP peer.sGThe number of EGP state transitions to the UP state with this EGP peer.s\The number of EGP state transitions from the UP state to any other state with this EGP peer.sThe interval between EGP Hello command retransmissions (in hundredths of a second). This represents the t1 timer as defined in RFC 904.sThe interval between EGP poll command retransmissions (in hundredths of a second). This represents the t3 timer as defined in RFC 904.sactivespassives>The polling mode of this EGP entity, either passive or active.sstartsstopsA control variable used to trigger operator- initiated Start and Stop events. When read, this variable always returns the most recent value that egpNeighEventTrigger was set to. If it has not been set since the last initialization of the network management subsystem on the node, it returns a value of `stop'. When set, this variable causes a Start or Stop event on the specified neighbor, as specified on pages 8-10 of RFC 904. Briefly, a Start event causes an Idle peer to begin neighbor acquisition and a non-Idle peer to reinitiate neighbor acquisition. A stop event causes a non-Idle peer to return to the Idle state until a Start event occurs, either via egpNeighEventTrigger or otherwise.s0The autonomous system number of this EGP entity.sUThe total number of Messages delivered to the SNMP entity from the transport service.skThe total number of SNMP Messages which were passed from the SNMP protocol entity to the transport service.s|The total number of SNMP Messages which were delivered to the SNMP protocol entity and were for an unsupported SNMP version.sThe total number of SNMP Messages delivered to the SNMP protocol entity which used a SNMP community name not known to said entity.sThe total number of SNMP Messages delivered to the SNMP protocol entity which represented an SNMP operation which was not allowed by the SNMP community named in the Message.suThe total number of ASN.1 or BER errors encountered by the SNMP protocol entity when decoding received SNMP Messages.sThe total number of SNMP PDUs which were delivered to the SNMP protocol entity and for which the value of the error-status field is `tooBig'.sThe total number of SNMP PDUs which were delivered to the SNMP protocol entity and for which the value of the error-status field is `noSuchName'.sThe total number of SNMP PDUs which were delivered to the SNMP protocol entity and for which the value of the error-status field is `badValue'.sxThe total number valid SNMP PDUs which were delivered to the SNMP protocol entity and for which the value of the error-status field is `readOnly'. It should be noted that it is a protocol error to generate an SNMP PDU which contains the value `readOnly' in the error-status field, as such this object is provided as a means of detecting incorrect implementations of the SNMP.sThe total number of SNMP PDUs which were delivered to the SNMP protocol entity and for which the value of the error-status field is `genErr'.sThe total number of MIB objects which have been retrieved successfully by the SNMP protocol entity as the result of receiving valid SNMP Get-Request and Get-Next PDUs.sThe total number of MIB objects which have been altered successfully by the SNMP protocol entity as the result of receiving valid SNMP Set-Request PDUs.smThe total number of SNMP Get-Request PDUs which have been accepted and processed by the SNMP protocol entity.sjThe total number of SNMP Get-Next PDUs which have been accepted and processed by the SNMP protocol entity.smThe total number of SNMP Set-Request PDUs which have been accepted and processed by the SNMP protocol entity.snThe total number of SNMP Get-Response PDUs which have been accepted and processed by the SNMP protocol entity.sfThe total number of SNMP Trap PDUs which have been accepted and processed by the SNMP protocol entity.sThe total number of SNMP PDUs which were generated by the SNMP protocol entity and for which the value of the error-status field is `tooBig.'sThe total number of SNMP PDUs which were generated by the SNMP protocol entity and for which the value of the error-status is `noSuchName'.sThe total number of SNMP PDUs which were generated by the SNMP protocol entity and for which the value of the error-status field is `badValue'.sThe total number of SNMP PDUs which were generated by the SNMP protocol entity and for which the value of the error-status field is `genErr'.s`The total number of SNMP Get-Request PDUs which have been generated by the SNMP protocol entity.s]The total number of SNMP Get-Next PDUs which have been generated by the SNMP protocol entity.s`The total number of SNMP Set-Request PDUs which have been generated by the SNMP protocol entity.saThe total number of SNMP Get-Response PDUs which have been generated by the SNMP protocol entity.sYThe total number of SNMP Trap PDUs which have been generated by the SNMP protocol entity.senabledsdisabledsIndicates whether the SNMP agent process is permitted to generate authentication-failure traps. The value of this object overrides any configuration information; as such, it provides a means whereby all authentication-failure traps may be disabled. Note that it is strongly recommended that this object be stored in non-volatile memory so that it remains constant between re-initializations of the network management system.smib_2ssystemssysDescrs sysObjectIDs sysUpTimes sysContactssysNames sysLocations sysServicess interfacessifNumbersifTablesifEntrysifDescrsifTypesifMtusifSpeeds ifPhysAddresss ifAdminStatuss ifOperStatuss ifLastChanges ifInOctetss ifInUcastPktssifInNUcastPktss ifInDiscardss ifInErrorssifInUnknownProtoss ifOutOctetssifOutUcastPktssifOutNUcastPktss ifOutDiscardss ifOutErrorss ifOutQLens ifSpecificsatsatTablesatEntrys atPhysAddresssips ipForwardings ipDefaultTTLs ipInReceivess ipInHdrErrorssipInAddrErrorssipForwDatagramssipInUnknownProtoss ipInDiscardss ipInDeliverss ipOutRequestss ipOutDiscardss ipOutNoRoutessipReasmTimeouts ipReasmReqdss ipReasmOKss ipReasmFailss ipFragOKss ipFragFailss ipFragCreatess ipAddrTables ipAddrEntrysipAdEntIfIndexsipAdEntNetMasksipAdEntBcastAddrsipAdEntReasmMaxSizes ipRouteTables ipRouteEntrysipRouteIfIndexsipRouteMetric1sipRouteMetric2sipRouteMetric3sipRouteMetric4sipRouteNextHops ipRouteTypes ipRouteProtos ipRouteAges ipRouteMasksipRouteMetric5s ipRouteInfosipNetToMediaTablesipNetToMediaEntrysipNetToMediaPhysAddresssipNetToMediaTypesipRoutingDiscardss icmpInMsgss icmpInErrorssicmpInDestUnreachssicmpInTimeExcdssicmpInParmProbssicmpInSrcQuenchssicmpInRedirectss icmpInEchossicmpInEchoRepssicmpInTimestampssicmpInTimestampRepssicmpInAddrMaskssicmpInAddrMaskRepss icmpOutMsgss icmpOutErrorssicmpOutDestUnreachssicmpOutTimeExcdssicmpOutParmProbssicmpOutSrcQuenchssicmpOutRedirectss icmpOutEchossicmpOutEchoRepssicmpOutTimestampssicmpOutTimestampRepssicmpOutAddrMaskssicmpOutAddrMaskRepsstcpstcpRtoAlgorithms tcpRtoMins tcpRtoMaxs tcpMaxConnstcpActiveOpensstcpPassiveOpensstcpAttemptFailsstcpEstabResetss tcpCurrEstabs tcpInSegss tcpOutSegsstcpRetransSegss tcpConnTables tcpConnEntrys tcpConnStates tcpInErrss tcpOutRstssudpsudpInDatagramss udpNoPortss udpInErrorssudpOutDatagramssudpTablesudpEntrys egpInMsgss egpInErrorss egpOutMsgss egpOutErrorss egpNeighTables egpNeighEntrys egpNeighStates egpNeighAssegpNeighInMsgssegpNeighInErrssegpNeighOutMsgssegpNeighOutErrssegpNeighInErrMsgssegpNeighOutErrMsgssegpNeighStateUpssegpNeighStateDownssegpNeighIntervalHellosegpNeighIntervalPolls egpNeighModesegpNeighEventTriggersegpAss transmissionssnmps snmpInPktss snmpOutPktsssnmpInBadVersionsssnmpInBadCommunityNamesssnmpInBadCommunityUsesssnmpInASNParseErrss snmpInTooBigsssnmpInNoSuchNamesssnmpInBadValuesssnmpInReadOnlyss snmpInGenErrsssnmpInTotalReqVarsssnmpInTotalSetVarsssnmpInGetRequestsssnmpInGetNextsssnmpInSetRequestsssnmpInGetResponsess snmpInTrapsssnmpOutTooBigsssnmpOutNoSuchNamesssnmpOutBadValuesssnmpOutGenErrsssnmpOutGetRequestsssnmpOutGetNextsssnmpOutSetRequestsssnmpOutGetResponsess snmpOutTrapsssnmpEnableAuthenTrapsN(s pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsNetworkAddresssBitss Counter32sGauge32s Integer32s IpAddresss MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickssmgmts DisplayStrings PhysAddressssetLabelsmib_2ssystemssubtypesValueSizeConstraints setMaxAccessssysDescrs loadTextsssetDescriptions sysObjectIDs sysUpTimes sysContactssysNames sysLocationsValueRangeConstraints sysServicess interfacessifNumbersifTables setIndexNamessifEntrysifIndexsifDescrsSingleValueConstraints NamedValuessifTypesifMtusifSpeeds ifPhysAddresss ifAdminStatuss ifOperStatuss ifLastChanges ifInOctetss ifInUcastPktssifInNUcastPktss ifInDiscardss ifInErrorssifInUnknownProtoss ifOutOctetssifOutUcastPktssifOutNUcastPktss ifOutDiscardss ifOutErrorss ifOutQLens ifSpecificsatsatTablesatEntrys atIfIndexs atPhysAddresss atNetAddresssatNetAddressPlaceholdersips ipForwardings ipDefaultTTLs ipInReceivess ipInHdrErrorssipInAddrErrorssipForwDatagramssipInUnknownProtoss ipInDiscardss ipInDeliverss ipOutRequestss ipOutDiscardss ipOutNoRoutessipReasmTimeouts ipReasmReqdss ipReasmOKss ipReasmFailss ipFragOKss ipFragFailss ipFragCreatess ipAddrTables ipAddrEntrys ipAdEntAddrsipAdEntIfIndexsipAdEntNetMasksipAdEntBcastAddrsipAdEntReasmMaxSizes ipRouteTables ipRouteEntrys ipRouteDestsipRouteIfIndexsipRouteMetric1sipRouteMetric2sipRouteMetric3sipRouteMetric4sipRouteNextHops ipRouteTypes ipRouteProtos ipRouteAges ipRouteMasksipRouteMetric5s ipRouteInfosipNetToMediaTablesipNetToMediaEntrysipNetToMediaIfIndexsipNetToMediaPhysAddresssipNetToMediaNetAddresssipNetToMediaTypesipRoutingDiscardssicmps icmpInMsgss icmpInErrorssicmpInDestUnreachssicmpInTimeExcdssicmpInParmProbssicmpInSrcQuenchssicmpInRedirectss icmpInEchossicmpInEchoRepssicmpInTimestampssicmpInTimestampRepssicmpInAddrMaskssicmpInAddrMaskRepss icmpOutMsgss icmpOutErrorssicmpOutDestUnreachssicmpOutTimeExcdssicmpOutParmProbssicmpOutSrcQuenchssicmpOutRedirectss icmpOutEchossicmpOutEchoRepssicmpOutTimestampssicmpOutTimestampRepssicmpOutAddrMaskssicmpOutAddrMaskRepsstcpstcpRtoAlgorithms tcpRtoMins tcpRtoMaxs tcpMaxConnstcpActiveOpensstcpPassiveOpensstcpAttemptFailsstcpEstabResetss tcpCurrEstabs tcpInSegss tcpOutSegsstcpRetransSegss tcpConnTables tcpConnEntrys tcpConnStatestcpConnLocalAddressstcpConnLocalPortstcpConnRemAddressstcpConnRemPorts tcpInErrss tcpOutRstssudpsudpInDatagramss udpNoPortss udpInErrorssudpOutDatagramssudpTablesudpEntrysudpLocalAddresss udpLocalPortsegps egpInMsgss egpInErrorss egpOutMsgss egpOutErrorss egpNeighTables egpNeighEntrys egpNeighStates egpNeighAddrs egpNeighAssegpNeighInMsgssegpNeighInErrssegpNeighOutMsgssegpNeighOutErrssegpNeighInErrMsgssegpNeighOutErrMsgssegpNeighStateUpssegpNeighStateDownssegpNeighIntervalHellosegpNeighIntervalPolls egpNeighModesegpNeighEventTriggersegpAss transmissionssnmps snmpInPktss snmpOutPktsssnmpInBadVersionsssnmpInBadCommunityNamesssnmpInBadCommunityUsesssnmpInASNParseErrss snmpInTooBigsssnmpInNoSuchNamesssnmpInBadValuesssnmpInReadOnlyss snmpInGenErrsssnmpInTotalReqVarsssnmpInTotalSetVarsssnmpInGetRequestsssnmpInGetNextsssnmpInSetRequestsssnmpInGetResponsess snmpInTrapsssnmpOutTooBigsssnmpOutNoSuchNamesssnmpOutBadValuesssnmpOutGenErrsssnmpOutGetRequestsssnmpOutGetNextsssnmpOutSetRequestsssnmpOutGetResponsess snmpOutTrapsssnmpEnableAuthenTrapss exportSymbols(ssnmpOutNoSuchNamessicmpOutTimestampss ipInDeliverss ipOutDiscardssifNumbersicmpOutAddrMaskssicmpInTimestampsstcps icmpInErrorss snmpInTrapssatTablesicmpOutAddrMaskRepss icmpInMsgss PhysAddresss egpOutMsgssifMtus ifInDiscardsssnmpEnableAuthenTrapssicmpOutEchoRepssudpInDatagramsssnmpOutBadValuess ipInHdrErrorssegpAss ipFragFailss snmpInPktsssnmpInBadVersionss ipAddrEntrys icmpOutErrorssMibTablesnamedvalsegpNeighStateUpsssysNames ipRouteAges ifInOctetssicmpOutSrcQuenchss ifLastChanges ifPhysAddressssnmpInBadCommunityNamess atNetAddresssGauge32sipNetToMediaEntrysmgmtssnmpInTotalReqVarss ifOutQLens ipRouteDestsudpLocalAddresss ipRouteEntrysicmpInAddrMaskssicmpInRedirectssudpEntrys transmissions ipFragOKsstcpConnRemPorts sysServicessipAdEntNetMasks ifOutOctetsssnmpOutSetRequestssicmpInTimestampRepss egpNeighModes ipInDiscardsssnmpInTotalSetVarsstcpActiveOpenssicmpInParmProbssifTypes TimeTickss ipRouteTypestcpConnLocalAddresss ipRouteProtos ifAdminStatuss ipReasmFailsssnmpInGetRequestssBitssipRoutingDiscardssMibTableColumnsipRouteIfIndexs egpInMsgss ipRouteTablesipRouteNextHopssnmpInNoSuchNamess egpInErrorssipAdEntReasmMaxSizes DisplayStrings tcpCurrEstabs ipAddrTables ipFragCreatess tcpInErrsstcpConnRemAddresssipAdEntIfIndexsicmpInDestUnreachss interfacess tcpInSegssifOutNUcastPktss ifSpecificstcpAttemptFailss sysUpTimesegpNeighEventTriggers icmpOutEchoss ipOutNoRoutess constraintsegpNeighInMsgss sysLocationsipNetToMediaTables snmpOutTrapsstcpRtoAlgorithmsipAdEntBcastAddrsicmpOutDestUnreachss udpInErrorss egpNeighStatesNetworkAddresss ipRouteMasksipNetToMediaPhysAddressssnmpInReadOnlyss egpNeighTables icmpInEchoss tcpRtoMinsegpNeighIntervalHellossnmpOutGetRequestss tcpConnStatesicmpOutParmProbss ifInErrorss icmpOutMsgsssnmpssystems egpNeighAsstcpEstabResetss egpOutErrorssicmpOutTimestampRepss ipInReceivessIntegersudpTablesegpNeighStateDownss sysObjectIDsifOutUcastPktssegpNeighOutErrMsgsssnmpOutGetResponsess ipDefaultTTLsegpNeighIntervalPollsifIndexsicmpInTimeExcdssicmps ipReasmOKss sysContacts Integer32s ipAdEntAddrs udpLocalPorts ipRouteInfosipNetToMediaIfIndexs tcpMaxConnstcpPassiveOpenssicmpInSrcQuenchsssnmpInBadValuessipInAddrErrorss egpNeighEntrys MibIdentifiersifInUnknownProtosssnmpOutGenErrsssysDescrs tcpConnTablesmib_2ssnmpInGetResponsessicmpOutRedirectss MibScalarssnmpInGetNextssips atPhysAddresssudpsipForwDatagramss snmpInGenErrss ifOutDiscardsssnmpInBadCommunityUsessats ipForwardings tcpOutSegss IpAddresssicmpOutTimeExcdss snmpInTooBigss tcpOutRstssipNetToMediaNetAddresss egpNeighAddrs tcpConnEntrys udpNoPortssifEntrysegpNeighInErrssegpNeighOutErrssipNetToMediaTypesifDescrsipReasmTimeouts ifOperStatuss OctetStringsudpOutDatagramss MibTableRowsifTables tcpRtoMaxsegpNeighInErrMsgsssnmpInASNParseErrss ifInUcastPktss snmpOutPktssipInUnknownProtossicmpInAddrMaskRepss atIfIndexssnmpInSetRequestssipRouteMetric1sipRouteMetric2sipRouteMetric3sipRouteMetric4sipRouteMetric5stcpConnLocalPortsifSpeedstcpRetransSegssatEntrysatNetAddressPlaceholders ipOutRequestssegpsegpNeighOutMsgss ipReasmReqdssObjectIdentifierssnmpOutGetNextssicmpInEchoRepssifInNUcastPktsssnmpOutTooBigss Counter32s ifOutErrors((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/RFC1213-MIB.pys?s!c'!K 3 3 K K K K !3 $ 9 9 Q  9 9 9   9 9 9 9 9 9 9 9 9 9 9 9 9 9 !$ Q 9 9 9 <!o 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 $ 9 9 9 9 9 Q $ 9 9 9 9 9 9 9 9   9 9 9 9 $ E 9 9 9  3 !3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 ! 3 3 3 3 3 3 3 3 3 3 3 $ ]  9 Q 9 Q 3 3 !3 3 3 3 $ E 9 Q !3 3 3 3 $ 9  9 9 9 9 9 9 9 9 9 9 9 9 u u 3 !!3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 o  PKAq> ȁۆpysnmp/smi/mibs/__init__.pyc; Ac@sdS(N((((s6build/bdist.linux-i686/egg/pysnmp/smi/mibs/__init__.pys?sPKt,> 8) & 0xff) + chr((value[1] & 0xff)) else: return OctetString.prettyIn(self, value) # Socket address syntax coercion def __getitem__(self, i): if not hasattr(self, '__tuple_value'): self.__tuple_value = ( string.join(map(lambda x: str(ord(x)), self._value[:4]), '.'), ord(self._value[4:5]) << 8 | ord(self._value[5:6]) ) return self.__tuple_value[i] class TransportAddressIPv4z(TextualConvention, OctetString): displayHint = "1d.1d.1d.1d%4d:2d" subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(10,10) fixedLength = 10 pass class TransportAddressIPv6(TextualConvention, OctetString): displayHint = "0a[2x:2x:2x:2x:2x:2x:2x:2x]0a:2d" subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(18,18) fixedLength = 18 def prettyIn(self, value): if type(value) == types.TupleType: return socket.inet_pton(socket.AF_INET6, value[0]) + chr((value[1] >> 8) & 0xff) + chr((value[1] & 0xff)) else: return OctetString.prettyIn(self, value) # Socket address syntax coercion def __getitem__(self, i): if not hasattr(self, '__tuple_value'): self.__tuple_value = ( socket.inet_ntop(socket.AF_INET6, self._value[:16]), ord(self._value[16:17]) << 8 | ord(self._value[17:18]), 0, 0) return self.__tuple_value[i] class TransportAddressIPv6z(TextualConvention, OctetString): displayHint = "0a[2x:2x:2x:2x:2x:2x:2x:2x%4d]0a:2d" subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(22,22) fixedLength = 22 pass class TransportAddressLocal(TextualConvention, OctetString): displayHint = "1a" subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(1,255) pass class TransportAddressType(Integer): subtypeSpec = Integer.subtypeSpec+constraint.SingleValueConstraint(12,9,14,2,7,1,8,0,11,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), ) pass class TransportDomain(ObjectIdentifier): pass # Objects transportAddressMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 100)).setRevisions(("2002-11-01 00:00",)) if mibBuilder.loadTexts: transportAddressMIB.setOrganization("IETF Operations and Management Area") if mibBuilder.loadTexts: transportAddressMIB.setContactInfo("Juergen Schoenwaelder (Editor)\nTU Braunschweig\nBueltenweg 74/75\n38106 Braunschweig, Germany\n\n\n\nPhone: +49 531 391-3289\nEMail: schoenw@ibr.cs.tu-bs.de\n\nSend comments to .") if mibBuilder.loadTexts: transportAddressMIB.setDescription("This MIB module provides commonly used transport\naddress definitions.\n\nCopyright (C) The Internet Society (2002). This version of\nthis MIB module is part of RFC 3419; see the RFC itself for\nfull legal notices.") transportDomains = MibIdentifier((1, 3, 6, 1, 2, 1, 100, 1)) transportDomainUdpIpv4 = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 1)) if mibBuilder.loadTexts: transportDomainUdpIpv4.setDescription("The UDP over IPv4 transport domain. The corresponding\ntransport address is of type TransportAddressIPv4 for\nglobal IPv4 addresses.") transportDomainUdpIpv6 = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 2)) if mibBuilder.loadTexts: transportDomainUdpIpv6.setDescription("The UDP over IPv6 transport domain. The corresponding\ntransport address is of type TransportAddressIPv6 for\nglobal IPv6 addresses.") transportDomainUdpIpv4z = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 3)) if mibBuilder.loadTexts: transportDomainUdpIpv4z.setDescription("The UDP over IPv4 transport domain. The corresponding\ntransport address is of type TransportAddressIPv4z for\nscoped IPv4 addresses with a zone index.") transportDomainUdpIpv6z = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 4)) if mibBuilder.loadTexts: transportDomainUdpIpv6z.setDescription("The UDP over IPv6 transport domain. The corresponding\ntransport address is of type TransportAddressIPv6z for\nscoped IPv6 addresses with a zone index.") transportDomainTcpIpv4 = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 5)) if mibBuilder.loadTexts: transportDomainTcpIpv4.setDescription("The TCP over IPv4 transport domain. The corresponding\ntransport address is of type TransportAddressIPv4 for\nglobal IPv4 addresses.") transportDomainTcpIpv6 = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 6)) if mibBuilder.loadTexts: transportDomainTcpIpv6.setDescription("The TCP over IPv6 transport domain. The corresponding\ntransport address is of type TransportAddressIPv6 for\nglobal IPv6 addresses.") transportDomainTcpIpv4z = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 7)) if mibBuilder.loadTexts: transportDomainTcpIpv4z.setDescription("The TCP over IPv4 transport domain. The corresponding\ntransport address is of type TransportAddressIPv4z for\nscoped IPv4 addresses with a zone index.") transportDomainTcpIpv6z = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 8)) if mibBuilder.loadTexts: transportDomainTcpIpv6z.setDescription("The TCP over IPv6 transport domain. The corresponding\ntransport address is of type TransportAddressIPv6z for\nscoped IPv6 addresses with a zone index.") transportDomainSctpIpv4 = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 9)) if mibBuilder.loadTexts: transportDomainSctpIpv4.setDescription("The SCTP over IPv4 transport domain. The corresponding\ntransport address is of type TransportAddressIPv4 for\nglobal IPv4 addresses. This transport domain usually\nrepresents the primary address on multihomed SCTP\nendpoints.") transportDomainSctpIpv6 = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 10)) if mibBuilder.loadTexts: transportDomainSctpIpv6.setDescription("The SCTP over IPv6 transport domain. The corresponding\ntransport address is of type TransportAddressIPv6 for\nglobal IPv6 addresses. This transport domain usually\nrepresents the primary address on multihomed SCTP\nendpoints.") transportDomainSctpIpv4z = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 11)) if mibBuilder.loadTexts: transportDomainSctpIpv4z.setDescription("The SCTP over IPv4 transport domain. The corresponding\ntransport address is of type TransportAddressIPv4z for\nscoped IPv4 addresses with a zone index. This transport\ndomain usually represents the primary address on\nmultihomed SCTP endpoints.") transportDomainSctpIpv6z = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 12)) if mibBuilder.loadTexts: transportDomainSctpIpv6z.setDescription("The SCTP over IPv6 transport domain. The corresponding\ntransport address is of type TransportAddressIPv6z for\nscoped IPv6 addresses with a zone index. This transport\ndomain usually represents the primary address on\nmultihomed SCTP endpoints.") transportDomainLocal = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 13)) if mibBuilder.loadTexts: transportDomainLocal.setDescription("The Posix Local IPC transport domain. The corresponding\ntransport address is of type TransportAddressLocal.\n\nThe Posix Local IPC transport domain incorporates the\nwell-known UNIX domain sockets.") transportDomainUdpDns = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 14)) if mibBuilder.loadTexts: transportDomainUdpDns.setDescription("The UDP transport domain using fully qualified domain\nnames. The corresponding transport address is of type\nTransportAddressDns.") transportDomainTcpDns = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 15)) if mibBuilder.loadTexts: transportDomainTcpDns.setDescription("The TCP transport domain using fully qualified domain\nnames. The corresponding transport address is of type\nTransportAddressDns.") transportDomainSctpDns = ObjectIdentity((1, 3, 6, 1, 2, 1, 100, 1, 16)) if mibBuilder.loadTexts: transportDomainSctpDns.setDescription("The SCTP transport domain using fully qualified domain\nnames. The corresponding transport address is of type\nTransportAddressDns.") # Augmentions # Exports # Module identity mibBuilder.exportSymbols("TRANSPORT-ADDRESS-MIB", PYSNMP_MODULE_ID=transportAddressMIB) # Types mibBuilder.exportSymbols("TRANSPORT-ADDRESS-MIB", TransportAddress=TransportAddress, TransportAddressDns=TransportAddressDns, TransportAddressIPv4=TransportAddressIPv4, TransportAddressIPv4z=TransportAddressIPv4z, TransportAddressIPv6=TransportAddressIPv6, TransportAddressIPv6z=TransportAddressIPv6z, TransportAddressLocal=TransportAddressLocal, TransportAddressType=TransportAddressType, TransportDomain=TransportDomain) # Objects mibBuilder.exportSymbols("TRANSPORT-ADDRESS-MIB", transportAddressMIB=transportAddressMIB, transportDomains=transportDomains, transportDomainUdpIpv4=transportDomainUdpIpv4, transportDomainUdpIpv6=transportDomainUdpIpv6, transportDomainUdpIpv4z=transportDomainUdpIpv4z, transportDomainUdpIpv6z=transportDomainUdpIpv6z, transportDomainTcpIpv4=transportDomainTcpIpv4, transportDomainTcpIpv6=transportDomainTcpIpv6, transportDomainTcpIpv4z=transportDomainTcpIpv4z, transportDomainTcpIpv6z=transportDomainTcpIpv6z, transportDomainSctpIpv4=transportDomainSctpIpv4, transportDomainSctpIpv6=transportDomainSctpIpv6, transportDomainSctpIpv4z=transportDomainSctpIpv4z, transportDomainSctpIpv6z=transportDomainSctpIpv6z, transportDomainLocal=transportDomainLocal, transportDomainUdpDns=transportDomainUdpDns, transportDomainTcpDns=transportDomainTcpDns, transportDomainSctpDns=transportDomainSctpDns) PKz:=bbpysnmp/smi/mibs/SNMPv2-MIB.py# PySNMP SMI module. Autogenerated from smidump -f python SNMPv2-MIB # by libsmi2pysnmp-0.0.9-alpha at Thu Mar 26 20:58:12 2009, # Python version (2, 4, 4, 'final', 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") ( 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") # 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") 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") 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") 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") 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") 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.") 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, 2147483647L))).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.") sysORDescr = MibTableColumn((1, 3, 6, 1, 2, 1, 1, 9, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sysORDescr.setDescription("A textual description of the capabilities identified\nby the corresponding instance of sysORID.") sysORUpTime = MibTableColumn((1, 3, 6, 1, 2, 1, 1, 9, 1, 4), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: sysORUpTime.setDescription("The value of sysUpTime at the time this conceptual\nrow was last instantiated.") snmp = MibIdentifier((1, 3, 6, 1, 2, 1, 11)) snmpInPkts = MibScalar((1, 3, 6, 1, 2, 1, 11, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInPkts.setDescription("The total number of messages delivered to the SNMP\nentity from the transport service.") snmpOutPkts = MibScalar((1, 3, 6, 1, 2, 1, 11, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutPkts.setDescription("The total number of SNMP Messages which were\npassed from the SNMP protocol entity to the\ntransport service.") snmpInBadVersions = MibScalar((1, 3, 6, 1, 2, 1, 11, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInBadVersions.setDescription("The total number of SNMP messages which were delivered\nto the SNMP entity and were for an unsupported SNMP\nversion.") snmpInBadCommunityNames = MibScalar((1, 3, 6, 1, 2, 1, 11, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInBadCommunityNames.setDescription("The total number of community-based SNMP messages (for\nexample, SNMPv1) delivered to the SNMP entity which\nused an SNMP community name not known to said entity.\nAlso, implementations which authenticate community-based\nSNMP messages using check(s) in addition to matching\nthe community name (for example, by also checking\nwhether the message originated from a transport address\nallowed to use a specified community name) MAY include\nin this value the number of messages which failed the\nadditional check(s). It is strongly RECOMMENDED that\n\n\n\nthe documentation for any security model which is used\nto authenticate community-based SNMP messages specify\nthe precise conditions that contribute to this value.") snmpInBadCommunityUses = MibScalar((1, 3, 6, 1, 2, 1, 11, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInBadCommunityUses.setDescription("The total number of community-based SNMP messages (for\nexample, SNMPv1) delivered to the SNMP entity which\nrepresented an SNMP operation that was not allowed for\nthe SNMP community named in the message. The precise\nconditions under which this counter is incremented\n(if at all) depend on how the SNMP entity implements\nits access control mechanism and how its applications\ninteract with that access control mechanism. It is\nstrongly RECOMMENDED that the documentation for any\naccess control mechanism which is used to control access\nto and visibility of MIB instrumentation specify the\nprecise conditions that contribute to this value.") snmpInASNParseErrs = MibScalar((1, 3, 6, 1, 2, 1, 11, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInASNParseErrs.setDescription("The total number of ASN.1 or BER errors encountered by\nthe SNMP entity when decoding received SNMP messages.") snmpInTooBigs = MibScalar((1, 3, 6, 1, 2, 1, 11, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInTooBigs.setDescription("The total number of SNMP PDUs which were\ndelivered to the SNMP protocol entity and for\nwhich the value of the error-status field was\n`tooBig'.") snmpInNoSuchNames = MibScalar((1, 3, 6, 1, 2, 1, 11, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInNoSuchNames.setDescription("The total number of SNMP PDUs which were\ndelivered to the SNMP protocol entity and for\nwhich the value of the error-status field was\n`noSuchName'.") snmpInBadValues = MibScalar((1, 3, 6, 1, 2, 1, 11, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInBadValues.setDescription("The total number of SNMP PDUs which were\ndelivered to the SNMP protocol entity and for\nwhich the value of the error-status field was\n`badValue'.") snmpInReadOnlys = MibScalar((1, 3, 6, 1, 2, 1, 11, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInReadOnlys.setDescription("The total number valid SNMP PDUs which were delivered\nto the SNMP protocol entity and for which the value\nof the error-status field was `readOnly'. It should\nbe noted that it is a protocol error to generate an\nSNMP PDU which contains the value `readOnly' in the\nerror-status field, as such this object is provided\nas a means of detecting incorrect implementations of\nthe SNMP.") snmpInGenErrs = MibScalar((1, 3, 6, 1, 2, 1, 11, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInGenErrs.setDescription("The total number of SNMP PDUs which were delivered\nto the SNMP protocol entity and for which the value\nof the error-status field was `genErr'.") snmpInTotalReqVars = MibScalar((1, 3, 6, 1, 2, 1, 11, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInTotalReqVars.setDescription("The total number of MIB objects which have been\nretrieved successfully by the SNMP protocol entity\nas the result of receiving valid SNMP Get-Request\nand Get-Next PDUs.") snmpInTotalSetVars = MibScalar((1, 3, 6, 1, 2, 1, 11, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInTotalSetVars.setDescription("The total number of MIB objects which have been\naltered successfully by the SNMP protocol entity as\nthe result of receiving valid SNMP Set-Request PDUs.") snmpInGetRequests = MibScalar((1, 3, 6, 1, 2, 1, 11, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInGetRequests.setDescription("The total number of SNMP Get-Request PDUs which\nhave been accepted and processed by the SNMP\nprotocol entity.") snmpInGetNexts = MibScalar((1, 3, 6, 1, 2, 1, 11, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInGetNexts.setDescription("The total number of SNMP Get-Next PDUs which have been\naccepted and processed by the SNMP protocol entity.") snmpInSetRequests = MibScalar((1, 3, 6, 1, 2, 1, 11, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInSetRequests.setDescription("The total number of SNMP Set-Request PDUs which\nhave been accepted and processed by the SNMP protocol\nentity.") snmpInGetResponses = MibScalar((1, 3, 6, 1, 2, 1, 11, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInGetResponses.setDescription("The total number of SNMP Get-Response PDUs which\nhave been accepted and processed by the SNMP protocol\nentity.") snmpInTraps = MibScalar((1, 3, 6, 1, 2, 1, 11, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpInTraps.setDescription("The total number of SNMP Trap PDUs which have been\naccepted and processed by the SNMP protocol entity.") snmpOutTooBigs = MibScalar((1, 3, 6, 1, 2, 1, 11, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutTooBigs.setDescription("The total number of SNMP PDUs which were generated\nby the SNMP protocol entity and for which the value\nof the error-status field was `tooBig.'") snmpOutNoSuchNames = MibScalar((1, 3, 6, 1, 2, 1, 11, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutNoSuchNames.setDescription("The total number of SNMP PDUs which were generated\nby the SNMP protocol entity and for which the value\nof the error-status was `noSuchName'.") snmpOutBadValues = MibScalar((1, 3, 6, 1, 2, 1, 11, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutBadValues.setDescription("The total number of SNMP PDUs which were generated\nby the SNMP protocol entity and for which the value\nof the error-status field was `badValue'.") snmpOutGenErrs = MibScalar((1, 3, 6, 1, 2, 1, 11, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutGenErrs.setDescription("The total number of SNMP PDUs which were generated\nby the SNMP protocol entity and for which the value\nof the error-status field was `genErr'.") snmpOutGetRequests = MibScalar((1, 3, 6, 1, 2, 1, 11, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutGetRequests.setDescription("The total number of SNMP Get-Request PDUs which\nhave been generated by the SNMP protocol entity.") snmpOutGetNexts = MibScalar((1, 3, 6, 1, 2, 1, 11, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutGetNexts.setDescription("The total number of SNMP Get-Next PDUs which have\nbeen generated by the SNMP protocol entity.") snmpOutSetRequests = MibScalar((1, 3, 6, 1, 2, 1, 11, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpOutSetRequests.setDescription("The total number of SNMP Set-Request PDUs which\nhave been generated by the SNMP protocol entity.") snmpOutGetResponses = MibScalar((1, 3, 6, 1, 2, 1, 11, 28), Counter32()).setMaxAccess("readonly") 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") 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.") snmpProxyDrops = MibScalar((1, 3, 6, 1, 2, 1, 11, 32), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpProxyDrops.setDescription("The total number of Confirmed Class PDUs\n(such as GetRequest-PDUs, GetNextRequest-PDUs,\nGetBulkRequest-PDUs, SetRequest-PDUs, and\nInformRequest-PDUs) delivered to the SNMP entity which\nwere silently dropped because the transmission of\nthe (possibly translated) message to a proxy target\nfailed in a manner (other than a time-out) such that\nno Response Class PDU (such as a Response-PDU) could\nbe returned.") snmpMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 1)).setRevisions(("2002-10-16 00:00","1995-11-09 00:00","1993-04-01 00:00",)) if mibBuilder.loadTexts: snmpMIB.setOrganization("IETF SNMPv3 Working Group") if mibBuilder.loadTexts: snmpMIB.setContactInfo("WG-EMail: snmpv3@lists.tislabs.com\nSubscribe: snmpv3-request@lists.tislabs.com\n\nCo-Chair: Russ Mundy\n Network Associates Laboratories\npostal: 15204 Omega Drive, Suite 300\n Rockville, MD 20850-4601\n USA\nEMail: mundy@tislabs.com\nphone: +1 301 947-7107\n\nCo-Chair: David Harrington\n Enterasys Networks\npostal: 35 Industrial Way\n P. O. Box 5005\n Rochester, NH 03866-5005\n USA\nEMail: dbh@enterasys.com\nphone: +1 603 337-2614\n\nEditor: Randy Presuhn\n BMC Software, Inc.\npostal: 2141 North First Street\n San Jose, CA 95131\n USA\nEMail: randy_presuhn@bmc.com\nphone: +1 408 546-1006") if mibBuilder.loadTexts: snmpMIB.setDescription("The MIB module for SNMP entities.\n\nCopyright (C) The Internet Society (2002). This\nversion of this MIB module is part of RFC 3418;\nsee the RFC itself for full legal notices.") snmpMIBObjects = MibIdentifier((1, 3, 6, 1, 6, 3, 1, 1)) snmpTrap = MibIdentifier((1, 3, 6, 1, 6, 3, 1, 1, 4)) snmpTrapOID = MibScalar((1, 3, 6, 1, 6, 3, 1, 1, 4, 1), ObjectIdentifier()).setMaxAccess("notifyonly") if mibBuilder.loadTexts: snmpTrapOID.setDescription("The authoritative identification of the notification\ncurrently being sent. This variable occurs as\nthe second varbind in every SNMPv2-Trap-PDU and\nInformRequest-PDU.") snmpTrapEnterprise = MibScalar((1, 3, 6, 1, 6, 3, 1, 1, 4, 3), ObjectIdentifier()).setMaxAccess("notifyonly") if mibBuilder.loadTexts: snmpTrapEnterprise.setDescription("The authoritative identification of the enterprise\nassociated with the trap currently being sent. When an\nSNMP proxy agent is mapping an RFC1157 Trap-PDU\ninto a SNMPv2-Trap-PDU, this variable occurs as the\nlast varbind.") snmpTraps = MibIdentifier((1, 3, 6, 1, 6, 3, 1, 1, 5)) snmpSet = MibIdentifier((1, 3, 6, 1, 6, 3, 1, 1, 6)) snmpSetSerialNo = MibScalar((1, 3, 6, 1, 6, 3, 1, 1, 6, 1), TestAndIncr()).setMaxAccess("readwrite") if mibBuilder.loadTexts: snmpSetSerialNo.setDescription("An advisory lock used to allow several cooperating\ncommand generator applications to coordinate their\nuse of the SNMP set operation.\n\nThis object is used for coarse-grain coordination.\nTo achieve fine-grain coordination, one or more similar\nobjects might be defined within each MIB group, as\nappropriate.") snmpMIBConformance = MibIdentifier((1, 3, 6, 1, 6, 3, 1, 2)) snmpMIBCompliances = MibIdentifier((1, 3, 6, 1, 6, 3, 1, 2, 1)) snmpMIBGroups = MibIdentifier((1, 3, 6, 1, 6, 3, 1, 2, 2)) # Augmentions # Notifications authenticationFailure = NotificationType((1, 3, 6, 1, 6, 3, 1, 1, 5, 5)).setObjects() warmStart = NotificationType((1, 3, 6, 1, 6, 3, 1, 1, 5, 2)).setObjects() coldStart = NotificationType((1, 3, 6, 1, 6, 3, 1, 1, 5, 1)).setObjects() # Groups snmpGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 1, 2, 2, 8)).setObjects(("SNMPv2-MIB", "snmpEnableAuthenTraps"), ("SNMPv2-MIB", "snmpSilentDrops"), ("SNMPv2-MIB", "snmpInASNParseErrs"), ("SNMPv2-MIB", "snmpInPkts"), ("SNMPv2-MIB", "snmpInBadVersions"), ("SNMPv2-MIB", "snmpProxyDrops"), ) snmpWarmStartNotificationGroup = NotificationGroup((1, 3, 6, 1, 6, 3, 1, 2, 2, 11)).setObjects(("SNMPv2-MIB", "warmStart"), ) snmpObsoleteGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 1, 2, 2, 10)).setObjects(("SNMPv2-MIB", "snmpOutNoSuchNames"), ("SNMPv2-MIB", "snmpInReadOnlys"), ("SNMPv2-MIB", "snmpInTotalReqVars"), ("SNMPv2-MIB", "snmpInSetRequests"), ("SNMPv2-MIB", "snmpOutGenErrs"), ("SNMPv2-MIB", "snmpOutGetRequests"), ("SNMPv2-MIB", "snmpOutPkts"), ("SNMPv2-MIB", "snmpOutBadValues"), ("SNMPv2-MIB", "snmpOutTraps"), ("SNMPv2-MIB", "snmpInNoSuchNames"), ("SNMPv2-MIB", "snmpInGetNexts"), ("SNMPv2-MIB", "snmpInGetRequests"), ("SNMPv2-MIB", "snmpOutGetResponses"), ("SNMPv2-MIB", "snmpInGenErrs"), ("SNMPv2-MIB", "snmpInTraps"), ("SNMPv2-MIB", "snmpInTotalSetVars"), ("SNMPv2-MIB", "snmpInGetResponses"), ("SNMPv2-MIB", "snmpOutSetRequests"), ("SNMPv2-MIB", "snmpInBadValues"), ("SNMPv2-MIB", "snmpInTooBigs"), ("SNMPv2-MIB", "snmpOutGetNexts"), ("SNMPv2-MIB", "snmpOutTooBigs"), ) snmpBasicNotificationsGroup = NotificationGroup((1, 3, 6, 1, 6, 3, 1, 2, 2, 7)).setObjects(("SNMPv2-MIB", "authenticationFailure"), ("SNMPv2-MIB", "coldStart"), ) snmpCommunityGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 1, 2, 2, 9)).setObjects(("SNMPv2-MIB", "snmpInBadCommunityNames"), ("SNMPv2-MIB", "snmpInBadCommunityUses"), ) snmpNotificationGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 1, 2, 2, 12)).setObjects(("SNMPv2-MIB", "snmpTrapOID"), ("SNMPv2-MIB", "snmpTrapEnterprise"), ) systemGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 1, 2, 2, 6)).setObjects(("SNMPv2-MIB", "sysName"), ("SNMPv2-MIB", "sysObjectID"), ("SNMPv2-MIB", "sysORLastChange"), ("SNMPv2-MIB", "sysORID"), ("SNMPv2-MIB", "sysLocation"), ("SNMPv2-MIB", "sysServices"), ("SNMPv2-MIB", "sysUpTime"), ("SNMPv2-MIB", "sysORDescr"), ("SNMPv2-MIB", "sysORUpTime"), ("SNMPv2-MIB", "sysDescr"), ("SNMPv2-MIB", "sysContact"), ) snmpSetGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 1, 2, 2, 5)).setObjects(("SNMPv2-MIB", "snmpSetSerialNo"), ) # Exports # Module identity mibBuilder.exportSymbols("SNMPv2-MIB", PYSNMP_MODULE_ID=snmpMIB) # Objects mibBuilder.exportSymbols("SNMPv2-MIB", system=system, sysDescr=sysDescr, sysObjectID=sysObjectID, sysUpTime=sysUpTime, sysContact=sysContact, sysName=sysName, sysLocation=sysLocation, sysServices=sysServices, sysORLastChange=sysORLastChange, sysORTable=sysORTable, sysOREntry=sysOREntry, sysORIndex=sysORIndex, sysORID=sysORID, sysORDescr=sysORDescr, sysORUpTime=sysORUpTime, snmp=snmp, snmpInPkts=snmpInPkts, snmpOutPkts=snmpOutPkts, snmpInBadVersions=snmpInBadVersions, snmpInBadCommunityNames=snmpInBadCommunityNames, snmpInBadCommunityUses=snmpInBadCommunityUses, snmpInASNParseErrs=snmpInASNParseErrs, snmpInTooBigs=snmpInTooBigs, snmpInNoSuchNames=snmpInNoSuchNames, snmpInBadValues=snmpInBadValues, snmpInReadOnlys=snmpInReadOnlys, snmpInGenErrs=snmpInGenErrs, snmpInTotalReqVars=snmpInTotalReqVars, snmpInTotalSetVars=snmpInTotalSetVars, snmpInGetRequests=snmpInGetRequests, snmpInGetNexts=snmpInGetNexts, snmpInSetRequests=snmpInSetRequests, snmpInGetResponses=snmpInGetResponses, snmpInTraps=snmpInTraps, snmpOutTooBigs=snmpOutTooBigs, snmpOutNoSuchNames=snmpOutNoSuchNames, snmpOutBadValues=snmpOutBadValues, snmpOutGenErrs=snmpOutGenErrs, snmpOutGetRequests=snmpOutGetRequests, snmpOutGetNexts=snmpOutGetNexts, snmpOutSetRequests=snmpOutSetRequests, snmpOutGetResponses=snmpOutGetResponses, snmpOutTraps=snmpOutTraps, snmpEnableAuthenTraps=snmpEnableAuthenTraps, snmpSilentDrops=snmpSilentDrops, snmpProxyDrops=snmpProxyDrops, snmpMIB=snmpMIB, snmpMIBObjects=snmpMIBObjects, snmpTrap=snmpTrap, snmpTrapOID=snmpTrapOID, snmpTrapEnterprise=snmpTrapEnterprise, snmpTraps=snmpTraps, snmpSet=snmpSet, snmpSetSerialNo=snmpSetSerialNo, snmpMIBConformance=snmpMIBConformance, snmpMIBCompliances=snmpMIBCompliances, snmpMIBGroups=snmpMIBGroups) # Notifications mibBuilder.exportSymbols("SNMPv2-MIB", authenticationFailure=authenticationFailure, warmStart=warmStart, coldStart=coldStart) # Groups mibBuilder.exportSymbols("SNMPv2-MIB", snmpGroup=snmpGroup, snmpWarmStartNotificationGroup=snmpWarmStartNotificationGroup, snmpObsoleteGroup=snmpObsoleteGroup, snmpBasicNotificationsGroup=snmpBasicNotificationsGroup, snmpCommunityGroup=snmpCommunityGroup, snmpNotificationGroup=snmpNotificationGroup, systemGroup=systemGroup, snmpSetGroup=snmpSetGroup) PK;@@xxpysnmp/smi/mibs/RFC1155-SMI.py# PySNMP SMI module. Autogenerated from smidump -f python RFC1155-SMI # by libsmi2pysnmp-0.0.9-alpha at Thu Mar 26 20:59:40 2009, # Python version (2, 4, 4, 'final', 0) # Imported just in case new ASN.1 types would be created from pyasn1.type import constraint, namedval # Manually added from pysnmp.proto.rfc1155 import NetworkAddress # Imports ( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") ( Bits, Integer32, MibIdentifier, TimeTicks, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "MibIdentifier", "TimeTicks") # Types class Counter(Integer32): subtypeSpec = Integer32.subtypeSpec+constraint.ValueRangeConstraint(0,4294967295L) pass class Gauge(Integer32): subtypeSpec = Integer32.subtypeSpec+constraint.ValueRangeConstraint(0,4294967295L) pass class IpAddress(OctetString): subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(4,4) fixedLength = 4 pass class NetworkAddress(IpAddress): pass class ObjectName(ObjectIdentifier): pass class Opaque(OctetString): pass class TimeTicks(Integer32): subtypeSpec = Integer32.subtypeSpec+constraint.ValueRangeConstraint(0,4294967295L) pass # Objects internet = MibIdentifier((1, 3, 6, 1)) directory = MibIdentifier((1, 3, 6, 1, 1)) mgmt = MibIdentifier((1, 3, 6, 1, 2)) experimental = MibIdentifier((1, 3, 6, 1, 3)) private = MibIdentifier((1, 3, 6, 1, 4)) enterprises = MibIdentifier((1, 3, 6, 1, 4, 1)) # Augmentions # Exports # Types mibBuilder.exportSymbols("RFC1155-SMI", Counter=Counter, Gauge=Gauge, IpAddress=IpAddress, NetworkAddress=NetworkAddress, ObjectName=ObjectName, Opaque=Opaque, TimeTicks=TimeTicks) # Objects mibBuilder.exportSymbols("RFC1155-SMI", internet=internet, directory=directory, mgmt=mgmt, experimental=experimental, private=private, enterprises=enterprises) PKAq>A/Z/Zpysnmp/smi/mibs/SNMPv2-MIB.pyc; %Ict@svdklZlZeidddd\ZZZeidddd\ZZ Z eid d d d d dddddddddd\Z Z Z ZZZZZZZZZZZeidddd\ZZZedddddddfZeddddddddfeideid d!id"Zei oei!d#neddddddddfeid"Z"ei oe"i!d$neddddddddfeid"Z#ei oe#i!d%nedddddddd&feideid d!id'Z$ei oe$i!d(nedddddddd)feideid d!id'Z%ei oe%i!d*neddddddddfeideid d!id'Z&ei oe&i!d+nedddddddd,fe idei'd d-id"Z(ei oe(i!d.nedddddddd/feid"Z)ei oe)i!d0nedddddddd1fZ*ei oe*i!d2nedddddddd1df i+d d3d4fZ,ei oe,i!d5nedddddddd1ddf e idei'dd6id7Z-ei oe-i!d8nedddddddd1ddf eid"Z.ei oe.i!d9nedddddddd1ddf eid"Z/ei oe/i!d:nedddddddd1dd&f eid"Z0ei oe0i!d;neddddddd<fZ1eddddddd<dfe id"Z2ei oe2i!d=neddddddd<dfe id"Z3ei oe3i!d>neddddddd<dfe id"Z4ei oe4i!d?neddddddd<d&fe id"Z5ei oe5i!d@neddddddd<d)fe id"Z6ei oe6i!dAneddddddd<dfe id"Z7ei oe7i!dBneddddddd<d/fe id"Z8ei oe8i!dCneddddddd<d1fe id"Z9ei oe9i!dDneddddddd<dEfe id"Z:ei oe:i!dFneddddddd<d<fe id"Z;ei oe;i!dGneddddddd<dHfe id"Z<ei oe<i!dIneddddddd<dJfe id"Z=ei oe=i!dKneddddddd<dLfe id"Z>ei oe>i!dMneddddddd<dNfe id"Z?ei oe?i!dOneddddddd<dPfe id"Z@ei oe@i!dQneddddddd<dRfe id"ZAei oeAi!dSneddddddd<dTfe id"ZBei oeBi!dUneddddddd<dVfe id"ZCei oeCi!dWneddddddd<dXfe id"ZDei oeDi!dYneddddddd<dZfe id"ZEei oeEi!d[neddddddd<d\fe id"ZFei oeFi!d]neddddddd<d^fe id"ZGei oeGi!d_neddddddd<d`fe id"ZHei oeHi!daneddddddd<dbfe id"ZIei oeIi!dcneddddddd<ddfe id"ZJei oeJi!deneddddddd<dffe id"ZKei oeKi!dgneddddddd<dhfe id"ZLei oeLi!dineddddddd<djfeideiMddidkeiNdldfdmdfid'ZOei oeOi!dnneddddddd<dofe id"ZPei oePi!dpneddddddd<dqfe id"ZQei oeQi!drnedddddddfiRdsdtdufZSei oeSiTdvnei oeSiUdwnei oeSi!dxneddddddddfZVeddddddddd&f ZWeddddddddd&df eidyZXei oeXi!dzneddddddddd&df eidyZYei oeYi!d{neddddddddd)f ZZedddddddddf Z[eddddddddddf eid'Z\ei oe\i!d|neddddddddfZ]edddddddddf Z^edddddddddf Z_eddddddddd)d)f i`Zaeddddddddd)df i`Zbeddddddddd)df i`Zce dddddddddd/f i`d3d}fd3d~fd3dfd3dfd3dfd3dfZde dddddddddd<f i`d3dfZee ddddddddddEf i`d3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfZfe dddddddddd,f i`d3dfd3dfZge dddddddddd1f i`d3dfd3dfZhe ddddddddddHf i`d3dfd3dfZie ddddddddddf i`d3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3dfd3df Zje dddddddddd)f i`d3dfZkeild3deSeild3dedede"de#de$de%de&de(de)de*de,d4e-de.de/de0de1de2de3de4de5de6de7de8de9de:de;de<de=de>de?de@deAdeBdeCdeDdeEdeFdeGdeHdeIdeJdeKdeLd}eOd~ePdeQdeSdeVdeWdeXdeYdeZde[de\de]de^de_9eild3deadebdeceild3deddeedefdegdehdeidejdekdS((s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStrings SNMPv2-CONFsModuleCompliancesNotificationGroups ObjectGroups SNMPv2-SMIsBitss Counter32s Integer32sModuleIdentitys MibIdentifiersNotificationTypes MibScalarsMibTables MibTableRowsMibTableColumns TimeTickssmib-2s snmpModuless SNMPv2-TCs DisplayStrings TestAndIncrs TimeStampiiiis subtypeSpeciisreadonlysA textual description of the entity. This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software.sThe vendor's authoritative identification of the network management subsystem contained in the entity. This value is allocated within the SMI enterprises subtree (1.3.6.1.4.1) and provides an easy and unambiguous means for determining `what kind of box' is being managed. For example, if vendor `Flintstones, Inc.' was assigned the subtree 1.3.6.1.4.1.424242, it could assign the identifier 1.3.6.1.4.1.424242.1.1 to its `Fred Router'.spThe time (in hundredths of a second) since the network management portion of the system was last re-initialized.is readwritesThe textual identification of the contact person for this managed node, together with information on how to contact this person. If no contact information is known, the value is the zero-length string.isAn administratively-assigned name for this managed node. By convention, this is the node's fully-qualified domain name. If the name is unknown, the value is the zero-length string.sThe physical location of this node (e.g., 'telephone closet, 3rd floor'). If the location is unknown, the value is the zero-length string.iisA value which indicates the set of services that this entity may potentially offer. The value is a sum. This sum initially takes the value zero. Then, for each layer, L, in the range 1 through 7, that this node performs transactions for, 2 raised to (L - 1) is added to the sum. For example, a node which performs only routing functions would have a value of 4 (2^(3-1)). In contrast, a node which is a host offering application services would have a value of 72 (2^(4-1) + 2^(7-1)). Note that in the context of the Internet suite of protocols, values should be calculated accordingly: layer functionality 1 physical (e.g., repeaters) 2 datalink/subnetwork (e.g., bridges) 3 internet (e.g., supports the IP) 4 end-to-end (e.g., supports the TCP) 7 applications (e.g., supports the SMTP) For systems including OSI protocols, layers 5 and 6 may also be counted.isjThe value of sysUpTime at the time of the most recent change in state or value of any instance of sysORID.i sThe (conceptual) table listing the capabilities of the local SNMP application acting as a command responder with respect to various MIB modules. SNMP entities having dynamically-configurable support of MIB modules will have a dynamically-varying number of conceptual rows.s SNMPv2-MIBs sysORIndexs,An entry (conceptual row) in the sysORTable.lsnoaccesss`The auxiliary variable used for identifying instances of the columnar objects in the sysORTable.sAn authoritative identification of a capabilities statement with respect to various MIB modules supported by the local SNMP application acting as a command responder.s^A textual description of the capabilities identified by the corresponding instance of sysORID.sMThe value of sysUpTime at the time this conceptual row was last instantiated.i sUThe total number of messages delivered to the SNMP entity from the transport service.skThe total number of SNMP Messages which were passed from the SNMP protocol entity to the transport service.ssThe total number of SNMP messages which were delivered to the SNMP entity and were for an unsupported SNMP version.sThe total number of community-based SNMP messages (for example, SNMPv1) delivered to the SNMP entity which used an SNMP community name not known to said entity. Also, implementations which authenticate community-based SNMP messages using check(s) in addition to matching the community name (for example, by also checking whether the message originated from a transport address allowed to use a specified community name) MAY include in this value the number of messages which failed the additional check(s). It is strongly RECOMMENDED that the documentation for any security model which is used to authenticate community-based SNMP messages specify the precise conditions that contribute to this value.s}The total number of community-based SNMP messages (for example, SNMPv1) delivered to the SNMP entity which represented an SNMP operation that was not allowed for the SNMP community named in the message. The precise conditions under which this counter is incremented (if at all) depend on how the SNMP entity implements its access control mechanism and how its applications interact with that access control mechanism. It is strongly RECOMMENDED that the documentation for any access control mechanism which is used to control access to and visibility of MIB instrumentation specify the precise conditions that contribute to this value.slThe total number of ASN.1 or BER errors encountered by the SNMP entity when decoding received SNMP messages.sThe total number of SNMP PDUs which were delivered to the SNMP protocol entity and for which the value of the error-status field was `tooBig'.sThe total number of SNMP PDUs which were delivered to the SNMP protocol entity and for which the value of the error-status field was `noSuchName'.i sThe total number of SNMP PDUs which were delivered to the SNMP protocol entity and for which the value of the error-status field was `badValue'.syThe total number valid SNMP PDUs which were delivered to the SNMP protocol entity and for which the value of the error-status field was `readOnly'. It should be noted that it is a protocol error to generate an SNMP PDU which contains the value `readOnly' in the error-status field, as such this object is provided as a means of detecting incorrect implementations of the SNMP.i sThe total number of SNMP PDUs which were delivered to the SNMP protocol entity and for which the value of the error-status field was `genErr'.i sThe total number of MIB objects which have been retrieved successfully by the SNMP protocol entity as the result of receiving valid SNMP Get-Request and Get-Next PDUs.isThe total number of MIB objects which have been altered successfully by the SNMP protocol entity as the result of receiving valid SNMP Set-Request PDUs.ismThe total number of SNMP Get-Request PDUs which have been accepted and processed by the SNMP protocol entity.isjThe total number of SNMP Get-Next PDUs which have been accepted and processed by the SNMP protocol entity.ismThe total number of SNMP Set-Request PDUs which have been accepted and processed by the SNMP protocol entity.isnThe total number of SNMP Get-Response PDUs which have been accepted and processed by the SNMP protocol entity.isfThe total number of SNMP Trap PDUs which have been accepted and processed by the SNMP protocol entity.isThe total number of SNMP PDUs which were generated by the SNMP protocol entity and for which the value of the error-status field was `tooBig.'isThe total number of SNMP PDUs which were generated by the SNMP protocol entity and for which the value of the error-status was `noSuchName'.isThe total number of SNMP PDUs which were generated by the SNMP protocol entity and for which the value of the error-status field was `badValue'.isThe total number of SNMP PDUs which were generated by the SNMP protocol entity and for which the value of the error-status field was `genErr'.is`The total number of SNMP Get-Request PDUs which have been generated by the SNMP protocol entity.is]The total number of SNMP Get-Next PDUs which have been generated by the SNMP protocol entity.is`The total number of SNMP Set-Request PDUs which have been generated by the SNMP protocol entity.isaThe total number of SNMP Get-Response PDUs which have been generated by the SNMP protocol entity.isYThe total number of SNMP Trap PDUs which have been generated by the SNMP protocol entity.is namedValuessenabledsdisabledsIndicates whether the SNMP entity is permitted to generate authenticationFailure traps. The value of this object overrides any configuration information; as such, it provides a means whereby all authenticationFailure traps may be disabled. Note that it is strongly recommended that this object be stored in non-volatile memory so that it remains constant across re-initializations of the network management system.isThe total number of Confirmed Class PDUs (such as GetRequest-PDUs, GetNextRequest-PDUs, GetBulkRequest-PDUs, SetRequest-PDUs, and InformRequest-PDUs) delivered to the SNMP entity which were silently dropped because the size of a reply containing an alternate Response Class PDU (such as a Response-PDU) with an empty variable-bindings field was greater than either a local constraint or the maximum message size associated with the originator of the request.i sThe total number of Confirmed Class PDUs (such as GetRequest-PDUs, GetNextRequest-PDUs, GetBulkRequest-PDUs, SetRequest-PDUs, and InformRequest-PDUs) delivered to the SNMP entity which were silently dropped because the transmission of the (possibly translated) message to a proxy target failed in a manner (other than a time-out) such that no Response Class PDU (such as a Response-PDU) could be returned.s2002-10-16 00:00s1995-11-09 00:00s1993-04-01 00:00sIETF SNMPv3 Working GroupsWG-EMail: snmpv3@lists.tislabs.com Subscribe: snmpv3-request@lists.tislabs.com Co-Chair: Russ Mundy Network Associates Laboratories postal: 15204 Omega Drive, Suite 300 Rockville, MD 20850-4601 USA EMail: mundy@tislabs.com phone: +1 301 947-7107 Co-Chair: David Harrington Enterasys Networks postal: 35 Industrial Way P. O. Box 5005 Rochester, NH 03866-5005 USA EMail: dbh@enterasys.com phone: +1 603 337-2614 Editor: Randy Presuhn BMC Software, Inc. postal: 2141 North First Street San Jose, CA 95131 USA EMail: randy_presuhn@bmc.com phone: +1 408 546-1006sThe MIB module for SNMP entities. Copyright (C) The Internet Society (2002). This version of this MIB module is part of RFC 3418; see the RFC itself for full legal notices.s notifyonlysThe authoritative identification of the notification currently being sent. This variable occurs as the second varbind in every SNMPv2-Trap-PDU and InformRequest-PDU.sThe authoritative identification of the enterprise associated with the trap currently being sent. When an SNMP proxy agent is mapping an RFC1157 Trap-PDU into a SNMPv2-Trap-PDU, this variable occurs as the last varbind.s0An advisory lock used to allow several cooperating command generator applications to coordinate their use of the SNMP set operation. This object is used for coarse-grain coordination. To achieve fine-grain coordination, one or more similar objects might be defined within each MIB group, as appropriate.ssnmpEnableAuthenTrapsssnmpSilentDropsssnmpInASNParseErrss snmpInPktsssnmpInBadVersionsssnmpProxyDropss warmStartssnmpOutNoSuchNamesssnmpInReadOnlysssnmpInTotalReqVarsssnmpInSetRequestsssnmpOutGenErrsssnmpOutGetRequestss snmpOutPktsssnmpOutBadValuess snmpOutTrapsssnmpInNoSuchNamesssnmpInGetNextsssnmpInGetRequestsssnmpOutGetResponsess snmpInGenErrss snmpInTrapsssnmpInTotalSetVarsssnmpInGetResponsesssnmpOutSetRequestsssnmpInBadValuess snmpInTooBigsssnmpOutGetNextsssnmpOutTooBigssauthenticationFailures coldStartssnmpInBadCommunityNamesssnmpInBadCommunityUsess snmpTrapOIDssnmpTrapEnterprisessysNames sysObjectIDssysORLastChangessysORIDs sysLocations sysServicess sysUpTimes sysORDescrs sysORUpTimessysDescrs sysContactssnmpSetSerialNosPYSNMP_MODULE_IDssystems sysORTables sysOREntryssnmpssnmpMIBssnmpMIBObjectsssnmpTraps snmpTrapsssnmpSetssnmpMIBConformancessnmpMIBCompliancess snmpMIBGroupss snmpGroupssnmpWarmStartNotificationGroupssnmpObsoleteGroupssnmpBasicNotificationsGroupssnmpCommunityGroupssnmpNotificationGroups systemGroups snmpSetGroupN(ms pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsModuleCompliancesNotificationGroups ObjectGroupsBitss Counter32s Integer32sModuleIdentitys MibIdentifiersNotificationTypes MibScalarsMibTables MibTableRowsMibTableColumns TimeTickssmib_2s snmpModuless DisplayStrings TestAndIncrs TimeStampssystemssubtypesValueSizeConstraints setMaxAccessssysDescrs loadTextsssetDescriptions sysObjectIDs sysUpTimes sysContactssysNames sysLocationsValueRangeConstraints sysServicesssysORLastChanges sysORTables setIndexNamess sysOREntrys sysORIndexssysORIDs sysORDescrs sysORUpTimessnmps snmpInPktss snmpOutPktsssnmpInBadVersionsssnmpInBadCommunityNamesssnmpInBadCommunityUsesssnmpInASNParseErrss snmpInTooBigsssnmpInNoSuchNamesssnmpInBadValuesssnmpInReadOnlyss snmpInGenErrsssnmpInTotalReqVarsssnmpInTotalSetVarsssnmpInGetRequestsssnmpInGetNextsssnmpInSetRequestsssnmpInGetResponsess snmpInTrapsssnmpOutTooBigsssnmpOutNoSuchNamesssnmpOutBadValuesssnmpOutGenErrsssnmpOutGetRequestsssnmpOutGetNextsssnmpOutSetRequestsssnmpOutGetResponsess snmpOutTrapssSingleValueConstraints NamedValuesssnmpEnableAuthenTrapsssnmpSilentDropsssnmpProxyDropss setRevisionsssnmpMIBssetOrganizationssetContactInfossnmpMIBObjectsssnmpTraps snmpTrapOIDssnmpTrapEnterprises snmpTrapsssnmpSetssnmpSetSerialNossnmpMIBConformancessnmpMIBCompliancess snmpMIBGroupss setObjectssauthenticationFailures warmStarts coldStarts snmpGroupssnmpWarmStartNotificationGroupssnmpObsoleteGroupssnmpBasicNotificationsGroupssnmpCommunityGroupssnmpNotificationGroups systemGroups snmpSetGroups exportSymbols(\ssnmpOutNoSuchNamesssnmpInTotalReqVarss snmpTrapss snmpModuless ObjectGroupssnmpEnableAuthenTrapsssnmpOutBadValuesssnmpCommunityGroupsauthenticationFailures snmpInPktsssnmpInBadVersionsssnmpMIBObjectssnamedvalssysNames TimeStampssnmpInBadCommunityNamess snmpGroups sysORTablessnmpObsoleteGroups sysServicess systemGroupssnmpInBadCommunityUsess TimeTicksssnmpInTotalSetVarssModuleIdentitys snmpInGenErrss sysORDescrsBitss coldStarts snmpOutPktssMibTableColumnssysORLastChangesModuleCompliancesNotificationTypessnmpNotificationGroupssnmpTrapssnmpInNoSuchNamessNotificationGroups DisplayStrings snmpMIBGroupss sysORIndexssnmpInGetRequestss warmStarts sysUpTimes snmpTrapOIDs constraintssnmpOutSetRequestss sysLocations sysOREntryssnmpMIBssysORIDssnmpInReadOnlysssnmpBasicNotificationsGroupssnmpOutGetRequestsssnmpTrapEnterprisessnmpSets snmpOutTrapsssnmpssystemsIntegers sysORUpTimessnmpMIBConformances sysObjectIDssnmpSilentDropsssnmpOutGetResponsess snmpSetGroupssnmpSetSerialNos snmpInTrapss sysContacts Integer32ssnmpInBadValuess snmpInTooBigss MibIdentifierssnmpProxyDropsssysDescrsmib_2s MibScalarssnmpInGetNextsssnmpOutGenErrssMibTables OctetStrings MibTableRowssnmpInASNParseErrss TestAndIncrssnmpInSetRequestsssnmpMIBCompliancesssnmpWarmStartNotificationGroupssnmpInGetResponsessObjectIdentifierssnmpOutGetNextsssnmpOutTooBigss Counter32((s8build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMPv2-MIB.pys?sb!!c!!K 3 3 K K K K 3 $ 9 Q 9 9 9 !3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 o 3 3 3   $'9 9 ''9 $''000f9BBB9dPKz:KŋBB"pysnmp/smi/mibs/SNMP-TARGET-MIB.py# PySNMP SMI module. Autogenerated from smidump -f python SNMP-TARGET-MIB # by libsmi2pysnmp-0.0.9-alpha at Thu Mar 26 20:58:12 2009, # Python version (2, 4, 4, 'final', 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") ( 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") ( RowStatus, StorageType, TAddress, TDomain, TextualConvention, TestAndIncr, TimeInterval, ) = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "StorageType", "TAddress", "TDomain", "TextualConvention", "TestAndIncr", "TimeInterval") # Types class SnmpTagList(TextualConvention, OctetString): displayHint = "255t" subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(0,255) pass class SnmpTagValue(TextualConvention, OctetString): displayHint = "255t" subtypeSpec = OctetString.subtypeSpec+constraint.ValueSizeConstraint(0,255) pass # Objects snmpTargetMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 12)).setRevisions(("2002-10-14 00:00","1998-08-04 00:00","1997-07-14 00:00",)) if mibBuilder.loadTexts: snmpTargetMIB.setOrganization("IETF SNMPv3 Working Group") if mibBuilder.loadTexts: snmpTargetMIB.setContactInfo("WG-email: snmpv3@lists.tislabs.com\nSubscribe: majordomo@lists.tislabs.com\n In message body: subscribe snmpv3\n\nCo-Chair: Russ Mundy\n Network Associates Laboratories\nPostal: 15204 Omega Drive, Suite 300\n Rockville, MD 20850-4601\n USA\nEMail: mundy@tislabs.com\nPhone: +1 301-947-7107\n\nCo-Chair: David Harrington\n Enterasys Networks\nPostal: 35 Industrial Way\n P. O. Box 5004\n Rochester, New Hampshire 03866-5005\n USA\nEMail: dbh@enterasys.com\nPhone: +1 603-337-2614\n\nCo-editor: David B. Levi\n Nortel Networks\nPostal: 3505 Kesterwood Drive\n Knoxville, Tennessee 37918\nEMail: dlevi@nortelnetworks.com\nPhone: +1 865 686 0432\n\nCo-editor: Paul Meyer\n Secure Computing Corporation\nPostal: 2675 Long Lake Road\n\n\n\n Roseville, Minnesota 55113\nEMail: paul_meyer@securecomputing.com\nPhone: +1 651 628 1592\n\nCo-editor: Bob Stewart\n Retired") if mibBuilder.loadTexts: snmpTargetMIB.setDescription("This MIB module defines MIB objects which provide\nmechanisms to remotely configure the parameters used\nby an SNMP entity for the generation of SNMP messages.\n\nCopyright (C) The Internet Society (2002). This\nversion of this MIB module is part of RFC 3413;\nsee the RFC itself for full legal notices.") snmpTargetObjects = MibIdentifier((1, 3, 6, 1, 6, 3, 12, 1)) snmpTargetSpinLock = MibScalar((1, 3, 6, 1, 6, 3, 12, 1, 1), TestAndIncr()).setMaxAccess("readwrite") if mibBuilder.loadTexts: snmpTargetSpinLock.setDescription("This object is used to facilitate modification of table\nentries in the SNMP-TARGET-MIB module by multiple\nmanagers. In particular, it is useful when modifying\nthe value of the snmpTargetAddrTagList object.\n\nThe procedure for modifying the snmpTargetAddrTagList\nobject is as follows:\n\n\n\n 1. Retrieve the value of snmpTargetSpinLock and\n of snmpTargetAddrTagList.\n\n 2. Generate a new value for snmpTargetAddrTagList.\n\n 3. Set the value of snmpTargetSpinLock to the\n retrieved value, and the value of\n snmpTargetAddrTagList to the new value. If\n the set fails for the snmpTargetSpinLock\n object, go back to step 1.") 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") 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.") snmpTargetAddrTAddress = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 3), TAddress()).setMaxAccess("readcreate") 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") 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") 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.") snmpTargetAddrRowStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 9), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: snmpTargetAddrRowStatus.setDescription("The status of this conceptual row.\n\nTo create a row in this table, a manager must\nset this object to either createAndGo(4) or\ncreateAndWait(5).\n\nUntil instances of all corresponding columns are\nappropriately configured, the value of the\ncorresponding instance of the snmpTargetAddrRowStatus\ncolumn is 'notReady'.\n\nIn particular, a newly created row cannot be made\nactive until the corresponding instances of\nsnmpTargetAddrTDomain, snmpTargetAddrTAddress, and\nsnmpTargetAddrParams have all been set.\n\nThe following objects may not be modified while the\nvalue of this object is active(1):\n - snmpTargetAddrTDomain\n - snmpTargetAddrTAddress\nAn attempt to set these objects while the value of\nsnmpTargetAddrRowStatus is active(1) will result in\nan inconsistentValue error.") 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") 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, 2147483647L))).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.") snmpTargetParamsSecurityLevel = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 5), SnmpSecurityLevel()).setMaxAccess("readcreate") if mibBuilder.loadTexts: snmpTargetParamsSecurityLevel.setDescription("The Level of Security to be used when generating\nSNMP messages using this entry.") snmpTargetParamsStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 6), StorageType().clone('nonVolatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: snmpTargetParamsStorageType.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.") snmpTargetParamsRowStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 7), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: snmpTargetParamsRowStatus.setDescription("The status of this conceptual row.\n\nTo create a row in this table, a manager must\nset this object to either createAndGo(4) or\ncreateAndWait(5).\n\nUntil instances of all corresponding columns are\nappropriately configured, the value of the\ncorresponding instance of the snmpTargetParamsRowStatus\ncolumn is 'notReady'.\n\nIn particular, a newly created row cannot be made\nactive until the corresponding\nsnmpTargetParamsMPModel,\nsnmpTargetParamsSecurityModel,\n\n\n\nsnmpTargetParamsSecurityName,\nand snmpTargetParamsSecurityLevel have all been set.\n\nThe following objects may not be modified while the\nvalue of this object is active(1):\n - snmpTargetParamsMPModel\n - snmpTargetParamsSecurityModel\n - snmpTargetParamsSecurityName\n - snmpTargetParamsSecurityLevel\nAn attempt to set these objects while the value of\nsnmpTargetParamsRowStatus is active(1) will result in\nan inconsistentValue error.") snmpUnavailableContexts = MibScalar((1, 3, 6, 1, 6, 3, 12, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpUnavailableContexts.setDescription("The total number of packets received by the SNMP\nengine which were dropped because the context\ncontained in the message was unavailable.") snmpUnknownContexts = MibScalar((1, 3, 6, 1, 6, 3, 12, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpUnknownContexts.setDescription("The total number of packets received by the SNMP\nengine which were dropped because the context\ncontained in the message was unknown.") snmpTargetConformance = MibIdentifier((1, 3, 6, 1, 6, 3, 12, 3)) snmpTargetCompliances = MibIdentifier((1, 3, 6, 1, 6, 3, 12, 3, 1)) snmpTargetGroups = MibIdentifier((1, 3, 6, 1, 6, 3, 12, 3, 2)) # Augmentions # Groups snmpTargetResponseGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 12, 3, 2, 2)).setObjects(("SNMP-TARGET-MIB", "snmpTargetAddrRetryCount"), ("SNMP-TARGET-MIB", "snmpTargetAddrTimeout"), ) snmpTargetCommandResponderGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 12, 3, 2, 3)).setObjects(("SNMP-TARGET-MIB", "snmpUnavailableContexts"), ("SNMP-TARGET-MIB", "snmpUnknownContexts"), ) snmpTargetBasicGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 12, 3, 2, 1)).setObjects(("SNMP-TARGET-MIB", "snmpTargetAddrTDomain"), ("SNMP-TARGET-MIB", "snmpTargetAddrParams"), ("SNMP-TARGET-MIB", "snmpTargetParamsRowStatus"), ("SNMP-TARGET-MIB", "snmpTargetParamsMPModel"), ("SNMP-TARGET-MIB", "snmpTargetAddrStorageType"), ("SNMP-TARGET-MIB", "snmpTargetParamsSecurityName"), ("SNMP-TARGET-MIB", "snmpTargetAddrRowStatus"), ("SNMP-TARGET-MIB", "snmpTargetAddrTAddress"), ("SNMP-TARGET-MIB", "snmpTargetParamsStorageType"), ("SNMP-TARGET-MIB", "snmpTargetAddrTagList"), ("SNMP-TARGET-MIB", "snmpTargetSpinLock"), ("SNMP-TARGET-MIB", "snmpTargetParamsSecurityLevel"), ("SNMP-TARGET-MIB", "snmpTargetParamsSecurityModel"), ) # Exports # Module identity mibBuilder.exportSymbols("SNMP-TARGET-MIB", PYSNMP_MODULE_ID=snmpTargetMIB) # Types mibBuilder.exportSymbols("SNMP-TARGET-MIB", SnmpTagList=SnmpTagList, SnmpTagValue=SnmpTagValue) # Objects mibBuilder.exportSymbols("SNMP-TARGET-MIB", snmpTargetMIB=snmpTargetMIB, snmpTargetObjects=snmpTargetObjects, snmpTargetSpinLock=snmpTargetSpinLock, snmpTargetAddrTable=snmpTargetAddrTable, snmpTargetAddrEntry=snmpTargetAddrEntry, snmpTargetAddrName=snmpTargetAddrName, snmpTargetAddrTDomain=snmpTargetAddrTDomain, snmpTargetAddrTAddress=snmpTargetAddrTAddress, snmpTargetAddrTimeout=snmpTargetAddrTimeout, snmpTargetAddrRetryCount=snmpTargetAddrRetryCount, snmpTargetAddrTagList=snmpTargetAddrTagList, snmpTargetAddrParams=snmpTargetAddrParams, snmpTargetAddrStorageType=snmpTargetAddrStorageType, snmpTargetAddrRowStatus=snmpTargetAddrRowStatus, snmpTargetParamsTable=snmpTargetParamsTable, snmpTargetParamsEntry=snmpTargetParamsEntry, snmpTargetParamsName=snmpTargetParamsName, snmpTargetParamsMPModel=snmpTargetParamsMPModel, snmpTargetParamsSecurityModel=snmpTargetParamsSecurityModel, snmpTargetParamsSecurityName=snmpTargetParamsSecurityName, snmpTargetParamsSecurityLevel=snmpTargetParamsSecurityLevel, snmpTargetParamsStorageType=snmpTargetParamsStorageType, snmpTargetParamsRowStatus=snmpTargetParamsRowStatus, snmpUnavailableContexts=snmpUnavailableContexts, snmpUnknownContexts=snmpUnknownContexts, snmpTargetConformance=snmpTargetConformance, snmpTargetCompliances=snmpTargetCompliances, snmpTargetGroups=snmpTargetGroups) # Groups mibBuilder.exportSymbols("SNMP-TARGET-MIB", snmpTargetResponseGroup=snmpTargetResponseGroup, snmpTargetCommandResponderGroup=snmpTargetCommandResponderGroup, snmpTargetBasicGroup=snmpTargetBasicGroup) PKAq>loMa a pysnmp/smi/mibs/RFC1155-SMI.pyc; Jc@sdklZlZdklZeidddd\ZZZ eidddd d \Z Z Z Z d e fd YZd e fdYZde fdYZdefdYZdefdYZde fdYZd e fdYZ e ddddfZe dddddfZe dddddfZe dddddfZe dddddfZe ddddddfZeidd ed ededededed e eiddeded ed!ed"ed#ed$S(%(s constraintsnamedval(sNetworkAddresssASN1sIntegersObjectIdentifiers OctetStrings SNMPv2-SMIsBitss Integer32s MibIdentifiers TimeTickssCountercBs!tZeieiddZRS(Nil(s__name__s __module__s Integer32s subtypeSpecs constraintsValueRangeConstraint(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/RFC1155-SMI.pysCounterssGaugecBs!tZeieiddZRS(Nil(s__name__s __module__s Integer32s subtypeSpecs constraintsValueRangeConstraint(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/RFC1155-SMI.pysGaugess IpAddresscBs'tZeieiddZdZRS(Ni(s__name__s __module__s OctetStrings subtypeSpecs constraintsValueSizeConstraints fixedLength(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/RFC1155-SMI.pys IpAddressssNetworkAddresscBstZRS(N(s__name__s __module__(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/RFC1155-SMI.pysNetworkAddressss ObjectNamecBstZRS(N(s__name__s __module__(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/RFC1155-SMI.pys ObjectName"ssOpaquecBstZRS(N(s__name__s __module__(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/RFC1155-SMI.pysOpaque%scBs!tZeieiddZRS(Nil(s__name__s __module__s Integer32s subtypeSpecs constraintsValueRangeConstraint(((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/RFC1155-SMI.pys TimeTicks(siiiiis RFC1155-SMIsinternets directorysmgmts experimentalsprivates enterprisesN(s pyasn1.types constraintsnamedvalspysnmp.proto.rfc1155sNetworkAddresss mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsBitss Integer32s MibIdentifiers TimeTickssCountersGauges IpAddresss ObjectNamesOpaquesinternets directorysmgmts experimentalsprivates enterprisess exportSymbols(sNetworkAddresssOpaques TimeTickssmgmtsprivatesBitss IpAddresssinternetsObjectIdentifiersnamedvals OctetStringsCounters enterprisessIntegers Integer32s ObjectNames constraints MibIdentifiers directorysGauges experimental((s9build/bdist.linux-i686/egg/pysnmp/smi/mibs/RFC1155-SMI.pys?s$ !'7PKz:*r>r>(pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py# PySNMP SMI module. Autogenerated from smidump -f python SNMP-NOTIFICATION-MIB # by libsmi2pysnmp-0.0.9-alpha at Thu Mar 26 20:58:12 2009, # Python version (2, 4, 4, 'final', 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") ( 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") ( Bits, Integer32, ModuleIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, snmpModules, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "ModuleIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "snmpModules") ( RowStatus, StorageType, ) = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "StorageType") # Objects snmpNotificationMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 13)).setRevisions(("2002-10-14 00:00","1998-08-04 00:00","1997-07-14 00:00",)) if mibBuilder.loadTexts: snmpNotificationMIB.setOrganization("IETF SNMPv3 Working Group") if mibBuilder.loadTexts: snmpNotificationMIB.setContactInfo("WG-email: snmpv3@lists.tislabs.com\nSubscribe: majordomo@lists.tislabs.com\n In message body: subscribe snmpv3\n\nCo-Chair: Russ Mundy\n Network Associates Laboratories\nPostal: 15204 Omega Drive, Suite 300\n Rockville, MD 20850-4601\n USA\nEMail: mundy@tislabs.com\nPhone: +1 301-947-7107\n\nCo-Chair: David Harrington\n Enterasys Networks\nPostal: 35 Industrial Way\n P. O. Box 5004\n Rochester, New Hampshire 03866-5005\n USA\nEMail: dbh@enterasys.com\nPhone: +1 603-337-2614\n\nCo-editor: David B. Levi\n Nortel Networks\nPostal: 3505 Kesterwood Drive\n Knoxville, Tennessee 37918\nEMail: dlevi@nortelnetworks.com\nPhone: +1 865 686 0432\n\nCo-editor: Paul Meyer\n Secure Computing Corporation\nPostal: 2675 Long Lake Road\n Roseville, Minnesota 55113\nEMail: paul_meyer@securecomputing.com\nPhone: +1 651 628 1592\n\nCo-editor: Bob Stewart\n Retired") if mibBuilder.loadTexts: snmpNotificationMIB.setDescription("This MIB module defines MIB objects which provide\nmechanisms to remotely configure the parameters\nused by an SNMP entity for the generation of\nnotifications.\n\nCopyright (C) The Internet Society (2002). This\nversion of this MIB module is part of RFC 3413;\nsee the RFC itself for full legal notices.") snmpNotifyObjects = MibIdentifier((1, 3, 6, 1, 6, 3, 13, 1)) 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") 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") 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.") snmpNotifyRowStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 5), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: snmpNotifyRowStatus.setDescription("The status of this conceptual row.\n\nTo create a row in this table, a manager must\nset this object to either createAndGo(4) or\ncreateAndWait(5).") 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") 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.") snmpNotifyFilterProfileRowStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 2, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: snmpNotifyFilterProfileRowStatus.setDescription("The status of this conceptual row.\n\nTo create a row in this table, a manager must\nset this object to either createAndGo(4) or\ncreateAndWait(5).\n\nUntil instances of all corresponding columns are\nappropriately configured, the value of the\ncorresponding instance of the\nsnmpNotifyFilterProfileRowStatus column is 'notReady'.\n\nIn particular, a newly created row cannot be made\nactive until the corresponding instance of\nsnmpNotifyFilterProfileName has been set.") snmpNotifyFilterTable = MibTable((1, 3, 6, 1, 6, 3, 13, 1, 3)) if mibBuilder.loadTexts: snmpNotifyFilterTable.setDescription("The table of filter profiles. Filter profiles are used\nto determine whether particular management targets should\nreceive particular notifications.\n\nWhen a notification is generated, it must be compared\nwith the filters associated with each management target\nwhich is configured to receive notifications, in order to\ndetermine whether it may be sent to each such management\ntarget.\n\nA more complete discussion of notification filtering\ncan be found in section 6. of [SNMP-APPL].") snmpNotifyFilterEntry = MibTableRow((1, 3, 6, 1, 6, 3, 13, 1, 3, 1)).setIndexNames((0, "SNMP-NOTIFICATION-MIB", "snmpNotifyFilterProfileName"), (1, "SNMP-NOTIFICATION-MIB", "snmpNotifyFilterSubtree")) 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") 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") 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.") snmpNotifyFilterRowStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 13, 1, 3, 1, 5), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: snmpNotifyFilterRowStatus.setDescription("The status of this conceptual row.\n\nTo create a row in this table, a manager must\nset this object to either createAndGo(4) or\ncreateAndWait(5).") snmpNotifyConformance = MibIdentifier((1, 3, 6, 1, 6, 3, 13, 3)) snmpNotifyCompliances = MibIdentifier((1, 3, 6, 1, 6, 3, 13, 3, 1)) snmpNotifyGroups = MibIdentifier((1, 3, 6, 1, 6, 3, 13, 3, 2)) # Augmentions # Groups snmpNotifyFilterGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 13, 3, 2, 2)).setObjects(("SNMP-NOTIFICATION-MIB", "snmpNotifyFilterRowStatus"), ("SNMP-NOTIFICATION-MIB", "snmpNotifyFilterProfileStorType"), ("SNMP-NOTIFICATION-MIB", "snmpNotifyFilterProfileName"), ("SNMP-NOTIFICATION-MIB", "snmpNotifyFilterType"), ("SNMP-NOTIFICATION-MIB", "snmpNotifyFilterStorageType"), ("SNMP-NOTIFICATION-MIB", "snmpNotifyFilterMask"), ("SNMP-NOTIFICATION-MIB", "snmpNotifyFilterProfileRowStatus"), ) snmpNotifyGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 13, 3, 2, 1)).setObjects(("SNMP-NOTIFICATION-MIB", "snmpNotifyTag"), ("SNMP-NOTIFICATION-MIB", "snmpNotifyRowStatus"), ("SNMP-NOTIFICATION-MIB", "snmpNotifyStorageType"), ("SNMP-NOTIFICATION-MIB", "snmpNotifyType"), ) # Exports # Module identity mibBuilder.exportSymbols("SNMP-NOTIFICATION-MIB", PYSNMP_MODULE_ID=snmpNotificationMIB) # Objects mibBuilder.exportSymbols("SNMP-NOTIFICATION-MIB", snmpNotificationMIB=snmpNotificationMIB, snmpNotifyObjects=snmpNotifyObjects, snmpNotifyTable=snmpNotifyTable, snmpNotifyEntry=snmpNotifyEntry, snmpNotifyName=snmpNotifyName, snmpNotifyTag=snmpNotifyTag, snmpNotifyType=snmpNotifyType, snmpNotifyStorageType=snmpNotifyStorageType, snmpNotifyRowStatus=snmpNotifyRowStatus, snmpNotifyFilterProfileTable=snmpNotifyFilterProfileTable, snmpNotifyFilterProfileEntry=snmpNotifyFilterProfileEntry, snmpNotifyFilterProfileName=snmpNotifyFilterProfileName, snmpNotifyFilterProfileStorType=snmpNotifyFilterProfileStorType, snmpNotifyFilterProfileRowStatus=snmpNotifyFilterProfileRowStatus, snmpNotifyFilterTable=snmpNotifyFilterTable, snmpNotifyFilterEntry=snmpNotifyFilterEntry, snmpNotifyFilterSubtree=snmpNotifyFilterSubtree, snmpNotifyFilterMask=snmpNotifyFilterMask, snmpNotifyFilterType=snmpNotifyFilterType, snmpNotifyFilterStorageType=snmpNotifyFilterStorageType, snmpNotifyFilterRowStatus=snmpNotifyFilterRowStatus, snmpNotifyConformance=snmpNotifyConformance, snmpNotifyCompliances=snmpNotifyCompliances, snmpNotifyGroups=snmpNotifyGroups) # Groups mibBuilder.exportSymbols("SNMP-NOTIFICATION-MIB", snmpNotifyFilterGroup=snmpNotifyFilterGroup, snmpNotifyGroup=snmpNotifyGroup) PKAq>' 00&pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.pyc; %Ic,@s dklZlZeidddd\ZZZeiddd\ZZ eidd d \Z Z eid d d \Z Z eiddddddddddddd \ ZZZZZZZZZZZZeiddd\ZZeddddddd fid!d"fZeioeid#neioeid$neioei d%neddddddd dfZ!eddddddd ddf Z"eioe"i d&neddddddd dddf i#dd'd(fZ$eioe$i d)neddddddd ddddf ei%d*ei&dd+i'd,Z(eioe(i d-neddddddd dddd.f ei'd/Z)eioe)i d0neddddddd ddddf ei%d*ei&dd+i'd/Z*eioe*i d1neddddddd dddd2f e i'd/Z+eioe+i d3neddddddd dddd4f ei%d*ei&d5d+i,d6i'd/Z-eioe-i d7neddddddd ddddf e i,d6i'd/Z.eioe.i d8neddddddd dddd9f ei'd/Z/eioe/i d:neddddddd dddd;f ei'd/Z0eioe0i d<neddddddd dd.f Z1eioe1i d=neddddddd dd.df Z2eioe2i d>neddddddd dd.ddf ei%d*ei&d5d?i,d6i'd/Z3eioe3i d@neddddddd dd.dd.f ei%d*ei4ei5d5d5ei5dAdBi,dAi'd/Z6eioe6i dCneddddddd ddf ei'dDZ7eioe7i dEneddddddd dd2f ei'dDZ8eioe8i dFneddddddd d.fZ9eddddddd d.df Z:eddddddd d.d.f Z;eidd \Z e i<d'dGfe=e2i#e i>e ddddddd d.d.df i?d'dHfd'dIfZ@e ddddddd d.d.df i?d'dJfd'dKfd'dLfd'dMfd'dNfd'dOfd'dPfd'dQfd'dRf ZAeiBd'dSeeiBd'dTedUe!dVe"dWe$d(e(dPe)dOe*dLe+dNe-dRe.dJe/dMe0dXe1dGe2dKe3dQe6dHe7dIe8dYe9dZe:d[e;eiBd'd\e@d]eAd^S(_(s constraintsnamedvalsASN1sIntegersObjectIdentifiers OctetStringsSNMP-FRAMEWORK-MIBsSnmpAdminStrings SnmpEngineIDsSNMP-TARGET-MIBs SnmpTagValuessnmpTargetAddrEntrys SNMPv2-CONFsModuleCompliances ObjectGroups SNMPv2-SMIsBitss Integer32s IpAddresssModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModuless SNMPv2-TCs RowStatuss StorageTypeiiiis2000-03-06 00:00s1999-05-13 00:00sSNMPv3 Working GroupsFWG-email: snmpv3@lists.tislabs.com Subscribe: majordomo@lists.tislabs.com In msg body: subscribe snmpv3 Chair: Russ Mundy TIS Labs at Network Associates Postal: 3060 Washington Rd Glenwood MD 21738 USA Email: mundy@tislabs.com Phone: +1-301-854-6889 Co-editor: Rob Frye CoSine Communications Postal: 1200 Bridge Parkway Redwood City, CA 94065 USA E-mail: rfrye@cosinecom.com Phone: +1 703 725 1130 Co-editor: David B. Levi Nortel Networks Postal: 3505 Kesterwood Drive Knoxville, TN 37918 E-mail: dlevi@nortelnetworks.com Phone: +1 423 686 0432 Co-editor: Shawn A. Routhier Integrated Systems Inc. Postal: 333 North Ave 4th Floor Wakefield, MA 01880 E-mail: sar@epilogue.com Phone: +1 781 245 0804 Co-editor: Bert Wijnen Lucent Technologies Postal: Schagen 33 3461 GL Linschoten Netherlands Email: bwijnen@lucent.com Phone: +31-348-407-775s`This MIB module defines objects to help support coexistence between SNMPv1, SNMPv2c, and SNMPv3.scThe table of community strings configured in the SNMP engine's Local Configuration Datastore (LCD).sSNMP-COMMUNITY-MIBssnmpCommunityIndexs0Information about a particular community string.s subtypeSpeci snoaccesss.The unique index value of a row in this table.is readcreatesNThe community string for which a row in this table represents a configuration.syA human readable string representing the corresponding value of snmpCommunityName in a Security Model independent format.isThe contextEngineID indicating the location of the context in which management information is accessed when using the community string specified by the corresponding instance of snmpCommunityName. The default value is the snmpEngineID of the entity in which this object is instantiated.iissThe context in which management information is accessed when using the community string specified by the corresponding instance of snmpCommunityName.sxThis object specifies a set of transport endpoints from which a command responder application will accept management requests. If a management request containing this community is received on a transport endpoint other than the transport endpoints identified by this object, the request is deemed unauthentic. The transports identified by this object are specified in the snmpTargetAddrTable. Entries in that table whose snmpTargetAddrTagList contains this tag value are identified. If the value of this object has zero-length, transport endpoints are not checked when authenticating messages containing this community string.isThe storage type for this conceptual row in the snmpCommunityTable. Conceptual rows having the value 'permanent' need not allow write-access to any columnar object in the row.isThe status of this conceptual row in the snmpCommunityTable. An entry in this table is not qualified for activation until instances of all corresponding columns have been initialized, either through default values, or through Set operations. The snmpCommunityName and snmpCommunitySecurityName objects must be explicitly set. There is no restriction on setting columns in this table when the value of snmpCommunityStatus is active(1).s*The table of mask and mms values associated with the snmpTargetAddrTable. The snmpTargetAddrExtTable augments the snmpTargetAddrTable with a transport address mask value and a maximum message size value. The transport address mask allows entries in the snmpTargetAddrTable to define a set of addresses instead of just a single address. The maximum message size value allows the maximum message size of another SNMP entity to be configured for use in SNMPv1 (and SNMPv2c) transactions, where the message format does not specify a maximum message size.s2Information about a particular mask and mms value.isThe mask value associated with an entry in the snmpTargetAddrTable. The value of this object must have the same length as the corresponding instance of snmpTargetAddrTAddress, or must have length 0. An attempt to set it to any other value will result in an inconsistentValue error. The value of this object allows an entry in the snmpTargetAddrTable to specify multiple addresses. The mask value is used to select which bits of a transport address must match bits of the corresponding instance of snmpTargetAddrTAddress, in order for the transport address to match a particular entry in the snmpTargetAddrTable. Bits which are 1 in the mask value indicate bits in the transport address which must match bits in the snmpTargetAddrTAddress value. Bits which are 0 in the mask indicate bits in the transport address which need not match. If the length of the mask is 0, the mask should be treated as if all its bits were 1 and its length were equal to the length of the corresponding value of snmpTargetAddrTable. This object may not be modified while the value of the corresponding instance of snmpTargetAddrRowStatus is active(1). An attempt to set this object in this case will result in an inconsistentValue error.ilsSThe maximum message size value associated with an entry in the snmpTargetAddrTable.s notifyonlysThe value of the agent-addr field of a Trap PDU which is forwarded by a proxy forwarder application using an SNMP version other than SNMPv1. The value of this object SHOULD contain the value of the agent-addr field from the original Trap PDU as generated by an SNMPv1 agent.sZThe value of the community string field of an SNMPv1 message containing a Trap PDU which is forwarded by a a proxy forwarder application using an SNMP version other than SNMPv1. The value of this object SHOULD contain the value of the community string field from the original SNMPv1 message containing a Trap PDU as generated by an SNMPv1 agent.ssnmpTargetAddrExtEntryssnmpTrapAddressssnmpTrapCommunityssnmpCommunityStorageTypessnmpTargetAddrTMaskssnmpCommunityContextEngineIDssnmpCommunityStatusssnmpCommunityContextNamessnmpCommunitySecurityNamessnmpCommunityNamessnmpTargetAddrMMSssnmpCommunityTransportTagsPYSNMP_MODULE_IDssnmpCommunityMIBssnmpCommunityMIBObjectsssnmpCommunityTablessnmpCommunityEntryssnmpTargetAddrExtTablessnmpCommunityMIBConformancessnmpCommunityMIBCompliancesssnmpCommunityMIBGroupsssnmpProxyTrapForwardGroupssnmpCommunityGroupN(Cs pyasn1.types constraintsnamedvals mibBuilders importSymbolssIntegersObjectIdentifiers OctetStringsSnmpAdminStrings SnmpEngineIDs SnmpTagValuessnmpTargetAddrEntrysModuleCompliances ObjectGroupsBitss Integer32s IpAddresssModuleIdentitys MibIdentifiers MibScalarsMibTables MibTableRowsMibTableColumns TimeTickss snmpModuless RowStatuss StorageTypes setRevisionsssnmpCommunityMIBs loadTextsssetOrganizationssetContactInfossetDescriptionssnmpCommunityMIBObjectsssnmpCommunityTables setIndexNamesssnmpCommunityEntryssubtypesValueSizeConstraints setMaxAccessssnmpCommunityIndexssnmpCommunityNamessnmpCommunitySecurityNamessnmpCommunityContextEngineIDsclonessnmpCommunityContextNamessnmpCommunityTransportTagssnmpCommunityStorageTypessnmpCommunityStatusssnmpTargetAddrExtTablessnmpTargetAddrExtEntryssnmpTargetAddrTMasksConstraintsUnionsValueRangeConstraintssnmpTargetAddrMMSssnmpTrapAddressssnmpTrapCommunityssnmpCommunityMIBConformancessnmpCommunityMIBCompliancesssnmpCommunityMIBGroupssregisterAugmentionssapplys getIndexNamess setObjectsssnmpProxyTrapForwardGroupssnmpCommunityGroups exportSymbols(/sSnmpAdminStrings MibScalarssnmpTrapAddresss TimeTicksssnmpCommunityContextEngineIDssnmpCommunityTablesModuleIdentitys SnmpEngineIDssnmpCommunityGroups snmpModulesssnmpCommunityMIBssnmpTargetAddrExtTables IpAddresss ObjectGroupssnmpCommunityStorageTypesMibTableColumnssnmpCommunitySecurityNamesModuleCompliancesMibTablessnmpCommunityStatusssnmpTargetAddrEntrysBitss RowStatusssnmpTrapCommunitysObjectIdentifiersnamedvals SnmpTagValues OctetStrings MibTableRowssnmpCommunityMIBConformancessnmpCommunityMIBGroupsssnmpProxyTrapForwardGroupsIntegerssnmpCommunityMIBObjectsssnmpCommunityTransportTags Integer32ssnmpCommunityMIBCompliancess constraints StorageTypessnmpCommunityEntryssnmpCommunityContextNamessnmpCommunityIndexs MibIdentifierssnmpTargetAddrTMaskssnmpCommunityNamessnmpTargetAddrMMSssnmpTargetAddrExtEntry((s@build/bdist.linux-i686/egg/pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.pys?s!W0   $' < T < T < ] E < < ' * ] u 6 6 $''BPK 4>ak::)pysnmp/smi/mibs/instances/__SNMPv2-MIB.pyfrom sys import version from time import time from pysnmp import majorVersionId ( MibScalarInstance, TimeTicks) = mibBuilder.importSymbols( 'SNMPv2-SMI', 'MibScalarInstance', 'TimeTicks' ) ( sysDescr, sysObjectID, sysUpTime, sysContact, sysName, sysLocation, sysServices, sysORLastChange, snmpInPkts, snmpOutPkts, snmpInBadVersions, snmpInBadCommunityNames, snmpInBadCommunityUses, snmpInASNParseErrs, snmpInTooBigs, snmpInNoSuchNames, snmpInBadValues, snmpInReadOnlys, snmpInGenErrs, snmpInTotalReqVars, snmpInTotalSetVars, snmpInGetRequests, snmpInGetNexts, snmpInSetRequests, snmpInGetResponses, snmpInTraps, snmpOutTooBigs, snmpOutNoSuchNames, snmpOutBadValues, snmpOutGenErrs, snmpOutSetRequests, snmpOutGetResponses, snmpOutTraps, snmpEnableAuthenTraps, snmpSilentDrops, snmpProxyDrops, snmpTrapOID, coldStart, snmpSetSerialNo ) = mibBuilder.importSymbols( 'SNMPv2-MIB', 'sysDescr', 'sysObjectID', 'sysUpTime', 'sysContact', 'sysName', 'sysLocation', 'sysServices', 'sysORLastChange', 'snmpInPkts', 'snmpOutPkts', 'snmpInBadVersions', 'snmpInBadCommunityNames', 'snmpInBadCommunityUses', 'snmpInASNParseErrs', 'snmpInTooBigs', 'snmpInNoSuchNames', 'snmpInBadValues', 'snmpInReadOnlys', 'snmpInGenErrs', 'snmpInTotalReqVars', 'snmpInTotalSetVars', 'snmpInGetRequests', 'snmpInGetNexts', 'snmpInSetRequests', 'snmpInGetResponses', 'snmpInTraps', 'snmpOutTooBigs', 'snmpOutNoSuchNames', 'snmpOutBadValues', 'snmpOutGenErrs', 'snmpOutSetRequests', 'snmpOutGetResponses', 'snmpOutTraps', 'snmpEnableAuthenTraps', 'snmpSilentDrops', 'snmpProxyDrops', 'snmpTrapOID', 'coldStart', 'snmpSetSerialNo' ) __sysDescr = MibScalarInstance(sysDescr.name, (0,), sysDescr.syntax.clone("PySNMP engine version %s, Python %s" % (majorVersionId, version))) __sysObjectID = MibScalarInstance(sysObjectID.name, (0,), sysObjectID.syntax.clone((1,3,6,1,4,1,20408))) class SysUpTime(TimeTicks): createdAt = time() def clone(self, **kwargs): if 'value' not in kwargs: kwargs['value'] = int((time()-self.createdAt)*100) return apply(TimeTicks.clone, [self], kwargs) __sysUpTime = MibScalarInstance(sysUpTime.name, (0,), SysUpTime(0)) __sysContact = MibScalarInstance(sysContact.name, (0,), sysContact.syntax.clone('')) __sysName = MibScalarInstance(sysName.name, (0,), sysName.syntax.clone('')) __sysLocation = MibScalarInstance(sysLocation.name, (0,), sysLocation.syntax.clone('')) __sysServices = MibScalarInstance(sysServices.name, (0,), sysServices.syntax.clone(0)) __sysORLastChange = MibScalarInstance(sysORLastChange.name, (0,), sysORLastChange.syntax.clone(0)) __snmpInPkts = MibScalarInstance(snmpInPkts.name, (0,), snmpInPkts.syntax.clone(0)) __snmpOutPkts = MibScalarInstance(snmpOutPkts.name, (0,), snmpOutPkts.syntax.clone(0)) __snmpInBadVersions = MibScalarInstance(snmpInBadVersions.name, (0,), snmpInBadVersions.syntax.clone(0)) __snmpInBadCommunityNames = MibScalarInstance(snmpInBadCommunityNames.name, (0,), snmpInBadCommunityNames.syntax.clone(0)) __snmpInBadCommunityUses = MibScalarInstance(snmpInBadCommunityUses.name, (0,), snmpInBadCommunityUses.syntax.clone(0)) __snmpInASNParseErrs = MibScalarInstance(snmpInASNParseErrs.name, (0,), snmpInASNParseErrs.syntax.clone(0)) __snmpInTooBigs = MibScalarInstance(snmpInTooBigs.name, (0,), snmpInTooBigs.syntax.clone(0)) __snmpInNoSuchNames = MibScalarInstance(snmpInNoSuchNames.name, (0,), snmpInNoSuchNames.syntax.clone(0)) __snmpInBadValues = MibScalarInstance(snmpInBadValues.name, (0,), snmpInBadValues.syntax.clone(0)) __snmpInReadOnlys = MibScalarInstance(snmpInReadOnlys.name, (0,), snmpInReadOnlys.syntax.clone(0)) __snmpInGenErrs = MibScalarInstance(snmpInGenErrs.name, (0,), snmpInGenErrs.syntax.clone(0)) __snmpInTotalReqVars = MibScalarInstance(snmpInTotalReqVars.name, (0,), snmpInTotalReqVars.syntax.clone(0)) __snmpInTotalSetVars = MibScalarInstance(snmpInTotalSetVars.name, (0,), snmpInTotalSetVars.syntax.clone(0)) __snmpInGetRequests = MibScalarInstance(snmpInGetRequests.name, (0,), snmpInGetRequests.syntax.clone(0)) __snmpInGetNexts = MibScalarInstance(snmpInGetNexts.name, (0,), snmpInGetNexts.syntax.clone(0)) __snmpInSetRequests = MibScalarInstance(snmpInSetRequests.name, (0,), snmpInSetRequests.syntax.clone(0)) __snmpInGetResponses = MibScalarInstance(snmpInGetResponses.name, (0,), snmpInGetResponses.syntax.clone(0)) __snmpInTraps = MibScalarInstance(snmpInTraps.name, (0,), snmpInTraps.syntax.clone(0)) __snmpOutTooBigs = MibScalarInstance(snmpOutTooBigs.name, (0,), snmpOutTooBigs.syntax.clone(0)) __snmpOutNoSuchNames = MibScalarInstance(snmpOutNoSuchNames.name, (0,), snmpOutNoSuchNames.syntax.clone(0)) __snmpOutBadValues = MibScalarInstance(snmpOutBadValues.name, (0,), snmpOutBadValues.syntax.clone(0)) __snmpOutGenErrs = MibScalarInstance(snmpOutGenErrs.name, (0,), snmpOutGenErrs.syntax.clone(0)) __snmpOutSetRequests = MibScalarInstance(snmpOutSetRequests.name, (0,), snmpOutSetRequests.syntax.clone(0)) __snmpOutGetResponses = MibScalarInstance(snmpOutGetResponses.name, (0,), snmpOutGetResponses.syntax.clone(0)) __snmpOutTraps = MibScalarInstance(snmpOutTraps.name, (0,), snmpOutTraps.syntax.clone(0)) __snmpEnableAuthenTraps = MibScalarInstance(snmpEnableAuthenTraps.name, (0,), snmpEnableAuthenTraps.syntax.clone(1)) __snmpSilentDrops = MibScalarInstance(snmpSilentDrops.name, (0,), snmpSilentDrops.syntax.clone(0)) __snmpProxyDrops = MibScalarInstance(snmpProxyDrops.name, (0,), snmpProxyDrops.syntax.clone(0)) __snmpTrapOID = MibScalarInstance(snmpTrapOID.name, (0,), snmpTrapOID.syntax.clone(coldStart.name)) __snmpSetSerialNo = MibScalarInstance(snmpSetSerialNo.name, (0,), snmpSetSerialNo.syntax.clone(0)) mibBuilder.exportSymbols( "__SNMPv2-MIB", sysDescr = __sysDescr, sysObjectID = __sysObjectID, sysUpTime = __sysUpTime, sysContact = __sysContact, sysName = __sysName, sysLocation = __sysLocation, sysServices = __sysServices, sysORLastChange = __sysORLastChange, snmpInPkts = __snmpInPkts, snmpOutPkts = __snmpOutPkts, snmpInBadVersions = __snmpInBadVersions, snmpInBadCommunityNames = __snmpInBadCommunityNames, snmpInBadCommunityUses = __snmpInBadCommunityUses, snmpInASNParseErrs = __snmpInASNParseErrs, snmpInTooBigs = __snmpInTooBigs, snmpInNoSuchNames = __snmpInNoSuchNames, snmpInBadValues = __snmpInBadValues, snmpInReadOnlys = __snmpInReadOnlys, snmpInGenErrs = __snmpInGenErrs, snmpInTotalReqVars = __snmpInTotalReqVars, snmpInTotalSetVars = __snmpInTotalSetVars, snmpInGetRequests = __snmpInGetRequests, snmpInGetNexts = __snmpInGetNexts, snmpInSetRequests = __snmpInSetRequests, snmpInGetResponses = __snmpInGetResponses, snmpInTraps = __snmpInTraps, snmpOutTooBigs = __snmpOutTooBigs, snmpOutNoSuchNames = __snmpOutNoSuchNames, snmpOutBadValues = __snmpOutBadValues, snmpOutGenErrs = __snmpOutGenErrs, snmpOutSetRequests = __snmpOutSetRequests, snmpOutGetResponses = __snmpOutGetResponses, snmpOutTraps = __snmpOutTraps, snmpEnableAuthenTraps = __snmpEnableAuthenTraps, snmpSilentDrops = __snmpSilentDrops, snmpProxyDrops = __snmpProxyDrops, snmpTrapOID = __snmpTrapOID, snmpSetSerialNo = __snmpSetSerialNo ) PKR 4|bff5pysnmp/smi/mibs/instances/__SNMP-USER-BASED-SM-MIB.py( MibScalarInstance, ) = mibBuilder.importSymbols( 'SNMPv2-SMI', 'MibScalarInstance' ) ( usmStatsUnsupportedSecLevels, usmStatsNotInTimeWindows, usmStatsUnknownUserNames, usmStatsUnknownEngineIDs, usmStatsWrongDigests, usmStatsDecryptionErrors, usmUserSpinLock ) = mibBuilder.importSymbols( 'SNMP-USER-BASED-SM-MIB', 'usmStatsUnsupportedSecLevels', 'usmStatsNotInTimeWindows', 'usmStatsUnknownUserNames', 'usmStatsUnknownEngineIDs', 'usmStatsWrongDigests', 'usmStatsDecryptionErrors', 'usmUserSpinLock' ) __usmStatsUnsupportedSecLevels = MibScalarInstance(usmStatsUnsupportedSecLevels.name, (0,), usmStatsUnsupportedSecLevels.syntax.clone(0)) __usmStatsNotInTimeWindows = MibScalarInstance(usmStatsNotInTimeWindows.name, (0,), usmStatsNotInTimeWindows.syntax.clone(0)) __usmStatsUnknownUserNames = MibScalarInstance(usmStatsUnknownUserNames.name, (0,), usmStatsUnknownUserNames.syntax.clone(0)) __usmStatsUnknownEngineIDs = MibScalarInstance(usmStatsUnknownEngineIDs.name, (0,), usmStatsUnknownEngineIDs.syntax.clone(0)) __usmStatsWrongDigests = MibScalarInstance(usmStatsWrongDigests.name, (0,), usmStatsWrongDigests.syntax.clone(0)) __usmStatsDecryptionErrors = MibScalarInstance(usmStatsDecryptionErrors.name, (0,), usmStatsDecryptionErrors.syntax.clone(0)) __usmUserSpinLock = MibScalarInstance(usmUserSpinLock.name, (0,), usmUserSpinLock.syntax.clone(0)) mibBuilder.exportSymbols( '__SNMP-USER-BASED-SM-MIB', usmStatsUnsupportedSecLevels = __usmStatsUnsupportedSecLevels, usmStatsNotInTimeWindows = __usmStatsNotInTimeWindows, usmStatsUnknownUserNames = __usmStatsUnknownUserNames, usmStatsUnknownEngineIDs = __usmStatsUnknownEngineIDs, usmStatsWrongDigests = __usmStatsWrongDigests, usmStatsDecryptionErrors = __usmStatsDecryptionErrors, usmUserSpinLock = __usmUserSpinLock ) PKAq>-C,pysnmp/smi/mibs/instances/__SNMP-MPD-MIB.pyc; ZDc@seidd\Zeidddd\ZZZeeidfeiidZ eeidfeiidZ eeidfeiidZ ei dde de de dS( s SNMPv2-SMIsMibScalarInstances SNMP-MPD-MIBssnmpUnknownSecurityModelsssnmpInvalidMsgsssnmpUnknownPDUHandlersis__SNMP-MPD-MIBN( s mibBuilders importSymbolssMibScalarInstancessnmpUnknownSecurityModelsssnmpInvalidMsgsssnmpUnknownPDUHandlerssnamessyntaxsclones__snmpUnknownSecurityModelss__snmpInvalidMsgss__snmpUnknownPDUHandlerss exportSymbols(ssnmpUnknownSecurityModelss__snmpInvalidMsgssMibScalarInstances__snmpUnknownSecurityModelsssnmpInvalidMsgsssnmpUnknownPDUHandlerss__snmpUnknownPDUHandlers((sFbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/instances/__SNMP-MPD-MIB.pys?s   $$$ PKR 4Cwjj+pysnmp/smi/mibs/instances/__SNMP-MPD-MIB.py( MibScalarInstance, ) = mibBuilder.importSymbols( 'SNMPv2-SMI', 'MibScalarInstance' ) ( snmpUnknownSecurityModels, snmpInvalidMsgs, snmpUnknownPDUHandlers ) = mibBuilder.importSymbols( 'SNMP-MPD-MIB', 'snmpUnknownSecurityModels', 'snmpInvalidMsgs', 'snmpUnknownPDUHandlers', ) __snmpUnknownSecurityModels = MibScalarInstance(snmpUnknownSecurityModels.name, (0,), snmpUnknownSecurityModels.syntax.clone(0)) __snmpInvalidMsgs = MibScalarInstance(snmpInvalidMsgs.name, (0,), snmpInvalidMsgs.syntax.clone(0)) __snmpUnknownPDUHandlers = MibScalarInstance(snmpUnknownPDUHandlers.name, (0,), snmpUnknownPDUHandlers.syntax.clone(0)) mibBuilder.exportSymbols( '__SNMP-MPD-MIB', snmpUnknownSecurityModels = __snmpUnknownSecurityModels, snmpInvalidMsgs = __snmpInvalidMsgs, snmpUnknownPDUHandlers = __snmpUnknownPDUHandlers ) PKAq>6.pysnmp/smi/mibs/instances/__PYSNMP-USM-MIB.pyc; ZDc@seidd\Zeiddd\ZZeeidfeiZeeidfeiZei ddededS(s SNMPv2-SMIsMibScalarInstancesPYSNMP-USM-MIBspysnmpUsmDiscoverablespysnmpUsmDiscoveryis__PYSNMP-USM-MIBN( s mibBuilders importSymbolssMibScalarInstancespysnmpUsmDiscoverablespysnmpUsmDiscoverysnamessyntaxs__pysnmpUsmDiscoverables__pysnmpUsmDiscoverys exportSymbols(spysnmpUsmDiscoverys__pysnmpUsmDiscoverys__pysnmpUsmDiscoverablesMibScalarInstancespysnmpUsmDiscoverable((sHbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/instances/__PYSNMP-USM-MIB.pys?s    PKd[3%pysnmp/smi/mibs/instances/__init__.pyPKAq> 86pysnmp/smi/mibs/instances/__SNMP-USER-BASED-SM-MIB.pyc; ZDc@seidd\Zeidddddddd \ZZZZZZZ eei d fei i d Z eei d fei i d Zeei d fei i d Zeei d fei i d Zeei d fei i d Zeei d fei i d Zee i d fe i i d Zeid de dededededed ed S( s SNMPv2-SMIsMibScalarInstancesSNMP-USER-BASED-SM-MIBsusmStatsUnsupportedSecLevelssusmStatsNotInTimeWindowssusmStatsUnknownUserNamessusmStatsUnknownEngineIDssusmStatsWrongDigestssusmStatsDecryptionErrorssusmUserSpinLockis__SNMP-USER-BASED-SM-MIBN(s mibBuilders importSymbolssMibScalarInstancesusmStatsUnsupportedSecLevelssusmStatsNotInTimeWindowssusmStatsUnknownUserNamessusmStatsUnknownEngineIDssusmStatsWrongDigestssusmStatsDecryptionErrorssusmUserSpinLocksnamessyntaxsclones__usmStatsUnsupportedSecLevelss__usmStatsNotInTimeWindowss__usmStatsUnknownUserNamess__usmStatsUnknownEngineIDss__usmStatsWrongDigestss__usmStatsDecryptionErrorss__usmUserSpinLocks exportSymbols(susmStatsUnknownEngineIDssusmStatsNotInTimeWindowssusmStatsUnknownUserNamess__usmStatsUnknownEngineIDss__usmStatsNotInTimeWindowssusmStatsUnsupportedSecLevelssusmStatsDecryptionErrorss__usmStatsWrongDigestssusmUserSpinLocks__usmStatsUnsupportedSecLevelssMibScalarInstances__usmStatsDecryptionErrorss__usmUserSpinLocksusmStatsWrongDigestss__usmStatsUnknownUserNames((sPbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/instances/__SNMP-USER-BASED-SM-MIB.pys?s0   $$$$$$$ PKAq>_II7pysnmp/smi/mibs/instances/__SNMP-VIEW-BASED-ACM-MIB.pyc; ZDc@s\eidd\Zeidd\ZeeidfeiZeiddedS(s SNMPv2-SMIsMibScalarInstancesSNMP-VIEW-BASED-ACM-MIBsvacmViewSpinLockis__SNMP-VIEW-BASED-ACM-MIBN(s mibBuilders importSymbolssMibScalarInstancesvacmViewSpinLocksnamessyntaxs__vacmViewSpinLocks exportSymbols(svacmViewSpinLocksMibScalarInstances__vacmViewSpinLock((sQbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/instances/__SNMP-VIEW-BASED-ACM-MIB.pys?s     PKAq>̇;mm2pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.pyc; XEc @sdkZeidd\Zeiddddd\ZZZZeeidfei Z eeidfei i d Z eeidfei i e eiZeeidfei i d Zeid de de dededS( Ns SNMPv2-SMIsMibScalarInstancesSNMP-FRAMEWORK-MIBs snmpEngineIDssnmpEngineBootsssnmpEngineTimessnmpEngineMaxMessageSizeiiis__SNMP-FRAMEWORK-MIB(stimes mibBuilders importSymbolssMibScalarInstances snmpEngineIDssnmpEngineBootsssnmpEngineTimessnmpEngineMaxMessageSizesnamessyntaxs__snmpEngineIDsclones__snmpEngineBootssints__snmpEngineTimes__snmpEngineMaxMessageSizes exportSymbols( ssnmpEngineMaxMessageSizessnmpEngineTimes__snmpEngineBootss snmpEngineIDssnmpEngineBootssMibScalarInstances__snmpEngineIDstimes__snmpEngineMaxMessageSizes__snmpEngineTime((sLbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.pys?s    $0$ PKjWN6,~1pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.pyimport time ( MibScalarInstance, ) = mibBuilder.importSymbols( 'SNMPv2-SMI', 'MibScalarInstance' ) ( snmpEngineID, snmpEngineBoots, snmpEngineTime, snmpEngineMaxMessageSize ) = mibBuilder.importSymbols( 'SNMP-FRAMEWORK-MIB', 'snmpEngineID', 'snmpEngineBoots', 'snmpEngineTime', 'snmpEngineMaxMessageSize' ) __snmpEngineID = MibScalarInstance(snmpEngineID.name, (0,), snmpEngineID.syntax) __snmpEngineBoots = MibScalarInstance(snmpEngineBoots.name, (0,), snmpEngineBoots.syntax.clone(1)) __snmpEngineTime = MibScalarInstance(snmpEngineTime.name, (0,), snmpEngineTime.syntax.clone(int(time.time()))) __snmpEngineMaxMessageSize = MibScalarInstance(snmpEngineMaxMessageSize.name, (0,), snmpEngineMaxMessageSize.syntax.clone(4096)) mibBuilder.exportSymbols( '__SNMP-FRAMEWORK-MIB', snmpEngineID = __snmpEngineID, snmpEngineBoots = __snmpEngineBoots, snmpEngineTime = __snmpEngineTime, snmpEngineMaxMessageSize = __snmpEngineMaxMessageSize ) PKR 4e9ư.pysnmp/smi/mibs/instances/__SNMP-TARGET-MIB.py( MibScalarInstance, ) = mibBuilder.importSymbols( 'SNMPv2-SMI', 'MibScalarInstance' ) ( snmpTargetSpinLock, snmpUnavailableContexts, snmpUnknownContexts ) = mibBuilder.importSymbols( 'SNMP-TARGET-MIB', 'snmpTargetSpinLock', 'snmpUnavailableContexts', 'snmpUnknownContexts' ) __snmpTargetSpinLock = MibScalarInstance(snmpTargetSpinLock.name, (0,), snmpTargetSpinLock.syntax.clone(0)) __snmpUnavailableContexts = MibScalarInstance(snmpUnavailableContexts.name, (0,), snmpUnavailableContexts.syntax.clone(0)) __snmpUnknownContexts = MibScalarInstance(snmpUnknownContexts.name, (0,), snmpUnknownContexts.syntax.clone(0)) mibBuilder.exportSymbols( '__SNMP-TARGET-MIB', snmpTargetSpinLock = __snmpTargetSpinLock, snmpUnavailableContexts = __snmpUnavailableContexts, snmpUnknownContexts = __snmpUnknownContexts ) PKR 4M6nn-pysnmp/smi/mibs/instances/__PYSNMP-USM-MIB.py( MibScalarInstance, ) = mibBuilder.importSymbols( 'SNMPv2-SMI', 'MibScalarInstance' ) ( pysnmpUsmDiscoverable, pysnmpUsmDiscovery ) = mibBuilder.importSymbols( 'PYSNMP-USM-MIB', 'pysnmpUsmDiscoverable', 'pysnmpUsmDiscovery' ) __pysnmpUsmDiscoverable = MibScalarInstance(pysnmpUsmDiscoverable.name, (0,), pysnmpUsmDiscoverable.syntax) __pysnmpUsmDiscovery = MibScalarInstance(pysnmpUsmDiscovery.name, (0,), pysnmpUsmDiscovery.syntax) mibBuilder.exportSymbols( "__PYSNMP-USM-MIB", pysnmpUsmDiscoverable = __pysnmpUsmDiscoverable, pysnmpUsmDiscovery = __pysnmpUsmDiscovery ) PKR 4)^6pysnmp/smi/mibs/instances/__SNMP-VIEW-BASED-ACM-MIB.py( MibScalarInstance, ) = mibBuilder.importSymbols( 'SNMPv2-SMI', 'MibScalarInstance' ) ( vacmViewSpinLock, ) = mibBuilder.importSymbols( 'SNMP-VIEW-BASED-ACM-MIB', 'vacmViewSpinLock' ) __vacmViewSpinLock = MibScalarInstance(vacmViewSpinLock.name, (0,), vacmViewSpinLock.syntax) mibBuilder.exportSymbols( "__SNMP-VIEW-BASED-ACM-MIB", vacmViewSpinLock = __vacmViewSpinLock ) PKAq> V*pysnmp/smi/mibs/instances/__SNMPv2-MIB.pyc; Q8McN@sdklZdklZdklZeiddd\ZZeidddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-(\'Z Z Z Z Z ZZZZZZZZZZZZZZZZZZZ Z!Z"Z#Z$Z%Z&Z'Z(Z)Z*Z+Z,Z-Z.Z/ee i0d.fe i1i2d/eefZ3ee i0d.fe i1i2d0d1d2d0d3d0d4fZ4d5efd6YZ5ee i0d.fe5d.Z6ee i0d.fe i1i2d7Z7ee i0d.fe i1i2d7Z8eei0d.fei1i2d7Z9eei0d.fei1i2d.Z:eei0d.fei1i2d.Z;eei0d.fei1i2d.Z<eei0d.fei1i2d.Z=eei0d.fei1i2d.Z>eei0d.fei1i2d.Z?eei0d.fei1i2d.Z@eei0d.fei1i2d.ZAeei0d.fei1i2d.ZBeei0d.fei1i2d.ZCeei0d.fei1i2d.ZDeei0d.fei1i2d.ZEeei0d.fei1i2d.ZFeei0d.fei1i2d.ZGeei0d.fei1i2d.ZHeei0d.fei1i2d.ZIeei0d.fei1i2d.ZJee i0d.fe i1i2d.ZKee!i0d.fe!i1i2d.ZLee"i0d.fe"i1i2d.ZMee#i0d.fe#i1i2d.ZNee$i0d.fe$i1i2d.ZOee%i0d.fe%i1i2d.ZPee&i0d.fe&i1i2d.ZQee'i0d.fe'i1i2d.ZRee(i0d.fe(i1i2d.ZSee)i0d.fe)i1i2d.ZTee*i0d.fe*i1i2d0ZUee+i0d.fe+i1i2d.ZVee,i0d.fe,i1i2d.ZWee-i0d.fe-i1i2e.i0ZXee/i0d.fe/i1i2d.ZYeiZd8de3de4d e6d e7d e8d e9d e:de;de<de=de>de?de@deAdeBdeCdeDdeEdeFdeGdeHdeIdeJdeKdeLd eMd!eNd"eOd#ePd$eQd%eRd&eSd'eTd(eUd)eVd*eWd+eXd-eY&d9S(:(sversion(stime(smajorVersionIds SNMPv2-SMIsMibScalarInstances TimeTickss SNMPv2-MIBssysDescrs sysObjectIDs sysUpTimes sysContactssysNames sysLocations sysServicesssysORLastChanges snmpInPktss snmpOutPktsssnmpInBadVersionsssnmpInBadCommunityNamesssnmpInBadCommunityUsesssnmpInASNParseErrss snmpInTooBigsssnmpInNoSuchNamesssnmpInBadValuesssnmpInReadOnlyss snmpInGenErrsssnmpInTotalReqVarsssnmpInTotalSetVarsssnmpInGetRequestsssnmpInGetNextsssnmpInSetRequestsssnmpInGetResponsess snmpInTrapsssnmpOutTooBigsssnmpOutNoSuchNamesssnmpOutBadValuesssnmpOutGenErrsssnmpOutSetRequestsssnmpOutGetResponsess snmpOutTrapsssnmpEnableAuthenTrapsssnmpSilentDropsssnmpProxyDropss snmpTrapOIDs coldStartssnmpSetSerialNois#PySNMP engine version %s, Python %siiiiiOs SysUpTimecBstZeZdZRS(NcKsId|jo"tt|id|d^Cؐ&pysnmp/smi/mibs/instances/__init__.pyc; _Cc@sdS(N((((s@build/bdist.linux-i686/egg/pysnmp/smi/mibs/instances/__init__.pys?sPKAq>{6/pysnmp/smi/mibs/instances/__SNMP-TARGET-MIB.pyc; ZDc@seidd\Zeidddd\ZZZeeidfeiidZ eeidfeiidZ eeidfeiidZ ei dde de de dS( s SNMPv2-SMIsMibScalarInstancesSNMP-TARGET-MIBssnmpTargetSpinLockssnmpUnavailableContextsssnmpUnknownContextsis__SNMP-TARGET-MIBN( s mibBuilders importSymbolssMibScalarInstancessnmpTargetSpinLockssnmpUnavailableContextsssnmpUnknownContextssnamessyntaxsclones__snmpTargetSpinLocks__snmpUnavailableContextss__snmpUnknownContextss exportSymbols(ssnmpUnknownContextss__snmpTargetSpinLocks__snmpUnknownContextssMibScalarInstances__snmpUnavailableContextsssnmpUnavailableContextsssnmpTargetSpinLock((sIbuild/bdist.linux-i686/egg/pysnmp/smi/mibs/instances/__SNMP-TARGET-MIB.pys?s   $$$ PKSn2pysnmp/carrier/__init__.pyPKAq>鑡pysnmp/carrier/error.pyc; Bc@s*dklZdeifdYZdS((serrors CarrierErrorcBstZRS(N(s__name__s __module__(((s2build/bdist.linux-i686/egg/pysnmp/carrier/error.pys CarrierErrorsN(spysnmpserrors PySnmpErrors CarrierError(s CarrierErrorserror((s2build/bdist.linux-i686/egg/pysnmp/carrier/error.pys?s PKAq>ýpysnmp/carrier/base.pyc; Q8Mc@s=dZdklZdfdYZdfdYZdS(s8Abstract I/O dispatcher. Defines standard dispatcher API(serrors TimerCallablecBs#tZdZdZdZRS(NcCs||_||_d|_dS(Ni(scbFunsselfs_TimerCallable__cbFuns callIntervals_TimerCallable__callIntervals_TimerCallable__nextCall(sselfscbFuns callInterval((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pys__init__s  cCs5|i|jo!|i|||i|_ndS(N(sselfs_TimerCallable__nextCallstimeNows_TimerCallable__cbFuns_TimerCallable__callInterval(sselfstimeNow((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pys__call__ s cCst|i|SdS(N(scmpsselfs_TimerCallable__cbFunscbFun(sselfscbFun((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pys__cmp__s(s__name__s __module__s__init__s__call__s__cmp__(((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pys TimerCallables  sAbstractTransportDispatchercBstZdZdZdZdZddZedZdZ d Z d Z d Z d Z d ZdZdZddZdZRS(NcCs(h|_h|_t|_g|_dS(N(sselfs(_AbstractTransportDispatcher__transportss"_AbstractTransportDispatcher__jobssNones'_AbstractTransportDispatcher__recvCbFuns,_AbstractTransportDispatcher__timerCallables(sself((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pys__init__s   cCsxK|iiD]$\}}||jo |}PqqWtid|f|i t jotidn|i ||||dS(NsUnregistered transport %ss9Receive callback not registered -- loosing incoming event( sselfs(_AbstractTransportDispatcher__transportssitemssnames transportsincomingTransportstransportDomainserrors CarrierErrors'_AbstractTransportDispatcher__recvCbFunsNonestransportAddresssincomingMessage(sselfsincomingTransportstransportAddresssincomingMessagesnamestransportDomains transport((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pys_cbFuns   cCs7|itj otid|in||_dS(Ns'Receive callback already registered: %s(sselfs'_AbstractTransportDispatcher__recvCbFunsNoneserrors CarrierErrors recvCbFun(sselfs recvCbFun((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pysregisterRecvCbFun,scCs t|_dS(N(sNonesselfs'_AbstractTransportDispatcher__recvCbFun(sself((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pysunregisterRecvCbFun3sf1.0cCs|iit||dS(N(sselfs,_AbstractTransportDispatcher__timerCallablessappends TimerCallables timerCbFuns tickInterval(sselfs timerCbFuns tickInterval((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pysregisterTimerCbFun6scCs.|tjo g|_n|ii|dS(N(s timerCbFunsNonesselfs,_AbstractTransportDispatcher__timerCallablessremove(sselfs timerCbFun((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pysunregisterTimerCbFun9s  cCsK||ijotid|fn|i|i||i||i|d|i|<|i|djo|i|=ndS(Nii(sselfs"_AbstractTransportDispatcher__jobssjobId(sselfsjobId((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pys jobFinishediscCs|iodSndSdS(Nii(sselfs"_AbstractTransportDispatcher__jobs(sself((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pysjobsArePendingns f0.0cCstiddS(NsMethod not implemented(serrors CarrierError(sselfstimeout((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pys runDispatchertscCsPx5|iiD]$}|i|i|i|qW|i|idS(N(sselfs(_AbstractTransportDispatcher__transportsskeysstDomainscloseTransportsunregisterTransportsunregisterRecvCbFunsunregisterTimerCbFun(sselfstDomain((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pyscloseDispatcherws  (s__name__s __module__s__init__s_cbFunsregisterRecvCbFunsunregisterRecvCbFunsregisterTimerCbFunsNonesunregisterTimerCbFunsregisterTransportsunregisterTransports getTransports sendMessageshandleTimerTicks jobStarteds jobFinishedsjobsArePendings runDispatcherscloseDispatcher(((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pysAbstractTransportDispatchers               N(s__doc__spysnmp.carrierserrors TimerCallablesAbstractTransportDispatcher(s TimerCallablesAbstractTransportDispatcherserror((s1build/bdist.linux-i686/egg/pysnmp/carrier/base.pys?s PKo2ʴFFpysnmp/carrier/error.pyfrom pysnmp import error class CarrierError(error.PySnmpError): pass PKAq>;epysnmp/carrier/__init__.pyc; nBc@sdS(N((((s5build/bdist.linux-i686/egg/pysnmp/carrier/__init__.pys?sPK4>+>//pysnmp/carrier/base.py"""Abstract I/O dispatcher. Defines standard dispatcher API""" from pysnmp.carrier import error class TimerCallable: def __init__(self, cbFun, callInterval): self.__cbFun = cbFun self.__callInterval = callInterval self.__nextCall = 0 def __call__(self, timeNow): if self.__nextCall <= timeNow: self.__cbFun(timeNow) self.__nextCall = timeNow + self.__callInterval def __cmp__(self, cbFun): return cmp(self.__cbFun, cbFun) class AbstractTransportDispatcher: def __init__(self): self.__transports = {} self.__jobs = {} self.__recvCbFun = None self.__timerCallables = [] def _cbFun(self, incomingTransport, transportAddress, incomingMessage): for name, transport in self.__transports.items(): if transport is incomingTransport: transportDomain = name break else: raise error.CarrierError( 'Unregistered transport %s' % (incomingTransport,) ) if self.__recvCbFun is None: raise error.CarrierError( 'Receive callback not registered -- loosing incoming event' ) self.__recvCbFun( self, transportDomain, transportAddress, incomingMessage ) # Dispatcher API def registerRecvCbFun(self, recvCbFun): if self.__recvCbFun is not None: raise error.CarrierError( 'Receive callback already registered: %s' % self.__recvCbFun ) self.__recvCbFun = recvCbFun def unregisterRecvCbFun(self): self.__recvCbFun = None def registerTimerCbFun(self, timerCbFun, tickInterval=1.0): self.__timerCallables.append(TimerCallable(timerCbFun, tickInterval)) def unregisterTimerCbFun(self, timerCbFun=None): if timerCbFun is None: self.__timerCallables = [] else: self.__timerCallables.remove(timerCbFun) def registerTransport(self, tDomain, transport): if tDomain in self.__transports: raise error.CarrierError( 'Transport %s already registered' % (tDomain,) ) transport.registerCbFun(self._cbFun) self.__transports[tDomain] = transport def unregisterTransport(self, tDomain): if tDomain not in self.__transports: raise error.CarrierError( 'Transport %s not registered' % (tDomain,) ) self.__transports[tDomain].unregisterCbFun() del self.__transports[tDomain] def getTransport(self, transportDomain): if transportDomain in self.__transports: return self.__transports[transportDomain] def sendMessage( self, outgoingMessage, transportDomain, transportAddress ): if transportDomain in self.__transports: self.__transports[transportDomain].sendMessage( outgoingMessage, transportAddress ) else: raise error.CarrierError( 'No suitable transport domain for %s' % (transportDomain,) ) def handleTimerTick(self, timeNow): for timerCallable in self.__timerCallables: timerCallable(timeNow) def jobStarted(self, jobId): if jobId in self.__jobs: self.__jobs[jobId] = self.__jobs[jobId] + 1 else: self.__jobs[jobId] = 1 def jobFinished(self, jobId): self.__jobs[jobId] = self.__jobs[jobId] - 1 if self.__jobs[jobId] == 0: del self.__jobs[jobId] def jobsArePending(self): if self.__jobs: return 1 else: return 0 def runDispatcher(self, timeout=0.0): raise error.CarrierError('Method not implemented') def closeDispatcher(self): for tDomain in self.__transports.keys(): self.__transports[tDomain].closeTransport() self.unregisterTransport(tDomain) self.unregisterRecvCbFun() self.unregisterTimerCbFun() PKl1#pysnmp/carrier/asynsock/__init__.pyPKAq>'l pysnmp/carrier/asynsock/base.pyc; Um8Mc@sKdZdkZdkZdkZdklZdeifdYZdS(s0Defines standard API to asyncore-based transportN(serrorsAbstractSocketTransportcBstZeZZdZdZeedZedZedZ edZ edZ dZ dZ d Zd Zd Zd ZRS( NicCs|tjo|itjotid|iin|itjotid|iinyt i |i|i}Wqt ij o}tid|qXn|tjo h}nt i i|||dS(NsAddress family %s not supportedsSocket type %s not supportedssocket() failed: %s(ssocksNonesselfs sockFamilyserrors CarrierErrors __class__s__name__ssockTypessocketswhyssockMapsasyncores dispatchers__init__(sselfssockssockMapswhy((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pys__init__ s   cCs|i|dS(N(sselfs add_channelssockMap(sselfssockMap((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pysregisterSocketscCs|i|dS(N(sselfs del_channelssockMap(sselfssockMap((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pysunregisterSocket!scCstiddS(NsMethod not implemented(serrors CarrierError(sselfsiface((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pysopenClientMode&scCstiddS(NsMethod not implemented(serrors CarrierError(sselfsiface((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pysopenServerMode)scCstiddS(NsMethod not implemented(serrors CarrierError(sselfsoutgoingMessagestransportAddress((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pys sendMessage,scCs ||_dS(N(scbFunsselfs_cbFun(sselfscbFun((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pys registerCbFun/scCs t|_dS(N(sNonesselfs_cbFun(sself((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pysunregisterCbFun2scCs|i|idS(N(sselfsunregisterCbFunsclose(sself((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pyscloseTransport5s cCstiddS(NsTransport unexpectedly closed(serrors CarrierError(sself((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pys handle_close:scCsdS(N((sself((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pys handle_error=s(s__name__s __module__sNones sockFamilyssockTypes retryCounts retryIntervals__init__sregisterSocketsunregisterSocketsopenClientModesopenServerModes sendMessages registerCbFunsunregisterCbFunscloseTransports handle_closes handle_error(((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pysAbstractSocketTransports           (s__doc__ssocketssyssasyncorespysnmp.carrierserrors dispatchersAbstractSocketTransport(ssyssAbstractSocketTransportsasyncoressocketserror((s:build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/base.pys?s  PKAq>x3$pysnmp/carrier/asynsock/__init__.pyc; ƔAc@sdS(N((((s>build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/__init__.pys?sPK4>99pysnmp/carrier/asynsock/base.py"""Defines standard API to asyncore-based transport""" import socket, sys import asyncore from pysnmp.carrier import error class AbstractSocketTransport(asyncore.dispatcher): sockFamily = sockType = None retryCount = 0; retryInterval = 0 def __init__(self, sock=None, sockMap=None): if sock is None: if self.sockFamily is None: raise error.CarrierError( 'Address family %s not supported' % self.__class__.__name__ ) if self.sockType is None: raise error.CarrierError( 'Socket type %s not supported' % self.__class__.__name__ ) try: sock = socket.socket(self.sockFamily, self.sockType) except socket.error, why: raise error.CarrierError('socket() failed: %s' % why) if sockMap is None: # The socket map is managed by the AsynsockDispatcher on # which this transport is registered, so this is a fake # socket map to avoid registering with deafult asyncore map. sockMap = {} asyncore.dispatcher.__init__(self, sock, sockMap) def registerSocket(self, sockMap=None): self.add_channel(sockMap) def unregisterSocket(self, sockMap=None): self.del_channel(sockMap) # Public API def openClientMode(self, iface=None): raise error.CarrierError('Method not implemented') def openServerMode(self, iface=None): raise error.CarrierError('Method not implemented') def sendMessage(self, outgoingMessage, transportAddress): raise error.CarrierError('Method not implemented') def registerCbFun(self, cbFun): self._cbFun = cbFun def unregisterCbFun(self): self._cbFun = None def closeTransport(self): self.unregisterCbFun() self.close() # asyncore API def handle_close(self): raise error.CarrierError( 'Transport unexpectedly closed' ) def handle_error(self): raise PK4>3?o#pysnmp/carrier/asynsock/dispatch.pyfrom time import time from select import select from asyncore import socket_map from pysnmp.carrier.base import AbstractTransportDispatcher from asyncore import poll class AsynsockDispatcher(AbstractTransportDispatcher): """Implements I/O over asynchronous sockets""" def __init__(self): self.__sockMap = {} # use own map for MT safety self.timeout = 0.5 AbstractTransportDispatcher.__init__(self) def getSocketMap(self): return self.__sockMap def setSocketMap(self, sockMap=socket_map): self.__sockMap = sockMap def registerTransport(self, tDomain, t): AbstractTransportDispatcher.registerTransport(self, tDomain, t) t.registerSocket(self.__sockMap) def unregisterTransport(self, tDomain): self.getTransport(tDomain).unregisterSocket(self.__sockMap) AbstractTransportDispatcher.unregisterTransport(self, tDomain) def transportsAreWorking(self): for transport in self.__sockMap.values(): if transport.writable(): return 1 return 0 def runDispatcher(self, timeout=0.0): while self.jobsArePending() or self.transportsAreWorking(): poll(timeout and timeout or self.timeout, self.__sockMap) self.handleTimerTick(time()) PKAq>cL $pysnmp/carrier/asynsock/dispatch.pyc; 0m8Mc@s[dklZdklZdklZdklZdklZdefdYZdS((stime(sselect(s socket_map(sAbstractTransportDispatcher(spollsAsynsockDispatchercBsStZdZdZdZedZdZdZdZ ddZ RS( s(Implements I/O over asynchronous socketscCs#h|_d|_ti|dS(Nf0.5(sselfs_AsynsockDispatcher__sockMapstimeoutsAbstractTransportDispatchers__init__(sself((s>build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dispatch.pys__init__ s  cCs |iSdS(N(sselfs_AsynsockDispatcher__sockMap(sself((s>build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dispatch.pys getSocketMapscCs ||_dS(N(ssockMapsselfs_AsynsockDispatcher__sockMap(sselfssockMap((s>build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dispatch.pys setSocketMapscCs'ti||||i|idS(N(sAbstractTransportDispatchersregisterTransportsselfstDomainstsregisterSockets_AsynsockDispatcher__sockMap(sselfstDomainst((s>build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dispatch.pysregisterTransportscCs-|i|i|iti||dS(N(sselfs getTransportstDomainsunregisterSockets_AsynsockDispatcher__sockMapsAbstractTransportDispatchersunregisterTransport(sselfstDomain((s>build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dispatch.pysunregisterTransportscCs7x,|iiD]}|iodSqqWdSdS(Nii(sselfs_AsynsockDispatcher__sockMapsvaluess transportswritable(sselfs transport((s>build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dispatch.pystransportsAreWorkings   f0.0cCsWxP|ip |io5t|o|p|i|i|itqWdS(N(sselfsjobsArePendingstransportsAreWorkingspollstimeouts_AsynsockDispatcher__sockMapshandleTimerTickstime(sselfstimeout((s>build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dispatch.pys runDispatchers!( s__name__s __module__s__doc__s__init__s getSocketMaps socket_maps setSocketMapsregisterTransportsunregisterTransportstransportsAreWorkings runDispatcher(((s>build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dispatch.pysAsynsockDispatchers       N(stimesselectsasyncores socket_mapspysnmp.carrier.basesAbstractTransportDispatcherspollsAsynsockDispatcher(sselectstimesAsynsockDispatcherspollsAbstractTransportDispatchers socket_map((s>build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dispatch.pys?s     PK-< ii%pysnmp/carrier/asynsock/dgram/udp6.py"""Implements asyncore-based UDP6 transport domain""" try: from socket import AF_INET6 except: AF_INET6 = None from pysnmp.carrier.asynsock.dgram.base import DgramSocketTransport domainName = snmpUDP6Domain = (1, 3, 6, 1, 2, 1, 100, 1, 2) class Udp6SocketTransport(DgramSocketTransport): sockFamily = AF_INET6 Udp6Transport = Udp6SocketTransport PK,:V,,>>%pysnmp/carrier/asynsock/dgram/unix.py"""Implements asyncore-based UNIX transport domain""" from os import remove from socket import AF_UNIX from pysnmp.carrier.asynsock.dgram.base import DgramSocketTransport domainName = snmpLocalDomain = (1, 3, 6, 1, 2, 1, 100, 1, 13) class UnixSocketTransport(DgramSocketTransport): sockFamily = AF_UNIX def closeTransport(self): DgramSocketTransport.closeTransport(self) try: remove(self._iface) except: pass UnixTransport = UnixSocketTransport # Compatibility stub UnixDgramSocketTransport = UnixSocketTransport PKl1)pysnmp/carrier/asynsock/dgram/__init__.pyPKAq>1&pysnmp/carrier/asynsock/dgram/base.pyc; >8Mc@sdZdkZdkZdklZdklZdklZhei d<ei d<ei d<ei d<ei d<eid/qq%pysnmp/carrier/asynsock/dgram/udp.pyc; Jc@s_dZdklZdklZdddddddfZZdefdYZeZdS( s.Implements asyncore-based UDP transport domain(sAF_INET(sDgramSocketTransportiiisUdpSocketTransportcBstZeZRS(N(s__name__s __module__sAF_INETs sockFamily(((s?build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dgram/udp.pysUdpSocketTransportsN( s__doc__ssocketsAF_INETs"pysnmp.carrier.asynsock.dgram.basesDgramSocketTransports domainNames snmpUDPDomainsUdpSocketTransports UdpTransport(s UdpTransportsDgramSocketTransports domainNamesAF_INETsUdpSocketTransports snmpUDPDomain((s?build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dgram/udp.pys?s   PKAq>R&pysnmp/carrier/asynsock/dgram/udp6.pyc; NKc @sydZydklZWn eZnXdklZdddddddddf ZZdefd YZeZ d S( s/Implements asyncore-based UDP6 transport domain(sAF_INET6(sDgramSocketTransportiiiiidsUdp6SocketTransportcBstZeZRS(N(s__name__s __module__sAF_INET6s sockFamily(((s@build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dgram/udp6.pysUdp6SocketTransport sN( s__doc__ssocketsAF_INET6sNones"pysnmp.carrier.asynsock.dgram.basesDgramSocketTransports domainNamessnmpUDP6DomainsUdp6SocketTransports Udp6Transport(sAF_INET6sDgramSocketTransportssnmpUDP6Domains Udp6Transports domainNamesUdp6SocketTransport((s@build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dgram/udp6.pys?s  %PKAq>G0!*pysnmp/carrier/asynsock/dgram/__init__.pyc; ƔAc@sdS(N((((sDbuild/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dgram/__init__.pys?sPKņ4>r %pysnmp/carrier/asynsock/dgram/base.py"""Implements asyncore-based generic DGRAM transport""" import socket, errno from pysnmp.carrier.asynsock.base import AbstractSocketTransport from pysnmp.carrier import error from pysnmp import debug sockErrors = { # Ignore these socket errors errno.ESHUTDOWN: 1, errno.ENOTCONN: 1, errno.ECONNRESET: 0, errno.ECONNREFUSED: 0, errno.EAGAIN: 0, errno.EWOULDBLOCK: 0 } try: # bad FD may happen upon FD closure on n-1 select() event sockErrors[errno.EBADFD] = 1 except AttributeError: # Windows sockets do not have EBADFD pass class DgramSocketTransport(AbstractSocketTransport): sockType = socket.SOCK_DGRAM retryCount = 3; retryInterval = 1 def __init__(self, sock=None, sockMap=None): self.__outQueue = [] AbstractSocketTransport.__init__(self, sock, sockMap) def openClientMode(self, iface=None): if iface is not None: try: self.socket.bind(iface) except socket.error, why: raise error.CarrierError('bind() failed: %s' % (why,)) return self def openServerMode(self, iface): try: self.socket.bind(iface) except socket.error, why: raise error.CarrierError('bind() failed: %s' % (why,)) self._iface = iface return self def sendMessage(self, outgoingMessage, transportAddress): self.__outQueue.append( (outgoingMessage, transportAddress) ) # asyncore API def handle_connect(self): pass def writable(self): return self.__outQueue def handle_write(self): outgoingMessage, transportAddress = self.__outQueue.pop() debug.logger & debug.flagIO and debug.logger('handle_write: transportAddress %s outgoingMessage %s' % (transportAddress, repr(outgoingMessage))) try: self.socket.sendto(outgoingMessage, transportAddress) except socket.error, why: if why[0] in sockErrors: debug.logger & debug.flagIO and debug.logger('handle_write: ignoring socket error %s' % (why,)) else: raise socket.error, why def readable(self): return 1 def handle_read(self): try: incomingMessage, transportAddress = self.socket.recvfrom(65535) debug.logger & debug.flagIO and debug.logger('handle_read: transportAddress %s incomingMessage %s' % (transportAddress, repr(incomingMessage))) if not incomingMessage: self.handle_close() return else: self._cbFun(self, transportAddress, incomingMessage) return except socket.error, why: if why[0] in sockErrors: debug.logger & debug.flagIO and debug.logger('handle_read: known socket error %s' % (why,)) sockErrors[why[0]] and self.handle_close() return else: raise socket.error, why def handle_close(self): pass # no datagram connection PKAq> iJJ&pysnmp/carrier/asynsock/dgram/unix.pyc; ԍJc @sxdZdklZdklZdklZddddddddd f ZZd efd YZ e Z e Z d S( s/Implements asyncore-based UNIX transport domain(sremove(sAF_UNIX(sDgramSocketTransportiiiiidi sUnixSocketTransportcBstZeZdZRS(NcCs,ti|yt|iWnnXdS(N(sDgramSocketTransportscloseTransportsselfsremoves_iface(sself((s@build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dgram/unix.pyscloseTransport s  (s__name__s __module__sAF_UNIXs sockFamilyscloseTransport(((s@build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dgram/unix.pysUnixSocketTransportsN( s__doc__sossremovessocketsAF_UNIXs"pysnmp.carrier.asynsock.dgram.basesDgramSocketTransports domainNamessnmpLocalDomainsUnixSocketTransports UnixTransportsUnixDgramSocketTransport(sAF_UNIXsUnixSocketTransportsDgramSocketTransports domainNamesremoves UnixTransportssnmpLocalDomainsUnixDgramSocketTransport((s@build/bdist.linux-i686/egg/pysnmp/carrier/asynsock/dgram/unix.pys?s   % PK:"pysnmp/carrier/twisted/__init__.pyPKAq>hhpysnmp/carrier/twisted/base.pyc; LsJc@sdfdYZdS(sAbstractTwistedTransportcBs2tZdZdZdZdZdZRS(s9Base Twisted Transport, to be used with TwistedDispatchercCs g|_dS(N(sselfs_writeQ(sself((s9build/bdist.linux-i686/egg/pysnmp/carrier/twisted/base.pys__init__scCs ||_dS(N(scbFunsselfs_cbFun(sselfscbFun((s9build/bdist.linux-i686/egg/pysnmp/carrier/twisted/base.pys registerCbFunscCs t|_dS(N(sNonesselfs_cbFun(sself((s9build/bdist.linux-i686/egg/pysnmp/carrier/twisted/base.pysunregisterCbFunscCs|idS(N(sselfsunregisterCbFun(sself((s9build/bdist.linux-i686/egg/pysnmp/carrier/twisted/base.pyscloseTransports(s__name__s __module__s__doc__s__init__s registerCbFunsunregisterCbFunscloseTransport(((s9build/bdist.linux-i686/egg/pysnmp/carrier/twisted/base.pysAbstractTwistedTransport s    N(sAbstractTwistedTransport(sAbstractTwistedTransport((s9build/bdist.linux-i686/egg/pysnmp/carrier/twisted/base.pys? sPKAq>s#pysnmp/carrier/twisted/__init__.pyc; LsJc@sdS(N((((s=build/bdist.linux-i686/egg/pysnmp/carrier/twisted/__init__.pys?sPK: Dpysnmp/carrier/twisted/base.py# # Copyright (C) 2008 Truelite Srl # Author: Filippo Giunchedi # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation # # Description: twisted DatagramProtocol UDP transport # class AbstractTwistedTransport: """Base Twisted Transport, to be used with TwistedDispatcher""" def __init__(self): self._writeQ = [] # AbstractTwistedTransport API def registerCbFun(self, cbFun): self._cbFun = cbFun def unregisterCbFun(self): self._cbFun = None def closeTransport(self): self.unregisterCbFun() PKU4>#//"pysnmp/carrier/twisted/dispatch.py# # Copyright (C) 2008 Truelite Srl # Author: Filippo Giunchedi # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 # as published by the Free Software Foundation # # Description: Transport dispatcher based on twisted.internet.reactor # from time import time from twisted.internet import reactor, task from pysnmp.carrier.base import AbstractTransportDispatcher from pysnmp.carrier import error class TwistedDispatcher(AbstractTransportDispatcher): """TransportDispatcher based on twisted.internet.reactor""" def __init__(self, *args, **kwargs): AbstractTransportDispatcher.__init__(self) self.__transportCount = 0 if 'timeout' in kwargs: self.timeout = kwargs['timeout'] else: self.timeout = 1.0 self.loopingcall = task.LoopingCall(self.handleTimeout) def handleTimeout(self): self.handleTimerTick(time()) def runDispatcher(self, timeout=0.0): if not reactor.running: try: reactor.run() except Exception, why: raise error.CarrierError(why) # jobstarted/jobfinished might be okay as-is def registerTransport(self, tDomain, transport): if not self.loopingcall.running and self.timeout > 0: self.loopingcall.start(self.timeout, now = False) AbstractTransportDispatcher.registerTransport( self, tDomain, transport ) self.__transportCount = self.__transportCount + 1 def unregisterTransport(self, tDomain): t = AbstractTransportDispatcher.getTransport(self, tDomain) if t is not None: AbstractTransportDispatcher.unregisterTransport(self, tDomain) t.closeTransport() self.__transportCount = self.__transportCount - 1 # The last transport has been removed, stop the timeout if self.__transportCount > 0 and self.loopingcall.running: self.loopingcall.stop() PKAq>: #pysnmp/carrier/twisted/dispatch.pyc; sP8Mc@sTdklZdklZlZdklZdklZdefdYZdS((stime(sreactorstask(sAbstractTransportDispatcher(serrorsTwistedDispatchercBs>tZdZdZdZddZdZdZRS(s5TransportDispatcher based on twisted.internet.reactorcOsVti|d|_d|jo|d|_n d|_ti|i|_ dS(Nistimeoutf1.0( sAbstractTransportDispatchers__init__sselfs"_TwistedDispatcher__transportCountskwargsstimeoutstasks LoopingCalls handleTimeouts loopingcall(sselfsargsskwargs((s=build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dispatch.pys__init__s     cCs|itdS(N(sselfshandleTimerTickstime(sself((s=build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dispatch.pys handleTimeoutsf0.0cCsHti o9ytiWqDtj o}ti|qDXndS(N(sreactorsrunningsruns Exceptionswhyserrors CarrierError(sselfstimeoutswhy((s=build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dispatch.pys runDispatchers  cCsb|ii o |idjo|ii|idtnti||||i d|_ dS(Nisnowi( sselfs loopingcallsrunningstimeoutsstartsFalsesAbstractTransportDispatchersregisterTransportstDomains transports"_TwistedDispatcher__transportCount(sselfstDomains transport((s=build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dispatch.pysregisterTransport'scCsti||}|tj o.ti|||i|id|_n|idjo |i i o|i i ndS(Nii( sAbstractTransportDispatchers getTransportsselfstDomainstsNonesunregisterTransportscloseTransports"_TwistedDispatcher__transportCounts loopingcallsrunningsstop(sselfstDomainst((s=build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dispatch.pysunregisterTransport/s  (s__name__s __module__s__doc__s__init__s handleTimeouts runDispatchersregisterTransportsunregisterTransport(((s=build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dispatch.pysTwistedDispatchers   N( stimestwisted.internetsreactorstaskspysnmp.carrier.basesAbstractTransportDispatcherspysnmp.carrierserrorsTwistedDispatcher(stasksreactorstimesTwistedDispatcherserrorsAbstractTransportDispatcher((s=build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dispatch.pys? s   PK: ;;$pysnmp/carrier/twisted/dgram/unix.py"""Implements twisted-based UNIX domain socket transport""" from twisted.internet import reactor from pysnmp.carrier.twisted.dgram.base import DgramTwistedTransport from pysnmp.carrier import error domainName = snmpLocalDomain = (1, 3, 6, 1, 2, 1, 100, 1, 13) class UnixTwistedTransport(DgramTwistedTransport): # AbstractTwistedTransport API def openClientMode(self, iface=''): try: self._lport = reactor.connectUNIXDatagram(iface, self) except Exception, why: raise error.CarrierError(why) return self def openServerMode(self, iface=None): try: self._lport = reactor.listenUNIXDatagram(iface, self) except Exception, why: raise error.CarrierError(why) return self UnixTransport = UnixTwistedTransportPK:(pysnmp/carrier/twisted/dgram/__init__.pyPKAq>k %pysnmp/carrier/twisted/dgram/base.pyc; LsJc@sqdZdklZdklZdklZdklZdkl Z dk l Z deefdYZ d S( s0Implements twisted-based generic DGRAM transport(stime(sDatagramProtocol(sreactor(sAbstractTwistedTransport(serror(sdebugsDgramTwistedTransportcBs2tZdZdZdZdZdZRS(sBBase Twisted datagram Transport, to be used with TwistedDispatchercCsC|itjotidntid|i|||dS(NsUnable to call cbFuni( sselfs_cbFunsNoneserrors CarrierErrorsreactors callLatersaddresssdatagram(sselfsdatagramsaddress((s?build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/base.pysdatagramReceivedscCstiti@o tidx|io|iid\}}titi@otid|t|fy|i i ||Wq!t j o}t id|fq!Xq!WdS(NsstartProtocol: invokedis5startProtocol: transportAddress %s outgoingMessage %ssTwisted exception: %s(sdebugsloggersflagIOsselfs_writeQspopsoutgoingMessagestransportAddresssreprs transportswrites Exceptionswhyserrors CarrierError(sselfstransportAddresssoutgoingMessageswhy((s?build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/base.pys startProtocols .cCs,titi@o tid|idS(NsstopProtocol: invoked(sdebugsloggersflagIOsselfscloseTransport(sself((s?build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/base.pys stopProtocol scCstiti@o7tid|itjodpd|t|f|itjo|i i ||fnFy|ii ||Wn+t j o}tid|fnXdS(Ns8startProtocol: %s transportAddress %s outgoingMessage %ssqueuingssendingsTwisted exception: %s(sdebugsloggersflagIOsselfs transportsNonestransportAddresssreprsoutgoingMessages_writeQsappendswrites Exceptionswhyserrors CarrierError(sselfsoutgoingMessagestransportAddressswhy((s?build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/base.pys sendMessage$sH(s__name__s __module__s__doc__sdatagramReceiveds startProtocols stopProtocols sendMessage(((s?build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/base.pysDgramTwistedTransport s   N( s__doc__stimestwisted.internet.protocolsDatagramProtocolstwisted.internetsreactorspysnmp.carrier.twisted.basesAbstractTwistedTransportspysnmp.carrierserrorspysnmpsdebugsDgramTwistedTransport(sreactorsDgramTwistedTransportstimesDatagramProtocolserrorsdebugsAbstractTwistedTransport((s?build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/base.pys?s      PK:E#pysnmp/carrier/twisted/dgram/udp.py"""Implements twisted-based UDP transport""" from twisted.internet import reactor from pysnmp.carrier.twisted.dgram.base import DgramTwistedTransport from pysnmp.carrier import error domainName = snmpUDPDomain = (1, 3, 6, 1, 6, 1, 1) class UdpTwistedTransport(DgramTwistedTransport): # AbstractTwistedTransport API def openClientMode(self, iface=''): try: self._lport = reactor.listenUDP(0, self, iface) except Exception, why: raise error.CarrierError(why) return self def openServerMode(self, iface=None): try: self._lport = reactor.listenUDP(iface[1], self, iface[0]) except Exception, why: raise error.CarrierError(why) return self UdpTransport = UdpTwistedTransportPKAq>$pysnmp/carrier/twisted/dgram/udp.pyc; LsJc@sldZdklZdklZdklZdddddddfZZdefdYZ e Z d S( s&Implements twisted-based UDP transport(sreactor(sDgramTwistedTransport(serroriiisUdpTwistedTransportcBs tZddZedZRS(NscCsKytid|||_Wn$tj o}ti|nX|SdS(Ni( sreactors listenUDPsselfsifaces_lports Exceptionswhyserrors CarrierError(sselfsifaceswhy((s>build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/udp.pysopenClientMode s cCsSy$ti|d||d|_Wn$tj o}ti|nX|SdS(Nii( sreactors listenUDPsifacesselfs_lports Exceptionswhyserrors CarrierError(sselfsifaceswhy((s>build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/udp.pysopenServerModes $(s__name__s __module__sopenClientModesNonesopenServerMode(((s>build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/udp.pysUdpTwistedTransports N( s__doc__stwisted.internetsreactors!pysnmp.carrier.twisted.dgram.basesDgramTwistedTransportspysnmp.carrierserrors domainNames snmpUDPDomainsUdpTwistedTransports UdpTransport(sUdpTwistedTransports UdpTransportsreactors domainNamesDgramTwistedTransportserrors snmpUDPDomain((s>build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/udp.pys?s    PKAq>Aٓ)pysnmp/carrier/twisted/dgram/__init__.pyc; LsJc@sdS(N((((sCbuild/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/__init__.pys?sPK: VV$pysnmp/carrier/twisted/dgram/base.py"""Implements twisted-based generic DGRAM transport""" from time import time from twisted.internet.protocol import DatagramProtocol from twisted.internet import reactor from pysnmp.carrier.twisted.base import AbstractTwistedTransport from pysnmp.carrier import error from pysnmp import debug class DgramTwistedTransport(DatagramProtocol, AbstractTwistedTransport): """Base Twisted datagram Transport, to be used with TwistedDispatcher""" # Twisted Datagram API def datagramReceived(self, datagram, address): if self._cbFun is None: raise error.CarrierError('Unable to call cbFun') else: # Callback fun is called through callLater() in attempt # to make Twisted timed calls work under high load. reactor.callLater(0, self._cbFun, self, address, datagram) def startProtocol(self): debug.logger & debug.flagIO and debug.logger('startProtocol: invoked') while self._writeQ: outgoingMessage, transportAddress = self._writeQ.pop(0) debug.logger & debug.flagIO and debug.logger('startProtocol: transportAddress %s outgoingMessage %s' % (transportAddress, repr(outgoingMessage))) try: self.transport.write(outgoingMessage, transportAddress) except Exception, why: raise error.CarrierError('Twisted exception: %s' % (why,)) def stopProtocol(self): debug.logger & debug.flagIO and debug.logger('stopProtocol: invoked') self.closeTransport() def sendMessage(self, outgoingMessage, transportAddress): debug.logger & debug.flagIO and debug.logger('startProtocol: %s transportAddress %s outgoingMessage %s' % ((self.transport is None and "queuing" or "sending"), transportAddress, repr(outgoingMessage))) if self.transport is None: self._writeQ.append((outgoingMessage, transportAddress)) else: try: self.transport.write(outgoingMessage, transportAddress) except Exception, why: raise error.CarrierError('Twisted exception: %s' % (why,)) PKAq>x%pysnmp/carrier/twisted/dgram/unix.pyc; LsJc @srdZdklZdklZdklZddddddddd f ZZd efd YZ e Z d S( s5Implements twisted-based UNIX domain socket transport(sreactor(sDgramTwistedTransport(serroriiiiidi sUnixTwistedTransportcBs tZddZedZRS(NscCsHyti|||_Wn$tj o}ti|nX|SdS(N( sreactorsconnectUNIXDatagramsifacesselfs_lports Exceptionswhyserrors CarrierError(sselfsifaceswhy((s?build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/unix.pysopenClientMode s cCsHyti|||_Wn$tj o}ti|nX|SdS(N( sreactorslistenUNIXDatagramsifacesselfs_lports Exceptionswhyserrors CarrierError(sselfsifaceswhy((s?build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/unix.pysopenServerModes (s__name__s __module__sopenClientModesNonesopenServerMode(((s?build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/unix.pysUnixTwistedTransports N( s__doc__stwisted.internetsreactors!pysnmp.carrier.twisted.dgram.basesDgramTwistedTransportspysnmp.carrierserrors domainNamessnmpLocalDomainsUnixTwistedTransports UnixTransport(sreactors domainNamesDgramTwistedTransportserrors UnixTransportssnmpLocalDomainsUnixTwistedTransport((s?build/bdist.linux-i686/egg/pysnmp/carrier/twisted/dgram/unix.pys?s    %PK9j2pysnmp/entity/__init__.pyPKAq>ϙPpysnmp/entity/engine.pyc; DLc@sdklZdklZlZdklZdklZl Z dk l Z dk l Z lZdklZdfdYZd S( (sMsgAndPduDispatcher(sSnmpV1MessageProcessingModelsSnmpV2cMessageProcessingModel(sSnmpV3MessageProcessingModel(sSnmpV1SecurityModelsSnmpV2cSecurityModel(sSnmpUSMSecurityModel(srfc3415svoid(serrors SnmpEnginecBs>tZededZdZdZdZdZRS(NicCs|tjot|_n ||_htit<tit<tit<|_ht i t <t i t <t i t <|_ htit<tit<|_t|_|iitjotidn|iiiidd\}|ii||_|iiiidd\}|id|_|tj o7|iiiidd\}|ii||_ndS(Ns&MIB instrumentation does not yet exists__SNMP-FRAMEWORK-MIBssnmpEngineMaxMessageSizessnmpEngineBootsis snmpEngineID(s msgAndPduDspsNonesMsgAndPduDispatchersselfsSnmpV1MessageProcessingModelsmessageProcessingModelIDsSnmpV2cMessageProcessingModelsSnmpV3MessageProcessingModelsmessageProcessingSubsystemssSnmpV1SecurityModelssecurityModelIDsSnmpV2cSecurityModelsSnmpUSMSecurityModelssecurityModelssvoids accessModelIDsrfc3415saccessControlModelstransportDispatchersmibInstrumControllerserrors PySnmpErrors mibBuilders importSymbolsssnmpEngineMaxMessageSizessyntaxsclonesmaxMessageSizessnmpEngineBootss snmpEngineIDsorigSnmpEngineID(sselfs snmpEngineIDsmaxMessageSizes msgAndPduDspsorigSnmpEngineIDssnmpEngineMaxMessageSizessnmpEngineBoots((s2build/bdist.linux-i686/egg/pysnmp/entity/engine.pys__init__ s   66!  cCs|ii||||dS(N(sselfs msgAndPduDspsreceiveMessagestransportDomainstransportAddressswholeMsg(sselfstransportDispatcherstransportDomainstransportAddressswholeMsg((s2build/bdist.linux-i686/egg/pysnmp/entity/engine.pys__receiveMessageCbFun5scCsk|ii||x'|iiD]}|i||q#Wx'|iiD]}|i||qMWdS(N( sselfs msgAndPduDspsreceiveTimerTickstimeNowsmessageProcessingSubsystemssvaluess mpHandlerssecurityModelss smHandler(sselfstimeNows mpHandlers smHandler((s2build/bdist.linux-i686/egg/pysnmp/entity/engine.pys__receiveTimerTickCbFun@scCsP|itj otidn|i|i|i|i||_dS(Ns'Transport dispatcher already registered( sselfstransportDispatchersNoneserrors PySnmpErrorsregisterRecvCbFuns _SnmpEngine__receiveMessageCbFunsregisterTimerCbFuns"_SnmpEngine__receiveTimerTickCbFun(sselfstransportDispatcher((s2build/bdist.linux-i686/egg/pysnmp/entity/engine.pysregisterTransportDispatcherGs cCsJ|itjotidn|ii|iit|_dS(Ns#Transport dispatcher not registered(sselfstransportDispatchersNoneserrors PySnmpErrorsunregisterRecvCbFunsunregisterTimerCbFun(sself((s2build/bdist.linux-i686/egg/pysnmp/entity/engine.pysunregisterTransportDispatcherTs   (s__name__s __module__sNones__init__s _SnmpEngine__receiveMessageCbFuns"_SnmpEngine__receiveTimerTickCbFunsregisterTransportDispatchersunregisterTransportDispatcher(((s2build/bdist.linux-i686/egg/pysnmp/entity/engine.pys SnmpEngine s (  N(spysnmp.proto.rfc3412sMsgAndPduDispatcherspysnmp.proto.mpmod.rfc2576sSnmpV1MessageProcessingModelsSnmpV2cMessageProcessingModelspysnmp.proto.mpmod.rfc3412sSnmpV3MessageProcessingModelspysnmp.proto.secmod.rfc2576sSnmpV1SecurityModelsSnmpV2cSecurityModelspysnmp.proto.secmod.rfc3414sSnmpUSMSecurityModelspysnmp.proto.acmodsrfc3415svoidspysnmpserrors SnmpEngine( sSnmpV1MessageProcessingModelsSnmpV1SecurityModelsvoidserrorsSnmpV2cSecurityModels SnmpEnginesSnmpV2cMessageProcessingModelsSnmpV3MessageProcessingModelsMsgAndPduDispatchersSnmpUSMSecurityModelsrfc3415((s2build/bdist.linux-i686/egg/pysnmp/entity/engine.pys?s    PK݅4>pg d dpysnmp/entity/config.py# Initial SNMP engine configuration functions. During further operation, # SNMP engine might be configured remotely (through SNMP). import string from pysnmp.carrier.asynsock import dispatch from pysnmp.carrier.asynsock.dgram import udp, udp6 try: from pysnmp.carrier.asynsock.dgram import unix snmpLocalDomain = unix.snmpLocalDomain except ImportError: # UNIX-specific -- may not be always available pass from pysnmp.proto import rfc3412 from pysnmp.entity import engine from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha, noauth from pysnmp.proto.secmod.rfc3414.priv import des, nopriv from pysnmp.proto.secmod.rfc3826.priv import aes from pysnmp.proto.secmod.eso.priv import des3, aes192, aes256 from pysnmp.smi.error import NotWritableError from pysnmp import error # A shortcut to popular constants # Transports snmpUDPDomain = udp.snmpUDPDomain snmpUDP6Domain = udp6.snmpUDP6Domain # Auth protocol usmHMACMD5AuthProtocol = hmacmd5.HmacMd5.serviceID usmHMACSHAAuthProtocol = hmacsha.HmacSha.serviceID usmNoAuthProtocol = noauth.NoAuth.serviceID # Privacy protocol usmDESPrivProtocol = des.Des.serviceID usm3DESEDEPrivProtocol = des3.Des3.serviceID usmAesCfb128Protocol = aes.Aes.serviceID usmAesCfb192Protocol = aes192.Aes192.serviceID usmAesCfb256Protocol = aes256.Aes256.serviceID usmNoPrivProtocol = nopriv.NoPriv.serviceID # Auth services authServices = { hmacmd5.HmacMd5.serviceID: hmacmd5.HmacMd5(), hmacsha.HmacSha.serviceID: hmacsha.HmacSha(), noauth.NoAuth.serviceID: noauth.NoAuth() } # Privacy services privServices = { des.Des.serviceID: des.Des(), des3.Des3.serviceID: des3.Des3(), aes.Aes.serviceID: aes.Aes(), aes192.Aes192.serviceID: aes192.Aes192(), aes256.Aes256.serviceID: aes256.Aes256(), nopriv.NoPriv.serviceID: nopriv.NoPriv() } def __cookV1SystemInfo(snmpEngine, securityName): snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') snmpCommunityEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-COMMUNITY-MIB', 'snmpCommunityEntry') tblIdx = snmpCommunityEntry.getInstIdFromIndices(securityName) return snmpCommunityEntry, tblIdx, snmpEngineID def addV1System(snmpEngine, securityName, communityName, contextEngineId=None, contextName=None, transportTag=None): snmpCommunityEntry, tblIdx, snmpEngineID = __cookV1SystemInfo( snmpEngine, securityName ) if contextEngineId is None: contextEngineId = snmpEngineID.syntax if contextName is None: contextName = '' snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpCommunityEntry.name + (8,) + tblIdx, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpCommunityEntry.name + (8,) + tblIdx, 'createAndGo'), (snmpCommunityEntry.name + (2,) + tblIdx, communityName), (snmpCommunityEntry.name + (3,) + tblIdx, securityName), (snmpCommunityEntry.name + (4,) + tblIdx, contextEngineId), (snmpCommunityEntry.name + (5,) + tblIdx, contextName), (snmpCommunityEntry.name + (6,) + tblIdx, transportTag), (snmpCommunityEntry.name + (7,) + tblIdx, 'nonVolatile')) ) def delV1System(snmpEngine, securityName): snmpCommunityEntry, tblIdx, snmpEngineID = __cookV1SystemInfo( snmpEngine, securityName ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpCommunityEntry.name + (8,) + tblIdx, 'destroy'),) ) def __cookV3UserInfo(snmpEngine, securityName, contextEngineId): if contextEngineId is None: snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') snmpEngineID = snmpEngineID.syntax else: snmpEngineID = contextEngineId usmUserEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-USER-BASED-SM-MIB', 'usmUserEntry') tblIdx1 = usmUserEntry.getInstIdFromIndices( snmpEngineID, securityName ) pysnmpUsmSecretEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('PYSNMP-USM-MIB', 'pysnmpUsmSecretEntry') tblIdx2 = pysnmpUsmSecretEntry.getInstIdFromIndices(securityName) return snmpEngineID, usmUserEntry, tblIdx1, pysnmpUsmSecretEntry, tblIdx2 def addV3User(snmpEngine, securityName, authProtocol=usmNoAuthProtocol, authKey=None, privProtocol=usmNoPrivProtocol, privKey=None, contextEngineId=None): ( snmpEngineID, usmUserEntry, tblIdx1, pysnmpUsmSecretEntry, tblIdx2 ) = __cookV3UserInfo( snmpEngine, securityName, contextEngineId ) # Load augmenting table before creating new row in base one pysnmpUsmKeyEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('PYSNMP-USM-MIB', 'pysnmpUsmKeyEntry') # Load clone-from (may not be needed) zeroDotZero, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMPv2-SMI', 'zeroDotZero') snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((usmUserEntry.name + (13,) + tblIdx1, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((usmUserEntry.name + (13,) + tblIdx1, 'createAndGo'), (usmUserEntry.name + (3,) + tblIdx1, securityName), (usmUserEntry.name + (4,) + tblIdx1, zeroDotZero.name), (usmUserEntry.name + (5,) + tblIdx1, authProtocol), (usmUserEntry.name + (8,) + tblIdx1, privProtocol)) ) # Localize keys if authProtocol in authServices: hashedAuthPassphrase = authServices[authProtocol].hashPassphrase( authKey and authKey or '' ) localAuthKey = authServices[authProtocol].localizeKey( hashedAuthPassphrase, snmpEngineID ) else: raise error.PySnmpError('Unknown auth protocol %s' % (authProtocol,)) if privProtocol in privServices: hashedPrivPassphrase = privServices[privProtocol].hashPassphrase( authProtocol, privKey and privKey or '' ) localPrivKey = privServices[privProtocol].localizeKey( authProtocol, hashedPrivPassphrase, snmpEngineID ) else: raise error.PySnmpError( 'Unknown priv protocol %s' % (privProtocol,) ) # Commit localized keys snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((pysnmpUsmKeyEntry.name + (1,) + tblIdx1, localAuthKey), (pysnmpUsmKeyEntry.name + (2,) + tblIdx1, localPrivKey), (pysnmpUsmKeyEntry.name + (3,) + tblIdx1, hashedAuthPassphrase), (pysnmpUsmKeyEntry.name + (4,) + tblIdx1, hashedPrivPassphrase)) ) # Commit passphrases snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((pysnmpUsmSecretEntry.name + (4,) + tblIdx2, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((pysnmpUsmSecretEntry.name + (4,) + tblIdx2, 'createAndGo'), (pysnmpUsmSecretEntry.name + (2,) + tblIdx2, authKey), (pysnmpUsmSecretEntry.name + (3,) + tblIdx2, privKey),) ) def delV3User(snmpEngine, securityName, contextEngineId=None): ( snmpEngineID, usmUserEntry, tblIdx1, pysnmpUsmSecretEntry, tblIdx2 ) = __cookV3UserInfo( snmpEngine, securityName, contextEngineId ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((usmUserEntry.name + (13,) + tblIdx1, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((pysnmpUsmSecretEntry.name + (4,) + tblIdx2, 'destroy'),) ) def __cookTargetParamsInfo(snmpEngine, name): snmpTargetParamsEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-TARGET-MIB', 'snmpTargetParamsEntry') tblIdx = snmpTargetParamsEntry.getInstIdFromIndices(name) return snmpTargetParamsEntry, tblIdx def addTargetParams( snmpEngine, name, securityName, securityLevel, mpModel=3 # 0 == SNMPv1, 1 == SNMPv2c, 3 == SNMPv3 ): if mpModel == 0: securityModel = 1 elif mpModel == 1 or mpModel == 2: securityModel = 2 elif mpModel == 3: securityModel = 3 else: raise error.PySnmpError('Unknown MP model %s' % mpModel) snmpTargetParamsEntry, tblIdx = __cookTargetParamsInfo(snmpEngine, name) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpTargetParamsEntry.name + (7,) + tblIdx, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpTargetParamsEntry.name + (7,) + tblIdx, 'createAndGo'), (snmpTargetParamsEntry.name + (1,) + tblIdx, name), (snmpTargetParamsEntry.name + (2,) + tblIdx, mpModel), (snmpTargetParamsEntry.name + (3,) + tblIdx, securityModel), (snmpTargetParamsEntry.name + (4,) + tblIdx, securityName), (snmpTargetParamsEntry.name + (5,) + tblIdx, securityLevel)) ) def delTargetParams(snmpEngine, name): snmpTargetParamsEntry, tblIdx = __cookTargetParamsInfo( snmpEngine, name ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpTargetParamsEntry.name + (7,) + tblIdx, 'destroy'),) ) def __cookTargetAddrInfo(snmpEngine, addrName): snmpTargetAddrEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-TARGET-MIB', 'snmpTargetAddrEntry') tblIdx = snmpTargetAddrEntry.getInstIdFromIndices(addrName) return snmpTargetAddrEntry, tblIdx def addTargetAddr( snmpEngine, addrName, transportDomain, transportAddress, params, timeout=None, retryCount=None, tagList='' ): snmpTargetAddrEntry, tblIdx = __cookTargetAddrInfo( snmpEngine, addrName ) if transportDomain[:len(snmpUDPDomain)] == snmpUDPDomain: SnmpUDPAddress, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMPv2-TM', 'SnmpUDPAddress') transportAddress = SnmpUDPAddress(transportAddress) elif transportDomain[:len(snmpUDP6Domain)] == snmpUDP6Domain: TransportAddressIPv6, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('TRANSPORT-ADDRESS-MIB', 'TransportAddressIPv6') transportAddress = TransportAddressIPv6(transportAddress) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpTargetAddrEntry.name + (9,) + tblIdx, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpTargetAddrEntry.name + (9,) + tblIdx, 'createAndGo'), (snmpTargetAddrEntry.name + (1,) + tblIdx, addrName), (snmpTargetAddrEntry.name + (2,) + tblIdx, transportDomain), (snmpTargetAddrEntry.name + (3,) + tblIdx, transportAddress), (snmpTargetAddrEntry.name + (4,) + tblIdx, timeout), (snmpTargetAddrEntry.name + (5,) + tblIdx, retryCount), # XXX (snmpTargetAddrEntry.name + (6,) + tblIdx,'%s %s'%(addrName,tagList)), (snmpTargetAddrEntry.name + (7,) + tblIdx, params),) ) def delTargetAddr(snmpEngine, addrName): snmpTargetAddrEntry, tblIdx = __cookTargetAddrInfo( snmpEngine, addrName ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpTargetAddrEntry.name + (9,) + tblIdx, 'destroy'),) ) def addSocketTransport(snmpEngine, transportDomain, transport): """Add transport object to socket dispatcher of snmpEngine""" if not snmpEngine.transportDispatcher: snmpEngine.registerTransportDispatcher(dispatch.AsynsockDispatcher()) snmpEngine.transportDispatcher.registerTransport( transportDomain, transport ) def delSocketTransport(snmpEngine, transportDomain): """Unregister transport object at socket dispatcher of snmpEngine""" if not snmpEngine.transportDispatcher: return snmpEngine.transportDispatcher.unregisterTransport( transportDomain ) snmpEngine.unregisterTransportDispatcher() # VACM shortcuts def addContext(snmpEngine, contextName): vacmContextEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols( 'SNMP-VIEW-BASED-ACM-MIB', 'vacmContextEntry' ) tblIdx = vacmContextEntry.getInstIdFromIndices(contextName) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((vacmContextEntry.name + (1,) + tblIdx, contextName),) ) def __cookVacmGroupInfo(snmpEngine, securityModel, securityName): vacmSecurityToGroupEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols( 'SNMP-VIEW-BASED-ACM-MIB', 'vacmSecurityToGroupEntry' ) tblIdx = vacmSecurityToGroupEntry.getInstIdFromIndices( securityModel, securityName ) return vacmSecurityToGroupEntry, tblIdx def addVacmGroup(snmpEngine, groupName, securityModel, securityName): vacmSecurityToGroupEntry, tblIdx = __cookVacmGroupInfo( snmpEngine, securityModel, securityName ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((vacmSecurityToGroupEntry.name + (5,) + tblIdx, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((vacmSecurityToGroupEntry.name + (5,) + tblIdx, 'createAndGo'), (vacmSecurityToGroupEntry.name + (1,) + tblIdx, securityModel), (vacmSecurityToGroupEntry.name + (2,) + tblIdx, securityName), (vacmSecurityToGroupEntry.name + (3,) + tblIdx, groupName),) ) def delVacmGroup(snmpEngine, securityModel, securityName): vacmSecurityToGroupEntry, tblIdx = __cookVacmGroupInfo( snmpEngine, securityModel, securityName ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((vacmSecurityToGroupEntry.name + (5,) + tblIdx, 'destroy'),) ) def __cookVacmAccessInfo(snmpEngine, groupName, contextName, securityModel, securityLevel): vacmAccessEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols( 'SNMP-VIEW-BASED-ACM-MIB', 'vacmAccessEntry' ) tblIdx = vacmAccessEntry.getInstIdFromIndices( groupName, contextName, securityModel, securityLevel ) return vacmAccessEntry, tblIdx def addVacmAccess(snmpEngine, groupName, contextName, securityModel, securityLevel, prefix, readView, writeView, notifyView): vacmAccessEntry, tblIdx = __cookVacmAccessInfo( snmpEngine, groupName, contextName, securityModel, securityLevel ) addContext(snmpEngine, contextName) # this is leaky snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((vacmAccessEntry.name + (9,) + tblIdx, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((vacmAccessEntry.name + (9,) + tblIdx, 'createAndGo'), (vacmAccessEntry.name + (1,) + tblIdx, contextName), (vacmAccessEntry.name + (2,) + tblIdx, securityModel), (vacmAccessEntry.name + (3,) + tblIdx, securityLevel), (vacmAccessEntry.name + (4,) + tblIdx, prefix), (vacmAccessEntry.name + (5,) + tblIdx, readView), (vacmAccessEntry.name + (6,) + tblIdx, writeView), (vacmAccessEntry.name + (7,) + tblIdx, notifyView),) ) def delVacmAccess(snmpEngine, groupName, contextName, securityModel, securityLevel): vacmAccessEntry, tblIdx = __cookVacmAccessInfo( snmpEngine, groupName, contextName, securityModel, securityLevel ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((vacmAccessEntry.name + (9,) + tblIdx, 'destroy'),) ) def __cookVacmViewInfo(snmpEngine, viewName, subTree): vacmViewTreeFamilyEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols( 'SNMP-VIEW-BASED-ACM-MIB', 'vacmViewTreeFamilyEntry' ) tblIdx = vacmViewTreeFamilyEntry.getInstIdFromIndices( viewName, subTree ) return vacmViewTreeFamilyEntry, tblIdx def addVacmView(snmpEngine, viewName, viewType, subTree, mask): vacmViewTreeFamilyEntry, tblIdx = __cookVacmViewInfo( snmpEngine, viewName, subTree ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((vacmViewTreeFamilyEntry.name + (6,) + tblIdx, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((vacmViewTreeFamilyEntry.name + (6,) + tblIdx, 'createAndGo'), (vacmViewTreeFamilyEntry.name + (1,) + tblIdx, viewName), (vacmViewTreeFamilyEntry.name + (2,) + tblIdx, subTree), (vacmViewTreeFamilyEntry.name + (3,) + tblIdx, mask), (vacmViewTreeFamilyEntry.name + (4,) + tblIdx, viewType),) ) def delVacmView(snmpEngine, viewName, subTree): vacmViewTreeFamilyEntry, tblIdx = __cookVacmViewInfo( snmpEngine, viewName, subTree ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((vacmViewTreeFamilyEntry.name + (6,) + tblIdx, 'destroy'),) ) # VACM simplicity wrappers def __cookVacmUserInfo(snmpEngine, securityModel, securityName, securityLevel): groupName = 'v-%s-%d' % (hash(securityName), securityModel) SnmpSecurityLevel, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpSecurityLevel') securityLevel = SnmpSecurityLevel(securityLevel) return ( groupName, securityLevel, 'r' + groupName, 'w' + groupName, 'n' + groupName ) def addVacmUser(snmpEngine, securityModel, securityName, securityLevel, readSubTree=(), writeSubTree=(), notifySubTree=(), contextName=''): ( groupName, securityLevel, readView, writeView, notifyView ) = __cookVacmUserInfo( snmpEngine, securityModel, securityName, securityLevel, ) addVacmGroup( snmpEngine, groupName, securityModel, securityName ) addVacmAccess( snmpEngine, groupName, contextName, securityModel, securityLevel, 1, readView, writeView, notifyView ) if readSubTree: addVacmView( snmpEngine, readView, "included", readSubTree, '', ) if writeSubTree: addVacmView( snmpEngine, writeView, "included", writeSubTree, '', ) if notifySubTree: addVacmView( snmpEngine, notifyView, "included", notifySubTree, '', ) def delVacmUser(snmpEngine, securityModel, securityName, securityLevel, readSubTree=(), writeSubTree=(), notifySubTree=()): ( groupName, securityLevel, readView, writeView, notifyView ) = __cookVacmUserInfo( snmpEngine, securityModel, securityName, securityLevel, ) delVacmGroup( snmpEngine, securityModel, securityName ) delVacmAccess( snmpEngine, groupName, '', securityModel, securityLevel ) if readSubTree: delVacmView( snmpEngine, readView, readSubTree ) if writeSubTree: delVacmView( snmpEngine, writeView, writeSubTree ) if notifySubTree: delVacmView( snmpEngine, notifyView, notifySubTree ) # Obsolete shortcuts for add/delVacmUser() wrappers def addRoUser(snmpEngine, securityModel, securityName, securityLevel, subTree): addVacmUser( snmpEngine, securityModel, securityName, securityLevel, subTree ) def delRoUser(snmpEngine, securityModel, securityName, securityLevel, subTree): delVacmUser( snmpEngine, securityModel, securityName, securityLevel, subTree ) def addRwUser(snmpEngine, securityModel, securityName, securityLevel, subTree): addVacmUser( snmpEngine, securityModel, securityName, securityLevel, subTree, subTree ) def delRwUser(snmpEngine, securityModel, securityName, securityLevel, subTree): delVacmUser( snmpEngine, securityModel, securityName, securityLevel, subTree, subTree ) def addTrapUser(snmpEngine,securityModel,securityName,securityLevel,subTree): addVacmUser( snmpEngine, securityModel, securityName, securityLevel, (), (), subTree, ) def delTrapUser(snmpEngine,securityModel,securityName,securityLevel,subTree): delVacmUser( snmpEngine, securityModel, securityName, securityLevel, (), (), subTree, ) # Notification target setup def __cookNotificationTargetInfo(snmpEngine, notificationName, paramsName, filterSubtree=None): snmpNotifyEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-NOTIFICATION-MIB', 'snmpNotifyEntry') tblIdx1 = snmpNotifyEntry.getInstIdFromIndices( notificationName ) snmpNotifyFilterProfileEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-NOTIFICATION-MIB', 'snmpNotifyFilterProfileEntry') tblIdx2 = snmpNotifyFilterProfileEntry.getInstIdFromIndices( paramsName ) profileName = '%s-filter' % hash(notificationName) if filterSubtree: snmpNotifyFilterEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-NOTIFICATION-MIB', 'snmpNotifyFilterEntry') tblIdx3 = snmpNotifyFilterEntry.getInstIdFromIndices( profileName, filterSubtree ) else: snmpNotifyFilterEntry = tblIdx3 = None return ( snmpNotifyEntry, tblIdx1, snmpNotifyFilterProfileEntry, tblIdx2, profileName, snmpNotifyFilterEntry, tblIdx3 ) def addNotificationTarget(snmpEngine, notificationName, paramsName, transportTag, notifyType=None, filterSubtree=None, filterMask=None, filterType=None): ( snmpNotifyEntry, tblIdx1, snmpNotifyFilterProfileEntry, tblIdx2, profileName, snmpNotifyFilterEntry, tblIdx3 ) = __cookNotificationTargetInfo( snmpEngine, notificationName, paramsName, filterSubtree ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpNotifyEntry.name + (5,) + tblIdx1, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpNotifyEntry.name + (5,) + tblIdx1, 'createAndGo'), (snmpNotifyEntry.name + (2,) + tblIdx1, transportTag), (snmpNotifyEntry.name + (3,) + tblIdx1, notifyType),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpNotifyFilterProfileEntry.name + (3,) + tblIdx2, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpNotifyFilterProfileEntry.name + (3,) + tblIdx2, 'createAndGo'), (snmpNotifyFilterProfileEntry.name + (1,) + tblIdx2, profileName),) ) if not snmpNotifyFilterEntry: return snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpNotifyFilterEntry.name + (5,) + tblIdx3, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpNotifyFilterEntry.name + (5,) + tblIdx3, 'createAndGo'), (snmpNotifyFilterEntry.name + (1,) + tblIdx3, filterSubtree), (snmpNotifyFilterEntry.name + (2,) + tblIdx3, filterMask), (snmpNotifyFilterEntry.name + (3,) + tblIdx3, filterType),) ) def delNotificationTarget(snmpEngine, notificationName, paramsName, filterSubtree=None): ( snmpNotifyEntry, tblIdx1, snmpNotifyFilterProfileEntry, tblIdx2, profileName, snmpNotifyFilterEntry, tblIdx3 ) = __cookNotificationTargetInfo( snmpEngine, notificationName, paramsName, filterSubtree ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpNotifyEntry.name + (5,) + tblIdx1, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpNotifyFilterProfileEntry.name + (3,) + tblIdx2, 'destroy'),) ) if not snmpNotifyFilterEntry: return snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpNotifyFilterEntry.name + (5,) + tblIdx3, 'destroy'),) ) # rfc3415: A.1 def setInitialVacmParameters(snmpEngine): # rfc3415: A.1.1 --> initial-semi-security-configuration # rfc3415: A.1.2 addContext(snmpEngine, "") # rfc3415: A.1.3 addVacmGroup(snmpEngine, "initial", 3, "initial") # rfc3415: A.1.4 addVacmAccess(snmpEngine, "initial", "", 3, "noAuthNoPriv", "exact", "restricted", None, "restricted") addVacmAccess(snmpEngine, "initial", "", 3, "authNoPriv", "exact", "internet", "internet", "internet") addVacmAccess(snmpEngine, "initial", "", 3, "authPriv", "exact", "internet", "internet", "internet") # rfc3415: A.1.5 (semi-secure) addVacmView(snmpEngine, "internet", "included", (1,3,6,1),"") addVacmView(snmpEngine, "restricted", "included", (1,3,6,1,2,1,1),"") addVacmView(snmpEngine, "restricted", "included", (1,3,6,1,2,1,11),"") addVacmView(snmpEngine, "restricted", "included", (1,3,6,1,6,3,10,2,1),"") addVacmView(snmpEngine, "restricted", "included", (1,3,6,1,6,3,11,2,1),"") addVacmView(snmpEngine, "restricted", "included", (1,3,6,1,6,3,15,1,1),"") PKAq>'„pysnmp/entity/__init__.pyc; Bc@sdS(N((((s4build/bdist.linux-i686/egg/pysnmp/entity/__init__.pys?sPKK~=30pysnmp/entity/engine.py# SNMP engine from pysnmp.proto.rfc3412 import MsgAndPduDispatcher from pysnmp.proto.mpmod.rfc2576 import SnmpV1MessageProcessingModel, \ SnmpV2cMessageProcessingModel from pysnmp.proto.mpmod.rfc3412 import SnmpV3MessageProcessingModel from pysnmp.proto.secmod.rfc2576 import SnmpV1SecurityModel, \ SnmpV2cSecurityModel from pysnmp.proto.secmod.rfc3414 import SnmpUSMSecurityModel from pysnmp.proto.acmod import rfc3415, void from pysnmp import error class SnmpEngine: def __init__(self, snmpEngineID=None, maxMessageSize=65507, msgAndPduDsp=None): if msgAndPduDsp is None: self.msgAndPduDsp = MsgAndPduDispatcher() else: self.msgAndPduDsp = msgAndPduDsp self.messageProcessingSubsystems = { SnmpV1MessageProcessingModel.messageProcessingModelID: SnmpV1MessageProcessingModel(), SnmpV2cMessageProcessingModel.messageProcessingModelID: SnmpV2cMessageProcessingModel(), SnmpV3MessageProcessingModel.messageProcessingModelID: SnmpV3MessageProcessingModel() } self.securityModels = { SnmpV1SecurityModel.securityModelID: SnmpV1SecurityModel(), SnmpV2cSecurityModel.securityModelID: SnmpV2cSecurityModel(), SnmpUSMSecurityModel.securityModelID: SnmpUSMSecurityModel() } self.accessControlModel = { void.accessModelID: void, rfc3415.accessModelID: rfc3415 } self.transportDispatcher = None if self.msgAndPduDsp.mibInstrumController is None: raise error.PySnmpError( 'MIB instrumentation does not yet exist' ) snmpEngineMaxMessageSize, = self.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize') snmpEngineMaxMessageSize.syntax = snmpEngineMaxMessageSize.syntax.clone(maxMessageSize) snmpEngineBoots, = self.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineBoots') snmpEngineBoots.syntax = snmpEngineBoots.syntax + 1 if snmpEngineID is not None: origSnmpEngineID, = self.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') origSnmpEngineID.syntax = origSnmpEngineID.syntax.clone(snmpEngineID) # Transport dispatcher bindings def __receiveMessageCbFun( self, transportDispatcher, transportDomain, transportAddress, wholeMsg ): self.msgAndPduDsp.receiveMessage( self, transportDomain, transportAddress, wholeMsg ) def __receiveTimerTickCbFun(self, timeNow): self.msgAndPduDsp.receiveTimerTick(self, timeNow) for mpHandler in self.messageProcessingSubsystems.values(): mpHandler.receiveTimerTick(self, timeNow) for smHandler in self.securityModels.values(): smHandler.receiveTimerTick(self, timeNow) def registerTransportDispatcher(self, transportDispatcher): if self.transportDispatcher is not None: raise error.PySnmpError( 'Transport dispatcher already registered' ) transportDispatcher.registerRecvCbFun( self.__receiveMessageCbFun ) transportDispatcher.registerTimerCbFun( self.__receiveTimerTickCbFun ) self.transportDispatcher = transportDispatcher def unregisterTransportDispatcher(self): if self.transportDispatcher is None: raise error.PySnmpError( 'Transport dispatcher not registered' ) self.transportDispatcher.unregisterRecvCbFun() self.transportDispatcher.unregisterTimerCbFun() self.transportDispatcher = None PKAq>05p5ppysnmp/entity/config.pyc; <8Mc@sdkZdklZdklZlZydklZeiZWnej onXdk l Z dk l Z dk lZlZlZdklZlZdklZd klZlZlZd klZd klZeiZeiZei i!Z"ei#i!Z$ei%i!Z&ei'i!Z(ei)i!Z*ei+i!Z,ei-i!Z.ei/i!Z0ei1i!Z2hei i!ei <ei#i!ei#<ei%i!ei%dZ?e6e6ddZ@dZAdZBdZCdZDdZEdZFdZGd ZHd!ZId"ZJd#ZKd$ZLd%ZMd&ZNfffdd'ZOfffd(ZPd)ZQd*ZRd+ZSd,ZTd-ZUd.ZVe6d/ZWe6e6e6e6d0ZXe6d1ZYd2ZZdS(3N(sdispatch(sudpsudp6(sunix(srfc3412(sengine(shmacmd5shmacshasnoauth(sdessnopriv(saes(sdes3saes192saes256(sNotWritableError(serrorcCs\|iiiidd\}|iiiidd\}|i|}|||fSdS(Ns__SNMP-FRAMEWORK-MIBs snmpEngineIDsSNMP-COMMUNITY-MIBssnmpCommunityEntry( s snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolss snmpEngineIDssnmpCommunityEntrysgetInstIdFromIndicess securityNamestblIdx(s snmpEngines securityNames snmpEngineIDstblIdxssnmpCommunityEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys__cookV1SystemInfo8sc Cs+t||\}}}|tjo |i}n|tjo d}n|i i i |i df|dff|i i i |i df|df|i df||f|i df||f|i df||f|i df||f|i d f||f|i d f|d ffdS( Nsisdestroys createAndGoiiiiiis nonVolatile(s__cookV1SystemInfos snmpEngines securityNamessnmpCommunityEntrystblIdxs snmpEngineIDscontextEngineIdsNonessyntaxs contextNames msgAndPduDspsmibInstrumControllers writeVarssnames communityNames transportTag( s snmpEngines securityNames communityNamescontextEngineIds contextNames transportTagssnmpCommunityEntrystblIdxs snmpEngineID((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys addV1System?s    *cCsFt||\}}}|iii|i df|dffdS(Nisdestroy( s__cookV1SystemInfos snmpEngines securityNamessnmpCommunityEntrystblIdxs snmpEngineIDs msgAndPduDspsmibInstrumControllers writeVarssname(s snmpEngines securityNamessnmpCommunityEntrys snmpEngineIDstblIdx((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys delV1SystemXscCs|tjo+|iiiidd\}|i}n|}|iiiidd\}|i ||}|iiiidd\}|i |}|||||fSdS(Ns__SNMP-FRAMEWORK-MIBs snmpEngineIDsSNMP-USER-BASED-SM-MIBs usmUserEntrysPYSNMP-USM-MIBspysnmpUsmSecretEntry(scontextEngineIdsNones snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolss snmpEngineIDssyntaxs usmUserEntrysgetInstIdFromIndicess securityNamestblIdx1spysnmpUsmSecretEntrystblIdx2(s snmpEngines securityNamescontextEngineIds usmUserEntrystblIdx2s snmpEngineIDstblIdx1spysnmpUsmSecretEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys__cookV3UserInfo`s  cCst|||\}} }}}|i i i i dd\}|i i i i dd\}|i i i| idf|dff|i i i| idf|df| idf||f| id f||if| id f||f| id f||ff|tjo;t|i|o|pd } t|i| |} ntid |f|tjoAt|i||o|pd } t|i|| |} ntid|f|i i i|idf|| f|idf|| f|idf|| f|id f|| ff|i i i|id f|dff|i i i|id f|df|idf||f|idf||ffdS(NsPYSNMP-USM-MIBspysnmpUsmKeyEntrys SNMPv2-SMIs zeroDotZeroi sdestroys createAndGoiiiissUnknown auth protocol %ssUnknown priv protocol %sii(s__cookV3UserInfos snmpEngines securityNamescontextEngineIds snmpEngineIDs usmUserEntrystblIdx1spysnmpUsmSecretEntrystblIdx2s msgAndPduDspsmibInstrumControllers mibBuilders importSymbolsspysnmpUsmKeyEntrys zeroDotZeros writeVarssnames authProtocols privProtocols authServicesshashPassphrasesauthKeyshashedAuthPassphrases localizeKeys localAuthKeyserrors PySnmpErrors privServicessprivKeyshashedPrivPassphrases localPrivKey(s snmpEngines securityNames authProtocolsauthKeys privProtocolsprivKeyscontextEngineIdstblIdx2stblIdx1s localAuthKeyshashedAuthPassphraseshashedPrivPassphrases usmUserEntrys localPrivKeys zeroDotZeros snmpEngineIDspysnmpUsmSecretEntryspysnmpUsmKeyEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys addV3Userqs !* ! $o *cCsyt|||\}}}}}|i i i |i df|dff|i i i |i df|dffdS(Ni sdestroyi( s__cookV3UserInfos snmpEngines securityNamescontextEngineIds snmpEngineIDs usmUserEntrystblIdx1spysnmpUsmSecretEntrystblIdx2s msgAndPduDspsmibInstrumControllers writeVarssname(s snmpEngines securityNamescontextEngineIds usmUserEntrystblIdx2s snmpEngineIDstblIdx1spysnmpUsmSecretEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys delV3Users!*cCs;|iiiidd\}|i|}||fSdS(NsSNMP-TARGET-MIBssnmpTargetParamsEntry( s snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolsssnmpTargetParamsEntrysgetInstIdFromIndicessnamestblIdx(s snmpEnginesnamestblIdxssnmpTargetParamsEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys__cookTargetParamsInfosicCsE|djo d}nO|djp |djo d}n+|djo d}ntid|t||\}}|i i i |idf|dff|i i i |idf|df|idf||f|idf||f|idf||f|id f||f|id f||ffdS( NiiiisUnknown MP model %sisdestroys createAndGoii(smpModels securityModelserrors PySnmpErrors__cookTargetParamsInfos snmpEnginesnamessnmpTargetParamsEntrystblIdxs msgAndPduDspsmibInstrumControllers writeVarss securityNames securityLevel(s snmpEnginesnames securityNames securityLevelsmpModelssnmpTargetParamsEntrystblIdxs securityModel((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pysaddTargetParamss     *cCsCt||\}}|iii|idf|dffdS(Nisdestroy(s__cookTargetParamsInfos snmpEnginesnamessnmpTargetParamsEntrystblIdxs msgAndPduDspsmibInstrumControllers writeVars(s snmpEnginesnamestblIdxssnmpTargetParamsEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pysdelTargetParamsscCs;|iiiidd\}|i|}||fSdS(NsSNMP-TARGET-MIBssnmpTargetAddrEntry( s snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolsssnmpTargetAddrEntrysgetInstIdFromIndicessaddrNamestblIdx(s snmpEnginesaddrNamessnmpTargetAddrEntrystblIdx((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys__cookTargetAddrInfossc Cst||\} } |tt tjo.|ii i i dd\} | |}nF|tt tjo.|ii i i dd\}||}n|ii i| idf| dff|ii i| idf| df| idf| |f| id f| |f| id f| |f| id f| |f| id f| |f| id f| d||ff| idf| |ffdS(Ns SNMPv2-TMsSnmpUDPAddresssTRANSPORT-ADDRESS-MIBsTransportAddressIPv6i sdestroys createAndGoiiiiiis%s %si(s__cookTargetAddrInfos snmpEnginesaddrNamessnmpTargetAddrEntrystblIdxstransportDomainslens snmpUDPDomains msgAndPduDspsmibInstrumControllers mibBuilders importSymbolssSnmpUDPAddressstransportAddressssnmpUDP6DomainsTransportAddressIPv6s writeVarssnamestimeouts retryCountstagListsparams( s snmpEnginesaddrNamestransportDomainstransportAddresssparamsstimeouts retryCountstagListsTransportAddressIPv6stblIdxsSnmpUDPAddressssnmpTargetAddrEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys addTargetAddrs *cCsCt||\}}|iii|idf|dffdS(Ni sdestroy( s__cookTargetAddrInfos snmpEnginesaddrNamessnmpTargetAddrEntrystblIdxs msgAndPduDspsmibInstrumControllers writeVarssname(s snmpEnginesaddrNamessnmpTargetAddrEntrystblIdx((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys delTargetAddrscCs9|i o|itin|ii||dS(s7Add transport object to socket dispatcher of snmpEngineN(s snmpEnginestransportDispatchersregisterTransportDispatchersdispatchsAsynsockDispatchersregisterTransportstransportDomains transport(s snmpEnginestransportDomains transport((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pysaddSocketTransports cCs1|i odSn|ii||idS(s>Unregister transport object at socket dispatcher of snmpEngineN(s snmpEnginestransportDispatchersunregisterTransportstransportDomainsunregisterTransportDispatcher(s snmpEnginestransportDomain((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pysdelSocketTransport%s  cCs[|iiiidd\}|i|}|iii |i df||ffdS(NsSNMP-VIEW-BASED-ACM-MIBsvacmContextEntryi( s snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolssvacmContextEntrysgetInstIdFromIndicess contextNamestblIdxs writeVarssname(s snmpEngines contextNamesvacmContextEntrystblIdx((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys addContext0scCs>|iiiidd\}|i||}||fSdS(NsSNMP-VIEW-BASED-ACM-MIBsvacmSecurityToGroupEntry( s snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolssvacmSecurityToGroupEntrysgetInstIdFromIndicess securityModels securityNamestblIdx(s snmpEngines securityModels securityNamestblIdxsvacmSecurityToGroupEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys__cookVacmGroupInfo9scCst|||\}}|iii|i df|dff|iii|i df|df|i df||f|i df||f|i df||ffdS(Nisdestroys createAndGoiii( s__cookVacmGroupInfos snmpEngines securityModels securityNamesvacmSecurityToGroupEntrystblIdxs msgAndPduDspsmibInstrumControllers writeVarssnames groupName(s snmpEngines groupNames securityModels securityNamestblIdxsvacmSecurityToGroupEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys addVacmGroupBs*cCsFt|||\}}|iii|i df|dffdS(Nisdestroy( s__cookVacmGroupInfos snmpEngines securityModels securityNamesvacmSecurityToGroupEntrystblIdxs msgAndPduDspsmibInstrumControllers writeVarssname(s snmpEngines securityModels securityNamesvacmSecurityToGroupEntrystblIdx((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys delVacmGroupPscCsD|iiiidd\}|i||||}||fSdS(NsSNMP-VIEW-BASED-ACM-MIBsvacmAccessEntry( s snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolssvacmAccessEntrysgetInstIdFromIndicess groupNames contextNames securityModels securityLevelstblIdx(s snmpEngines groupNames contextNames securityModels securityLevelsvacmAccessEntrystblIdx((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys__cookVacmAccessInfoXsc Cs$t|||||\} } t|||i i i | i df| dff|i i i | i df| df| i df| |f| i df| |f| i df| |f| i df| |f| i df| |f| i d f| |f| i d f| |ffdS( Ni sdestroys createAndGoiiiiiii(s__cookVacmAccessInfos snmpEngines groupNames contextNames securityModels securityLevelsvacmAccessEntrystblIdxs addContexts msgAndPduDspsmibInstrumControllers writeVarssnamesprefixsreadViews writeViews notifyView( s snmpEngines groupNames contextNames securityModels securityLevelsprefixsreadViews writeViews notifyViewsvacmAccessEntrystblIdx((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys addVacmAccessbs *cCsLt|||||\}}|ii i |i df|dffdS(Ni sdestroy( s__cookVacmAccessInfos snmpEngines groupNames contextNames securityModels securityLevelsvacmAccessEntrystblIdxs msgAndPduDspsmibInstrumControllers writeVarssname(s snmpEngines groupNames contextNames securityModels securityLevelsvacmAccessEntrystblIdx((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys delVacmAccessxscCs>|iiiidd\}|i||}||fSdS(NsSNMP-VIEW-BASED-ACM-MIBsvacmViewTreeFamilyEntry( s snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolssvacmViewTreeFamilyEntrysgetInstIdFromIndicessviewNamessubTreestblIdx(s snmpEnginesviewNamessubTreestblIdxsvacmViewTreeFamilyEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys__cookVacmViewInfoscCst|||\}}|iii|i df|dff|iii|i df|df|i df||f|i df||f|i df||f|i df||ffdS(Nisdestroys createAndGoiiii( s__cookVacmViewInfos snmpEnginesviewNamessubTreesvacmViewTreeFamilyEntrystblIdxs msgAndPduDspsmibInstrumControllers writeVarssnamesmasksviewType(s snmpEnginesviewNamesviewTypessubTreesmasksvacmViewTreeFamilyEntrystblIdx((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys addVacmViews*cCsFt|||\}}|iii|i df|dffdS(Nisdestroy( s__cookVacmViewInfos snmpEnginesviewNamessubTreesvacmViewTreeFamilyEntrystblIdxs msgAndPduDspsmibInstrumControllers writeVarssname(s snmpEnginesviewNamessubTreesvacmViewTreeFamilyEntrystblIdx((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys delVacmViewscCscdt||f}|iiiidd\}||}||d|d|d|fSdS(Nsv-%s-%dsSNMP-FRAMEWORK-MIBsSnmpSecurityLevelsrswsn( shashs securityNames securityModels groupNames snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolssSnmpSecurityLevels securityLevel(s snmpEngines securityModels securityNames securityLevels groupNamesSnmpSecurityLevel((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys__cookVacmUserInfos c Cst||||\} }} } }t || ||t || |||d| | | |ot || d|dn|ot || d|dn|ot ||d|dndS(Nisincludeds(s__cookVacmUserInfos snmpEngines securityModels securityNames securityLevels groupNamesreadViews writeViews notifyViews addVacmGroups addVacmAccesss contextNames readSubTrees addVacmViews writeSubTrees notifySubTree( s snmpEngines securityModels securityNames securityLevels readSubTrees writeSubTrees notifySubTrees contextNames notifyViews writeViews groupNamesreadView((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys addVacmUsers$ c Cst||||\} }} }}t |||t || d|||ot || |n|ot |||n|ot |||ndS(Ns(s__cookVacmUserInfos snmpEngines securityModels securityNames securityLevels groupNamesreadViews writeViews notifyViews delVacmGroups delVacmAccesss readSubTrees delVacmViews writeSubTrees notifySubTree( s snmpEngines securityModels securityNames securityLevels readSubTrees writeSubTrees notifySubTrees notifyViews writeViews groupNamesreadView((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys delVacmUsers$cCst|||||dS(N(s addVacmUsers snmpEngines securityModels securityNames securityLevelssubTree(s snmpEngines securityModels securityNames securityLevelssubTree((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys addRoUserscCst|||||dS(N(s delVacmUsers snmpEngines securityModels securityNames securityLevelssubTree(s snmpEngines securityModels securityNames securityLevelssubTree((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys delRoUserscCst||||||dS(N(s addVacmUsers snmpEngines securityModels securityNames securityLevelssubTree(s snmpEngines securityModels securityNames securityLevelssubTree((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys addRwUserscCst||||||dS(N(s delVacmUsers snmpEngines securityModels securityNames securityLevelssubTree(s snmpEngines securityModels securityNames securityLevelssubTree((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys delRwUserscCs t||||ff|dS(N(s addVacmUsers snmpEngines securityModels securityNames securityLevelssubTree(s snmpEngines securityModels securityNames securityLevelssubTree((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys addTrapUserscCs t||||ff|dS(N(s delVacmUsers snmpEngines securityModels securityNames securityLevelssubTree(s snmpEngines securityModels securityNames securityLevelssubTree((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys delTrapUsersc Cs|iiiidd\}|i|}|iiiidd\}|i|}dt |} |o4|iiiidd\} | i| |}n t} }||||| | |fSdS(NsSNMP-NOTIFICATION-MIBssnmpNotifyEntryssnmpNotifyFilterProfileEntrys %s-filterssnmpNotifyFilterEntry(s snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolsssnmpNotifyEntrysgetInstIdFromIndicessnotificationNamestblIdx1ssnmpNotifyFilterProfileEntrys paramsNamestblIdx2shashs profileNames filterSubtreessnmpNotifyFilterEntrystblIdx3sNone( s snmpEnginesnotificationNames paramsNames filterSubtreessnmpNotifyEntryssnmpNotifyFilterProfileEntrystblIdx2stblIdx3stblIdx1s profileNamessnmpNotifyFilterEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys__cookNotificationTargetInfos cCst||||\} } } } }} }|i i i| idf| dff|i i i| idf| df| idf| |f| idf| |ff|i i i| idf| dff|i i i| idf| df| idf| |ff| odSn|i i i| idf|dff|i i i| idf|df| idf||f| idf||f| idf||ffdS(Nisdestroys createAndGoiii(s__cookNotificationTargetInfos snmpEnginesnotificationNames paramsNames filterSubtreessnmpNotifyEntrystblIdx1ssnmpNotifyFilterProfileEntrystblIdx2s profileNamessnmpNotifyFilterEntrystblIdx3s msgAndPduDspsmibInstrumControllers writeVarssnames transportTags notifyTypes filterMasks filterType(s snmpEnginesnotificationNames paramsNames transportTags notifyTypes filterSubtrees filterMasks filterTypestblIdx3ssnmpNotifyFilterProfileEntryssnmpNotifyEntryssnmpNotifyFilterEntrystblIdx2stblIdx1s profileName((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pysaddNotificationTargets**X*A*c Cst||||\}}}}} } }|i i i|idf|dff|i i i|idf|dff| odSn|i i i| idf|dffdS(Nisdestroyi(s__cookNotificationTargetInfos snmpEnginesnotificationNames paramsNames filterSubtreessnmpNotifyEntrystblIdx1ssnmpNotifyFilterProfileEntrystblIdx2s profileNamessnmpNotifyFilterEntrystblIdx3s msgAndPduDspsmibInstrumControllers writeVarssname( s snmpEnginesnotificationNames paramsNames filterSubtreessnmpNotifyEntryssnmpNotifyFilterProfileEntrystblIdx2stblIdx3stblIdx1s profileNamessnmpNotifyFilterEntry((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pysdelNotificationTargetEs ***c Cst|dt|dddt|ddddddtd t|dddddddd t|dddd dddd t|dd d dd d fdt|dd d dd d d d d fdt|dd d dd d d d dfdt|dd d dd d d ddd d f dt|dd d dd d d ddd d f dt|dd d dd d d ddd d f ddS(Nssinitialis noAuthNoPrivsexacts restricteds authNoPrivsinternetsauthPrivsincludediiii i i(s addContexts snmpEngines addVacmGroups addVacmAccesssNones addVacmView(s snmpEngine((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pyssetInitialVacmParameters]s    "++11([sstringspysnmp.carrier.asynsocksdispatchspysnmp.carrier.asynsock.dgramsudpsudp6sunixssnmpLocalDomains ImportErrors pysnmp.protosrfc3412s pysnmp.entitysengines pysnmp.proto.secmod.rfc3414.authshmacmd5shmacshasnoauths pysnmp.proto.secmod.rfc3414.privsdessnoprivs pysnmp.proto.secmod.rfc3826.privsaesspysnmp.proto.secmod.eso.privsdes3saes192saes256spysnmp.smi.errorsNotWritableErrorspysnmpserrors snmpUDPDomainssnmpUDP6DomainsHmacMd5s serviceIDsusmHMACMD5AuthProtocolsHmacShasusmHMACSHAAuthProtocolsNoAuthsusmNoAuthProtocolsDessusmDESPrivProtocolsDes3susm3DESEDEPrivProtocolsAessusmAesCfb128ProtocolsAes192susmAesCfb192ProtocolsAes256susmAesCfb256ProtocolsNoPrivsusmNoPrivProtocols authServicess privServicess__cookV1SystemInfosNones addV1Systems delV1Systems__cookV3UserInfos addV3Users delV3Users__cookTargetParamsInfosaddTargetParamssdelTargetParamss__cookTargetAddrInfos addTargetAddrs delTargetAddrsaddSocketTransportsdelSocketTransports addContexts__cookVacmGroupInfos addVacmGroups delVacmGroups__cookVacmAccessInfos addVacmAccesss delVacmAccesss__cookVacmViewInfos addVacmViews delVacmViews__cookVacmUserInfos addVacmUsers delVacmUsers addRoUsers delRoUsers addRwUsers delRwUsers addTrapUsers delTrapUsers__cookNotificationTargetInfosaddNotificationTargetsdelNotificationTargetssetInitialVacmParameters(Es__cookV1SystemInfosaddNotificationTargetsusmNoAuthProtocols addV3UserssnmpUDP6Domains addRwUsers addV1Systems addVacmGroupsusmNoPrivProtocolsdispatchsdes3shmacmd5s delVacmGroupsunixs addContexts delTargetAddrsnoauths__cookV3UserInfosaes192ssetInitialVacmParameterssnoprivsaddSocketTransports delRoUsersdelSocketTransportsaes256susmHMACMD5AuthProtocolsusm3DESEDEPrivProtocols addVacmUsers addTrapUsersudp6susmAesCfb192Protocols delVacmViews snmpUDPDomains__cookNotificationTargetInfos authServicessaddTargetParamss addTargetAddrs privServicessenginesudps delV1SystemsdelNotificationTargetsstringshmacshas delTrapUsers delV3Users__cookVacmViewInfosrfc3412ssnmpLocalDomainsNotWritableErrors__cookTargetAddrInfosdelTargetParamssusmDESPrivProtocols delVacmAccesssusmAesCfb256Protocols__cookTargetParamsInfosaessusmAesCfb128Protocols__cookVacmGroupInfos__cookVacmUserInfos addVacmAccesssusmHMACSHAAuthProtocolsdess addVacmViews delVacmUserserrors addRoUsers delRwUsers__cookVacmAccessInfo((s2build/bdist.linux-i686/egg/pysnmp/entity/config.pys?s                    E   D    $              ' PKAq>RFv!! pysnmp/entity/rfc3413/ntforg.pyc; 3VMc@s}dkZdklZdklZdklZdklZdk l Z dk l Z e i dZ dfd YZdS( N(sconfig(srfc2576(sv2c(serror(snextid(sdebugisNotificationOriginatorcBs>tZdZdZdZdZeeeddZRS(NicCsh|_||_dS(N(sselfs$_NotificationOriginator__pendingReqss snmpContexts _NotificationOriginator__context(sselfs snmpContext((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/ntforg.pys__init__ s c Cs| \} }|i| \}}}}}}}}}}}}}}|i| =|iit|| o_titi@otid| | f||joJtiti@otid| |f|i|| d| |dSn|ii|||||||||||dt|dti|i | |f} |ii!t|titi@otid| |||f|||||||||||||d| f|i| i>|i?||f} titi@otid | |f| ||||||i i;|||||dtCf|iD| <|iEiFtG|| SqeWdS( Ns+sendNoification: notifyTag %s notifyType %ss __SNMPv2-MIBs sysUpTimes snmpTrapOIDsnotifyiiiids-sendNoification: sendPduHandle %s, timeout %d(HsconfigsgetNotificationInfos snmpEnginesnotificationTargets notifyTags notifyTypesdebugsloggersflagAppsselfs _NotificationOriginator__contexts getMibInstrums contextNamescontextMibInstrumCtlsgetTargetNamesstargetAddrNames getTargetAddrstransportDomainstransportAddressstimeouts retryCountsparamssgetTargetParamssmessageProcessingModels securityModels securityNames securityLevelsvarBindss mibBuilders importSymbolss sysUpTimesappendsnamessyntaxsclones snmpTrapOidsnotificationNamesadditionalVarBindssextendsvarNamesvarValsaccessControlModelsacmIDsisAccessAllowedserrorsSmiErrorsv2cs SNMPv2TrapPDUspdusInformRequestPDUs RuntimeErrorsapiPDUs setDefaultss setVarBindssrfc2576sv2ToV1s pduVersions msgAndPduDspssendPduscontextEngineIdsNonesfloatstimesprocessResponsePduscbFunscbCtxs sendPduHandles getNextHandles$_NotificationOriginator__pendingReqsstransportDispatchers jobStartedsid(sselfs snmpEnginesnotificationTargetsnotificationNamesadditionalVarBindsscbFunscbCtxs contextNamestransportAddresss sendPduHandlesvarNamestransportDomainsvarValstargetAddrNames notifyTags snmpTrapOidsvarBindss securityModelsmessageProcessingModels notifyTypesparamss pduVersions sysUpTimescontextMibInstrumCtls securityLevelspdus securityNamestimeouts retryCount((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/ntforg.pyssendNotificationts (! &             (@(s__name__s __module__sacmIDs__init__sprocessResponsePdus_handleResponsesNonessendNotification(((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/ntforg.pysNotificationOriginator s   [ (stimespysnmp.entity.rfc3413sconfigspysnmp.proto.proxysrfc2576spysnmp.proto.apisv2cs pysnmp.smiserrorspysnmpsnextidsdebugsIntegers getNextHandlesNotificationOriginator( sv2cstimes getNextHandlesNotificationOriginatorsrfc2576serrorsdebugsnextidsconfig((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/ntforg.pys?s       PKQj2!pysnmp/entity/rfc3413/__init__.pyPKAq>dEE pysnmp/entity/rfc3413/cmdgen.pyc; `9VMc@sdkZdkZdklZlZlZlZdklZdk l Z dk l Z l Z lZdklZe idZdZeidZd Zd fd YZd efd YZdefdYZdefdYZdefdYZdS(N(srfc1157srfc1905sapiserrind(sconfig(srfc2576(serrorsnextidsdebug(sunivicCs2|djo d}nd}|ti|fSdS(Nii(s snmpVersions pduVersionsapis protoModules(s snmpVersions pduVersion((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/cmdgen.pysgetVersionSpecifics s  scCst}t|}}g}x|o|d}t||dti o|d}n7||di ||di jo t i }n|id||dtfqW| o g}n||fSdS(Nii(sNoneserrorIndicationslensvarBindssidxsnonNullss rspVarBindss isinstancesunivsNulls origVarBindssasTupleserrindsoidNotIncreasingsinserts__null(s origVarBindssvarBindssidxs rspVarBindssnonNullsserrorIndication((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/cmdgen.pysgetNextVarBindss ) # sCommandGeneratorBasecBsDtZeidZdZdZeeddZdZ RS(NscCs h|_dS(N(sselfs"_CommandGeneratorBase__pendingReqs(sself((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/cmdgen.pys__init__'sc Cs| \} }|i| \}}}}}}}}}}}}}}|i| =|iit|| otiti@otid| | f||joMtiti@otid| |f| || dddf|dSn|i||||||||||||||d||i| |ffdSn||jpL||jp?||jp2|o ||jp|o ||jp ||joCtiti@otid| | |dddf|dSnt"i#|}|i%i&| |i%i&|joCtiti@otid| | |dddf|dSn|djo&t(i)| |} t"i#t"i*}n|i+||||||||||||||| || |fdS( Ns:processResponsePdu: sendPduHandle %s, statusInformation %ss=processResponsePdu: sendPduHandle %s, retry count %d exceededserrorIndicationiisDprocessResponsePdu: sendPduHandle %s, request/response data mismatchs badResponsesEprocessResponsePdu: sendPduHandle %s, request-id/response-id mismatch(,scbFunscbCtxsselfs"_CommandGeneratorBase__pendingReqss sendPduHandlesorigTransportDomainsorigTransportAddresssorigMessageProcessingModelsorigSecurityModelsorigSecurityNamesorigSecurityLevelsorigContextEngineIdsorigContextNamesorigPduVersionsorigPdus origTimeoutsorigRetryCounts origRetriessorigSendRequestHandles snmpEnginestransportDispatchers jobFinishedsidsstatusInformationsdebugsloggersflagApps_sendPdusprocessResponsePdusmessageProcessingModels securityModelscontextEngineIds contextNames pduVersionsapis protoModulesspModsapiPDUs getRequestIDsPDUsrfc2576sv1ToV2sprotoVersion2cs_handleResponse(sselfs snmpEnginesmessageProcessingModels securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionsPDUsstatusInformations sendPduHandles.24scbFunscbCtxsorigMessageProcessingModelsorigPduspModsorigSecurityLevelsorigSecurityNamesorigPduVersionsorigContextEngineIds origRetriessorigSendRequestHandlesorigContextNamesorigRetryCountsorigTransportDomains origTimeoutsorigSecurityModelsorigTransportAddress((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/cmdgen.pysprocessResponsePdu*sr 7 ( ( \" %"  cCstiddS(NsMethod not implemented(serrors PySnmpError(sselfs snmpEnginesaddrNamesvarBindsscbFunscbCtxscontextEngineIds contextName((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/cmdgen.pyssendReqs cCs|\}}|ii||||||||| | | dt| dti||}|iit|titi@otid|| || f|||||||| | | | | ||f|i|4g66 pysnmp/entity/rfc3413/cmdrsp.pyc; "=8Mc@sdklZlZlZlZlZlZdklZdk l Z dk Z dk l Z dfdYZdefdYZd efd YZd efd YZd efdYZdS((srfc1157srfc1902srfc1905srfc3411serrindserror(sv2c(srfc2576N(sdebugsCommandResponderBasecBsztZdZfZdZdZdZdZei i Z ei i Z eii Zeii ZdZdZRS(NicCs5|ii|i|i|i||_h|_dS(N( s snmpEngines msgAndPduDspsregisterContextEngineIds snmpContextscontextEngineIdsselfspduTypess processPdus"_CommandResponderBase__pendingReqs(sselfs snmpEngines snmpContext((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/cmdrsp.pys__init__ s cCs|\}}dS(N(sacFunsacCtx(sselfs snmpEnginesstateReferences contextNamesPDUs.10sacFunsacCtx((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/cmdrsp.pyshandleMgmtOperations cCs |ii|ii|idS(N(s snmpEngines msgAndPduDspsunregisterContextEngineIdsselfs snmpContextscontextEngineIdspduTypes(sselfs snmpEngine((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/cmdrsp.pysclosesc Csl|i|\ } }}}} } }}}} }|i|=titi@otid||||ftii||tii||tii||| djoti||}ny5|ii|| |||| | ||| || Wnntij o_}titi@otid||f|ii!i"i#dd\} | i%d| _%nXdS(NsFsendRsp: stateReference %s, errorStatus %s, errorIndex %s, varBinds %sis0sendRsp: stateReference %s, statusInformation %ss __SNMPv2-MIBssnmpSilentDropsi(&sselfs"_CommandResponderBase__pendingReqssstateReferencesmessageProcessingModels securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionsPDUsorigPdusmaxSizeResponseScopedPDUsstatusInformationsdebugsloggersflagApps errorStatuss errorIndexsvarBindssv2csapiPDUssetErrorStatuss setErrorIndexs setVarBindssrfc2576sv2ToV1s snmpEngines msgAndPduDspsreturnResponsePduserrorsStatusInformationswhysmibInstrumControllers mibBuilders importSymbolsssnmpSilentDropsssyntax(sselfs snmpEnginesstateReferences errorStatuss errorIndexsvarBindssorigPdusstatusInformations securityModelscontextEngineIdsmessageProcessingModelsmaxSizeResponseScopedPDUs contextNamessnmpSilentDropssPDUs pduVersionswhys securityLevels securityName((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/cmdrsp.pyssendRsps2. .   (c  Cs|djo| } ti| } nt} | itijo| iti jot i d| int i i| }h}||||||||| | |f |i| <|||||| if}t i i| }ddf\}} t"i#t"i$@ot"i#d| |fy&|i%|| || |i&|fWnSt'i(i i)j o^}t"i#t"i$@ot"i#d| |fd|jo |d|d<|d|dDpysnmp/entity/rfc3413/config.py# Shortcuts to MIB instrumentation items used internally in SNMP applications import string from pysnmp.smi.error import SmiError, NoSuchObjectError from pysnmp.smi.exval import noSuchInstance from pysnmp.entity import config def getTargetAddr(snmpEngine, snmpTargetAddrName): mibInstrumController = snmpEngine.msgAndPduDsp.mibInstrumController # Transport endpoint snmpTargetAddrEntry, = mibInstrumController.mibBuilder.importSymbols( 'SNMP-TARGET-MIB', 'snmpTargetAddrEntry' ) tblIdx = snmpTargetAddrEntry.getInstIdFromIndices( snmpTargetAddrName ) ((v, snmpTargetAddrTDomain), (v, snmpTargetAddrTAddress), (v, snmpTargetAddrTimeout), (v, snmpTargetAddrRetryCount), (v, snmpTargetAddrParams)) = mibInstrumController.readVarsFast( ((snmpTargetAddrEntry.name + (2,) + tblIdx, None), (snmpTargetAddrEntry.name + (3,) + tblIdx, None), (snmpTargetAddrEntry.name + (4,) + tblIdx, None), (snmpTargetAddrEntry.name + (5,) + tblIdx, None), (snmpTargetAddrEntry.name + (7,) + tblIdx, None)) ) if noSuchInstance.isSameTypeWith(snmpTargetAddrParams): raise SmiError('Target %s not configured at SMI' % snmpTargetAddrName) if snmpTargetAddrTDomain[:len(config.snmpUDPDomain)] == config.snmpUDPDomain: SnmpUDPAddress, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMPv2-TM', 'SnmpUDPAddress') snmpTargetAddrTAddress = tuple( SnmpUDPAddress(snmpTargetAddrTAddress) ) elif snmpTargetAddrTDomain[:len(config.snmpUDP6Domain)] == config.snmpUDP6Domain: TransportAddressIPv6, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('TRANSPORT-ADDRESS-MIB', 'TransportAddressIPv6') snmpTargetAddrTAddress = tuple( TransportAddressIPv6(snmpTargetAddrTAddress) ) return ( snmpTargetAddrTDomain, snmpTargetAddrTAddress, snmpTargetAddrTimeout, snmpTargetAddrRetryCount, snmpTargetAddrParams ) def getTargetInfo(snmpEngine, snmpTargetAddrName): # Transport endpoint ( snmpTargetAddrTDomain, snmpTargetAddrTAddress, snmpTargetAddrTimeout, snmpTargetAddrRetryCount, snmpTargetAddrParams ) = getTargetAddr(snmpEngine, snmpTargetAddrName) mibInstrumController = snmpEngine.msgAndPduDsp.mibInstrumController # Target params snmpTargetParamsEntry, = mibInstrumController.mibBuilder.importSymbols( 'SNMP-TARGET-MIB', 'snmpTargetParamsEntry' ) tblIdx = snmpTargetParamsEntry.getInstIdFromIndices( snmpTargetAddrParams ) ((v, snmpTargetParamsMPModel), (v, snmpTargetParamsSecurityModel), (v, snmpTargetParamsSecurityName), (v, snmpTargetParamsSecurityLevel)) = mibInstrumController.readVarsFast( ((snmpTargetParamsEntry.name + (2,) + tblIdx, None), (snmpTargetParamsEntry.name + (3,) + tblIdx, None), (snmpTargetParamsEntry.name + (4,) + tblIdx, None), (snmpTargetParamsEntry.name + (5,) + tblIdx, None)) ) if noSuchInstance.isSameTypeWith(snmpTargetParamsSecurityName): raise SmiError('Parameters %s not configured at SMI' % snmpTargetAddrParams) return ( snmpTargetAddrTDomain, snmpTargetAddrTAddress, snmpTargetAddrTimeout, snmpTargetAddrRetryCount, snmpTargetParamsMPModel, snmpTargetParamsSecurityModel, snmpTargetParamsSecurityName, snmpTargetParamsSecurityLevel ) def getTargetParams(snmpEngine, paramsName): mibInstrumController = snmpEngine.msgAndPduDsp.mibInstrumController snmpTargetParamsEntry, = mibInstrumController.mibBuilder.importSymbols( 'SNMP-TARGET-MIB', 'snmpTargetParamsEntry' ) tblIdx = snmpTargetParamsEntry.getInstIdFromIndices( paramsName ) ((v, snmpTargetParamsMPModel), (v, snmpTargetParamsSecurityModel), (v, snmpTargetParamsSecurityName), (v, snmpTargetParamsSecurityLevel)) = mibInstrumController.readVarsFast( ((snmpTargetParamsEntry.name + (2,) + tblIdx, None), (snmpTargetParamsEntry.name + (3,) + tblIdx, None), (snmpTargetParamsEntry.name + (4,) + tblIdx, None), (snmpTargetParamsEntry.name + (5,) + tblIdx, None)) ) if noSuchInstance.isSameTypeWith(snmpTargetParamsMPModel): raise SmiError('Parameters %s not configured at SMI' % paramsName) return ( snmpTargetParamsMPModel, snmpTargetParamsSecurityModel, snmpTargetParamsSecurityName, snmpTargetParamsSecurityLevel ) def getNotificationInfo(snmpEngine, notificationTarget): mibInstrumController = snmpEngine.msgAndPduDsp.mibInstrumController # Transport endpoint snmpNotifyEntry, = mibInstrumController.mibBuilder.importSymbols( 'SNMP-NOTIFICATION-MIB', 'snmpNotifyEntry' ) tblIdx = snmpNotifyEntry.getInstIdFromIndices( notificationTarget ) ((v, snmpNotifyTag), (v, snmpNotifyType)) = mibInstrumController.readVarsFast( ((snmpNotifyEntry.name + (2,) + tblIdx, None), (snmpNotifyEntry.name + (3,) + tblIdx, None)) ) if noSuchInstance.isSameTypeWith(snmpNotifyTag): raise SmiError('Target %s not configured at SMI' % notificationTarget) return snmpNotifyTag, snmpNotifyType def getTargetNames(snmpEngine, tag): mibInstrumController = snmpEngine.msgAndPduDsp.mibInstrumController # Transport endpoint ( snmpTargetAddrEntry, snmpTargetAddrTagList ) = mibInstrumController.mibBuilder.importSymbols( 'SNMP-TARGET-MIB', 'snmpTargetAddrEntry', 'snmpTargetAddrTagList' ) targetNames = [] nextName = snmpTargetAddrTagList.name while 1: try: mibNode = snmpTargetAddrTagList.getNextNode(nextName) except NoSuchObjectError: break # XXX stop on eot if tag in string.split(str(mibNode.syntax)): # XXX add __split__() idx = mibNode.name[len(snmpTargetAddrTagList.name):] targetNames.append( snmpTargetAddrEntry.getIndicesFromInstId(idx)[0] ) nextName = mibNode.name return targetNames # XXX # convert cmdrsp/cmdgen into this api PK4>U"" pysnmp/entity/rfc3413/context.py# SNMP entity context from pysnmp import error from pysnmp import debug class SnmpContext: def __init__(self, snmpEngine, contextEngineId=None): if contextEngineId is None: # Default to local snmpEngineId contextEngineId,= snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpEngineID') contextEngineId = contextEngineId.syntax self.contextEngineId = contextEngineId debug.logger & debug.flagIns and debug.logger('SnmpContext: contextEngineId \"%s\"' % repr(contextEngineId)) self.contextNames = { '': snmpEngine.msgAndPduDsp.mibInstrumController # Default name } def registerContextName(self, contextName, mibInstrum=None): if contextName in self.contextNames: raise error.PySnmpError( 'Duplicate contextName %s' % contextName ) debug.logger & debug.flagIns and debug.logger('registerContextName: registered contextName \"%s\", mibInstrum %s' % (contextName, mibInstrum)) if mibInstrum is None: self.contextNames[contextName] = self.contextNames[''] else: self.contextNames[contextName] = mibInstrum def unregisterContextName(self, contextName): if contextName in self.contextNames: debug.logger & debug.flagIns and debug.logger('unregisterContextName: unregistered contextName \"%s\"' % contextName) del self.contextNames[contextName] def getMibInstrum(self, contextName): if contextName not in self.contextNames: debug.logger & debug.flagIns and debug.logger('getMibInstrum: contextName \"%s\" not registered' % contextName) raise error.PySnmpError( 'Missing contextName %s' % contextName ) else: debug.logger & debug.flagIns and debug.logger('getMibInstrum: contextName \"%s\", mibInstum %s' % (contextName, self.contextNames[contextName])) return self.contextNames[contextName] PKAq>|=8Mc@s1dklZdklZdfdYZdS((serror(sdebugs SnmpContextcBs2tZedZedZdZdZRS(NcCs|tjo+|iiiidd\}|i}n||_t i t i @ot i dt |hd|ii<|_ dS(Ns__SNMP-FRAMEWORK-MIBs snmpEngineIDs!SnmpContext: contextEngineId "%s"s(scontextEngineIdsNones snmpEngines msgAndPduDspsmibInstrumControllers mibBuilders importSymbolsssyntaxsselfsdebugsloggersflagInssreprs contextNames(sselfs snmpEnginescontextEngineId((s;build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/context.pys__init__s    (cCs||ijotid|ntiti@otid||f|t jo|id|i|KH5p%%pysnmp/entity/rfc3413/ntforg.pyimport time from pysnmp.entity.rfc3413 import config from pysnmp.proto.proxy import rfc2576 from pysnmp.proto.api import v2c from pysnmp.smi import error from pysnmp import nextid from pysnmp import debug getNextHandle = nextid.Integer(0x7fffffff) class NotificationOriginator: acmID = 3 # default MIB access control method to use def __init__(self, snmpContext): self.__pendingReqs = {} self.__context = snmpContext def processResponsePdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, statusInformation, sendPduHandle, (cbFun, cbCtx) ): # 3.3.6d ( origTransportDomain, origTransportAddress, origMessageProcessingModel, origSecurityModel, origSecurityName, origSecurityLevel, origContextEngineId, origContextName, origPduVersion, origPdu, origTimeout, origRetryCount, origRetries, origSendRequestHandle ) = self.__pendingReqs[sendPduHandle] del self.__pendingReqs[sendPduHandle] snmpEngine.transportDispatcher.jobFinished(id(self)) if statusInformation: debug.logger & debug.flagApp and debug.logger('processResponsePdu: sendPduHandle %s statusInformation %s' % (sendPduHandle, statusInformation)) if origRetries == origRetryCount: debug.logger & debug.flagApp and debug.logger('processResponsePdu: sendPduHandle %s retry count %d exceeded' % (sendPduHandle, origRetries)) self._handleResponse( origSendRequestHandle, statusInformation['errorIndication'], cbFun, cbCtx) return # 3.3.6a sendPduHandle = snmpEngine.msgAndPduDsp.sendPdu( snmpEngine, origTransportDomain, origTransportAddress, origMessageProcessingModel, origSecurityModel, origSecurityName, origSecurityLevel, origContextEngineId, origContextName, origPduVersion, origPdu, 1, # expectResponse float(origTimeout)/100 + time.time(), # timeout self.processResponsePdu, (cbFun, cbCtx) ) snmpEngine.transportDispatcher.jobStarted(id(self)) debug.logger & debug.flagApp and debug.logger('processResponsePdu: sendPduHandle %s, timeout %d, retry %d of %d' % (sendPduHandle, origTimeout, origRetries, origRetryCount)) # 3.3.6b self.__pendingReqs[sendPduHandle] = ( origTransportDomain, origTransportAddress, origMessageProcessingModel, origSecurityModel, origSecurityName, origSecurityLevel, origContextEngineId, origContextName, origPduVersion, origPdu, origTimeout, origRetryCount, origRetries + 1, sendPduHandle ) return # 3.3.6c self._handleResponse(origSendRequestHandle, None, cbFun, cbCtx) def _handleResponse( self, sendRequestHandle, errorIndication, cbFun, cbCtx): cbFun(sendRequestHandle, errorIndication, cbCtx) def sendNotification( self, snmpEngine, notificationTarget, notificationName, additionalVarBinds=None, cbFun=None, cbCtx=None, contextName='' ): # 3.3 ( notifyTag, notifyType ) = config.getNotificationInfo( snmpEngine, notificationTarget ) debug.logger & debug.flagApp and debug.logger('sendNoification: notifyTag %s notifyType %s' % (notifyTag, notifyType)) contextMibInstrumCtl = self.__context.getMibInstrum( contextName ) for targetAddrName in config.getTargetNames(snmpEngine, notifyTag): ( transportDomain, transportAddress, timeout, retryCount, params ) = config.getTargetAddr(snmpEngine, targetAddrName) ( messageProcessingModel, securityModel, securityName, securityLevel ) = config.getTargetParams(snmpEngine, params) # 3.3.1 XXX # XXX filtering's yet to be implemented # filterProfileName = config.getNotifyFilterProfile(params) # ( filterSubtree, # filterMask, # filterType ) = config.getNotifyFilter(filterProfileName) varBinds = [] # 3.3.2 & 3.3.3 sysUpTime, = contextMibInstrumCtl.mibBuilder.importSymbols( '__SNMPv2-MIB', 'sysUpTime' ) varBinds.append( (sysUpTime.name, sysUpTime.syntax.clone()) # for actual value ) snmpTrapOid, = contextMibInstrumCtl.mibBuilder.importSymbols( '__SNMPv2-MIB', 'snmpTrapOID' ) if notificationName: varBinds.append( (snmpTrapOid.name, snmpTrapOid.syntax.clone(notificationName)) ) else: varBinds.append((snmpTrapOid.name, snmpTrapOid.syntax)) # XXX it's still not clear how to instantiate OBJECTS clause # # Get notification objects names # for notificationObject in snmpTrapVal.getObjects(): # mibNode, = apply( # contextMibInstrumCtl.mibBuilder.importSymbols, # notificationObject # ) # try: # objectInstance = mibNode.getNode(mibNode.name + (0,)) # except error.SmiError: # return # varBinds.append((objectInstance.name, objectInstance.syntax)) if additionalVarBinds: varBinds.extend(additionalVarBinds) for varName, varVal in varBinds: try: snmpEngine.accessControlModel[self.acmID].isAccessAllowed( snmpEngine, securityModel, securityName, securityLevel, 'notify', contextName, varName ) except error.SmiError: return # 3.3.4 if notifyType == 1: pdu = v2c.SNMPv2TrapPDU() elif notifyType == 2: pdu = v2c.InformRequestPDU() else: raise RuntimeError() v2c.apiPDU.setDefaults(pdu) v2c.apiPDU.setVarBinds(pdu, varBinds) # User-side API assumes SMIv2 if messageProcessingModel == 0: pdu = rfc2576.v2ToV1(pdu) pduVersion = 0 else: pduVersion = 1 # 3.3.5 if notifyType == 1: snmpEngine.msgAndPduDsp.sendPdu( snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, self.__context.contextEngineId, contextName, pduVersion, pdu, None ) else: # 3.3.6a sendPduHandle = snmpEngine.msgAndPduDsp.sendPdu( snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, self.__context.contextEngineId, contextName, pduVersion, pdu, 1, # expectResponse float(timeout)/100 + time.time(), # timeout self.processResponsePdu, (cbFun, cbCtx) ) debug.logger & debug.flagApp and debug.logger('sendNoification: sendPduHandle %s, timeout %d' % (sendPduHandle, timeout)) # 3.3.6b self.__pendingReqs[sendPduHandle] = ( transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, self.__context.contextEngineId, contextName, pduVersion, pdu, timeout, retryCount, 1, getNextHandle() ) snmpEngine.transportDispatcher.jobStarted(id(self)) return sendPduHandle # XXX # move/group/implement config setting/retrieval at a stand-alone module PK 4>? eR2R2pysnmp/entity/rfc3413/cmdrsp.pyfrom pysnmp.proto import rfc1157, rfc1902, rfc1905, rfc3411, errind, error from pysnmp.proto.api import v2c # backend is always SMIv2 compliant from pysnmp.proto.proxy import rfc2576 import pysnmp.smi.error from pysnmp import debug # 3.2 class CommandResponderBase: acmID = 3 # default MIB access control method to use pduTypes = () def __init__(self, snmpEngine, snmpContext): snmpEngine.msgAndPduDsp.registerContextEngineId( snmpContext.contextEngineId, self.pduTypes, self.processPdu ) self.snmpContext = snmpContext # for unregistration self.__pendingReqs = {} def handleMgmtOperation( self, snmpEngine, stateReference, contextName, PDU, (acFun, acCtx) ): pass def close(self, snmpEngine): snmpEngine.msgAndPduDsp.unregisterContextEngineId( self.snmpContext.contextEngineId, self.pduTypes ) def sendRsp(self, snmpEngine, stateReference, errorStatus, errorIndex, varBinds): ( messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, origPdu, maxSizeResponseScopedPDU, statusInformation ) = self.__pendingReqs[stateReference] del self.__pendingReqs[stateReference] debug.logger & debug.flagApp and debug.logger('sendRsp: stateReference %s, errorStatus %s, errorIndex %s, varBinds %s' % (stateReference, errorStatus, errorIndex, varBinds)) v2c.apiPDU.setErrorStatus(PDU, errorStatus) v2c.apiPDU.setErrorIndex(PDU, errorIndex) v2c.apiPDU.setVarBinds(PDU, varBinds) # Agent-side API complies with SMIv2 if messageProcessingModel == 0: PDU = rfc2576.v2ToV1(PDU, origPdu) # 3.2.6 try: snmpEngine.msgAndPduDsp.returnResponsePdu( snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference, statusInformation ) except error.StatusInformation, why: debug.logger & debug.flagApp and debug.logger('sendRsp: stateReference %s, statusInformation %s' % (stateReference, why)) snmpSilentDrops, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpSilentDrops') snmpSilentDrops.syntax = snmpSilentDrops.syntax + 1 _getRequestType = rfc1905.GetRequestPDU.tagSet _getNextRequestType = rfc1905.GetNextRequestPDU.tagSet _setRequestType = rfc1905.SetRequestPDU.tagSet _counter64Type = rfc1902.Counter64.tagSet def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): # Agent-side API complies with SMIv2 if messageProcessingModel == 0: origPdu = PDU PDU = rfc2576.v1ToV2(PDU) else: origPdu = None # 3.2.1 if PDU.tagSet not in rfc3411.readClassPDUs and \ PDU.tagSet not in rfc3411.writeClassPDUs: raise error.ProtocolError('Unexpected PDU class %s' % PDU.tagSet) # 3.2.2 --> no-op # 3.2.4 rspPDU = v2c.apiPDU.getResponse(PDU) statusInformation = {} self.__pendingReqs[stateReference] = ( messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, rspPDU, origPdu, maxSizeResponseScopedPDU, statusInformation ) acCtx = ( snmpEngine, securityModel, securityName, securityLevel, contextName, PDU.getTagSet() ) # 3.2.5 varBinds = v2c.apiPDU.getVarBinds(PDU) errorStatus, errorIndex = 'noError', 0 debug.logger & debug.flagApp and debug.logger('processPdu: stateReference %s, varBinds %s' % (stateReference, varBinds)) try: self.handleMgmtOperation( snmpEngine, stateReference, contextName, PDU, (self.__verifyAccess, acCtx) ) # SNMPv2 SMI exceptions except pysnmp.smi.error.GenError, errorIndication: debug.logger & debug.flagApp and debug.logger('processPdu: stateReference %s, errorIndication %s' % (stateReference, errorIndication)) if 'oid' in errorIndication: # Request REPORT generation statusInformation['oid'] = errorIndication['oid'] statusInformation['val'] = errorIndication['val'] # PDU-level SMI errors except pysnmp.smi.error.NoAccessError, errorIndication: errorStatus, errorIndex = 'noAccess', errorIndication['idx'] + 1 except pysnmp.smi.error.WrongTypeError, errorIndication: errorStatus, errorIndex = 'wrongType', errorIndication['idx'] + 1 except pysnmp.smi.error.WrongValueError, errorIndication: errorStatus, errorIndex = 'wrongValue', errorIndication['idx'] + 1 except pysnmp.smi.error.NoCreationError, errorIndication: errorStatus, errorIndex = 'noCreation', errorIndication['idx'] + 1 except pysnmp.smi.error.InconsistentValueError, errorIndication: errorStatus, errorIndex = 'inconsistentValue', errorIndication['idx'] + 1 except pysnmp.smi.error.ResourceUnavailableError, errorIndication: errorStatus, errorIndex = 'resourceUnavailable', errorIndication['idx'] + 1 except pysnmp.smi.error.CommitFailedError, errorIndication: errorStatus, errorIndex = 'commitFailedError', errorIndication['idx'] + 1 except pysnmp.smi.error.UndoFailedError, errorIndication: errorStatus, errorIndex = 'undoFailedError', errorIndication['idx'] + 1 except pysnmp.smi.error.AuthorizationError, errorIndication: errorStatus, errorIndex = 'authorizationError', errorIndication['idx'] + 1 except pysnmp.smi.error.NotWritableError, errorIndication: errorStatus, errorIndex = 'notWritable', errorIndication['idx'] + 1 except pysnmp.smi.error.InconsistentNameError, errorIndication: errorStatus, errorIndex = 'inconsistentName', errorIndication['idx'] + 1 except pysnmp.smi.error.SmiError, errorIndication: errorStatus, errorIndex = 'genErr', len(varBinds) and 1 or 0 except pysnmp.error.PySnmpError, errorIndication: errorStatus, errorIndex = 'genErr', len(varBinds) and 1 or 0 else: return self.sendRsp( snmpEngine, stateReference, errorStatus, errorIndex, varBinds ) def __verifyAccess(self, name, syntax, idx, viewType, (snmpEngine, securityModel, securityName, securityLevel, contextName, pduType) ): try: snmpEngine.accessControlModel[self.acmID].isAccessAllowed( snmpEngine, securityModel, securityName, securityLevel, viewType, contextName, name ) # Map ACM errors onto SMI ones except error.StatusInformation, statusInformation: debug.logger & debug.flagApp and debug.logger('__verifyAccess: name %s, statusInformation %s' % (name, statusInformation)) errorIndication = statusInformation['errorIndication'] # 3.2.5... if errorIndication == errind.noSuchView or \ errorIndication == errind.noAccessEntry or \ errorIndication == errind.noGroupName: raise pysnmp.smi.error.AuthorizationError( name=name, idx=idx ) elif errorIndication == errind.otherError: raise pysnmp.smi.error.GenError(name=name, idx=idx) elif errorIndication == errind.noSuchContext: snmpUnknownContexts, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-TARGET-MIB', 'snmpUnknownContexts') snmpUnknownContexts.syntax = snmpUnknownContexts.syntax + 1 # Request REPORT generation raise pysnmp.smi.error.GenError( name=name, idx=idx, oid=snmpUnknownContexts.name, val=snmpUnknownContexts.syntax ) elif errorIndication == errind.notInView: return 1 else: raise error.ProtocolError( 'Unknown ACM error %s' % errorIndication ) else: # rfc2576: 4.1.2.1 if securityModel == 1 and \ syntax is not None and \ self._counter64Type == syntax.getTagSet() and \ self._getNextRequestType == pduType: # This will cause MibTree to skip this OID-value raise pysnmp.smi.error.NoAccessError(name=name, idx=idx) class GetCommandResponder(CommandResponderBase): pduTypes = ( rfc1905.GetRequestPDU.tagSet, ) # rfc1905: 4.2.1 def handleMgmtOperation( self, snmpEngine, stateReference, contextName, PDU, (acFun, acCtx) ): # rfc1905: 4.2.1.1 mgmtFun = self.snmpContext.getMibInstrum(contextName).readVars self.sendRsp( snmpEngine, stateReference, 0, 0, mgmtFun( v2c.apiPDU.getVarBinds(PDU), (acFun, acCtx) ) ) class NextCommandResponder(CommandResponderBase): pduTypes = ( rfc1905.GetNextRequestPDU.tagSet, ) # rfc1905: 4.2.2 def handleMgmtOperation( self, snmpEngine, stateReference, contextName, PDU, (acFun, acCtx) ): # rfc1905: 4.2.2.1 mgmtFun = self.snmpContext.getMibInstrum(contextName).readNextVars self.sendRsp( snmpEngine, stateReference, 0, 0, mgmtFun( v2c.apiPDU.getVarBinds(PDU), (acFun, acCtx) ) ) class BulkCommandResponder(CommandResponderBase): pduTypes = ( rfc1905.GetBulkRequestPDU.tagSet, ) maxVarBinds = 64 # rfc1905: 4.2.3 def handleMgmtOperation( self, snmpEngine, stateReference, contextName, PDU, (acFun, acCtx) ): nonRepeaters = v2c.apiBulkPDU.getNonRepeaters(PDU) if nonRepeaters < 0: nonRepeaters = 0 maxRepetitions = v2c.apiBulkPDU.getMaxRepetitions(PDU) if maxRepetitions < 0: maxRepetitions = 0 reqVarBinds = v2c.apiPDU.getVarBinds(PDU) N = min(int(nonRepeaters), len(reqVarBinds)) M = int(maxRepetitions) R = max(len(reqVarBinds)-N, 0) if R: M = min(M, self.maxVarBinds/R) debug.logger & debug.flagApp and debug.logger('handleMgmtOperation: N %d, M %d, R %d' % (N, M, R)) mgmtFun = self.snmpContext.getMibInstrum(contextName).readNextVars if N: rspVarBinds = mgmtFun(reqVarBinds[:N], (acFun, acCtx)) else: rspVarBinds = [] varBinds = reqVarBinds[-R:] while M and R: rspVarBinds.extend( mgmtFun(varBinds, (acFun, acCtx)) ) varBinds = rspVarBinds[-R:] M = M - 1 if len(rspVarBinds): self.sendRsp( snmpEngine, stateReference, 0, 0, rspVarBinds ) else: raise pysnmp.smi.error.SmiError() class SetCommandResponder(CommandResponderBase): pduTypes = ( rfc1905.SetRequestPDU.tagSet, ) # rfc1905: 4.2.5 def handleMgmtOperation( self, snmpEngine, stateReference, contextName, PDU, (acFun, acCtx) ): mgmtFun = self.snmpContext.getMibInstrum(contextName).writeVars # rfc1905: 4.2.5.1-13 try: self.sendRsp( snmpEngine, stateReference, 0, 0, mgmtFun( v2c.apiPDU.getVarBinds(PDU), (acFun, acCtx) ) ) except ( pysnmp.smi.error.NoSuchObjectError, pysnmp.smi.error.NoSuchInstanceError ), errorIndication: e = pysnmp.smi.error.NotWritableError() e.update(errorIndication) raise e PK4>gzAApysnmp/entity/rfc3413/ntfrcv.pyfrom pysnmp.proto import rfc3411, error from pysnmp.proto.api import v1, v2c # backend is always SMIv2 compliant from pysnmp.proto.proxy import rfc2576 from pysnmp import debug # 3.4 class NotificationReceiver: pduTypes = ( v1.TrapPDU.tagSet, v2c.SNMPv2TrapPDU.tagSet, v2c.InformRequestPDU.tagSet ) def __init__(self, snmpEngine, cbFun, cbCtx=None): snmpEngine.msgAndPduDsp.registerContextEngineId( '', self.pduTypes, self.processPdu # '' is a wildcard ) self.__cbFunVer = 0 self.__cbFun = cbFun self.__cbCtx = cbCtx def close(self, snmpEngine): snmpEngine.msgAndPduDsp.unregisterContextEngineId( '', self.pduTypes ) def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): # Agent-side API complies with SMIv2 if messageProcessingModel == 0: origPdu = PDU PDU = rfc2576.v1ToV2(PDU) else: origPdu = None errorStatus = 'noError'; errorIndex = 0 varBinds = v2c.apiPDU.getVarBinds(PDU) debug.logger & debug.flagApp and debug.logger('processPdu: stateReference %s, varBinds %s' % (stateReference, varBinds)) # 3.4 if PDU.tagSet in rfc3411.confirmedClassPDUs: # 3.4.1 --> no-op rspPDU = v2c.apiPDU.getResponse(PDU) # 3.4.2 v2c.apiPDU.setErrorStatus(rspPDU, errorStatus) v2c.apiPDU.setErrorIndex(rspPDU, errorIndex) v2c.apiPDU.setVarBinds(rspPDU, varBinds) debug.logger & debug.flagApp and debug.logger('processPdu: stateReference %s, confirm PDU %s' % (stateReference, rspPDU.prettyPrint())) # Agent-side API complies with SMIv2 if messageProcessingModel == 0: rspPDU = rfc2576.v2ToV1(rspPDU, origPdu) statusInformation = {} # 3.4.3 try: snmpEngine.msgAndPduDsp.returnResponsePdu( snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, rspPDU, maxSizeResponseScopedPDU, stateReference, statusInformation ) except error.StatusInformation, why: debug.logger & debug.flagApp and debug.logger('processPdu: stateReference %s, statusInformation %s' % (stateReference, why)) snmpSilentDrops, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpSilentDrops') snmpSilentDrops.syntax = snmpSilentDrops.syntax + 1 elif PDU.tagSet in rfc3411.unconfirmedClassPDUs: pass else: raise error.ProtocolError('Unexpected PDU class %s' % PDU.tagSet) debug.logger & debug.flagApp and debug.logger('processPdu: stateReference %s, user cbFun %s, cbCtx %s, varBinds %s' % (stateReference, self.__cbFun, self.__cbCtx, varBinds)) if self.__cbFunVer: self.__cbFun( snmpEngine, stateReference, contextEngineId, contextName, varBinds, self.__cbCtx ) else: # Compatibility stub (handle legacy cbFun interface) try: self.__cbFun( snmpEngine, contextEngineId, contextName, varBinds, self.__cbCtx ) except TypeError: self.__cbFunVer = 1 self.__cbFun( snmpEngine, stateReference, contextEngineId, contextName, varBinds, self.__cbCtx ) PKAq>! ! pysnmp/entity/rfc3413/mibvar.pyc; #:Mc@sTdkZdklZdklZdZeidfZdZdZ dS(N(suniv(sNoSuchObjectErrorc Csnt|dtijo.tddd|d\}}|o|ii |n|ii |o|i ||\}}} n|i|\}}} |d} |i|\}}}|ii||\}t|doN|i|d \}}}|ii||\}|t|i| fSqj|| fSn#|i|\}}} || fSdS(NiscCs ||fS(N(sxsy(sxsy((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/mibvar.pys sis createTesti(stypesnamestypess TupleTypesapplysmodNamessymNamesmibViews mibBuilders loadModulessgetNodeNameByDescsoidslabelssuffixsgetFirstNodeNamesgetNodeLocations_ss importSymbolssmibNodeshasattrsrowNodesgetInstIdFromIndicessgetNodeNameByOid( smibViewsnamesmodNamesoidssymNames_sslabelsrowNodesmibNodessuffix((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/mibvar.pys mibNameToOids$"  ic Cs|it|\} }}|i| \}}} |i i ||\} t| doQ|i| d \}}}|i i ||\} ||f| i|fSn]| o||f|fSnA|dfjo||ftfSntdd|| ifdS(Ns createTestiisstrs&No MIB info for %s (closest parent %s)(smibViewsgetNodeNameByOidstuplesoids_oidslabelssuffixsgetNodeLocationsmodNamessymNames__suffixs mibBuilders importSymbolssmibNodeshasattrs __modNames __symNames__ssrowNodesgetIndicesFromInstIds__scalarSuffixsNoSuchObjectErrorsname( smibViewsoidsmodNamessymNamessuffixslabels __modNames __symNames__ssrowNodes__suffixsmibNodes_oid((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/mibvar.pys oidToMibName$scCsD|ii||\}t|do|ii|SndSdS(Nssyntax( smibViews mibBuilders importSymbolssmodNamessymNamesmibNodeshasattrssyntaxsclonesvalue(smibViewsmodNamessymNamesvaluesmibNode((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/mibvar.pyscloneFromMibValue:s( stypess pyasn1.typesunivspysnmp.smi.errorsNoSuchObjectErrors mibNameToOidsIntegers__scalarSuffixs oidToMibNamescloneFromMibValue(s__scalarSuffixs oidToMibNamescloneFromMibValuesNoSuchObjectErrorstypessunivs mibNameToOid((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/mibvar.pys?s     PKAq>I355 pysnmp/entity/rfc3413/ntfrcv.pyc; <8Mc@sWdklZlZdklZlZdklZdkl Z dfdYZ dS((srfc3411serror(sv1sv2c(srfc2576(sdebugsNotificationReceivercBsGtZeiieiieiifZe dZ dZ dZ RS(NcCs;|iid|i|id|_||_||_ dS(Nsi( s snmpEngines msgAndPduDspsregisterContextEngineIdsselfspduTypess processPdus_NotificationReceiver__cbFunVerscbFuns_NotificationReceiver__cbFunscbCtxs_NotificationReceiver__cbCtx(sselfs snmpEnginescbFunscbCtx((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/ntfrcv.pys__init__s  cCs|iid|idS(Ns(s snmpEngines msgAndPduDspsunregisterContextEngineIdsselfspduTypes(sselfs snmpEngine((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/ntfrcv.pysclosesc  Cs|djo| } ti| } nt} d}d} ti i | }t i t i@ot i d| |f| itijoLti i| }ti i||ti i|| ti i||t i t i@ot i d| |if|djoti|| }nh}y5|ii|||||||||| | | Wqt%i&j o_}t i t i@ot i d| |f|ii(i)i*dd\}|i,d|_,qXn.| iti-jont%i.d | it i t i@o#t i d | |i0|i1|f|i2o#|i0|| ||||i1n_y |i0|||||i1Wn;t3j o/d|_2|i0|| ||||i1nXdS( NisnoErrors*processPdu: stateReference %s, varBinds %ss-processPdu: stateReference %s, confirm PDU %ss3processPdu: stateReference %s, statusInformation %ss __SNMPv2-MIBssnmpSilentDropsisUnexpected PDU class %ssCprocessPdu: stateReference %s, user cbFun %s, cbCtx %s, varBinds %s(4smessageProcessingModelsPDUsorigPdusrfc2576sv1ToV2sNones errorStatuss errorIndexsv2csapiPDUs getVarBindssvarBindssdebugsloggersflagAppsstateReferencestagSetsrfc3411sconfirmedClassPDUss getResponsesrspPDUssetErrorStatuss setErrorIndexs setVarBindss prettyPrintsv2ToV1sstatusInformations snmpEngines msgAndPduDspsreturnResponsePdus securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionsmaxSizeResponseScopedPDUserrorsStatusInformationswhysmibInstrumControllers mibBuilders importSymbolsssnmpSilentDropsssyntaxsunconfirmedClassPDUss ProtocolErrorsselfs_NotificationReceiver__cbFuns_NotificationReceiver__cbCtxs_NotificationReceiver__cbFunVers TypeError(sselfs snmpEnginesmessageProcessingModels securityModels securityNames securityLevelscontextEngineIds contextNames pduVersionsPDUsmaxSizeResponseScopedPDUsstateReferences errorIndexsorigPdusstatusInformations errorStatussvarBindsssnmpSilentDropsswhysrspPDU((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/ntfrcv.pys processPdus^  (.   (4  ( s__name__s __module__sv1sTrapPDUstagSetsv2cs SNMPv2TrapPDUsInformRequestPDUspduTypessNones__init__scloses processPdu(((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/ntfrcv.pysNotificationReceivers!  N( s pysnmp.protosrfc3411serrorspysnmp.proto.apisv1sv2cspysnmp.proto.proxysrfc2576spysnmpsdebugsNotificationReceiver(srfc2576sNotificationReceiversv2csv1serrorsdebugsrfc3411((s:build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/ntfrcv.pys?s  PKAq>o'"pysnmp/entity/rfc3413/__init__.pyc; 렮Bc@sdS(N((((s<build/bdist.linux-i686/egg/pysnmp/entity/rfc3413/__init__.pys?sPKUL>؁lDlDpysnmp/entity/rfc3413/cmdgen.pyimport types, time from pysnmp.proto import rfc1157, rfc1905, api, errind from pysnmp.entity.rfc3413 import config from pysnmp.proto.proxy import rfc2576 from pysnmp import error, nextid, debug from pyasn1.type import univ getNextHandle = nextid.Integer(0x7fffffff) def getVersionSpecifics(snmpVersion): if snmpVersion == 0: pduVersion = 0 else: pduVersion = 1 return pduVersion, api.protoModules[pduVersion] __null = univ.Null('') def getNextVarBinds(origVarBinds, varBinds): errorIndication = None idx = nonNulls = len(varBinds) rspVarBinds = [] while idx: idx = idx - 1 if isinstance(varBinds[idx][1], univ.Null): nonNulls = nonNulls - 1 elif origVarBinds[idx][0].asTuple() >= varBinds[idx][0].asTuple(): errorIndication = errind.oidNotIncreasing rspVarBinds.insert(0, (varBinds[idx][0], __null)) if not nonNulls: rspVarBinds = [] return errorIndication, rspVarBinds class CommandGeneratorBase: _null = univ.Null('') def __init__(self): self.__pendingReqs = {} def processResponsePdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, statusInformation, sendPduHandle, (cbFun, cbCtx) ): # 3.1.1 ( origTransportDomain, origTransportAddress, origMessageProcessingModel, origSecurityModel, origSecurityName, origSecurityLevel, origContextEngineId, origContextName, origPduVersion, origPdu, origTimeout, origRetryCount, origRetries, origSendRequestHandle ) = self.__pendingReqs[sendPduHandle] del self.__pendingReqs[sendPduHandle] snmpEngine.transportDispatcher.jobFinished(id(self)) # 3.1.3 if statusInformation: debug.logger & debug.flagApp and debug.logger('processResponsePdu: sendPduHandle %s, statusInformation %s' % (sendPduHandle, statusInformation)) if origRetries == origRetryCount: debug.logger & debug.flagApp and debug.logger('processResponsePdu: sendPduHandle %s, retry count %d exceeded' % (sendPduHandle, origRetries)) cbFun(origSendRequestHandle, statusInformation['errorIndication'], 0, 0, (), cbCtx) return self._sendPdu( snmpEngine, origTransportDomain, origTransportAddress, origMessageProcessingModel, origSecurityModel, origSecurityName, origSecurityLevel, origContextEngineId, origContextName, origPduVersion, origPdu, origTimeout, origRetryCount, origRetries + 1, origSendRequestHandle, (self.processResponsePdu, (cbFun, cbCtx)) ) return if origMessageProcessingModel != messageProcessingModel or \ origSecurityModel != securityModel or \ origSecurityName != origSecurityName or \ origContextEngineId and origContextEngineId != contextEngineId or \ origContextName and origContextName != contextName or \ origPduVersion != pduVersion: debug.logger & debug.flagApp and debug.logger('processResponsePdu: sendPduHandle %s, request/response data mismatch' % sendPduHandle) cbFun(origSendRequestHandle, 'badResponse', 0, 0, (), cbCtx) return pMod = api.protoModules[pduVersion] # 3.1.2 if pMod.apiPDU.getRequestID(PDU) != pMod.apiPDU.getRequestID(origPdu): debug.logger & debug.flagApp and debug.logger('processResponsePdu: sendPduHandle %s, request-id/response-id mismatch' % sendPduHandle) cbFun(origSendRequestHandle, 'badResponse', 0, 0, (), cbCtx) return # User-side API assumes SMIv2 if messageProcessingModel == 0: PDU = rfc2576.v1ToV2(PDU, origPdu) pMod = api.protoModules[api.protoVersion2c] self._handleResponse( snmpEngine, origTransportDomain, origTransportAddress, origMessageProcessingModel, origSecurityModel, origSecurityName, origSecurityLevel, origContextEngineId, origContextName, origPduVersion, origPdu, origTimeout, origRetryCount, pMod, PDU, origSendRequestHandle, (cbFun, cbCtx), ) def sendReq( self, snmpEngine, addrName, varBinds, cbFun, cbCtx=None, contextEngineId=None, contextName='' ): raise error.PySnmpError('Method not implemented') def _sendPdu( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, reqPDU, timeout, retryCount, retries, sendRequestHandle, (processResponsePdu, cbCtx) ): # 3.1 sendPduHandle = snmpEngine.msgAndPduDsp.sendPdu( snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, reqPDU, 1, # expectResponse float(timeout)/100 + time.time(), # timeout processResponsePdu, cbCtx ) snmpEngine.transportDispatcher.jobStarted(id(self)) debug.logger & debug.flagApp and debug.logger('_sendPdu: sendPduHandle %s, timeout %d, retry %d of %d' % (sendPduHandle, timeout, retries, retryCount)) self.__pendingReqs[sendPduHandle] = ( transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, reqPDU, timeout, retryCount, retries, sendRequestHandle, ) class GetCommandGenerator(CommandGeneratorBase): def sendReq( self, snmpEngine, addrName, varBinds, cbFun, cbCtx=None, contextEngineId=None, contextName='' ): ( transportDomain, transportAddress, timeout, retryCount, messageProcessingModel, securityModel, securityName, securityLevel ) = config.getTargetInfo(snmpEngine, addrName) pduVersion, pMod = getVersionSpecifics(messageProcessingModel) reqPDU = pMod.GetRequestPDU() pMod.apiPDU.setDefaults(reqPDU) pMod.apiPDU.setVarBinds(reqPDU, varBinds) requestHandle = getNextHandle() self._sendPdu( snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, reqPDU, timeout, retryCount, 0, requestHandle, (self.processResponsePdu, (cbFun, cbCtx)) ) return requestHandle def _handleResponse( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, timeout, retryCount, pMod, rspPDU, sendRequestHandle, (cbFun, cbCtx) ): cbFun(sendRequestHandle, None, pMod.apiPDU.getErrorStatus(rspPDU), pMod.apiPDU.getErrorIndex(rspPDU), pMod.apiPDU.getVarBinds(rspPDU), cbCtx) class SetCommandGenerator(CommandGeneratorBase): def sendReq( self, snmpEngine, addrName, varBinds, cbFun, cbCtx=None, contextEngineId=None, contextName='' ): ( transportDomain, transportAddress, timeout, retryCount, messageProcessingModel, securityModel, securityName, securityLevel ) = config.getTargetInfo(snmpEngine, addrName) pduVersion, pMod = getVersionSpecifics(messageProcessingModel) reqPDU = pMod.SetRequestPDU() pMod.apiPDU.setDefaults(reqPDU) pMod.apiPDU.setVarBinds(reqPDU, varBinds) # User-side API assumes SMIv2 if messageProcessingModel == 0: reqPDU = rfc2576.v2ToV1(reqPDU) pMod = api.protoModules[api.protoVersion1] requestHandle = getNextHandle() self._sendPdu( snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, reqPDU, timeout, retryCount, 0, requestHandle, (self.processResponsePdu, (cbFun, cbCtx)) ) return requestHandle def _handleResponse( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, timeout, retryCount, pMod, rspPDU, sendRequestHandle, (cbFun, cbCtx) ): cbFun(sendRequestHandle, None, pMod.apiPDU.getErrorStatus(rspPDU), pMod.apiPDU.getErrorIndex(rspPDU), pMod.apiPDU.getVarBinds(rspPDU), cbCtx) class NextCommandGenerator(CommandGeneratorBase): def sendReq( self, snmpEngine, addrName, varBinds, cbFun, cbCtx=None, contextEngineId=None, contextName='' ): ( transportDomain, transportAddress, timeout, retryCount, messageProcessingModel, securityModel, securityName, securityLevel ) = config.getTargetInfo(snmpEngine, addrName) pduVersion, pMod = getVersionSpecifics(messageProcessingModel) reqPDU = pMod.GetNextRequestPDU() pMod.apiPDU.setDefaults(reqPDU) pMod.apiPDU.setVarBinds(reqPDU, varBinds) requestHandle = getNextHandle() self._sendPdu( snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, reqPDU, timeout, retryCount, 0, requestHandle, (self.processResponsePdu, (cbFun, cbCtx)) ) return requestHandle def _handleResponse( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, timeout, retryCount, pMod, rspPDU, sendRequestHandle, (cbFun, cbCtx) ): varBindTable = pMod.apiPDU.getVarBindTable(PDU, rspPDU) if pMod.apiPDU.getErrorStatus(rspPDU): errorIndication = None elif not varBindTable: errorIndication = errind.emptyResponse else: errorIndication, varBinds = getNextVarBinds( pMod.apiPDU.getVarBinds(PDU), varBindTable[-1] ) if not cbFun(sendRequestHandle, errorIndication, pMod.apiPDU.getErrorStatus(rspPDU), pMod.apiPDU.getErrorIndex(rspPDU), varBindTable, cbCtx): debug.logger & debug.flagApp and debug.logger('_handleResponse: sendRequestHandle %s, app says to stop walking' % sendRequestHandle) return # app says enough if not varBinds: return # no more objects available pMod.apiPDU.setRequestID(PDU, pMod.getNextRequestID()) pMod.apiPDU.setVarBinds(PDU, varBinds) self._sendPdu( snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, timeout, retryCount, 0, getNextHandle(), (self.processResponsePdu, (cbFun, cbCtx)) ) class BulkCommandGenerator(CommandGeneratorBase): def sendReq( self, snmpEngine, addrName, nonRepeaters, maxRepetitions, varBinds, cbFun, cbCtx=None, contextEngineId=None, contextName='' ): ( transportDomain, transportAddress, timeout, retryCount, messageProcessingModel, securityModel, securityName, securityLevel ) = config.getTargetInfo(snmpEngine, addrName) pduVersion, pMod = getVersionSpecifics(messageProcessingModel) if not hasattr(pMod, 'GetBulkRequestPDU'): raise error.PySnmpError('BULK PDU not implemented at %s' % pMod) reqPDU = pMod.GetBulkRequestPDU() pMod.apiBulkPDU.setDefaults(reqPDU) pMod.apiBulkPDU.setNonRepeaters(reqPDU, nonRepeaters) pMod.apiBulkPDU.setMaxRepetitions(reqPDU, maxRepetitions) pMod.apiBulkPDU.setVarBinds(reqPDU, varBinds) requestHandle = getNextHandle() self._sendPdu( snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, reqPDU, timeout, retryCount, 0, requestHandle, (self.processResponsePdu, (cbFun, cbCtx)) ) return requestHandle def _handleResponse( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, timeout, retryCount, pMod, rspPDU, sendRequestHandle, (cbFun, cbCtx) ): varBindTable = pMod.apiBulkPDU.getVarBindTable(PDU, rspPDU) if pMod.apiBulkPDU.getErrorStatus(rspPDU): errorIndication = None elif not varBindTable: errorIndication = errind.emptyResponse else: errorIndication, varBinds = getNextVarBinds( pMod.apiBulkPDU.getVarBinds(PDU), varBindTable[-1] ) if not cbFun(sendRequestHandle, errorIndication, pMod.apiBulkPDU.getErrorStatus(rspPDU), pMod.apiBulkPDU.getErrorIndex(rspPDU), varBindTable, cbCtx): debug.logger & debug.flagApp and debug.logger('_handleResponse: sendRequestHandle %s, app says to stop walking' % sendRequestHandle) return # app says enough if not varBinds: return # no more objects available pMod.apiBulkPDU.setRequestID(PDU, pMod.getNextRequestID()) pMod.apiBulkPDU.setVarBinds(PDU, varBinds) self._sendPdu( snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, timeout, retryCount, 0, getNextHandle(), (self.processResponsePdu, (cbFun, cbCtx)) ) PK6> 9S S pysnmp/entity/rfc3413/mibvar.py# MIB variable pretty printers/parsers import types from pyasn1.type import univ from pysnmp.smi.error import NoSuchObjectError # Name def mibNameToOid(mibView, name): if type(name[0]) == types.TupleType: modName, symName = apply(lambda x='',y='': (x,y), name[0]) if modName: # load module if needed mibView.mibBuilder.loadModules(modName) else: mibView.mibBuilder.loadModules() # load all (slow) if symName: oid, label, suffix = mibView.getNodeNameByDesc(symName, modName) else: oid, label, suffix = mibView.getFirstNodeName(modName) suffix = name[1:] modName, symName, _s = mibView.getNodeLocation(oid) mibNode, = mibView.mibBuilder.importSymbols( modName, symName ) if hasattr(mibNode, 'createTest'): # table column XXX modName, symName, _s = mibView.getNodeLocation(oid[:-1]) rowNode, = mibView.mibBuilder.importSymbols(modName, symName) return oid, apply(rowNode.getInstIdFromIndices, suffix) else: # scalar or incomplete spec return oid, suffix else: oid, label, suffix = mibView.getNodeNameByOid(name) return oid, suffix __scalarSuffix = (univ.Integer(0),) def oidToMibName(mibView, oid): _oid, label, suffix = mibView.getNodeNameByOid(tuple(oid)) modName, symName, __suffix = mibView.getNodeLocation(_oid) mibNode, = mibView.mibBuilder.importSymbols( modName, symName ) if hasattr(mibNode, 'createTest'): # table column __modName, __symName, __s = mibView.getNodeLocation(_oid[:-1]) rowNode, = mibView.mibBuilder.importSymbols(__modName, __symName) return (symName, modName), rowNode.getIndicesFromInstId(suffix) elif not suffix: # scalar return (symName, modName), suffix elif suffix == (0,): # scalar return (symName, modName), __scalarSuffix else: raise NoSuchObjectError( str='No MIB info for %s (closest parent %s)' % (oid, mibNode.name) ) # Value def cloneFromMibValue(mibView, modName, symName, value): mibNode, = mibView.mibBuilder.importSymbols( modName, symName ) if hasattr(mibNode, 'syntax'): # scalar return mibNode.syntax.clone(value) else: return # identifier PKAq>ݱcGG pysnmp/entity/rfc3413/config.pyc; N )pysnmp/entity/rfc3413/oneliner/ntforg.pyc; UMc@sdkZdkZdklZdklZlZlZdkl Z e i Z e i Z e i Z e i Z e iZe iZe iZe iZe iZe iZe iZe iZde ifdYZdfdYZdS(N(sconfig(sntforgscontextsmibvar(scmdgensAsynNotificationOriginatorcBsMtZeedZdZdZdZeeefdZeZRS(NcCs2tii||||_h|_h|_dS(N(scmdgensAsynCommandGenerators__init__sselfs snmpEngines snmpContexts-_AsynNotificationOriginator__knownNotifyNamess'_AsynNotificationOriginator__knownAuths(sselfs snmpEngines snmpContext((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/ntforg.pys__init__s  cCs|idS(N(sselfs uncfgNtfOrg(sself((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/ntforg.pys__del__!sc Cs)|i|||\}}|||f} | |i jo|i | \}} n@dt i }ti|i||||||f|i | <||ijoEdddf}ti|i|i|i|i|||i|WW)pysnmp/entity/rfc3413/oneliner/cmdgen.pyc; СMc@s>dkZdkZdkZdklZlZdklZlZdk l Z dk l Z dk lZlZdklZeiZeiZeiZeiZeiZeiZeiZeiZeiZeidZdfd YZd fd YZd fd YZdfdYZ dfdYZ!dS(N(senginesconfig(scmdgensmibvar(sudp(sview(snextidserror(sunivls CommunityDatacBsQtZdZedZdZdZeeedZdZdZ dZ RS(Nis noAuthNoPrivscCs||_||_|tj o||_|d|_n||_|tj o ||_n|i|i|i|i|i|i|if|_ t |i |_ dS(Ni( s securityNamesselfs communityNamesmpModelsNones securityModelscontextEngineIds contextNames securityLevels_CommunityData__cmpshashs_CommunityData__hash(sselfs securityNames communityNamesmpModelscontextEngineIds contextName((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__init__s       3cCs-d|ii|i|i|i|ifSdS(Ns!%s("%s", , %s, %s, %s)(sselfs __class__s__name__s securityNamesmpModelscontextEngineIds contextName(sself((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__repr__*scCs |iSdS(N(sselfs_CommunityData__hash(sself((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__hash__3scCst|i|SdS(N(scmpsselfs_CommunityData__cmpsother(sselfsother((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__cmp__4s( s__name__s __module__smpModels securityModels securityLevels contextNamesNones__init__s__repr__s__hash__s__cmp__(((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys CommunityDatas  s UsmUserDatacBsltZeZZeZeZdZ dZ dZ dZ eeeeeedZ dZdZdZRS( Ns noAuthNoPriviisc CsD||_|tj oM||_|tjo t|_n ||_|idjo d|_qcn|tj o\||_|itjot i dnd|_|tjo t |_ q||_ n||_ |tj o ||_n|i|i|i|i|i|i|i |i|i f |_t|i|_dS(NsauthPrivs authNoPrivsPrivacy implies authenticity(s securityNamesselfsauthKeysNones authProtocolsusmHMACMD5AuthProtocols securityLevelsprivKeysusmNoAuthProtocolserrors PySnmpErrors privProtocolsusmDESPrivProtocolscontextEngineIds contextNamesmpModels securityModels_UsmUserData__cmpshashs_UsmUserData__hash(sselfs securityNamesauthKeysprivKeys authProtocols privProtocolscontextEngineIds contextName((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__init__>s*               ?cCs3d|ii|i|i|i|i|ifSdS(Ns.%s("%s", , , %s, %s, %s, %s)(sselfs __class__s__name__s securityNames authProtocols privProtocolscontextEngineIds contextName(sself((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__repr__^scCs |iSdS(N(sselfs_UsmUserData__hash(sself((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__hash__hscCst|i|SdS(N(scmpsselfs_UsmUserData__cmpsother(sselfsother((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__cmp__is(s__name__s __module__sNonesauthKeysprivKeysusmNoAuthProtocols authProtocolsusmNoPrivProtocols privProtocols securityLevels securityModelsmpModels contextNames__init__s__repr__s__hash__s__cmp__(((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys UsmUserData6s  sUdpTransportTargetcBsDtZeiZdddZdZdZdZdZ RS(NiicCs6ti|d|df|_||_||_dS(Nii(ssockets gethostbynames transportAddrsselfstimeoutsretries(sselfs transportAddrstimeoutsretries((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__init__ms  cCs5d|ii|id|id|i|ifSdS(Ns%s(("%s", %s), %s, %s)ii(sselfs __class__s__name__s transportAddrstimeoutsretries(sself((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__repr__tscCst|iSdS(N(shashsselfs transportAddr(sself((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__hash__zscCst|i|SdS(N(scmpsselfs transportAddrsother(sselfsother((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__cmp__{scCs tii|_|iSdS(N(sudpsUdpSocketTransportsopenClientModesselfs transport(sself((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pysopenClientMode}s( s__name__s __module__sudps domainNamestransportDomains__init__s__repr__s__hash__s__cmp__sopenClientMode(((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pysUdpTransportTargetks     sAsynCommandGeneratorcBstZeidZedZdZddZdZ dZ dZ e Z dZ e Zd ZeZd ZeZRS( NscCsfh|_h|_h|_|tjoti|_n ||_ti |ii i i |_ dS(N(sselfs!_AsynCommandGenerator__knownAuthss&_AsynCommandGenerator__knownTransportss*_AsynCommandGenerator__knownTransportAddrss snmpEnginesNonesengines SnmpEnginesviewsMibViewControllers msgAndPduDspsmibInstrumControllers mibBuildersmibViewController(sselfs snmpEngine((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__init__s     cCs|idS(N(sselfs uncfgCmdGen(sself((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__del__sc Cst|tod||if}n||ijo|i|}ndt}t|toTt i |i |i|i |i |i|t i|i ||i|i|inwt|toWt i|i |i|i|i|i|i|i t i|i ||i|intid||i|<|i|ijo9|i}t i|i |i|||i|ix|iiD]\}}t|to-ti|i |i ti |i |qt|t o-ti |i |i ti |i |qtidqW|iix:|iiD])\}}ti|i ||iqW|iix*|iiD]}ti|i |qW|iidS(Ns!Unsupported authentication object(sselfs!_AsynCommandGenerator__knownAuthssitemssauthDatas paramsNames isinstances CommunityDatasconfigs delV1Systems snmpEngines securityNamesdelTargetParamss UsmUserDatas delV3Userserrors PySnmpErrorsclears&_AsynCommandGenerator__knownTransportsstransportDomains transportsdelSocketTransportscloseTransports*_AsynCommandGenerator__knownTransportAddrssvaluessaddrNames delTargetAddr(sselfsauthDatas paramsNamesaddrNamestransportDomains transport((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys uncfgCmdGens(      cCsg}xv|D]n}t|dtitifjo |}n&ti |i |\}}||}|i ||ifq W|SdS(Ni(svarBindssvarNamessvarNamestypestypessIntTypesLongTypesnamesmibvars mibNameToOidsselfsmibViewControllersoidsappends_null(sselfsvarNamessvarBindssnamesvarNamesoid((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pysmakeReadVarBindss#  c Cse|\}}|i||\}} |i|}t i i |i|||||i|iSdS(N(scbFunscbCtxsselfs cfgCmdGensauthDatastransportTargetsaddrNames paramsNamesmakeReadVarBindssvarNamessvarBindsscmdgensGetCommandGeneratorssendReqs snmpEnginescontextEngineIds contextName( sselfsauthDatastransportTargetsvarNamess.8scbFunscbCtxsaddrNamesvarBindss paramsName((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pysgetCmds cCs9|\}}|i||\} } g}x|D]\}} t i |i|\}}t| tij o}t i|i||\\}} }t i|i| || } | tjotidt|n| i| } n|i||| fq1Wt i!i"|i#| ||||i$|i%SdS(Ns#Value type MIB lookup failed for %s(&scbFunscbCtxsselfs cfgCmdGensauthDatastransportTargetsaddrNames paramsNames_AsynCommandGenerator__varBindssvarBindssvarNamesvarValsmibvars mibNameToOidsmibViewControllersnamesoidstypestypess InstanceTypes oidToMibNamessymNamesmodNamessuffixscloneFromMibValuessyntaxsNoneserrors PySnmpErrorsreprsclonesappendscmdgensSetCommandGeneratorssendReqs snmpEnginescontextEngineIds contextName(sselfsauthDatastransportTargetsvarBindss.8scbFunscbCtxssuffixsvarNamesmodNamessyntaxsvarValsaddrNames paramsNamesoids_AsynCommandGenerator__varBindsssymNamesname((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pyssetCmds  % c Cse|\}}|i||\}} |i|}t i i |i|||||i|iSdS(N(scbFunscbCtxsselfs cfgCmdGensauthDatastransportTargetsaddrNames paramsNamesmakeReadVarBindssvarNamessvarBindsscmdgensNextCommandGeneratorssendReqs snmpEnginescontextEngineIds contextName( sselfsauthDatastransportTargetsvarNamess.8scbFunscbCtxsaddrNamesvarBindss paramsName((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pysnextCmd/s c Csk|\}}|i||\} } |i|} t i i |i| ||| |||i|i SdS(N(scbFunscbCtxsselfs cfgCmdGensauthDatastransportTargetsaddrNames paramsNamesmakeReadVarBindssvarNamessvarBindsscmdgensBulkCommandGeneratorssendReqs snmpEngines nonRepeaterssmaxRepetitionsscontextEngineIds contextName( sselfsauthDatastransportTargets nonRepeaterssmaxRepetitionssvarNamess.12scbFunscbCtxsvarBindss paramsNamesaddrName((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pysbulkCmd=s (s__name__s __module__sunivsNulls_nullsNones__init__s__del__s cfgCmdGens uncfgCmdGensmakeReadVarBindssgetCmds asyncGetCmdssetCmds asyncSetCmdsnextCmds asyncNextCmdsbulkCmds asyncBulkCmd(((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pysAsynCommandGenerators  @ "     sCommandGeneratorcBsAtZeZeedZdZdZdZdZRS(NcCsK|tjot||_n ||_|ii|_|ii|_dS(N(s asynCmdGensNonesAsynCommandGenerators snmpEnginesselfs_CommandGenerator__asynCmdGensmibViewController(sselfs snmpEngines asynCmdGen((sCbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/cmdgen.pys__init__Os   cGsed}h}|ii|||||f|iii i |d|d|d|dfSdS(NcCs,||d<||d<||d<||d}ti|ii|\}} |i t i || qWh}|ii||||||g|ff|iiii|d|d|d|dfSdS(NcCsT|\}}}} |p|og|| d<|djo*|id| d<|id| d} ti|ii| \}} |i t i || qWh} |ii||||||||g| ff|iiii| d| d| d| dfSdS(NcCsU|\}}}} |p|o0|| d<|| d<|| d<|| d(pysnmp/entity/rfc3413/oneliner/ntforg.pyimport types, string from pysnmp.entity import config from pysnmp.entity.rfc3413 import ntforg, context, mibvar from pysnmp.entity.rfc3413.oneliner import cmdgen # Auth protocol usmHMACMD5AuthProtocol = cmdgen.usmHMACMD5AuthProtocol usmHMACSHAAuthProtocol = cmdgen.usmHMACSHAAuthProtocol usmNoAuthProtocol = cmdgen.usmNoAuthProtocol # Privacy protocol usmDESPrivProtocol = cmdgen.usmDESPrivProtocol usm3DESEDEPrivProtocol = cmdgen.usm3DESEDEPrivProtocol usmAesCfb128Protocol = cmdgen.usmAesCfb128Protocol usmAesCfb192Protocol = cmdgen.usmAesCfb192Protocol usmAesCfb256Protocol = cmdgen.usmAesCfb256Protocol usmNoPrivProtocol = cmdgen.usmNoPrivProtocol # Credentials CommunityData = cmdgen.CommunityData UsmUserData = cmdgen.UsmUserData # Transport UdpTransportTarget = cmdgen.UdpTransportTarget class AsynNotificationOriginator(cmdgen.AsynCommandGenerator): def __init__(self, snmpEngine=None, snmpContext=None): cmdgen.AsynCommandGenerator.__init__(self, snmpEngine) self.snmpContext = snmpContext self.__knownNotifyNames = {} self.__knownAuths = {} def __del__(self): self.uncfgNtfOrg() def cfgNtfOrg(self, authData, transportTarget, notifyType, tagList): addrName, paramsName = self.cfgCmdGen( authData, transportTarget, tagList ) k = paramsName, tagList, notifyType if k in self.__knownNotifyNames: notifyName, _ = self.__knownNotifyNames[k] else: notifyName = 'n%s' % cmdgen.nextID() config.addNotificationTarget( self.snmpEngine, notifyName, paramsName, tagList, notifyType ) self.__knownNotifyNames[k] = notifyName, paramsName if authData not in self.__knownAuths: subTree = (1,3,6) config.addTrapUser( self.snmpEngine, authData.securityModel, authData.securityName, authData.securityLevel, subTree ) self.__knownAuths[authData] = subTree if self.snmpContext is None: self.snmpContext = context.SnmpContext(self.snmpEngine) config.addContext( self.snmpEngine, '' # this is leaky ) return notifyName def uncfgNtfOrg(self): for notifyName, paramsName in self.__knownNotifyNames.values(): config.delNotificationTarget( self.snmpEngine, notifyName, paramsName ) for authData, subTree in self.__knownAuths.items(): config.delTrapUser( self.snmpEngine, authData.securityModel, authData.securityName, authData.securityLevel, subTree ) self.uncfgCmdGen() def sendNotification( self, authData, transportTarget, notifyType, notificationType, varBinds=None, (cbFun, cbCtx)=(None, None) ): tagList = string.replace(str(transportTarget.transportAddr), ' ', '_') notifyName = self.cfgNtfOrg(authData, transportTarget, notifyType, tagList) if notificationType: name, oid = mibvar.mibNameToOid( self.mibViewController, notificationType ) notificationType = name + oid if varBinds: __varBinds = [] for varName, varVal in varBinds: name, oid = mibvar.mibNameToOid( self.mibViewController, varName ) if not type(varVal) == types.InstanceType: ((symName, modName), suffix) = mibvar.oidToMibName( self.mibViewController, name + oid ) syntax = mibvar.cloneFromMibValue( self.mibViewController, modName, symName, varVal ) if syntax is None: raise error.PySnmpError( 'Value type MIB lookup failed for %s' % repr(varName) ) varVal = syntax.clone(varVal) __varBinds.append((name + oid, varVal)) else: __varBinds = None return ntforg.NotificationOriginator(self.snmpContext).sendNotification(self.snmpEngine, notifyName, notificationType, __varBinds, cbFun, cbCtx) asyncSendNotification = sendNotification class NotificationOriginator: def __init__(self, snmpEngine=None, snmpContext=None, asynNtfOrg=None): if asynNtfOrg is None: self.__asynNtfOrg = AsynNotificationOriginator( snmpEngine, snmpContext ) else: self.__asynNtfOrg = asynNtfOrg def sendNotification( self, authData, transportTarget, notifyType, notificationType, *varBinds ): def __cbFun(sendRequestHandle, errorIndication, appReturn): appReturn['errorIndication'] = errorIndication appReturn = {} self.__asynNtfOrg.sendNotification( authData, transportTarget, notifyType, notificationType, varBinds, (__cbFun, appReturn) ) self.__asynNtfOrg.snmpEngine.transportDispatcher.runDispatcher() if 'errorIndication' in appReturn: return appReturn['errorIndication'] PKAq>,iVW+pysnmp/entity/rfc3413/oneliner/__init__.pyc; MBc@sdS(N((((sEbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/oneliner/__init__.pys?sPKo>ޯKK(pysnmp/entity/rfc3413/oneliner/cmdgen.pyimport socket, string, types from pysnmp.entity import engine, config from pysnmp.entity.rfc3413 import cmdgen, mibvar from pysnmp.carrier.asynsock.dgram import udp from pysnmp.smi import view from pysnmp import nextid, error from pyasn1.type import univ # Auth protocol usmHMACMD5AuthProtocol = config.usmHMACMD5AuthProtocol usmHMACSHAAuthProtocol = config.usmHMACSHAAuthProtocol usmNoAuthProtocol = config.usmNoAuthProtocol # Privacy protocol usmDESPrivProtocol = config.usmDESPrivProtocol usm3DESEDEPrivProtocol = config.usm3DESEDEPrivProtocol usmAesCfb128Protocol = config.usmAesCfb128Protocol usmAesCfb192Protocol = config.usmAesCfb192Protocol usmAesCfb256Protocol = config.usmAesCfb256Protocol usmNoPrivProtocol = config.usmNoPrivProtocol nextID = nextid.Integer(0xffffffffL) class CommunityData: mpModel = 1 # Default is SMIv2 securityModel = mpModel+1 securityLevel = 'noAuthNoPriv' contextName = '' def __init__(self, securityName, communityName, mpModel=None, contextEngineId=None, contextName=None): self.securityName = securityName self.communityName = communityName if mpModel is not None: self.mpModel = mpModel self.securityModel = mpModel + 1 self.contextEngineId = contextEngineId if contextName is not None: self.contextName = contextName self.__cmp = self.mpModel, self.securityModel, self.securityLevel, self.securityName, self.communityName, self.contextEngineId, self.contextName self.__hash = hash(self.__cmp) def __repr__(self): return '%s("%s", , %s, %s, %s)' % ( self.__class__.__name__, self.securityName, self.mpModel, self.contextEngineId, self.contextName ) def __hash__(self): return self.__hash def __cmp__(self, other): return cmp(self.__cmp, other) class UsmUserData: authKey = privKey = None authProtocol = usmNoAuthProtocol privProtocol = usmNoPrivProtocol securityLevel = 'noAuthNoPriv' securityModel = 3 mpModel = 2 contextName = '' def __init__(self, securityName, authKey=None, privKey=None, authProtocol=None, privProtocol=None, contextEngineId=None, contextName=None): self.securityName = securityName if authKey is not None: self.authKey = authKey if authProtocol is None: self.authProtocol = usmHMACMD5AuthProtocol else: self.authProtocol = authProtocol if self.securityLevel != 'authPriv': self.securityLevel = 'authNoPriv' if privKey is not None: self.privKey = privKey if self.authProtocol == usmNoAuthProtocol: raise error.PySnmpError('Privacy implies authenticity') self.securityLevel = 'authPriv' if privProtocol is None: self.privProtocol = usmDESPrivProtocol else: self.privProtocol = privProtocol self.contextEngineId = contextEngineId if contextName is not None: self.contextName = contextName self.__cmp = self.mpModel, self.securityModel, self.securityLevel, self.securityName, self.authProtocol, self.authKey, self.privProtocol, self.privKey, self.contextEngineId self.__hash = hash(self.__cmp) def __repr__(self): return '%s("%s", , , %s, %s, %s, %s)' % ( self.__class__.__name__, self.securityName, self.authProtocol, self.privProtocol, self.contextEngineId, self.contextName ) def __hash__(self): return self.__hash def __cmp__(self, other): return cmp(self.__cmp, other) class UdpTransportTarget: transportDomain = udp.domainName def __init__(self, transportAddr, timeout=1, retries=5): self.transportAddr = ( socket.gethostbyname(transportAddr[0]), transportAddr[1] ) self.timeout = timeout self.retries = retries def __repr__(self): return '%s(("%s", %s), %s, %s)' % ( self.__class__.__name__, self.transportAddr[0], self.transportAddr[1], self.timeout, self.retries ) def __hash__(self): return hash(self.transportAddr) def __cmp__(self, other): return cmp(self.transportAddr, other) def openClientMode(self): self.transport = udp.UdpSocketTransport().openClientMode() return self.transport class AsynCommandGenerator: _null = univ.Null('') def __init__(self, snmpEngine=None): self.__knownAuths = {} self.__knownTransports = {} self.__knownTransportAddrs = {} if snmpEngine is None: self.snmpEngine = engine.SnmpEngine() else: self.snmpEngine = snmpEngine self.mibViewController = view.MibViewController( self.snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder ) def __del__(self): self.uncfgCmdGen() def cfgCmdGen(self, authData, transportTarget, tagList=''): if isinstance(authData, CommunityData): tagList = '%s %s' % (tagList, authData.securityName) if authData in self.__knownAuths: paramsName = self.__knownAuths[authData] else: paramsName = 'p%s' % nextID() if isinstance(authData, CommunityData): config.addV1System( self.snmpEngine, authData.securityName, authData.communityName, authData.contextEngineId, authData.contextName, tagList ) config.addTargetParams( self.snmpEngine, paramsName, authData.securityName, authData.securityLevel, authData.mpModel ) elif isinstance(authData, UsmUserData): config.addV3User( self.snmpEngine, authData.securityName, authData.authProtocol, authData.authKey, authData.privProtocol, authData.privKey, authData.contextEngineId ) config.addTargetParams( self.snmpEngine, paramsName, authData.securityName, authData.securityLevel ) else: raise error.PySnmpError('Unsupported authentication object') self.__knownAuths[authData] = paramsName if transportTarget.transportDomain not in self.__knownTransports: transport = transportTarget.openClientMode() config.addSocketTransport( self.snmpEngine, transportTarget.transportDomain, transport ) self.__knownTransports[transportTarget.transportDomain] = transport k = paramsName, transportTarget, tagList if k in self.__knownTransportAddrs: addrName = self.__knownTransportAddrs[k] else: addrName = 'a%s' % nextID() config.addTargetAddr( self.snmpEngine, addrName, transportTarget.transportDomain, transportTarget.transportAddr, paramsName, transportTarget.timeout * 100, transportTarget.retries, tagList ) self.__knownTransportAddrs[k] = addrName return addrName, paramsName def uncfgCmdGen(self): for authData, paramsName in self.__knownAuths.items(): if isinstance(authData, CommunityData): config.delV1System( self.snmpEngine, authData.securityName ) config.delTargetParams( self.snmpEngine, paramsName ) elif isinstance(authData, UsmUserData): config.delV3User( self.snmpEngine, authData.securityName ) config.delTargetParams( self.snmpEngine, paramsName ) else: raise error.PySnmpError('Unsupported authentication object') self.__knownAuths.clear() for transportDomain, transport in self.__knownTransports.items(): config.delSocketTransport( self.snmpEngine, transportDomain ) transport.closeTransport() self.__knownTransports.clear() for addrName in self.__knownTransportAddrs.values(): config.delTargetAddr( self.snmpEngine, addrName ) self.__knownTransportAddrs.clear() def makeReadVarBinds(self, varNames): varBinds = [] for varName in varNames: if type(varName[0]) in (types.IntType, types.LongType): name = varName else: name, oid = mibvar.mibNameToOid( self.mibViewController, varName ) name = name + oid varBinds.append((name, self._null)) return varBinds # Async SNMP apps def getCmd( self, authData, transportTarget, varNames, (cbFun, cbCtx) ): addrName, paramsName = self.cfgCmdGen( authData, transportTarget ) varBinds = self.makeReadVarBinds(varNames) return cmdgen.GetCommandGenerator().sendReq( self.snmpEngine, addrName, varBinds, cbFun, cbCtx, authData.contextEngineId, authData.contextName ) asyncGetCmd = getCmd def setCmd( self, authData, transportTarget, varBinds, (cbFun, cbCtx) ): addrName, paramsName = self.cfgCmdGen( authData, transportTarget ) __varBinds = [] for varName, varVal in varBinds: name, oid = mibvar.mibNameToOid( self.mibViewController, varName ) if not type(varVal) == types.InstanceType: ((symName, modName), suffix) = mibvar.oidToMibName( self.mibViewController, name + oid ) syntax = mibvar.cloneFromMibValue( self.mibViewController, modName, symName, varVal ) if syntax is None: raise error.PySnmpError( 'Value type MIB lookup failed for %s' % repr(varName) ) varVal = syntax.clone(varVal) __varBinds.append((name + oid, varVal)) return cmdgen.SetCommandGenerator().sendReq( self.snmpEngine, addrName, __varBinds, cbFun, cbCtx, authData.contextEngineId, authData.contextName ) asyncSetCmd = setCmd def nextCmd( self, authData, transportTarget, varNames, (cbFun, cbCtx) ): addrName, paramsName = self.cfgCmdGen( authData, transportTarget ) varBinds = self.makeReadVarBinds(varNames) return cmdgen.NextCommandGenerator().sendReq( self.snmpEngine, addrName, varBinds, cbFun, cbCtx, authData.contextEngineId, authData.contextName ) asyncNextCmd = nextCmd def bulkCmd( self, authData, transportTarget, nonRepeaters, maxRepetitions, varNames, (cbFun, cbCtx) ): addrName, paramsName = self.cfgCmdGen( authData, transportTarget ) varBinds = self.makeReadVarBinds(varNames) return cmdgen.BulkCommandGenerator().sendReq( self.snmpEngine, addrName, nonRepeaters, maxRepetitions, varBinds, cbFun, cbCtx, authData.contextEngineId, authData.contextName ) asyncBulkCmd = bulkCmd class CommandGenerator: lexicographicMode = None def __init__(self, snmpEngine=None, asynCmdGen=None): if asynCmdGen is None: self.__asynCmdGen = AsynCommandGenerator(snmpEngine) else: self.__asynCmdGen = asynCmdGen # compatibility attributes self.snmpEngine = self.__asynCmdGen.snmpEngine self.mibViewController = self.__asynCmdGen.mibViewController def getCmd(self, authData, transportTarget, *varNames): def __cbFun( sendRequestHandle, errorIndication, errorStatus, errorIndex, varBinds, appReturn ): appReturn['errorIndication'] = errorIndication appReturn['errorStatus'] = errorStatus appReturn['errorIndex'] = errorIndex appReturn['varBinds'] = varBinds appReturn = {} self.__asynCmdGen.getCmd( authData, transportTarget, varNames, (__cbFun, appReturn) ) self.__asynCmdGen.snmpEngine.transportDispatcher.runDispatcher() return ( appReturn['errorIndication'], appReturn['errorStatus'], appReturn['errorIndex'], appReturn['varBinds'] ) def setCmd(self, authData, transportTarget, *varBinds): def __cbFun( sendRequestHandle, errorIndication, errorStatus, errorIndex, varBinds, appReturn ): appReturn['errorIndication'] = errorIndication appReturn['errorStatus'] = errorStatus appReturn['errorIndex'] = errorIndex appReturn['varBinds'] = varBinds appReturn = {} self.__asynCmdGen.setCmd( authData, transportTarget, varBinds, (__cbFun, appReturn) ) self.__asynCmdGen.snmpEngine.transportDispatcher.runDispatcher() return ( appReturn['errorIndication'], appReturn['errorStatus'], appReturn['errorIndex'], appReturn['varBinds'] ) def nextCmd(self, authData, transportTarget, *varNames): def __cbFun( sendRequestHandle, errorIndication, errorStatus, errorIndex, varBindTable, (self, varBindHead, varBindTotalTable, appReturn) ): if errorIndication or errorStatus: appReturn['errorIndication'] = errorIndication if errorStatus == 2: # Hide SNMPv1 noSuchName error which leaks in here # from SNMPv1 Agent through internal pysnmp proxy. appReturn['errorStatus'] = errorStatus.clone(0) appReturn['errorIndex'] = errorIndex.clone(0) else: appReturn['errorStatus'] = errorStatus appReturn['errorIndex'] = errorIndex appReturn['varBindTable'] = varBindTotalTable return else: varBindTableRow = varBindTable[-1] for idx in range(len(varBindTableRow)): name, val = varBindTableRow[idx] # XXX extra rows if not isinstance(val, univ.Null): if self.lexicographicMode: if varBindHead[idx] <= name: break else: if varBindHead[idx].isPrefixOf(name): break else: appReturn['errorIndication'] = errorIndication appReturn['errorStatus'] = errorStatus appReturn['errorIndex'] = errorIndex appReturn['varBindTable'] = varBindTotalTable return varBindTotalTable.extend(varBindTable) return 1 # continue table retrieval varBindHead = [] for varName in varNames: name, suffix = mibvar.mibNameToOid( self.__asynCmdGen.mibViewController, varName ) varBindHead.append(univ.ObjectIdentifier(name + suffix)) appReturn = {} self.__asynCmdGen.nextCmd( authData, transportTarget, varNames, (__cbFun, (self, varBindHead,[],appReturn)) ) self.__asynCmdGen.snmpEngine.transportDispatcher.runDispatcher() return ( appReturn['errorIndication'], appReturn['errorStatus'], appReturn['errorIndex'], appReturn['varBindTable'] ) def bulkCmd(self, authData, transportTarget, nonRepeaters, maxRepetitions, *varNames): def __cbFun( sendRequestHandle, errorIndication, errorStatus, errorIndex, varBindTable, (self, varBindHead, varBindTotalTable, appReturn) ): if errorIndication or errorStatus: appReturn['errorIndication'] = errorIndication appReturn['errorStatus'] = errorStatus appReturn['errorIndex'] = errorIndex appReturn['varBindTable'] = varBindTable return else: while varBindTable: if len(varBindTable[-1]) != len(varBindHead): # Fix possibly non-rectangular table del varBindTable[-1] else: break varBindTotalTable.extend(varBindTable) # XXX out of table # rows possible varBindTableRow = varBindTable[-1] for idx in range(len(varBindTableRow)): name, val = varBindTableRow[idx] if not isinstance(val, univ.Null): if self.lexicographicMode: if varBindHead[idx] <= name: break else: if varBindHead[idx].isPrefixOf(name): break else: appReturn['errorIndication'] = errorIndication appReturn['errorStatus'] = errorStatus appReturn['errorIndex'] = errorIndex appReturn['varBindTable'] = varBindTotalTable return return 1 # continue table retrieval varBindHead = [] for varName in varNames: name, suffix = mibvar.mibNameToOid( self.__asynCmdGen.mibViewController, varName ) varBindHead.append(univ.ObjectIdentifier(name + suffix)) appReturn = {} self.__asynCmdGen.bulkCmd( authData, transportTarget, nonRepeaters, maxRepetitions, varNames, (__cbFun, (self, varBindHead, [], appReturn)) ) self.__asynCmdGen.snmpEngine.transportDispatcher.runDispatcher() return ( appReturn['errorIndication'], appReturn['errorStatus'], appReturn['errorIndex'], appReturn['varBindTable'] ) PKAq>aTP,,(pysnmp/entity/rfc3413/twisted/ntforg.pyc; LsJc@s=dklZlZdklZdeifdYZdS((sreactorsdefer(sntforgsNotificationOriginatorcBs tZeddZdZRS(Nsc Cs<ti}tii|||||t |dd|SdS(Ns contextNames( sdefersDeferredsdfsntforgsNotificationOriginatorssendNotificationsselfs snmpEnginesnotificationTargetsnotificationNamesadditionalVarBindssNone(sselfs snmpEnginesnotificationTargetsnotificationNamesadditionalVarBindss contextNamesdf((sBbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/twisted/ntforg.pyssendNotifications   cCs|i||fdS(N(scbCtxscallbackssendRequestHandleserrorIndication(sselfssendRequestHandleserrorIndicationscbFunscbCtx((sBbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/twisted/ntforg.pys_handleResponses(s__name__s __module__sNonessendNotifications_handleResponse(((sBbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/twisted/ntforg.pysNotificationOriginatorsN(stwisted.internetsreactorsdeferspysnmp.entity.rfc3413sntforgsNotificationOriginator(sntforgsdefersreactorsNotificationOriginator((sBbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/twisted/ntforg.pys?s PK:)pysnmp/entity/rfc3413/twisted/__init__.pyPKAq>>66(pysnmp/entity/rfc3413/twisted/cmdgen.pyc; K4Mc@sdklZdklZdZdeifdYZdeifdYZdZdeifd YZd ei fd YZ d S( (sdefer(scmdgencCs|i||||fdS(N(scbCtxscallbackserrorIndications errorStatuss errorIndexsvarBinds(ssendRequestHandleserrorIndications errorStatuss errorIndexsvarBindsscbCtx((sBbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/twisted/cmdgen.pys_cbFunssGetCommandGeneratorcBstZeddZRS(Nsc Cs9ti}tii||||t ||||SdS(N( sdefersDeferredsdfscmdgensGetCommandGeneratorssendReqsselfs snmpEnginesaddrNamesvarBindss_cbFunscontextEngineIds contextName(sselfs snmpEnginesaddrNamesvarBindsscontextEngineIds contextNamesdf((sBbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/twisted/cmdgen.pyssendReq s  (s__name__s __module__sNonessendReq(((sBbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/twisted/cmdgen.pysGetCommandGeneratorssSetCommandGeneratorcBstZeddZRS(Nsc Cs9ti}tii||||t ||||SdS(N( sdefersDeferredsdfscmdgensSetCommandGeneratorssendReqsselfs snmpEnginesaddrNamesvarBindss_cbFunscontextEngineIds contextName(sselfs snmpEnginesaddrNamesvarBindsscontextEngineIds contextNamesdf((sBbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/twisted/cmdgen.pyssendReqs  (s__name__s __module__sNonessendReq(((sBbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/twisted/cmdgen.pysSetCommandGeneratorscCsR|d}|i||||ft|it i o|i|dJ0*pysnmp/entity/rfc3413/twisted/__init__.pyc; LsJc@sdS(N((((sDbuild/bdist.linux-i686/egg/pysnmp/entity/rfc3413/twisted/__init__.pys?sPK'=X X 'pysnmp/entity/rfc3413/twisted/cmdgen.pyfrom twisted.internet import defer from pysnmp.entity.rfc3413 import cmdgen def _cbFun(sendRequestHandle, errorIndication, errorStatus, errorIndex, varBinds, cbCtx): cbCtx.callback((errorIndication, errorStatus, errorIndex, varBinds)) class GetCommandGenerator(cmdgen.GetCommandGenerator): def sendReq( self, snmpEngine, addrName, varBinds, contextEngineId=None, contextName='' ): df = defer.Deferred() cmdgen.GetCommandGenerator.sendReq( self, snmpEngine, addrName, varBinds, _cbFun, df, contextEngineId, contextName ) return df class SetCommandGenerator(cmdgen.SetCommandGenerator): def sendReq( self, snmpEngine, addrName, varBinds, contextEngineId=None, contextName='' ): df = defer.Deferred() cmdgen.SetCommandGenerator.sendReq( self, snmpEngine, addrName, varBinds, _cbFun, df, contextEngineId, contextName ) return df def _cbFunWithDeferred(sendRequestHandle, errorIndication, errorStatus, errorIndex, varBinds, cbCtx): df = cbCtx['df'] df.callback( (errorIndication, errorStatus, errorIndex, varBinds) ) # Callback function may return another deferred to indicate # it wishes to continue MIB walk. if isinstance(df.result, defer.Deferred): cbCtx['df'] = df.result return 1 # continue walking class NextCommandGenerator(cmdgen.NextCommandGenerator): def sendReq( self, snmpEngine, addrName, varBinds, contextEngineId=None, contextName='' ): df = defer.Deferred() cmdgen.NextCommandGenerator.sendReq( self, snmpEngine, addrName, varBinds, _cbFunWithDeferred, { 'df': df }, # anonymous dictionary used for cbCtx contextEngineId, contextName ) return df class BulkCommandGenerator(cmdgen.BulkCommandGenerator): def sendReq( self, snmpEngine, addrName, nonRepeaters, maxRepetitions, varBinds, contextEngineId=None, contextName='' ): df = defer.Deferred() cmdgen.BulkCommandGenerator.sendReq( self, snmpEngine, addrName, nonRepeaters, maxRepetitions, varBinds, _cbFunWithDeferred, { 'df': df }, # anonymous dictionary used for cbCtx contextEngineId=None, contextName='' ) return df PKAq>GEGG-INFO/top_level.txtPKAq>Ԛ*  ;EGG-INFO/SOURCES.txtPKAq>cxEGG-INFO/PKG-INFOPKAq>?qEGG-INFO/requires.txtPK=2EGG-INFO/zip-safePKAq>2EGG-INFO/dependency_links.txtPK)f}=Vz6))!BEGG-INFO/scripts/build-pysnmp-mibPKAq>|cc큪 EGG-INFO/scripts/libsmi2pysnmpPKAq>Cw_ _ pysnmp/cache.pycPKx4>Y>>pysnmp/__init__.pyPKAq>Hpppysnmp/error.pycPK4>ttpysnmp/debug.pyPKi2g''?pysnmp/error.pyPKAq>s| pysnmp/debug.pycPK^7>1D"Hpysnmp/cache.pyPKL>'pysnmp/nextid.pyPKAq>²Hpysnmp/__init__.pycPKAq>G2//`pysnmp/nextid.pycPKAq>}=2zzpysnmp/proto/cache.pycPKl1Llpysnmp/proto/__init__.pyPKAq>z `pysnmp/proto/error.pycPK [>y/|pysnmp/proto/rfc1902.pyPKAq>Zpysnmp/proto/rfc3411.pycPKt4>=ǵpysnmp/proto/error.pyPKAq>&&pysnmp/proto/rfc1905.pycPK]QL>GGpysnmp/proto/rfc3412.pyPKy78rZpysnmp/proto/rfc3411.pyPKAq>ya._pysnmp/proto/rfc1157.pycPK=3>UQ~~upysnmp/proto/rfc1905.pyPKAq>۶R8R8pysnmp/proto/rfc3412.pycPKK>^3pysnmp/proto/cache.pyPKܓ<\!!pysnmp/proto/rfc1155.pyPK3>DK Vpysnmp/proto/rfc1157.pyPKAq> 2QQpysnmp/proto/__init__.pycPK=A'pysnmp/proto/errind.pyPKAq>pysnmp/proto/rfc1155.pycPKAq>%933pysnmp/proto/errind.pycPKAq>];L.L.fHpysnmp/proto/rfc1902.pycPKAq> "ѷbbvpysnmp/proto/acmod/rfc3415.pycPKs2pysnmp/proto/acmod/__init__.pyPKAq> z…pysnmp/proto/acmod/void.pycPKAq>pysnmp/proto/acmod/__init__.pycPK:1>̂WWpysnmp/proto/acmod/rfc3415.pyPK1>b  pysnmp/proto/acmod/void.pyPKAq>qVpysnmp/proto/mpmod/cache.pycPKau2pysnmp/proto/mpmod/__init__.pyPKAq>N`g pysnmp/proto/mpmod/base.pycPKģO>`150w0wpysnmp/proto/mpmod/rfc3412.pyPKAq>kTcNcN2pysnmp/proto/mpmod/rfc3412.pycPKV?>D>iipysnmp/proto/mpmod/cache.pyPKAq>p>pysnmp/proto/mpmod/__init__.pycPKV?>V//pysnmp/proto/mpmod/base.pyPKkL>D;;kpysnmp/proto/mpmod/rfc2576.pyPKAq>և))pysnmp/proto/mpmod/rfc2576.pycPKo2pysnmp/proto/proxy/__init__.pyPKAq>dxɉpysnmp/proto/proxy/__init__.pycPKΒ5> bI5%5%pysnmp/proto/proxy/rfc2576.pyPKAq>{6#pysnmp/proto/proxy/rfc2576.pycPKAq>5!Bpysnmp/proto/secmod/cache.pycPKl1=Hpysnmp/proto/secmod/__init__.pyPKAq>.FU U zHpysnmp/proto/secmod/base.pycPKMYK>,3 Spysnmp/proto/secmod/cache.pyPKAq>$Ev 0Vpysnmp/proto/secmod/__init__.pycPKPYK>? Vpysnmp/proto/secmod/base.pyPKXK>,,\pysnmp/proto/secmod/rfc2576.pyPKAq>fLz|$|$ pysnmp/proto/secmod/rfc2576.pycPKe1>#Įpysnmp/proto/secmod/eso/__init__.pyPKAq>U{$pysnmp/proto/secmod/eso/__init__.pycPKe1>_vv&կpysnmp/proto/secmod/eso/priv/aes256.pyPKe1>(pysnmp/proto/secmod/eso/priv/__init__.pyPKe1>svv&մpysnmp/proto/secmod/eso/priv/aes192.pyPKAq>v""%pysnmp/proto/secmod/eso/priv/des3.pycPKAq>'pysnmp/proto/secmod/eso/priv/aes192.pycPKAq> fP'pysnmp/proto/secmod/eso/priv/aes256.pycPKAq>u;Y)pysnmp/proto/secmod/eso/priv/__init__.pycPKe1>]rB$pysnmp/proto/secmod/eso/priv/des3.pyPKu&,pysnmp/proto/secmod/rfc3414/service.pyPKAq>Kٵ (,pysnmp/proto/secmod/rfc3414/localkey.pycPKAq>eaa''pysnmp/proto/secmod/rfc3414/service.pycPKAq>f%%(5pysnmp/proto/secmod/rfc3414/__init__.pycPK de, pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pycPKAq> $$)#pysnmp/proto/secmod/rfc3414/auth/base.pycPK1>bF +%pysnmp/proto/secmod/rfc3414/auth/hmacmd5.pyPK1>=*2pysnmp/proto/secmod/rfc3414/auth/noauth.pyPKAq>cd-5pysnmp/proto/secmod/rfc3414/auth/__init__.pycPK1>,SS(y6pysnmp/proto/secmod/rfc3414/auth/base.pyPKAq>*,9pysnmp/proto/secmod/rfc3414/auth/hmacsha.pycPKAq>J+:Jpysnmp/proto/secmod/rfc3414/auth/noauth.pycPK1>r; +Qpysnmp/proto/secmod/rfc3414/auth/hmacsha.pyPK\v2,^pysnmp/proto/secmod/rfc3414/priv/__init__.pyPKAq>H[0)_pysnmp/proto/secmod/rfc3414/priv/base.pycPK1>F'hpysnmp/proto/secmod/rfc3414/priv/des.pyPKAq>ۤ(zpysnmp/proto/secmod/rfc3414/priv/des.pycPKAq>Fk>-/pysnmp/proto/secmod/rfc3414/priv/__init__.pycPKAq>ܥM))+pysnmp/proto/secmod/rfc3414/priv/nopriv.pycPK1>l44(pysnmp/proto/secmod/rfc3414/priv/base.pyPK6'pysnmp/proto/secmod/rfc3826/__init__.pyPKAq>OOT(Bpysnmp/proto/secmod/rfc3826/__init__.pycPK6,pysnmp/proto/secmod/rfc3826/priv/__init__.pyPKAq>X-dpysnmp/proto/secmod/rfc3826/priv/__init__.pycPK1>=22'Fpysnmp/proto/secmod/rfc3826/priv/aes.pyPKAq>(pysnmp/proto/secmod/rfc3826/priv/aes.pycPKu2ΩFpysnmp/proto/api/__init__.pyPK1L>*NNpysnmp/proto/api/v1.pyPKAq>HEEpysnmp/proto/api/verdec.pycPKAq>M9j,<,<pysnmp/proto/api/v1.pycPKAq>sw'pysnmp/proto/api/__init__.pycPKAq> r##)pysnmp/proto/api/v2c.pycPKC5>^ոLpysnmp/proto/api/verdec.pyPK5>dMpysnmp/proto/api/v2c.pyPKAq>,8 . .`pysnmp/smi/view.pycPKl1Qpysnmp/smi/__init__.pyPKAq>m2pysnmp/smi/error.pycPK 4>f  pysnmp/smi/error.pyPKAq>c#annLpysnmp/smi/exval.pycPK 4><""pysnmp/smi/instrum.pyPKAq>[v;;pysnmp/smi/instrum.pycPKAq>q``Bpysnmp/smi/indices.pycPKAq>0FgϠpysnmp/smi/__init__.pycPK6>̷..pysnmp/smi/view.pyPKAq>)p99?pysnmp/smi/builder.pycPK)o=ޯzypysnmp/smi/exval.pyPKɫ4>1܎  szpysnmp/smi/indices.pyPK}j>5--Ćpysnmp/smi/builder.pyPKAq>_MY=~~pysnmp/smi/mibs/ASN1.pycPKAq>RnG??pysnmp/smi/mibs/SNMPv2-SMI.pycPKĺE8DNii) pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.pyPKAq>."3 pysnmp/smi/mibs/PYSNMP-USM-MIB.pycPKAq>!kjkj*N" pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.pycPKo1 pysnmp/smi/mibs/__init__.pyPKAq> HH: pysnmp/smi/mibs/SNMPv2-CONF.pycPK 7>h/ /  pysnmp/smi/mibs/SNMPv2-TM.pyPKz:Go( pysnmp/smi/mibs/RFC1213-MIB.pyPKz:tƉ33% pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.pyPKAq>) ) $ pysnmp/smi/mibs/SNMP-USM-AES-MIB.pycPKz:" g!2 pysnmp/smi/mibs/PYSNMP-USM-MIB.pyPKAq>$2  4% pysnmp/smi/mibs/SNMPv2-TM.pycPKݩz: {7 pysnmp/smi/mibs/PYSNMP-MIB.pyPK 5=wN %\A pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pyPKz:rr#a pysnmp/smi/mibs/SNMP-USM-AES-MIB.pyPKAq> M__+\j pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.pycPKz: !! pysnmp/smi/mibs/SNMP-MPD-MIB.pyPKo> =]11 pysnmp/smi/mibs/SNMPv2-TC.pyPK~=v5ȯ pysnmp/smi/mibs/SNMPv2-CONF.pyPKAq>G77) pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.pycPKnr2ĎCCP pysnmp/smi/mibs/ASN1.pyPKAq><+ WS pysnmp/smi/mibs/SNMP-MPD-MIB.pycPKAq>hM99)fg pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.pycPKAq>jd77a pysnmp/smi/mibs/SNMPv2-TC.pycPKAq>  pysnmp/smi/mibs/PYSNMP-MIB.pycPKAq>t>># pysnmp/smi/mibs/SNMP-TARGET-MIB.pycPKz:01zii*#pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.pyPKAq>\m&&&pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.pycPK]7>EMSSnpysnmp/smi/mibs/SNMPv2-SMI.pyPKAq>7\BBQpysnmp/smi/mibs/RFC1213-MIB.pycPKAq> ȁۆ{Opysnmp/smi/mibs/__init__.pycPKt,A/Z/Zhpysnmp/smi/mibs/SNMPv2-MIB.pycPKz:KŋBB"@pysnmp/smi/mibs/SNMP-TARGET-MIB.pyPKAq>loMa a ׃pysnmp/smi/mibs/RFC1155-SMI.pycPKz:*r>r>(upysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.pyPKAq>' 00&-pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.pycPK 4>ak::)pysnmp/smi/mibs/instances/__SNMPv2-MIB.pyPKR 4|bff5 pysnmp/smi/mibs/instances/__SNMP-USER-BASED-SM-MIB.pyPKAq>-C,%pysnmp/smi/mibs/instances/__SNMP-MPD-MIB.pycPKR 4Cwjj+)pysnmp/smi/mibs/instances/__SNMP-MPD-MIB.pyPKAq>6.-pysnmp/smi/mibs/instances/__PYSNMP-USM-MIB.pycPKd[3%0pysnmp/smi/mibs/instances/__init__.pyPKAq> 861pysnmp/smi/mibs/instances/__SNMP-USER-BASED-SM-MIB.pycPKAq>_II7j8pysnmp/smi/mibs/instances/__SNMP-VIEW-BASED-ACM-MIB.pycPKAq>̇;mm2;pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.pycPKjWN6,~1?pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.pyPKR 4e9ư.Dpysnmp/smi/mibs/instances/__SNMP-TARGET-MIB.pyPKR 4M6nn-Gpysnmp/smi/mibs/instances/__PYSNMP-USM-MIB.pyPKR 4)^6Jpysnmp/smi/mibs/instances/__SNMP-VIEW-BASED-ACM-MIB.pyPKAq> V*zLpysnmp/smi/mibs/instances/__SNMPv2-MIB.pycPKAq>^Cؐ&ipysnmp/smi/mibs/instances/__init__.pycPKAq>{6/cjpysnmp/smi/mibs/instances/__SNMP-TARGET-MIB.pycPKSn2vnpysnmp/carrier/__init__.pyPKAq>鑡npysnmp/carrier/error.pycPKAq>ýppysnmp/carrier/base.pycPKo2ʴFF|pysnmp/carrier/error.pyPKAq>;epysnmp/carrier/__init__.pycPK4>+>//pysnmp/carrier/base.pyPKl1#pysnmp/carrier/asynsock/__init__.pyPKAq>'l Ypysnmp/carrier/asynsock/base.pycPKAq>x3$pysnmp/carrier/asynsock/__init__.pycPK4>99pysnmp/carrier/asynsock/base.pyPK4>3?o#_pysnmp/carrier/asynsock/dispatch.pyPKAq>cL $pysnmp/carrier/asynsock/dispatch.pycPK-< ii%pysnmp/carrier/asynsock/dgram/udp6.pyPK,:V,,>>%Gpysnmp/carrier/asynsock/dgram/unix.pyPKl1)pysnmp/carrier/asynsock/dgram/__init__.pyPKAq>1&pysnmp/carrier/asynsock/dgram/base.pycPK:Fba55$pysnmp/carrier/asynsock/dgram/udp.pyPKAq>/qq%~pysnmp/carrier/asynsock/dgram/udp.pycPKAq>R&2pysnmp/carrier/asynsock/dgram/udp6.pycPKAq>G0!*)pysnmp/carrier/asynsock/dgram/__init__.pycPKņ4>r %pysnmp/carrier/asynsock/dgram/base.pyPKAq> iJJ&Cpysnmp/carrier/asynsock/dgram/unix.pycPK:"pysnmp/carrier/twisted/__init__.pyPKAq>hhpysnmp/carrier/twisted/base.pycPKAq>s#pysnmp/carrier/twisted/__init__.pycPK: Dpysnmp/carrier/twisted/base.pyPKU4>#//" pysnmp/carrier/twisted/dispatch.pyPKAq>: # pysnmp/carrier/twisted/dispatch.pycPK: ;;$&pysnmp/carrier/twisted/dgram/unix.pyPK:("pysnmp/carrier/twisted/dgram/__init__.pyPKAq>k %"pysnmp/carrier/twisted/dgram/base.pycPK:E#0pysnmp/carrier/twisted/dgram/udp.pyPKAq>$m3pysnmp/carrier/twisted/dgram/udp.pycPKAq>Aٓ):pysnmp/carrier/twisted/dgram/__init__.pycPK: VV$Y;pysnmp/carrier/twisted/dgram/base.pyPKAq>x%Cpysnmp/carrier/twisted/dgram/unix.pycPK9j2,Kpysnmp/entity/__init__.pyPKAq>ϙPcKpysnmp/entity/engine.pycPK݅4>pg d dH^pysnmp/entity/config.pyPKAq>'„pysnmp/entity/__init__.pycPKK~=30Dpysnmp/entity/engine.pyPKAq>05p5ppysnmp/entity/config.pycPKAq>RFv!! ~Cpysnmp/entity/rfc3413/ntforg.pycPKQj2!]pysnmp/entity/rfc3413/__init__.pyPKAq>dEE ^pysnmp/entity/rfc3413/cmdgen.pycPKAq>4g66 pysnmp/entity/rfc3413/cmdrsp.pycPKy|7>D[pysnmp/entity/rfc3413/config.pyPK4>U"" pysnmp/entity/rfc3413/context.pyPKAq>|KH5p%%pysnmp/entity/rfc3413/ntforg.pyPK 4>? eR2R2,pysnmp/entity/rfc3413/cmdrsp.pyPK4>gzAAr_pysnmp/entity/rfc3413/ntfrcv.pyPKAq>! ! opysnmp/entity/rfc3413/mibvar.pycPKAq>I355 O|pysnmp/entity/rfc3413/ntfrcv.pycPKAq>o'"Œpysnmp/entity/rfc3413/__init__.pycPKUL>؁lDlDpysnmp/entity/rfc3413/cmdgen.pyPK6> 9S S 7pysnmp/entity/rfc3413/mibvar.pyPKAq>ݱcGG pysnmp/entity/rfc3413/config.pycPKAq>N )Lpysnmp/entity/rfc3413/oneliner/ntforg.pycPK 2*lpysnmp/entity/rfc3413/oneliner/__init__.pyPKAq>WW)pysnmp/entity/rfc3413/oneliner/cmdgen.pycPKgK>(kpysnmp/entity/rfc3413/oneliner/ntforg.pyPKAq>,iVW+pysnmp/entity/rfc3413/oneliner/__init__.pycPKo>ޯKK(tpysnmp/entity/rfc3413/oneliner/cmdgen.pyPKAq>aTP,,(pysnmp/entity/rfc3413/twisted/ntforg.pycPK:)pysnmp/entity/rfc3413/twisted/__init__.pyPKAq>>66(Fpysnmp/entity/rfc3413/twisted/cmdgen.pycPK:*;;'pysnmp/entity/rfc3413/twisted/ntforg.pyPKAq>J0*Bpysnmp/entity/rfc3413/twisted/__init__.pycPK'=X X 'pysnmp/entity/rfc3413/twisted/cmdgen.pyPKM