2008/5/12 Rupa P V <[EMAIL PROTECTED]>:
> Thanks a lot for the reply. But I have a doubt : how to generate
> template code for  this "basic table helper", if not using mib2c ?
> What is the command to generate this code framework for my mibnode ?

As Magnus has said, there isn't a mib2c template specifically
aimed at the basic table helper.   Probably the simplest approach
would be to use the 'table_data' template, and then tweak the
generated code to strip out the tdata stuff.

Just off the top of my head, the changes you should make are
probably something like:

  table_init():
       drop the netsnmp_tdata_create_table() call (& var)
       change netsnmp_tdata_register() to netsnmp_table_register()

  table_handler():
       In the GET block, change the netsnmp_tdata_extract_entry()
          call to pull the requested row from your underlying table
          This should probably come *after* the table_info call
             (since this is where you retrieve the index values)

      Duplicate this block to form a GETNEXT block, and tweak it
          to search your underlying table for the appropriate row.
          (Or you could write a single routine to handle both cases,
           and pass a flag to indicate whether this is a GET/GETNEXT)

       Note that you would also need to update the request OID
          when processing a GETNEXT request.  This is handled
          automatically by the table_tdata routines, but not by
          the basic table helper.

You'd also have to do something similar to the various SET support
passes, but it's probably sensible to start with a read-only table.

If you have a look at the file AGENT.txt, this will discuss the sort
of processing that is required.   It's aimed at the original UCD (v4)
APIs, so the details will be wrong, but the underlying principles
still hold true

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to