summaryrefslogtreecommitdiff
path: root/pysnmp/entity/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'pysnmp/entity/config.py')
-rw-r--r--pysnmp/entity/config.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pysnmp/entity/config.py b/pysnmp/entity/config.py
index 553c3da4..2f4b6b03 100644
--- a/pysnmp/entity/config.py
+++ b/pysnmp/entity/config.py
@@ -529,6 +529,21 @@ def addRwUser(snmpEngine, securityModel, securityName, securityLevel, subTree):
# Notification configuration
+def addTrapUser(snmpEngine,securityModel,securityName,securityLevel,subTree):
+ groupName = '%s-grp-%d' % (securityName, securityModel)
+ SnmpSecurityLevel, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpSecurityLevel')
+ securityLevel = SnmpSecurityLevel(securityLevel)
+ addVacmGroup(
+ snmpEngine, groupName, securityModel, securityName
+ )
+ addVacmAccess(
+ snmpEngine, groupName, '', securityModel, securityLevel, 1,
+ '', '', groupName+'-view-trap',
+ )
+ addVacmView(
+ snmpEngine, groupName+'-view-trap', 1, subTree, ''
+ )
+
def addNotificationTarget(snmpEngine, notificationName, paramsName,
transportTag, notifyType=None, filterSubtree=None,
filterMask=None, filterType=None):