Template:FAQ:Coding 12

From Net-SNMP Wiki
Jump to: navigation, search

If you're using the main source tree to compile your new module, then put these two files (mymib.[ch]) in the directory 'agent/mibgroup'. You should then re-run configure to add in your new module

              configure --with-mib-modules=mymib

and recompile.

If you've got a number of new modules to add, it might be sensible to put them all into a single subdirectory of 'mibgroup'. Then create a header file, listing the individual components. This might look something like:

               config_require(mymib/myObjects)
               config_require(mymib/myTable)
               config_require(mymib/myOtherTable)

If this was saved as the file 'mymib.h', then the same configure line given above, would pull in all three modules. See the current contents of 'agent/mibgroup' for examples of this. Note that the MfD framework will generate a similar grouping automatically.