On 15 September 2011 00:24, N. Karthikeyan <karthik_96...@yahoo.com> wrote:
>      Could you please let me know whether there is any document
> available on how to change the mib2c generated code?

Not really.
I started writing a book on this, but it never really came to fruition.

The main problem is that "changing mib2c generated code" is too vague.
There are several different table frameworks, and they all work in
different ways.   What you need to change will be different for each one.

I *think* that Dheeraj's explanation refers to the iterate_access template
(or possibly MfD),  which are both rather different to ther iterator or
table_data approaches.


>                                                   I am trying
> to implement a table with mib2c.iterate.conf with cache enabled.

First thing - if you are caching the data within the agent, then there's
probably no point in using the iterator helper.
    This was originally designed for a situation where the (external)
data can come in any order, so does some (relatively inefficient)
processing to handle the sorting requirements.

If you've got a local cache of the data, then the MIB implementation
can know exactly which rows are present in the table, and go straight
to the appropriate row.
   I would strongly suggest that you look at using the table_data template
(+ cache) instead.    These two are reasonably similar, but the table_data
helper (strictly table_tdata) omits the  first/next  hook processing of the
iterator helper.


The main things you will need to change are in the  xxx_load routine
to populate the contents of the cache.    You may need to tweak bits
of the main handler routine (particularly for SET handling and creating
new rows),   but at first glance, that code seems more or less OK.

The template load routine is very simple (and incomplete (and slightly wrong!))

It assumes the basic data is read from a file - one line per row
of the table   (read using while fgets).
    If that's not true, you need to change this driving loop.

The first step is to identify the index value(s) of this row, and assign them
to the index variables defined at the head of the table.   This is simply
left as a comment in the generated template - you need to replace this
with the necessary code.

The next step (creating the entry in the local cache) is slightly wrong.
It should actually read

    row = xxx_createEntry(....);
    this = row->entry;

where 'this' is defined as a local variable of type  struct xxx_entry
(this definition is also missing from the template code)

The final element is to populate this data structure with the rest
of the values for that row.   Again, this is left as a comment in
the generated template - you need to provide the relevant code.



Hope this helps

Dave

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to