On 18/07/06, Elias Bou Rahal <[EMAIL PROTECTED]> wrote:
>
> hi Dear,
>
>
>    in the UCD-snmp extending agent , i have the function write_Name(int
> action, u_char  *var_val, u_char  var_val_type,   size_t   var_val_len,
> u_char   *statP,  oid  *name, size_t   name_len):
>    the second, third and fourth parameters provide information about the new
> desired value, both the type, value and length.

Correct.

> So my question is which function should i use to get the desiring value in
> the block of this function in case the type is integer.

The same function is used for *all* values - OIDs, string-based values
and integers,  You should think of the 'u_char*' parameter as a void
pointer, and cast it to the appropriate type.

i.e.

   write_Name( int action,
                        u_char  *var_val, u_char  var_val_type, size_t
var_val_len,
                       u_char   *statP,  oid  *name, size_t   name_len) {

       long new_val = *(long *)var_val;
       // etc, etc
   }

Dave

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to