diff options
Diffstat (limited to 'pysnmp/entity/rfc3413/ntforg.py')
-rw-r--r-- | pysnmp/entity/rfc3413/ntforg.py | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/pysnmp/entity/rfc3413/ntforg.py b/pysnmp/entity/rfc3413/ntforg.py index abf1a47f..85bdb9d0 100644 --- a/pysnmp/entity/rfc3413/ntforg.py +++ b/pysnmp/entity/rfc3413/ntforg.py @@ -333,66 +333,5 @@ class NotificationOriginator(object): return notificationHandle - -# -# Obsolete, compatibility interfaces. -# - -def _sendNotificationCbFun(snmpEngine, sendRequestHandle, errorIndication, - errorStatus, errorIndex, varBinds, cbCtx): - cbFun, cbCtx = cbCtx - - try: - # we need to pass response PDU information to user for INFORMs - cbFun(sendRequestHandle, errorIndication, - errorStatus, errorIndex, varBinds, cbCtx) - except TypeError: - # a backward compatible way of calling user function - cbFun(sendRequestHandle, errorIndication, cbCtx) - - -def _sendNotification(self, snmpEngine, notificationTarget, notificationName, - additionalVarBinds=(), cbFun=None, cbCtx=None, - contextName=null, instanceIndex=None): - if self.snmpContext is None: - raise error.ProtocolError('SNMP context not specified') - - # - # Here we first expand trap OID into associated OBJECTS - # and then look them up at context-specific MIB - # - - mibViewController = snmpEngine.getUserContext('mibViewController') - if not mibViewController: - mibViewController = view.MibViewController(snmpEngine.getMibBuilder()) - snmpEngine.setUserContext(mibViewController=mibViewController) - - # Support the following syntax: - # '1.2.3.4' - # (1,2,3,4) - # ('MIB', 'symbol') - if isinstance(notificationName, (tuple, list)) and \ - notificationName and isinstance(notificationName[0], str): - notificationName = rfc1902.ObjectIdentity(*notificationName) - else: - notificationName = rfc1902.ObjectIdentity(notificationName) - - varBinds = rfc1902.NotificationType(notificationName, - instanceIndex=instanceIndex) - varBinds.resolveWithMib(mibViewController) - - mibInstrumController = self.snmpContext.getMibInstrum(contextName) - - varBinds = varBinds[:1] + mibInstrumController.readVars(varBinds[1:]) - - return self.sendVarBinds(snmpEngine, notificationTarget, - self.snmpContext.contextEngineId, - contextName, varBinds + list(additionalVarBinds), - _sendNotificationCbFun, (cbFun, cbCtx)) - - -# install compatibility wrapper -NotificationOriginator.sendNotification = _sendNotification - # XXX # move/group/implement config setting/retrieval at a stand-alone module |