diff options
author | David Lamparter <equinox@diac24.net> | 2019-08-01 18:49:50 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2019-12-06 15:13:32 +0100 |
commit | c572fbfe2d928c275e4dece74e7872f3f87726bd (patch) | |
tree | 247fcf4c8fc44e8448f3db5638610f1fa397fb8c /ospf6d/ospf6_top.c | |
parent | ospfd: remove minor WTF in instance creation (diff) | |
download | frr-c572fbfe2d928c275e4dece74e7872f3f87726bd.tar.xz frr-c572fbfe2d928c275e4dece74e7872f3f87726bd.zip |
ospfd: use new defaults mechanism (v2)
Some preprocessor constants converted to enums to make the names usable
in the preprocessor.
v2: better isolation between core and vty code to make future northbound
conversion easier.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'ospf6d/ospf6_top.c')
-rw-r--r-- | ospf6d/ospf6_top.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 95dafff84..95537eb86 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -51,6 +51,11 @@ DEFINE_QOBJ_TYPE(ospf6) +FRR_CFG_DEFAULT_BOOL(OSPF6_LOG_ADJACENCY_CHANGES, + { .val_long = true, .match_profile = "datacenter", }, + { .val_long = false }, +) + /* global ospf6d variable */ struct ospf6 *ospf6; static struct ospf6_master ospf6_master; @@ -179,11 +184,6 @@ static struct ospf6 *ospf6_create(vrf_id_t vrf_id) o->distance_table = route_table_init(); -/* Enable "log-adjacency-changes" */ -#if DFLT_OSPF6_LOG_ADJACENCY_CHANGES - SET_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_CHANGES); -#endif - QOBJ_REG(o, ospf6); return o; @@ -327,6 +327,9 @@ DEFUN_NOSH (router_ospf6, { if (ospf6 == NULL) { ospf6 = ospf6_create(VRF_DEFAULT); + if (DFLT_OSPF6_LOG_ADJACENCY_CHANGES) + SET_FLAG(ospf6->config_flags, + OSPF6_LOG_ADJACENCY_CHANGES); if (ospf6->router_id == 0) ospf6_router_id_update(); } @@ -1079,9 +1082,9 @@ static int config_write_ospf6(struct vty *vty) if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) { if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL)) vty_out(vty, " log-adjacency-changes detail\n"); - else if (!DFLT_OSPF6_LOG_ADJACENCY_CHANGES) + else if (!SAVE_OSPF6_LOG_ADJACENCY_CHANGES) vty_out(vty, " log-adjacency-changes\n"); - } else if (DFLT_OSPF6_LOG_ADJACENCY_CHANGES) { + } else if (SAVE_OSPF6_LOG_ADJACENCY_CHANGES) { vty_out(vty, " no log-adjacency-changes\n"); } |