Thanks, so now in the 

magazineTable_get_next_data_point(void **my_loop_context,
                                  void **my_data_context,
                                  netsnmp_variable_list *
put_index_data,
                                  netsnmp_iterator_info *mydata)

How do I extract the current values from the loop context?

Neither 

    printf("next mag data this_index %s\n",(const char*)*my_loop_context
); 
    printf("next mag data this_int_index
%u\n",(unsigned)*my_loop_context );

Show the current settings


-----Original Message-----
From: Dave Shield [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 20, 2006 1:31 PM
To: Toth, Gregory S
Cc: [email protected]
Subject: Re: How to do doubly-indexed table

On 20/09/06, Toth, Gregory S <[EMAIL PROTECTED]> wrote:
> How do I setup the indexes in the "get_first_data_point" method?  Is 
> it something like this:

[snip]

Right general idea, but a couple of problems:



>     snmp_set_var_value(vptr, (u_char *) &this_name ,
>                        sizeof(this_name) );
>     vptr = vptr->next_variable;
>     snmp_set_var_value(vptr, (u_char *) &this_page ,
>                        sizeof(this_page) );

This is the wrong way round.
    You defined the table as UNSIGNED followed by OCTET_STR, but set the
index values as OCTET_STR followed by UNSIGNED.

The indexes set up here must match the original definition of the table.

The string-based index should also be set using "strlen", rather than
"sizeof" (since you've defined this buffer as a SPRINT_MAX_LEN).

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

Reply via email to