On 24/12/2007, Kuczynski, Edward <[EMAIL PROTECTED]> wrote:
> Is mib2c.table_data.conf used anymore?

Which version of mib2c.table_data are you referring to?
What does the code generated by this template look like?

Is the table registered using  "netsnmp_register_table_data()"
or "netsnmp_tdata_register()"?   The choice of helper used by
this template changed between the 5.2.x and 5.3.x lines.

The current table_data template (netsnmp_tdata_register)
is definitely still used - this would be my personal preferred
starting point for a MIB table (whether read-only or read-write).
Though other developers might see things differently.


> 1)       In initialize-table, at the end it states init contents of table 
> here.
>          What's the preferred method?

You've already created a data structure to hold the table as a whole
("table_data").
You pass this to the createEntry routine, together with the index values for the
new row.   This routine then constructs a data structure for this new row, with
empty or default values for the various columns, inserts this row into
the table,
and passes the row back.   You can then insert the appropriate (non-default)
values for selected colums.  Something like:


     table_data = netsnmp_tdata_create_table( "myTable", 0 );
        // configure the structure of the table
     netsnmp_tdata_register( reg, table_data, table_info );

     //  Initialise the table contents
     netsnmp_tdata_row *row = myTable_createEntry( table_data, 1);
     (myTable_entry *myRow = (myTable_entry *)row->data;
     strcpy( data->name, "John");

     netsnmp_tdata_row *row = myTable_createEntry( table_data, 2);
     myRow = (myTable_entry *)row->data;
     strcpy( data->name, "Paul");

     netsnmp_tdata_row *row = myTable_createEntry( table_data, 3);
     myRow = (myTable_entry *)row->data;
     strcpy( data->name, "George");

     netsnmp_tdata_row *row = myTable_createEntry( table_data, 4);
     myRow = (myTable_entry *)row->data;
     strcpy( data->name, "Ringo");


>  Who should call table_createEntry and when?

There are two situations where the createEntry routine would be called.
a)  When the table is being populated from some external source
     (either initially, or via the cache loading mechanism).

b)  When a new row is being created dynamically (via SET requests).

Given that you are talking about a read-only table, then b) is not relevant.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to