dear guys,

I have below c code using snmp api in C. I have succeed to fetch integer 
and than doing convert to string/char variable.
But, I can't fetch counter64 value and convert to char/string. I think 
caused of struct of counter64 is different with counter32.
Any clues ? or any sample code to fix this problem ?.
Thanks.

Johan


for(vars = response->variables; vars; vars = vars->next_variable)
                {
                if (vars->type == ASN_COUNTER)
                   {
                        asprintf(&buf1,"%u",*vars->val.integer);
                          printf("integer: %s\n",buf1);
                   }
                if (vars->type == ASN_COUNTER64)
                   {
                        buf1=malloc(20);
                        asprintf(&buf1,"%u",*vars->val.counter64);
                          printf("counter64: %s\n",buf1);
                   }


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&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

Reply via email to