I've recently been experimenting with the new (and very welcome) "include" mechanism for config files. I have a couple of tweaks that I'd like to see accepted before 5.6 goes live. But given the lateness within the pre-release phase, these really need explicit approval as to whether to apply them or not. Please vote!
Firstly, the current include directive specifies
the name of a config file, which is searched
for in the list of configuration directories.
This was slightly counterintuitive to me, as I
expected to be able to give the full path of the
file to include.
So the first attachment (NS-include.patch), adds support
for this way of working. The config handling library
will first try to open the file specified in the include
directive, as is. If this fails (and *only* if this fails),
will it search the config path.
[As an aside - in order to implement this, I
needed to tweak the 'read_config' call to return
a success/failure indication, rather than void.
In the attached patch, this is done using a
new internal '_read_config()' call.
It might be cleaner to change the read_config()
call itself, though this would change the API slightly.
I'm not sure whether this would break existing code,
or whether 'read_config' is regarded as part of the
main public API (as opposed to the internal public
API).
Thoughts?
]
The second attachment (NS-includedir.patch), adds support
for a new "includedir" directive. This would scan the
specified directory, and read in any file of the form "%s.conf".
The purpose of this should hopefully be fairly obvious!
[Note that this second patch actually includes *both*
sets of changes, since the main SVN trunk is untouched]
I look forward to hearing people's comments.
Dave
NS-include.patch
Description: Binary data
NS-includedir.patch
Description: Binary data
------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
