On Sat, 2009-05-09 at 21:48 +0200, Magnus Fromreide wrote:

At the moment the parsed index of a table with a OCTET STRING index
behaves as follows for GETNEXT (tri is a netsnmp_table_request_info
returned from netsnmp_extract_table_info):

Table.1 =>
        tri->number_indexes = 0
        tri->indexes = [0] ""
Table.1.0 =>
        tri->number_indexes = 1
        tri->indexes = [0] ""
Table.1.1 =>
        tri->number_indexes = 1
        tri->indexes = [1] "\0"
Table.1.1.0 =>
        tri->number_indexes = 1
        tri->indexes = [1] "\0"

The problem with this is that the handler can't differentiate entries
that should give different result. Assume that the table contains the
indices "", "\0" and "\1", then the first request should return the ""
entry, the second and third "\0" and the fourth "\1" but there is not
enough information to achieve that as of today.

I thus wish to change the table helper so that tri->number_indexes count
complete index values instead of partial ones. This would change the
example to be

Table.1 =>
        tri->number_indexes = 0
        tri->indexes = [0] ""
Table.1.0 =>
        tri->number_indexes = 1
        tri->indexes = [0] ""
Table.1.1 =>
        tri->number_indexes = 0
        tri->indexes = [1] "\0"
Table.1.1.0 =>
        tri->number_indexes = 1
        tri->indexes = [1] "\0"

and the result would be that enough information is preserved to make it
possible to do a proper walk.

This is obviously not a backwards compatible change so I assume that I
should do this by adding some flag to table_helper.

/MF

> If I use the table helper with a table that have a variable length
> string index then how am I supposed to handle the following case:
> 
> snmpgetnext thehost myEntryVar.1 myEntryVar.1.0
> 
> I expect this to return myEntryVar.1.0 and myEntryVar.1.1 but when I
> look at ahe contents of table_info->indexes it contains the same value
> for both - how am I supposed to differentiate between those cases?
> 
> /MF
> 
> 
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image 
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> Net-snmp-coders mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to