diff options
| author | David Lamparter <equinox@diac24.net> | 2019-12-04 04:20:55 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2019-12-06 15:13:32 +0100 |
| commit | f210b3e3002e2918e912cd5e49c43e874a55e40d (patch) | |
| tree | 19c3482ead49d05828a3ff0c99601f0ffda9cae6 /lib/defaults.h | |
| parent | ac4adef44127e5e6659abd735827ce699c469718 (diff) | |
lib/defaults: add bool variable support
(I hadn't initially added this because I thought it superfluous, but it
kinda makes things nicer.)
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/defaults.h')
| -rw-r--r-- | lib/defaults.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/defaults.h b/lib/defaults.h index ad2f1ad2e7..b35bdfeaf3 100644 --- a/lib/defaults.h +++ b/lib/defaults.h @@ -19,6 +19,9 @@ #define _FRR_DEFAULTS_H #include "config.h" + +#include <stdbool.h> + #include "compiler.h" #ifdef HAVE_DATACENTER @@ -67,6 +70,7 @@ struct frr_default_entry { const char *match_profile; /* value to use */ + bool val_bool; const char *val_str; long val_long; unsigned long val_ulong; @@ -90,12 +94,14 @@ struct frr_default { */ /* variable holding the default value for reading/use */ + bool *dflt_bool; const char **dflt_str; long *dflt_long; unsigned long *dflt_ulong; float *dflt_float; /* variable to use when comparing for config save */ + bool *save_bool; const char **save_str; long *save_long; unsigned long *save_ulong; @@ -133,6 +139,8 @@ struct frr_default { * will be expanded and blow up with a compile error. Use an enum or add an * extra _ at the beginning (e.g. _SHARP_BLUNTNESS => DFLT__SHARP_BLUNTNESS) */ +#define FRR_CFG_DEFAULT_BOOL(varname, ...) \ + _FRR_CFG_DEFAULT(bool, bool, varname, ## __VA_ARGS__) #define FRR_CFG_DEFAULT_LONG(varname, ...) \ _FRR_CFG_DEFAULT(long, long, varname, ## __VA_ARGS__) #define FRR_CFG_DEFAULT_ULONG(varname, ...) \ |
