Hi,

Any ideas? It is rather urgent.

Thanx,
Nikos
  ----- Original Message ----- 
  From: Nikos Balkanas 
  To: [email protected] 
  Sent: Thursday, January 01, 2009 11:30 PM
  Subject: Register_int handler


  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

Reply via email to