Hi SNMP masters...
I'm developing an aplication that request some OID's from alot of network devices for example the sys name, sys description, num of interfaces and stuff like that. The problem that I have is that I can't get the "integer" value of the integers OID as such num of interfaces when I use the "C" sample, it works fine with the code that it has: /*
* SUCCESS: Print the result variables
*/
* SUCCESS: Print the result variables
*/
// for(vars = response->variables; vars; vars = vars->next_variable)
// print_variable(vars->name, vars->name_length, vars);
// print_variable(vars->name, vars->name_length, vars);
but it just print it, in the part that says: /* manipuate the information ourselves */
for(vars = response->variables; vars; vars = vars->next_variable)
{
if (vars->type == ASN_OCTET_STR) {
char *sp = (char *)malloc(1 + vars->val_len);
memcpy(sp, vars->val.string, vars->val_len);
sp[vars->val_len] = '\0';
if (vars->type == ASN_OCTET_STR) {
char *sp = (char *)malloc(1 + vars->val_len);
memcpy(sp, vars->val.string, vars->val_len);
sp[vars->val_len] = '\0';
there is not a problem because it allways get the string value but when is an integer I don't know how to get it...I wonder if some of you guys can give me a hand with that..thank's alot
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
