Difference between revisions of "Template:FAQ:Coding 12"
From Net-SNMP Wiki
m (Latest FAQ revision - preparing for 5.5 release) |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | <!-- NB: | ||
+ | There is a mismatch between the template numbering | ||
+ | for this entry, and the FAQ entries that refer to it. | ||
+ | This follows a review of the entries in the | ||
+ | Coding section. | ||
+ | --> | ||
If you're using the main source tree to compile your new module, then | If you're using the main source tree to compile your new module, then | ||
put these two files (<CODE>mymib.[ch]</CODE>) in the directory <CODE>'agent/mibgroup'</CODE>. | put these two files (<CODE>mymib.[ch]</CODE>) in the directory <CODE>'agent/mibgroup'</CODE>. | ||
You should then re-run configure to add in your new module | 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 | If you've got a number of new modules to add, it might be | ||
Line 16: | Line 23: | ||
line given above, would pull in all three modules. See the | line given above, would pull in all three modules. See the | ||
current contents of <CODE>'agent/mibgroup'</CODE> for examples of this. | current contents of <CODE>'agent/mibgroup'</CODE> for examples of this. | ||
+ | Note that the | ||
+ | MfD framework will generate a similar grouping automatically. |
Latest revision as of 19:47, 20 July 2009
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.