Is there an advantage between generating the code (using mib2c) for "all" 
Tables at once and generating code for each Table individually?  I mean if I 
spent the extra time and generated the code for each Table (and scalars) 
individually (one at a time), then should I reach the same results?  I mean 
will the code eb generated the exact same way or would I be missing some 
functionality which would be required which relates all the Tables/Scalars 
together as one unit?

Now, I originally generated the code for each Table one at a time, but I found 
it did not generate the required .h files for each new Table. 

For example:

I went into the 
".../net-snmp-5.4/agent/mibgroup/OC-STB-HOST-MIB/ocStbHostAVInterfaceTable/" 
directory and issued the mib2c command for the particular 
"ocStbHostAVInterfaceTable" node and the code was generated into this directory 
for me.   I tried testing with only this newly generated code and eventually 
was successful in getting the "ocStbHostAVInterfaceTable" data to be displayed 
by performing an "snmpwalk" command.

** However, during my testing I noticed the following files were "not" 
generated for me automatically and I had to create them:

1) .../net-snmp-5.4/agent/mibgroup/OC-STB-HOST-MIB.h
 2) .../net-snmp-5.4/agent/mibgroup/OC-STB-HOST-MIB/ocStbHostAVInterfaceTable.h
 
Here are the file contents in case you are wondering what I did:

OC-STB-HOST-MIB.h
/*
 * module to include the modules
 */

config_require(OC-STB-HOST-MIB/ocStbHostAVInterfaceTable);
config_add_mib(OC-STB-HOST-MIB)


ocStbHostAVInterfaceTable.h
/*
 * module to include the modules
 */

config_require(OC-STB-HOST-MIB/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable)



*** Keep in mind I only generated code using mib2c for the 
"ocStbHostAVInterfaceTable" only for my testing.  I would think I would need to 
update these files when I include more tables.

I also thought these were the ".h" files which might have been created for me 
automatically.  Seems weird I would have to create these two ".h" files myself. 
   These files seem to link all the new directories together, so they seemed to 
be required to allow my testing to proceeed.

Anyway, this is what got me wondering whether there was a way to generate all 
tables together in which these ".h" files might be created for me and so all 
Tables would be related together automatically.  


PS:  Now, I did try to generate all tables automatically, based on your 
recommendation, but it did not work.  It only generated code for one Table 
only.   Not sure if I am doing something wrong, but I did try a few different 
high-level nodes to use in the mib2c command.   Anyway, this failure led me to 
send this email asking whether there was a difference between generating table 
code individual or all at once ..... does it real matter which way the code is 
generated?





Dave Shield <[EMAIL PROTECTED]> wrote: On 23/05/07, Need Help  wrote:
> 3) I created subdirectories for each table and scalar located with the
> OC-STB-HOST-MIB file as follows:
   [snip]
> 4) I went into each table and scalar subdirectory and generated code using
> the "mib2c" command with the "mib2c.mfd.conf" configuration file

Robert's the expert on this framework, but I believe you should be
able to generate code for all the tables in one go.

Try running "mib2c -c mib2c.mfd.conf ocStbHostRoot"
(where 'ocStbHostRoot' is the parent node of all the tables).

That ought to generate code for each of the tables,
plus a header file "ocStbHostRoot.h" to link them all together.

Compiling this into the main agent is then just a matter of
copying this tree into the 'agent/mibgroup' subdirectory of
the source tree, and running

    configure --with-mib-modules=ocStbHostRoot

Robert - feel free to correct any inaccuracies in the above.


Dave


       Choose the right car based on your needs.  Check out Yahoo! Autos new 
Car Finder 
tool.http://us.rd.yahoo.com/evt=48518/*http://autos.yahoo.com/carfinder/;_ylc=X3oDMTE3NWsyMDd2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDY2FyLWZpbmRlcg--
 hot CTA = Yahoo! Autos new Car Finder tool
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to