diff options
author | elie <elie> | 2005-10-12 16:02:47 +0000 |
---|---|---|
committer | elie <elie> | 2005-10-12 16:02:47 +0000 |
commit | a990464ab27330d9725b28985ec4effe7d030ebf (patch) | |
tree | ee9a24538701814f0dc485e74cb518d0fba1a868 /pysnmp | |
parent | beac2b8a85446ea9e67020370cf82edea825ab65 (diff) | |
download | pysnmp-git-a990464ab27330d9725b28985ec4effe7d030ebf.tar.gz |
sendNotification() now takes notifyType parameter (trap or inform)
Diffstat (limited to 'pysnmp')
-rw-r--r-- | pysnmp/hlapi/asyncore/ntforg.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/pysnmp/hlapi/asyncore/ntforg.py b/pysnmp/hlapi/asyncore/ntforg.py index 551f49c1..a99d4390 100644 --- a/pysnmp/hlapi/asyncore/ntforg.py +++ b/pysnmp/hlapi/asyncore/ntforg.py @@ -1,5 +1,5 @@ from pysnmp.entity import config -from pysnmp.entity.rfc3413 import ntforg, context +from pysnmp.entity.rfc3413 import ntforg, context, mibvar from pysnmp.entity.rfc3413.oneliner import cmdgen # Auth protocol @@ -25,7 +25,8 @@ class AsynNotificationOriginator(cmdgen.AsynCommandGenerator): self.__knownAuths = {} def asyncSendNotification( - self, authData, transportTarget, notificationType, varBinds=None + self, authData, transportTarget, notifyType, + notificationType, varBinds=None ): tagList = 'notify-list' addrName, paramsName = cmdgen.AsynCommandGenerator._configure( @@ -38,7 +39,8 @@ class AsynNotificationOriginator(cmdgen.AsynCommandGenerator): self.snmpEngine, notifyName, paramsName, - tagList + tagList, + notifyType ) config.addContext( self.snmpEngine, '' @@ -63,17 +65,18 @@ class AsynNotificationOriginator(cmdgen.AsynCommandGenerator): __varBinds.append((name + oid, varVal)) else: __varBinds = None - - return ntforg.NotificationOriginator(snmpContext).sendNotification( + + return ntforg.NotificationOriginator(self.snmpContext).sendNotification( self.snmpEngine, notifyName, notificationType, __varBinds ) class NotificationOriginator(AsynNotificationOriginator): def sendNotification( - self, authData, transportTarget, notificationType, varBinds=None + self, authData, transportTarget, notifyType, + notificationType, varBinds=None ): errorIndication = self.asyncSendNotification( - authData, transportTarget, notificationType, varBinds + authData, transportTarget, notifyType, notificationType, varBinds ) if errorIndication: return errorIndication |