From: Dave S. <D.T...@li...> - 2008-01-30 12:47:58
|
On 27/01/2008, Isaac Eliassi <Isa...@ni...> wrote: > I am using ucd-snmp-4.2.6 code, and I was unable to understand execlly what > does the 2 MACRO's config_require() and config_add_mib() does, As Magnus has said, these are used as part of the "configure" mechanism, rather than when actually compiling the code. If you run configure --with-mib-modules=someModule then the "config_require" directive can be used to pull in any additional modules or supporting code that might be required. So someModule.h: config_require(someOtherModule) would be equivalent to running configure --with-mib-modules=someModule,someOtherModule except that the person compiling the code doesn't need to know about the dependency. It's commonly used to pull in a whole bunch of related modules. For example configure --with-mib-modules=host relies on the fact that 'host.h' contains config_require( 'host/hr_system' ) config_require( 'host/hr_device' ) : config_require( 'host/hr_swrun' ) to include the various elements of the HostRes implementation. But the person compiling the code only needs to request the top-level wrapper module - not the full list. config_add_mib( SOME-MIB ) is similar, and is used to set the list of MIB modules that the library should load by default. The thinking being that if you're compiling the agent with the Host Resources MIB code (for example), then you probably want the command-line tools to recognise these MIB names. But once "configure" has set up the Makefiles (and the net-snmp-config.h header file), these two directives have done their job, and can be ignored when it comes to actually compiling the code. Dave |