- original asynsock transport and AsyncsockDispatcher renamed into

asyncore and AsyncoreDispatcher respectively to provide better hint
  to fellow devs on the underlying transport being used
- backward compatibility preserved through dummy asynsock symbols
pull/45/head
elie 2015-07-05 14:22:26 +00:00
parent fad315e4f8
commit 7e2076a1e0
78 changed files with 113 additions and 95 deletions

View File

@ -29,6 +29,10 @@ Revision 4.3.0
- Initial support for the asyncio & Trollius frameworks and
coroutines-based SNMP Applications interfaces added. Both IPv4 and IPv6
datagram transports are currently supported.
- Original asynsock transport and AsyncsockDispatcher renamed into
asyncore and AsyncoreDispatcher respectively to provide better hint
to fellow devs on the underlying transport being used. Backward
compatibility preserved.
- The asyncore-based transport subsystem extended to support POSIX
sendmsg()/recvmsg() based socket communication what could be used,
among other things, in the context of a transparent SNMP proxy

View File

@ -26,7 +26,7 @@
#
from pysnmp.entity.rfc3413.oneliner import ntforg
from pysnmp.entity import engine
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
# List of targets in the following format:
# ( ( authData, transportTarget ), ... )
@ -54,7 +54,7 @@ def cbFun(snmpEngine, sendRequestHandle, errorIndication,
print('%s = %s' % (name.prettyPrint(), val.prettyPrint()))
# Instantiate the single transport dispatcher object
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
# Setup a custom data routing function to select snmpEngine by transportDomain
transportDispatcher.registerRoutingCbFun(

View File

@ -27,7 +27,7 @@
#
from pysnmp.entity.rfc3413.oneliner import cmdgen
from pysnmp.entity import engine
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
# List of targets in the followin format:
# ( ( authData, transportTarget, varNames ), ... )
@ -77,7 +77,7 @@ def cbFun(snmpEngine, sendRequestHandle, errorIndication,
# Instantiate the single transport dispatcher object
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
# Setup a custom data routing function to select snmpEngine by transportDomain
transportDispatcher.registerRoutingCbFun(

View File

@ -1,6 +1,6 @@
# Command Responder Application (GET/GETNEXT)
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asynsock.dgram import udp, udp6, unix
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
from pysnmp.carrier.asyncore.dgram import udp, udp6, unix
from pyasn1.codec.ber import encoder, decoder
from pysnmp.proto import api
import time, bisect
@ -97,7 +97,7 @@ def cbFun(transportDispatcher, transportDomain, transportAddress, wholeMsg):
)
return wholeMsg
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
transportDispatcher.registerRecvCbFun(cbFun)
# UDP/IPv4

View File

@ -1,6 +1,6 @@
# Notification Originator Application (TRAP)
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asynsock.dgram import udp, udp6, unix
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
from pysnmp.carrier.asyncore.dgram import udp, udp6, unix
from pyasn1.codec.ber import encoder
from pysnmp.proto import api
@ -23,7 +23,7 @@ pMod.apiMessage.setDefaults(trapMsg)
pMod.apiMessage.setCommunity(trapMsg, 'public')
pMod.apiMessage.setPDU(trapMsg, trapPDU)
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
# UDP/IPv4
transportDispatcher.registerTransport(

View File

@ -1,5 +1,5 @@
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
from pysnmp.carrier.asyncore.dgram import udp
from pyasn1.codec.ber import encoder, decoder
from pysnmp.proto import api
from time import time
@ -51,7 +51,7 @@ def cbRecvFun(transportDispatcher, transportDomain, transportAddress,
transportDispatcher.jobFinished(1)
return wholeMsg
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
transportDispatcher.registerRecvCbFun(cbRecvFun)
transportDispatcher.registerTimerCbFun(cbTimerFun)

View File

@ -1,6 +1,6 @@
# GET Command Generator
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asynsock.dgram import udp, udp6, unix
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
from pysnmp.carrier.asyncore.dgram import udp, udp6, unix
from pyasn1.codec.ber import encoder, decoder
from pysnmp.proto import api
from time import time
@ -46,7 +46,7 @@ def cbRecvFun(transportDispatcher, transportDomain, transportAddress,
transportDispatcher.jobFinished(1)
return wholeMsg
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
transportDispatcher.registerRecvCbFun(cbRecvFun)
transportDispatcher.registerTimerCbFun(cbTimerFun)

View File

@ -1,6 +1,6 @@
# GETBULK Command Generator (SNMPv2c only)
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
from pysnmp.carrier.asyncore.dgram import udp
from pyasn1.codec.ber import encoder, decoder
from pysnmp.proto.api import v2c
from time import time
@ -77,7 +77,7 @@ def cbRecvFun(transportDispatcher, transportDomain, transportAddress,
startedAt = time()
return wholeMsg
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
transportDispatcher.registerRecvCbFun(cbRecvFun)
transportDispatcher.registerTimerCbFun(cbTimerFun)

View File

@ -1,6 +1,6 @@
# GETNEXT Command Generator
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
from pysnmp.carrier.asyncore.dgram import udp
from pyasn1.codec.ber import encoder, decoder
from pysnmp.proto import api
from time import time
@ -70,7 +70,7 @@ def cbRecvFun(transportDispatcher, transportDomain, transportAddress,
startedAt = time()
return wholeMsg
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
transportDispatcher.registerRecvCbFun(cbRecvFun)
transportDispatcher.registerTimerCbFun(cbTimerFun)

View File

@ -1,5 +1,5 @@
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.proto import api
from pyasn1.codec.ber import encoder, decoder
from time import time
@ -53,7 +53,7 @@ def cbRecvFun(transportDispatcher, transportDomain, transportAddress,
transportDispatcher.jobFinished(1)
return wholeMsg
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
transportDispatcher.registerRecvCbFun(cbRecvFun)
transportDispatcher.registerTimerCbFun(cbTimerFun)

View File

@ -1,6 +1,6 @@
# SET Command Generator
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
from pysnmp.carrier.asyncore.dgram import udp
from pyasn1.codec.ber import encoder, decoder
from pysnmp.proto import api
from time import time
@ -48,7 +48,7 @@ def cbRecvFun(transportDispatcher, transportDomain, transportAddress,
transportDispatcher.jobFinished(1)
return wholeMsg
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
transportDispatcher.registerRecvCbFun(cbRecvFun)
transportDispatcher.registerTimerCbFun(cbTimerFun)

View File

@ -1,6 +1,6 @@
# Notification Receiver (TRAP PDU)
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asynsock.dgram import udp, udp6, unix
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
from pysnmp.carrier.asyncore.dgram import udp, udp6, unix
from pyasn1.codec.ber import decoder
from pysnmp.proto import api
@ -50,7 +50,7 @@ def cbFun(transportDispatcher, transportDomain, transportAddress, wholeMsg):
print('%s = %s' % (oid.prettyPrint(), val.prettyPrint()))
return wholeMsg
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
transportDispatcher.registerRecvCbFun(cbFun)

View File

@ -18,7 +18,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.smi import instrum, builder
from pysnmp.proto.api import v2c

View File

@ -17,7 +17,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.smi import instrum
from pysnmp.proto.api import v2c

View File

@ -16,7 +16,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.proto import rfc1902
# Create SNMP engine

View File

@ -17,7 +17,7 @@
import sys
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.proto.api import v2c
# Create SNMP engine

View File

@ -25,7 +25,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.proto.api import v2c
# Create SNMP engine

View File

@ -17,7 +17,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp, udp6
from pysnmp.carrier.asyncore.dgram import udp, udp6
# Create SNMP engine with autogenernated engineID and pre-bound
# to socket transport dispatcher

View File

@ -16,7 +16,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
# Create SNMP engine with autogenernated engineID and pre-bound
# to socket transport dispatcher

View File

@ -32,7 +32,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
# Create SNMP engine
snmpEngine = engine.SnmpEngine()

View File

@ -16,7 +16,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
# Create SNMP engine with autogenernated engineID and pre-bound
# to socket transport dispatcher

View File

@ -26,8 +26,8 @@
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.proto import rfc1902
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
from pysnmp.carrier.asyncore.dgram import udp
# Configuration parameters for each of SNMP Engines
snmpEngineInfo = (
@ -36,7 +36,7 @@ snmpEngineInfo = (
)
# Instantiate the single transport dispatcher object
transportDispatcher = AsynsockDispatcher()
transportDispatcher = AsyncoreDispatcher()
# Setup a custom data routing function to select snmpEngine by transportDomain
transportDispatcher.registerRoutingCbFun(lambda td,t,d: td)

View File

@ -19,7 +19,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
# Create SNMP engine
snmpEngine = engine.SnmpEngine()

View File

@ -20,7 +20,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
# Create SNMP engine
snmpEngine = engine.SnmpEngine()

View File

@ -17,7 +17,7 @@
# 1.3.6.1.2.1.1.1.0 = 'Example Notificator'
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.proto.api import v2c

View File

@ -13,7 +13,7 @@
# 1.3.6.1.6.3.1.1.4.1.0 = 1.3.6.1.6.3.1.1.5.1
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.proto.api import v2c

View File

@ -15,7 +15,7 @@
# 1.3.6.1.2.1.1.5.0 = 'Notificator Example'
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.proto.api import v2c

View File

@ -14,7 +14,7 @@
# 1.3.6.1.2.1.1.5.0 = 'Notificator Example'
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp, udp6
from pysnmp.carrier.asyncore.dgram import udp, udp6
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.proto.api import v2c

View File

@ -12,7 +12,7 @@
# * with TRAP ID 'coldStart' specified as an OID
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.proto.api import v2c

View File

@ -15,7 +15,7 @@
# 1.3.6.1.2.1.1.5.0 = 'Notificator Example'
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.proto.api import v2c

View File

@ -12,7 +12,7 @@
# * include managed object information 1.3.6.1.2.1.1.5.0 = 'system name'
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.proto.api import v2c

View File

@ -16,7 +16,7 @@
# * include managed object information '1.3.6.1.2.1.1.1.0' = 'my system'
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.proto.api import v2c
#from pysnmp import debug

View File

@ -14,7 +14,7 @@
# 1.3.6.1.2.1.1.5.0 = 'Notificator Example'
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.proto.api import v2c

View File

@ -23,7 +23,7 @@
# To run this example make sure to have IF-MIB.py in search path.
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.smi import rfc1902, view

View File

@ -14,7 +14,7 @@
# 1.3.6.1.2.1.1.5.0 = 'Notificator Example'
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.proto.api import v2c

View File

@ -12,7 +12,7 @@
# * include managed object information 1.3.6.1.2.1.1.5.0 = 'system name'
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntforg
from pysnmp.proto.api import v2c

View File

@ -15,7 +15,7 @@
# $ snmpget -v3 -l authNoPriv -u usr-md5-none -A authkey1 -E 80004fb805636c6f75644dab22cc -n da761cfc8c94d3aceef4f60f049105ba -ObentU 195.218.195.228:161 1.3.6.1.2.1.1.1.0
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
from pysnmp.proto import rfc1902

View File

@ -13,7 +13,7 @@
# $ snmpget -v2c -c public -ObentU -r 5 -t 1 195.218.195.228 1.3.6.1.2.1.1.1.0
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
# Create SNMP engine instance

View File

@ -13,7 +13,7 @@
# $ snmpwalk -v3 -l authNoPriv -u usr-md5-none -A authkey1 -ObentU udp6:[::1]:161 1.3.6.1.2.1.1 1.3.6.1.4.1.1
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp6
from pysnmp.carrier.asyncore.dgram import udp6
from pysnmp.entity.rfc3413 import cmdgen
# Create SNMP engine instance

View File

@ -15,7 +15,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdgen
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
# Create SNMP engine instance
snmpEngine = engine.SnmpEngine()

View File

@ -15,7 +15,7 @@
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdgen
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
# Create SNMP engine instance
snmpEngine = engine.SnmpEngine()

View File

@ -13,7 +13,7 @@
# $ snmpwalk -v1 -c public -ObentU 195.218.195.228 1.3.6.1.2.1.1 1.3.6.1.4.1.1
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
from pysnmp.smi import compiler, view, rfc1902

View File

@ -13,7 +13,7 @@
# $ snmpwalk -v1 -c public -ObentU 195.218.195.228 1.3.6.1.2.1.1 1.3.6.1.4.1.1
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
# Create SNMP engine instance

View File

@ -16,7 +16,7 @@
# $ snmpget -v3 -l authPriv -u usr-sha-aes -a SHA -A authkey1 -x AES -X privkey1 -ObentU 195.218.195.228:161 1.3.6.1.2.1.1.1.0
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
# Create SNMP engine instance

View File

@ -13,7 +13,7 @@
# $ snmpwalk -v3 -l noAuthNoPriv -u usr-none-none -ObentU 195.218.195.228:161 1.3.6.1.2.1.1
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
from pysnmp.proto import rfc1902

View File

@ -14,7 +14,7 @@
# $ snmpwalk -v2c -c public -ObentU 195.218.195.228 1.3.6.1.2.1.1 1.3.6.1.4.1.1
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
# Create SNMP engine instance

View File

@ -12,7 +12,7 @@
# $ snmpset -v1 -c private -ObentU 195.218.195.228:161 1.3.6.1.2.1.1.9.1.3.1 s 'my value' 1.3.6.1.2.1.1.9.1.4.1 t 123
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
from pysnmp.proto import rfc1902

View File

@ -23,7 +23,7 @@
#
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
# Create SNMP engine instance

View File

@ -12,7 +12,7 @@
# $ snmpget -v3 -l authPriv -u usr-sha-aes -a SHA -A authkey1 -x AES -X privkey1 -ObentU 195.218.195.228:161 1.3.6.1.2.1.1.1.0
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
# Create SNMP engine instance

View File

@ -12,7 +12,7 @@
# $ snmpset -v3 -l authNoPriv -u usr-sha-none -a SHA -A authkey1 -ObentU 195.218.195.228:161 1.3.6.1.2.1.1.9.1.3.1 s 'my new value'
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
from pysnmp.proto import rfc1902

View File

@ -12,7 +12,7 @@
# $ snmpget -v1 -c public -ObentU 195.218.195.228 1.3.6.1.2.1.1.1.0
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
# Create SNMP engine instance

View File

@ -12,7 +12,7 @@
# $ snmpset -v2c -c private -ObentU 195.218.195.228:161 1.3.6.1.2.1.1.9.1.4.1 t 123
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import cmdgen
from pysnmp.proto import rfc1902

View File

@ -15,7 +15,7 @@
# $ snmptrap -v2c -c public 127.0.0.1:162 123 1.3.6.1.6.3.1.1.5.1 1.3.6.1.2.1.1.5.0 s test
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntfrcv
# Create SNMP engine with autogenernated engineID and pre-bound

View File

@ -16,7 +16,7 @@
# $ snmpinform -v2c -c public 127.0.0.1:2162 123 1.3.6.1.6.3.1.1.5.1
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntfrcv
# Create SNMP engine with autogenernated engineID and pre-bound

View File

@ -17,7 +17,7 @@
# $ snmpinform -v2c -c public 127.0.0.1 123 1.3.6.1.6.3.1.1.5.1
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp, udp6
from pysnmp.carrier.asyncore.dgram import udp, udp6
from pysnmp.entity.rfc3413 import ntfrcv
# Create SNMP engine with autogenernated engineID and pre-bound

View File

@ -19,7 +19,7 @@
# $ snmpinform -v3 -u usr-sha-aes128 -l authPriv -a SHA -A authkey1 -x AES -X privkey1 127.0.0.1 123 1.3.6.1.6.3.1.1.5.1
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntfrcv
from pysnmp.proto.api import v2c

View File

@ -18,7 +18,7 @@
# $ snmpinform -v2c -c public 127.0.0.1 123 1.3.6.1.6.3.1.1.5.1
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp, udp6
from pysnmp.carrier.asyncore.dgram import udp, udp6
from pysnmp.entity.rfc3413 import ntfrcv
# Create SNMP engine with autogenernated engineID and pre-bound

View File

@ -24,7 +24,7 @@
# CommunityName's, not explicitly configured to local SNMP Engine.
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntfrcv
from pysnmp.proto.api import v2c
import re

View File

@ -21,7 +21,7 @@
# initial request PDUs from different Managers, into unique values to
# avoid sending duplicate request-IDs to Agents.
#
from pysnmp.carrier.asynsock.dgram import udp, udp6
from pysnmp.carrier.asyncore.dgram import udp, udp6
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, cmdgen, context
from pysnmp.proto.api import v2c

View File

@ -21,7 +21,7 @@
# initial request PDUs from different Managers, into unique values to
# avoid sending duplicate request-IDs to Agents.
#
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, cmdgen, context
from pysnmp.proto.api import v2c

View File

@ -21,7 +21,7 @@
# initial request PDUs from different Managers, into unique values to
# avoid sending duplicate request-IDs to Agents.
#
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, cmdgen, context
from pysnmp.proto.api import v2c

View File

@ -21,7 +21,7 @@
# initial request PDUs from different Managers, into unique values to
# avoid sending duplicate request-IDs to Agents.
#
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, cmdgen, context
from pysnmp.proto.api import v2c

View File

@ -3,11 +3,11 @@ import socket, sys
import asyncore
from pysnmp.carrier import error
from pysnmp.carrier.base import AbstractTransport
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher
from pysnmp import debug
class AbstractSocketTransport(asyncore.dispatcher, AbstractTransport):
protoTransportDispatcher = AsynsockDispatcher
protoTransportDispatcher = AsyncoreDispatcher
sockFamily = sockType = None
retryCount = 0; retryInterval = 0
bufferSize = 131070
@ -36,10 +36,10 @@ class AbstractSocketTransport(asyncore.dispatcher, AbstractTransport):
except Exception:
debug.logger & debug.flagIO and debug.logger('%s: socket buffer size option mangling failure for buffer %d: %s' % (self.__class__.__name__, b, sys.exc_info()[1]))
# The socket map is managed by the AsynsockDispatcher on
# The socket map is managed by the AsyncoreDispatcher on
# which this transport is registered. Here we just prepare
# socket and postpone transport registration at dispatcher
# till AsynsockDispatcher invokes registerSocket()
# till AsyncoreDispatcher invokes registerSocket()
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setblocking(0)

View File

@ -1,6 +1,6 @@
# Implements asyncore-based generic DGRAM transport
import socket, errno, sys
from pysnmp.carrier.asynsock.base import AbstractSocketTransport
from pysnmp.carrier.asyncore.base import AbstractSocketTransport
from pysnmp.carrier import sockfix, sockmsg, error
from pysnmp import debug

View File

@ -1,7 +1,7 @@
# Implements asyncore-based UDP transport domain
from socket import AF_INET
from pysnmp.carrier.base import AbstractTransportAddress
from pysnmp.carrier.asynsock.dgram.base import DgramSocketTransport
from pysnmp.carrier.asyncore.dgram.base import DgramSocketTransport
domainName = snmpUDPDomain = (1, 3, 6, 1, 6, 1, 1)

View File

@ -1,7 +1,7 @@
# Implements asyncore-based UDP6 transport domain
from pysnmp.carrier import sockfix
from pysnmp.carrier.base import AbstractTransportAddress
from pysnmp.carrier.asynsock.dgram.base import DgramSocketTransport
from pysnmp.carrier.asyncore.dgram.base import DgramSocketTransport
import socket
domainName = snmpUDP6Domain = (1, 3, 6, 1, 2, 1, 100, 1, 2)

View File

@ -6,7 +6,7 @@ try:
except ImportError:
AF_UNIX = None
from pysnmp.carrier.base import AbstractTransportAddress
from pysnmp.carrier.asynsock.dgram.base import DgramSocketTransport
from pysnmp.carrier.asyncore.dgram.base import DgramSocketTransport
domainName = snmpLocalDomain = (1, 3, 6, 1, 2, 1, 100, 1, 13)

View File

@ -7,7 +7,7 @@ from asyncore import loop
from pysnmp.carrier.base import AbstractTransportDispatcher
from pysnmp.error import PySnmpError
class AsynsockDispatcher(AbstractTransportDispatcher):
class AsyncoreDispatcher(AbstractTransportDispatcher):
def __init__(self):
self.__sockMap = {} # use own map for MT safety
self.timeout = 0.5

View File

@ -0,0 +1 @@
# This file is necessary to make this directory a package.

View File

@ -0,0 +1 @@
# This file is necessary to make this directory a package.

View File

@ -0,0 +1,2 @@
# Obsolete, compatibility interface
from pysnmp.carrier.asyncore.dgram.udp import *

View File

@ -0,0 +1,2 @@
# Obsolete, compatibility interface
from pysnmp.carrier.asyncore.dgram.udp6 import *

View File

@ -0,0 +1,2 @@
# Obsolete, compatibility interface
from pysnmp.carrier.asyncore.dgram.unix import *

View File

@ -0,0 +1,4 @@
# Obsolete, compatibility interface
from pysnmp.carrier.asyncore.dispatch import *
AsynsockDispatcher = AsyncoreDispatcher

View File

@ -1,7 +1,7 @@
# Initial SNMP engine configuration functions. During further operation,
# SNMP engine might be configured remotely (through SNMP).
from pyasn1.compat.octets import null
from pysnmp.carrier.asynsock.dgram import udp, udp6, unix
from pysnmp.carrier.asyncore.dgram import udp, udp6, unix
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

View File

@ -1,5 +1,5 @@
import socket, sys
from pysnmp.carrier.asynsock.dgram import udp, udp6, unix
from pysnmp.carrier.asyncore.dgram import udp, udp6, unix
from pysnmp import error
from pyasn1.compat.octets import null

View File

@ -3,7 +3,7 @@ import sys
from pyasn1.codec.ber import encoder
from pyasn1.error import PyAsn1Error
from pysnmp.proto.secmod import base
from pysnmp.carrier.asynsock.dgram import udp, udp6, unix
from pysnmp.carrier.asyncore.dgram import udp, udp6, unix
from pysnmp.smi.error import NoSuchInstanceError
from pysnmp.proto import errind, error
from pysnmp import debug

View File

@ -96,6 +96,8 @@ params.update( {
'pysnmp.carrier',
'pysnmp.carrier.asynsock',
'pysnmp.carrier.asynsock.dgram',
'pysnmp.carrier.asyncore',
'pysnmp.carrier.asyncore.dgram',
'pysnmp.carrier.twisted',
'pysnmp.carrier.twisted.dgram',
'pysnmp.carrier.asyncio',