Re: hi need help

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
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
[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.