# Path: pysnmp/entity/engine.py
# class SnmpEngine:
#     def __init__(self, snmpEngineID=None, maxMessageSize=65507,
#                  msgAndPduDsp=None):
#     def __receiveMessageCbFun(
#         self,
#         transportDispatcher,
#         transportDomain,
#         transportAddress,
#         wholeMsg
#         ):
#     def __receiveTimerTickCbFun(self, timeNow):
#     def registerTransportDispatcher(self, transportDispatcher):
#     def unregisterTransportDispatcher(self):
# 
# Path: pysnmp/entity/config.py
# def __cookV1SystemInfo(snmpEngine, securityName):
# def addV1System(snmpEngine, securityName, communityName,
#                 contextEngineId=None, contextName=None,
#                 transportTag=None):
# def delV1System(snmpEngine, securityName):
# def __cookV3UserInfo(snmpEngine, securityName, contextEngineId):
# def addV3User(snmpEngine, securityName,
#               authProtocol=usmNoAuthProtocol, authKey=None,
#               privProtocol=usmNoPrivProtocol, privKey=None,
#               contextEngineId=None):
# def delV3User(snmpEngine, securityName, contextEngineId=None):
# def __cookTargetParamsInfo(snmpEngine, name):
# def addTargetParams(
#     snmpEngine,
#     name,
#     securityName,
#     securityLevel,
#     mpModel=3  # 0 == SNMPv1, 1 == SNMPv2c, 3 == SNMPv3
#     ):
# def delTargetParams(snmpEngine, name):
# def __cookTargetAddrInfo(snmpEngine, addrName):
# def addTargetAddr(
#     snmpEngine,
#     addrName,
#     transportDomain,    
#     transportAddress,
#     params,
#     timeout=None,
#     retryCount=None,
#     tagList=null
#     ):
# def delTargetAddr(snmpEngine, addrName):
# def addSocketTransport(snmpEngine, transportDomain, transport):
# def delSocketTransport(snmpEngine, transportDomain):
# def addContext(snmpEngine, contextName):
# def __cookVacmGroupInfo(snmpEngine, securityModel, securityName):
# def addVacmGroup(snmpEngine, groupName, securityModel, securityName):
# def delVacmGroup(snmpEngine, securityModel, securityName):
# def __cookVacmAccessInfo(snmpEngine, groupName, contextName, securityModel,
#                          securityLevel):
# def addVacmAccess(snmpEngine, groupName, contextName, securityModel,
#                   securityLevel, prefix, readView, writeView, notifyView):
# def delVacmAccess(snmpEngine, groupName, contextName, securityModel,
#                   securityLevel):
# def __cookVacmViewInfo(snmpEngine, viewName, subTree):
# def addVacmView(snmpEngine, viewName, viewType, subTree, mask):
# def delVacmView(snmpEngine, viewName, subTree):
# def __cookVacmUserInfo(snmpEngine, securityModel, securityName, securityLevel):
# def addVacmUser(snmpEngine, securityModel, securityName, securityLevel,
#                 readSubTree=(), writeSubTree=(), notifySubTree=(),
#                 contextName=null):
# def delVacmUser(snmpEngine, securityModel, securityName, securityLevel,
#                 readSubTree=(), writeSubTree=(), notifySubTree=()):
# def addRoUser(snmpEngine, securityModel, securityName, securityLevel, subTree):
# def delRoUser(snmpEngine, securityModel, securityName, securityLevel, subTree):
# def addRwUser(snmpEngine, securityModel, securityName, securityLevel, subTree):
# def delRwUser(snmpEngine, securityModel, securityName, securityLevel, subTree):
# def addTrapUser(snmpEngine,securityModel,securityName,securityLevel,subTree):
# def delTrapUser(snmpEngine,securityModel,securityName,securityLevel,subTree):
# def __cookNotificationTargetInfo(snmpEngine, notificationName, paramsName,
#                                  filterSubtree=None):
# def addNotificationTarget(snmpEngine, notificationName, paramsName,
#                           transportTag, notifyType=None, filterSubtree=None,
#                           filterMask=None, filterType=None):
# def delNotificationTarget(snmpEngine, notificationName, paramsName,
#                           filterSubtree=None):
# def setInitialVacmParameters(snmpEngine):
# 
# Path: pysnmp/carrier/twisted/dispatch.py
# class TwistedDispatcher(AbstractTransportDispatcher):
#     def __init__(self, *args, **kwargs):
#     def handleTimeout(self):
#     def runDispatcher(self, timeout=0.0):
#     def registerTransport(self, tDomain, transport):
#     def unregisterTransport(self, tDomain):
# 
# Path: pysnmp/carrier/twisted/dgram/udp.py
# class UdpTwistedTransport(DgramTwistedTransport):
#     def openClientMode(self, iface=''):
#     def openServerMode(self, iface=None):
# 
# Path: pysnmp/entity/rfc3413/ntfrcv.py
# class NotificationReceiver:
#     def __init__(self, snmpEngine, cbFun, cbCtx=None):
#     def close(self, snmpEngine):
#     def processPdu(
#         self,
#         snmpEngine,
#         messageProcessingModel,
#         securityModel,
#         securityName,
#         securityLevel,
#         contextEngineId,
#         contextName,
#         pduVersion,
#         PDU,
#         maxSizeResponseScopedPDU,
#         stateReference
#         ):
#             PDU = rfc2576.v1ToV2(PDU)


from pysnmp.entity import engine, config
from pysnmp.carrier.twisted import dispatch
from pysnmp.carrier.twisted.dgram import udp
from pysnmp.entity.rfc3413 import ntfrcv
# Notification Receiver (TRAP/INFORM)
#from pysnmp import debug

# Optionally enable stdout debugging
#debug.setLogger(debug.Debug('all'))

# Create SNMP engine with autogenernated engineID and pre-bound
# to socket transport dispatcher
snmpEngine = engine.SnmpEngine()

# Set Twisted dispatcher
snmpEngine.registerTransportDispatcher(dispatch.TwistedDispatcher())

#
# Transport setup
#

# UDP over IPv4
config.addSocketTransport(
    snmpEngine,

# Path: pysnmp/entity/engine.py
# class SnmpEngine:
#     def __init__(self, snmpEngineID=None, maxMessageSize=65507,
#                  msgAndPduDsp=None):
#     def __receiveMessageCbFun(
#         self,
#         transportDispatcher,
#         transportDomain,
#         transportAddress,
#         wholeMsg
#         ):
#     def __receiveTimerTickCbFun(self, timeNow):
#     def registerTransportDispatcher(self, transportDispatcher):
#     def unregisterTransportDispatcher(self):
# 
# Path: pysnmp/entity/config.py
# def __cookV1SystemInfo(snmpEngine, securityName):
# def addV1System(snmpEngine, securityName, communityName,
#                 contextEngineId=None, contextName=None,
#                 transportTag=None):
# def delV1System(snmpEngine, securityName):
# def __cookV3UserInfo(snmpEngine, securityName, contextEngineId):
# def addV3User(snmpEngine, securityName,
#               authProtocol=usmNoAuthProtocol, authKey=None,
#               privProtocol=usmNoPrivProtocol, privKey=None,
#               contextEngineId=None):
# def delV3User(snmpEngine, securityName, contextEngineId=None):
# def __cookTargetParamsInfo(snmpEngine, name):
# def addTargetParams(
#     snmpEngine,
#     name,
#     securityName,
#     securityLevel,
#     mpModel=3  # 0 == SNMPv1, 1 == SNMPv2c, 3 == SNMPv3
#     ):
# def delTargetParams(snmpEngine, name):
# def __cookTargetAddrInfo(snmpEngine, addrName):
# def addTargetAddr(
#     snmpEngine,
#     addrName,
#     transportDomain,    
#     transportAddress,
#     params,
#     timeout=None,
#     retryCount=None,
#     tagList=null
#     ):
# def delTargetAddr(snmpEngine, addrName):
# def addSocketTransport(snmpEngine, transportDomain, transport):
# def delSocketTransport(snmpEngine, transportDomain):
# def addContext(snmpEngine, contextName):
# def __cookVacmGroupInfo(snmpEngine, securityModel, securityName):
# def addVacmGroup(snmpEngine, groupName, securityModel, securityName):
# def delVacmGroup(snmpEngine, securityModel, securityName):
# def __cookVacmAccessInfo(snmpEngine, groupName, contextName, securityModel,
#                          securityLevel):
# def addVacmAccess(snmpEngine, groupName, contextName, securityModel,
#                   securityLevel, prefix, readView, writeView, notifyView):
# def delVacmAccess(snmpEngine, groupName, contextName, securityModel,
#                   securityLevel):
# def __cookVacmViewInfo(snmpEngine, viewName, subTree):
# def addVacmView(snmpEngine, viewName, viewType, subTree, mask):
# def delVacmView(snmpEngine, viewName, subTree):
# def __cookVacmUserInfo(snmpEngine, securityModel, securityName, securityLevel):
# def addVacmUser(snmpEngine, securityModel, securityName, securityLevel,
#                 readSubTree=(), writeSubTree=(), notifySubTree=(),
#                 contextName=null):
# def delVacmUser(snmpEngine, securityModel, securityName, securityLevel,
#                 readSubTree=(), writeSubTree=(), notifySubTree=()):
# def addRoUser(snmpEngine, securityModel, securityName, securityLevel, subTree):
# def delRoUser(snmpEngine, securityModel, securityName, securityLevel, subTree):
# def addRwUser(snmpEngine, securityModel, securityName, securityLevel, subTree):
# def delRwUser(snmpEngine, securityModel, securityName, securityLevel, subTree):
# def addTrapUser(snmpEngine,securityModel,securityName,securityLevel,subTree):
# def delTrapUser(snmpEngine,securityModel,securityName,securityLevel,subTree):
# def __cookNotificationTargetInfo(snmpEngine, notificationName, paramsName,
#                                  filterSubtree=None):
# def addNotificationTarget(snmpEngine, notificationName, paramsName,
#                           transportTag, notifyType=None, filterSubtree=None,
#                           filterMask=None, filterType=None):
# def delNotificationTarget(snmpEngine, notificationName, paramsName,
#                           filterSubtree=None):
# def setInitialVacmParameters(snmpEngine):
# 
# Path: pysnmp/carrier/twisted/dispatch.py
# class TwistedDispatcher(AbstractTransportDispatcher):
#     def __init__(self, *args, **kwargs):
#     def handleTimeout(self):
#     def runDispatcher(self, timeout=0.0):
#     def registerTransport(self, tDomain, transport):
#     def unregisterTransport(self, tDomain):
# 
# Path: pysnmp/carrier/twisted/dgram/udp.py
# class UdpTwistedTransport(DgramTwistedTransport):
#     def openClientMode(self, iface=''):
#     def openServerMode(self, iface=None):
# 
# Path: pysnmp/entity/rfc3413/ntfrcv.py
# class NotificationReceiver:
#     def __init__(self, snmpEngine, cbFun, cbCtx=None):
#     def close(self, snmpEngine):
#     def processPdu(
#         self,
#         snmpEngine,
#         messageProcessingModel,
#         securityModel,
#         securityName,
#         securityLevel,
#         contextEngineId,
#         contextName,
#         pduVersion,
#         PDU,
#         maxSizeResponseScopedPDU,
#         stateReference
#         ):
#             PDU = rfc2576.v1ToV2(PDU)


# Path: examples/v3arch/twisted/manager/ntfrcv.py
from pysnmp.entity import engine, config
from pysnmp.carrier.twisted import dispatch
from pysnmp.carrier.twisted.dgram import udp
from pysnmp.entity.rfc3413 import ntfrcv

# Notification Receiver (TRAP/INFORM)
#from pysnmp import debug

# Optionally enable stdout debugging
#debug.setLogger(debug.Debug('all'))

# Create SNMP engine with autogenernated engineID and pre-bound
# to socket transport dispatcher
snmpEngine = engine.SnmpEngine()

# Set Twisted dispatcher
snmpEngine.registerTransportDispatcher(dispatch.TwistedDispatcher())

#
# Transport setup
#

# UDP over IPv4
config.addSocketTransport(
    snmpEngine,

    udp.domainName,