On Tue, 2005-11-08 at 13:37 +0800, Earnest Pan wrote:
>      What is the difference between iterate and 
>      iterate_access?

The iterate helper takes care of deciding which row
is required for any particular request, using the
'{first,next}_data_point' routines to step through
the rows of the table (in whatever order is most
convenient).

Once the necessary row has been identified, it's
passed to a user-provided handler for processing.
All of this is common to both the 'iterate' and
'iterate_access' mib2c frameworks.

But much of this processing is fairly standard,
and just depends on the syntax of the MIB table.
The basic iterate mib2c config will generate a
single handler routine, containing the template
code for implementing the table, including all
of this "standard" code generated automatically.

The iterate_access config tries to separate out
the standard processing from the table-specific
stuff - splitting these into two separate files.
So in principle, you only need to edit the file
"myTable_access.c" - all the rest of the code
should be useable as it stands.


The same idea underlies the MfD framework - separating
the standard processing (which you don't need to worry
about) from the table-specific code (which you do).
But the MfD framework is much more flexible and complete
(and possible confusing :-))  than the iterate_access
config, which hasn't really seen the same level of
development as MfD.  


>      Is there any document for programmer to 
>      reference how to write code in the generating
>      c skeleton code?What can I add my code in 
>      where?

Not really - no.
I'm in the process of writing something, but that's
not really ready for publication yet.

Your best bet is probably to look at some of the
existing MIB implementations, and get a feel for how
they work.  There are examples of most of the various
mib2c styles included in the mibgroup subtree.

Have a poke around, and compare these with the
raw mib2c output.

Dave


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
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