On Tue, Sep 17, 2019 at 5:18 AM Bill Fenner <fen...@gmail.com> wrote:
>
> You can do this if you use snmp_varlist_add_variable() to create the index 
> info (you can't use netsnmp_table_helper_add_indexes).  The code would be 
> something like
>
>     table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
>     snmp_varlist_add_variable(&table_info->indexes,
>                                   NULL,
>                                   0,
>                                   ASN_TYPE_OF_IFACE_NAME,
>                                   NULL,
>                                   0);
>     snmp_varlist_add_variable(&table_info->indexes,
>                                   NULL,
>                                   0,
>                                   ASN_IMPLIED_OCTET_STR,
>                                   "XXXXXX",
>                                   6);
>     snmp_varlist_add_variable(&table_info->indexes,
>                                   NULL,
>                                   0,
>                                   ASN_TYPE_OF_HIST_CLASS,
>                                   NULL,
>                                   0);
>     snmp_varlist_add_variable(&table_info->indexes,
>                                   NULL,
>                                   0,
>                                   ASN_TYPE_OF_HISTBIN_INDEX,
>                                   NULL,
>                                   0);
>
Thanks, Bill. I was using  "netsnmp_table_set_add_indexes" for the
initial addition (don't have access to index_data but only type),
and then when the data is available I either use
"netsnmp_table_dataset_replace_row/netsnmp_table_dataset_add_row"
using the API "netsnmp_table_row_add_index" for index.

I guess it all boils down to using netsnmp_table_data_add_index (using
only types) Vs netsnmp_table_row_add_index (types and indexes).


_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to