From: anand gupta on
Hi,

I am working on a snmp agent simulator for a test tool.

I am working with tnm package provided in the scotty-00-02-21 tag
source code.

A simple test program which involves establishing an oid handler on
notifier role is not working,

>>>>>>>>>>>>>>>>>>>>>>>>>>.
platNetra_sam_1_9_1:> cat test3.tcl
#!/usr/local/bin/tclsh

package require Tnm 3.0
catch {
namespace import Tnm::snmp Tnm::mib
}


set interp [interp create -safe]

set a [snmp responder -port 9876]
puts [$a configure]


$a instance tnmTclCmdCount.0 tnmTclCmdCount 0

$a bind tnmTclCmdCount.0 get {
set tnmTclCmdCount [info cmdcount]
}

$a destroy

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,

When I run it, I get the syntax error on bind command,

platNetra_sam_1_9_1 SAM004:> ./test3.tcl
....
wrong # args: should be "snmp0 bind event ?command?"
while executing
"$a bind tnmTclCmdCount.0 get {
set tnmTclCmdCount [info cmdcount]
}"
(file "./test3.tcl" line 17)


The latest sources at https://cnds.eecs.jacobs-university.de/svn/schoenw/src/scotty/
have the same code for the ResponderCmd. Looking at the implementation
of the
responderCmd it seems that the bind command in the test3.tcl could not
possibly work.
This example in test3.tcl is taken from the agents example in the
distribution, which is also not working.
I am willing to fix and test the source code and share the fix if
someone can me get to the bottom of this
issue.

A similar functionality is available and working on the generator code
where a script can be specified
to be executed when get/set is done on a oid or varable binding list.
Also the function to set binding on OIDs is available in the source
code (TnmSnmpSetNodeBinding ) but it is just not called from anywhere.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
platNetra_sam_1_9_1 SAM004:> pwd
/space/scotty-00-02-21

platNetra_sam_1_9_1 SAM004:> grep TnmSnmpSetNodeBinding */* */*/*
tnm/snmp/tnmSnmp.h:TnmSnmpSetNodeBinding _ANSI_ARGS_((TnmSnmp
*session, TnmOid *oidPtr,
tnm/snmp/tnmSnmpInst.c: * TnmSnmpSetNodeBinding --
tnm/snmp/tnmSnmpInst.c:TnmSnmpSetNodeBinding(session, oidPtr, event,
command)

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


Thanks in advance,
Anand