Thanks again Dave,
Now it´s almost perfect, but I´m having some trouble accessing the
value when it is not a string.
For example, when the value type is ASN_OCTET_STR this works:
---------
netsnmp_table_data_set_storage *data1 =
netsnmp_table_data_set_find_column( (netsnmp_table_data_set_storage
*)row->data, 2);
printf("value = %s", data1->data.string);
---------
But, when the value type is ASN_OPAQUE_FLOAT the printf prints 0.00000
even if the value is some other.
-------
netsnmp_table_data_set_storage *data2 =
netsnmp_table_data_set_find_column( (netsnmp_table_data_set_storage
*)row->data, 3);
printf("value = %f" , data2->data.floatVal);
------
Via snmpget, for the above float value I get the following, proving
its not 0.00000:
NET-SNMP-MIB::netSnmp.2.2.1.1.3.1 = Opaque: Float: 2.450000
Other question: In what place in the union the ASN_IPADDRESS is
stored? And how can I access it? data->data.integer?
Again, let me thank you for the attention, and sorry for the inconvenience,
Best regards,
Vinícius M. Pacheco
On 1/30/07, Dave Shield <[EMAIL PROTECTED]> wrote:
> On 29/01/07, Vinicius Pacheco <[EMAIL PROTECTED]> wrote:
> > Thanks for the previous answer, but when I compiled the agent with you
> > suggestions, I got the following error:
> > --------------------------------------------------------------
> > "warning: passing argument 1 of 'netsnmp_table_data_set_find_column'
> > from incompatible pointer type"
> > -----This warning is refering to the following suggested line of code:
> > netsnmp_table_data_set_storage *data =
> > netsnmp_table_data_set_find_column( row, 2);
> > --------------------------------------------------------------
>
> Sorry - my mistake.
> Try:
>
> netsnmp_table_data_set_storage *data =
> netsnmp_table_data_set_find_column(
> (netsnmp_table_data_set_storage *)row->data, 2);
>
> 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-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders