Re: snmp_set_var_typed_value with ASN_TIMETICKS problem

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On Fri, 2006-02-10 at 14:10 -0800, stan buyanov wrote:

>       u_char str_return[MAX_VAR_LEN+1];
>       long returnVal = 123456;
>       sprintf((char*)str_return,"%d",returnVal);
>       int str_return_len = strlen((char*)str_return);


>     snmp_set_var_typed_value(requests->requestvb, ASN_TIMETICKS,
>                             (u_char *)str_return,
>                             str_return_len);

TimeTicks is an *integer* based type, not a string.

Try
      snmp_set_var_typed_value(requests->requestvb, ASN_TIMETICKS,
                              (u_char*)&returnVal,
                              sizeof(returnVal));


Dave


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
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.