Commit Graph

9 Commits

Author SHA1 Message Date
Andrew Bettison
96d524200c Support 'config get' var pattern matching 2012-12-10 15:26:35 +10:30
Andrew Bettison
21509e0b67 Add 'config schema' command to dump schema
That was easy.
2012-12-06 17:54:30 +10:30
Andrew Bettison
aa638a9bfd Fix new 'interfaces' config option
Introduce CFINCOMPATIBLE config parse result flag.

Sort interface rules by unsigned integer key.

Legacy and modern 'interfaces' config styles are now incompatible.

Validate config_network_interface struct to enforce that only exactly one of
'match' and 'dummy' options are set.

Add test cases for 'interface' config option.
2012-12-05 12:58:07 +10:30
Andrew Bettison
71ed78e058 Make all 'config' tests pass
Change a test case: configuration options are now case sensitive.

Fix config file load and parse logic in conf.c, always copy 'debug' flags
from config.debug.

The config schema 'interfaces' option is no longer MANDATORY.

Introduce new CLIFLAG_PERMISSIVE_CONFIG to supress bad-config ERROR messages
from the 'config set' and 'config get' commands.

Refactor cli_execute() into cli_parse() and cli_invoke().  Use *const* struct
command_line_option everywhere.
2012-12-04 16:52:49 +10:30
Andrew Bettison
caa209fc1d Integrate new config into servald
Not passing any tests yet, but compiles and links and simple uses do not
SEGV.
2012-12-04 14:12:28 +10:30
Andrew Bettison
4aac3637ed Improve new config code, SORTED and NO_DUPLICATE flags
Config Object Model parser now returns bitmask result of CFxxx flags and only
allocates root node if the config file is non-empty.

Added emalloc_zero().
2012-11-30 12:32:30 +10:30
Andrew Bettison
f42292ffc6 Refactor emalloc() etc. into mem.c/.h 2012-11-29 17:12:43 +10:30
Andrew Bettison
3686a4ade4 Improve new config code to use "log.h"
With all the __whence/__WHENCE__ goodness, ready for integration into servald.
2012-11-29 16:44:06 +10:30
Andrew Bettison
2853d346f1 Re-organise new config code some more
Split into several source .c files, leave throw-away code in config_test.c.
2012-11-29 16:07:34 +10:30