Register_int handler

"Nikos Balkanas" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <002701c96c58$225d46f0$02b2a8c0@tardis>
Hi,

During development of my own handlers, after putting a trace on the handler I notice that it is called 4 times during an snmpset operation. 2 with the old value and 2 with the new value. This apart from dangerous, seems a waste of resources to do a simple set. What instance does each call respresent? Can I avoid it? Am I doing something wrong?

Server2:~/work/snmp-> snmpset 127.0.0.1 iwSetMode = 4
IANWAP-MIB::iwSetMode = INTEGER: restart(4)
.
.
.
nkssnmpd: info: setMode ~> mode = 3
nkssnmpd: info: setMode ~> mode = 3
nkssnmpd: info: setMode ~> mode = 4
nkssnmpd: info: setMode ~> mode = 4
.
.
.

My registration. mode is a static enum:

netsnmp_register_int_instance("iwSetMode",
                                             mode_oid,
                                            OID_LENGTH(mode_oid),
                                            (void *)&mode, (void *)setMode);

PS I would love to pass arguments to setMode, but I have tried several function pointers (i.e. void (*setMode)(int mode)) and don't work. Any suggestions on that?

Thanx,
Nikos

------------------------------------------------------------------------------

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.