On Wed, 24 Nov 2004 09:50:33 +0000 Dave wrote:
DS> I was mislead by the use of the token "TODO".
DS> That's tended to be used as a marker for future work - a place where the
DS> handling has been simplified a bit (ducking the difficult cases), and
DS> usually denotes where we need to come back and finish things properly.

That's exactly what it is, but intended for the user, not us.


DS> I'm still not clear about exactly what's going on all the time (esp. the
DS> data mapping and setting the indexes), but it's definitely starting to come
DS> together.

Data mapping is for the case when you have an external source for your data,
and that data doesn't conform to the MIB definition. The simplest example is a
C boolean vs a TruthValue. If you are caching data, you can convert as you
populate the data context. But if you just keep a pointer to memory
someone else is using, you need to convert the value to conform to the MIB
definition before you return it.


DS> Printing out the files and highlighting the actual code helped too - you
DS> do seem to have a tendency to over-comment (2/3 of data_access and
DS> data_get?!)

<stunned silence>

Me? Overly verbose? Coming from you?

<more stunned silence>

Well, if you have suggestions for trimming comments without losing information,
and keeping in mind the target audience (SNMP newbies), let me know!


DS> > Hmmm.. well, the mib2c control variables are quite important!
DS> 
DS> So I'm starting to realise!
DS> 
DS> That's another difference from the previous helpers - up to now I've
DS> just run 'mib2c -c config table' and got something I could understand.
DS> It's taking a little while to get used to this style of
DS> micro-configuration.
DS> 
DS> You've mentioned supressing the example code, and I've spotted mention of
DS> turning off mapping.  Is there anything else that can be omitted while I'm
DS> still learning my way around?

The flags that are intended for user modification are stored in the
default-table-myTable.md2 file.

DS> The cache handling, perhaps?

Not currently possible, but it should be very easy to do for the next release.
I feel quite silly, having gone from a help that didn't handle external data
(array-user) to one that doesn't (out-of-the-box) handle internal data!


DS>   $ ./mib2c -S mdf_interactive_setup=1 -c mib2c.mfd.conf myTable
                   ^^^
Try 'mfd'. ;-)


DS> > DS> I'm basically still identifying what can be ignored, and what is
DS> > DS> actually useful :-)
DS> 
DS> > I tried to put as much as possilbe of the 'safe to ignore' stuff in the
DS> > interface file.
DS> 
DS> That's the impression I got.   And there doesn't seem to be much of
DS> interest in the basic 'myTable.c' file either.  I'm concentrating on
DS> the 'data_access' and 'data_get' files for now.
DS> 
DS> Any other hints or pointers gratefully received.

I completely forgot to mention the 'Dave Shield' flag. :-P

        -S mfd_fewer_files=1

This will merge data_get and data_set into myTable.[ch].


One other tool you might want to keep in mind is the new mib2c-update script.
It automates updating your code when the mib2c conf files are updated. Not as
useful to you at the moment, but when I start incorporating fixes into the conf
files, it may be more useful. Beginnings of a tutorial here:

   http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mib2c/mib2c-update.html

-- 
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to