Re: How to index a table with a string

2006-09-20 Thread Dave Shield
On 20/09/06, Toth, Gregory S <[EMAIL PROTECTED]> wrote: > I got it to work finally. For some reason, doing the snprintf as > described in my previous post did not always work: > > snprintf(this_index, strlen((char *)*my_loop_context), >"%s",(const char*)*my_loop_context); I doubt it's

RE: How to index a table with a string

2006-09-20 Thread Toth, Gregory S
{ return NULL; } -----Original Message- From: Toth, Gregory S Sent: Tuesday, September 19, 2006 1:48 PM Cc: [email protected] Subject: RE: How to index a table with a string That worked better for the bookTable_get_first_data_point method. Now I am trying

Re: How to index a table with a string

2006-09-20 Thread Dave Shield
On 20/09/06, Daniel Chuang <[EMAIL PROTECTED]> wrote: > netsnmp_table_helper_add_indexes(table_info, >ASN_OCTET_STR, /* index: ExampleDataName */ >0); > How can you use 'IMPLIED" index without the len before it ? ASN_PRIV_IMPLIED_OCTE

Re: How to index a table with a string

2006-09-19 Thread Daniel Chuang
One extra question related to this one, when I registered the index with: netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /* index: ExampleDataName */ 0); It will always append the length of string before the oid when it is be

Re: How to index a table with a string

2006-09-19 Thread Dave Shield
On 19/09/06, Toth, Gregory S <[EMAIL PROTECTED]> wrote: > bookTable_get_first_data_point() > { > char this_index[SPRINT_MAX_LEN] = "title1"; which is a local variable, and so the memory will be discarded when the routine exits. > *my_loop_context = (void *)this_index; > *my_data_

RE: How to index a table with a string

2006-09-19 Thread Toth, Gregory S
to increment to the next datapoint. -Original Message- From: Dave Shield [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 19, 2006 11:08 AM To: Toth, Gregory S Cc: [email protected] Subject: Re: How to index a table with a string On 19/09/06, Toth, Gregory S <[EMAIL PRO

Re: How to index a table with a string

2006-09-19 Thread Dave Shield
On 19/09/06, Toth, Gregory S <[EMAIL PROTECTED]> wrote: > char this_index[SPRINT_MAX_LEN] = "title1"; > snmp_set_var_value(vptr, (u_char *) &this_index , >sizeof(this_index) ); try snmp_set_var_value( vptr, this_index, strlen(this_index)); The size of 'thi