Chen Lihua <spark.c...@gmail.com> writes:

Hi Chen,

> I used  mib2c.iterate.conf to create skeleton code for my table, which 
> generated two functions:
> xxx_get_first_data_point and xxx_get_next_data_point. Below is my
> current implementation:
...
> It worked, however, it seems not too efficient:

Yes, the iterate method was designed to be very easy to implement
without knowing much about how SNMP ordering must be done.  The downside
is that it is slow.

You might look into using caching if that's acceptable.  See the
"stash_cache" portion of the snmpd.conf manual page for how to add it
dynamically at run-time.  You can also inject the handler in code as
well.

> 1. Can I know the MIB table index from xxx_get_first_data_point() or 
> xxx_get_next_data_point(), so that I
> needn't loop from the header of the linked list?

As I said above, the iterate based one is not really designed for
someone that knows how to look up the data themselves.  You might run
the mfd based mib2c code generator, which offers you more choices about
storing data and how it's indexed.

-- 
Wes Hardaker
Please mail all replies to net-snmp-coders@lists.sourceforge.net


_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to