On 16/04/07, Senthil Nathan <[EMAIL PROTECTED]> wrote:
>  Regarding this position style loop context,the index of the table generated
> by me . Pls any one ,help us , how to generate the simple index other than
> position style loop context.

It's not clear to me exactly what you mean by this.
But the important thing to realise about the two 'context'
pointers, is that they are only ever interpreted by code
that you provide.  So you can use whatever values you
like, as long as you are consistent.

The 'loop_context' value is used to walk through the
list of rows in the table, keeping track of how far through
you've got.   So the 'get_next' routine will take the value
passed in for 'my_loop_context' and use this to retrieve
the next row.   It then returns an updated value for
'my_loop_context', so that the next call can retrieve the
*next* row in the table, and so on.
  As long as this works, you can use whatever value
you like - an index into an array, the address of an
entry in a linked list, an address in kernel memory,
a lookup key for a database, etc, etc....

The 'data_context' value is used to specify to the main
handler routine, which row is needed for a particular request.
It's only ever set by the two 'get_{first,next}' routines, and
only ever read by the MIB handler.  Again, as long as these
two agree on how it should be interpreted, you can use whatever
value seems sensible.
   This can be the same as the 'loop_context' or different. It
doesn't matter - just as long as you're consistent.


Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
  • Indexing... Senthil Nathan
    • Re: Indexing... Dave Shield

Reply via email to