summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2005-10-14 19:50:55 +0000
committerelie <elie>2005-10-14 19:50:55 +0000
commit4c8b50287d3308bfc78e99a759cac62427ba6fc0 (patch)
treeeb8727aedd4a20fca0ff2da3bc896a75b5b6ce6b
parent8bb958fab7def712540bb77a2869579da6f3b211 (diff)
downloadpysnmp-4c8b50287d3308bfc78e99a759cac62427ba6fc0.tar.gz
make use of SetCommandResponder
-rw-r--r--examples/v3arch/agent/cmdrsp.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/v3arch/agent/cmdrsp.py b/examples/v3arch/agent/cmdrsp.py
index 804c162..aaa0046 100644
--- a/examples/v3arch/agent/cmdrsp.py
+++ b/examples/v3arch/agent/cmdrsp.py
@@ -11,7 +11,7 @@ snmpEngine = engine.SnmpEngine()
config.addSocketTransport(
snmpEngine,
udp.domainName,
- udp.UdpSocketTransport().openServerMode(('127.0.0.1', 161))
+ udp.UdpSocketTransport().openServerMode(('127.0.0.1', 1161))
)
# Create and put on-line my managed object
@@ -34,15 +34,16 @@ config.addV3User(
# VACM setup
config.addContext(snmpEngine, '')
-config.addRoUser(snmpEngine, 1, 'test-agent', 'noAuthNoPriv', (1,3,6)) # v1
-config.addRoUser(snmpEngine, 2, 'test-agent', 'noAuthNoPriv', (1,3,6)) # v2c
-config.addRoUser(snmpEngine, 3, 'test-user', 'authPriv', (1,3,6)) # v3
+config.addRwUser(snmpEngine, 1, 'test-agent', 'noAuthNoPriv', (1,3,6)) # v1
+config.addRwUser(snmpEngine, 2, 'test-agent', 'noAuthNoPriv', (1,3,6)) # v2c
+config.addRwUser(snmpEngine, 3, 'test-user', 'authPriv', (1,3,6)) # v3
# SNMP context
snmpContext = context.SnmpContext(snmpEngine)
# Apps registration
cmdrsp.GetCommandResponder(snmpEngine, snmpContext)
+cmdrsp.SetCommandResponder(snmpEngine, snmpContext)
cmdrsp.NextCommandResponder(snmpEngine, snmpContext)
cmdrsp.BulkCommandResponder(snmpEngine, snmpContext)
snmpEngine.transportDispatcher.jobStarted(1) # this job would never finish