> I tried this construct:
>
> netsnmp_table_row_add_index(row, ASN_INTEGER, 1, 0);
> [...]
> netsnmp_table_row_add_index(row, ASN_INTEGER, 2, 0);
Close, but not quite right.
If you check Jeff's message, the third parameter needs
to specify the *address* of the index value (and the
fourth parameter contains the size of this value).
Try:
int i;
i = 1;
netsnmp_table_row_add_index(row, ASN_INTEGER, &i, sizeof(i));
i = 2;
netsnmp_table_row_add_index(row, ASN_INTEGER, &i, sizeof(i));
> As for the notion of the function being flexible, the requirement
> to use an allocated variable to pass integral data is not, to my
> mind, an example of flexibility. Rather, it is a straight-jacket.
But if the third parameter of the 'netsnmp_table_row_add_index'
passed the index value directly (rather than as a pointer),
then how could this routine support non-integer index values?
Remember that MIB tables can be indexed by strings (or even OIDs),
so the 'netsnmp_table_row_add_index' routine needs to be able to
support string index values as well. An integer index parameter
wouldn't be able to do this.
Dave
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
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