diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-04-01 19:28:24 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-04-06 19:00:21 +0300 |
| commit | 3ebeec9446e4bcc29f477c778ff2b4fa276df7d3 (patch) | |
| tree | e08b6047835b93fe96f8941872c7f4441e8887b8 /lib/routemap_northbound.c | |
| parent | d6cfe1b8840fa75ee0e617f28b32eccc60fd715e (diff) | |
lib: convert route-map optimization to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/routemap_northbound.c')
| -rw-r--r-- | lib/routemap_northbound.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/routemap_northbound.c b/lib/routemap_northbound.c index 410eb51f5e..64be8ad6b0 100644 --- a/lib/routemap_northbound.c +++ b/lib/routemap_northbound.c @@ -141,6 +141,30 @@ static int lib_route_map_destroy(struct nb_cb_destroy_args *args) } /* + * XPath: /frr-route-map:lib/route-map/optimization-disabled + */ +static int +lib_route_map_optimization_disabled_modify(struct nb_cb_modify_args *args) +{ + struct route_map *rm; + bool disabled = yang_dnode_get_bool(args->dnode, NULL); + + switch (args->event) { + case NB_EV_VALIDATE: + case NB_EV_PREPARE: + case NB_EV_ABORT: + /* NOTHING */ + break; + case NB_EV_APPLY: + rm = nb_running_get_entry(args->dnode, NULL, true); + rm->optimization_disabled = disabled; + break; + } + + return NB_OK; +} + +/* * XPath: /frr-route-map:lib/route-map/entry */ static int lib_route_map_entry_create(struct nb_cb_create_args *args) @@ -1198,6 +1222,12 @@ const struct frr_yang_module_info frr_route_map_info = { } }, { + .xpath = "/frr-route-map:lib/route-map/optimization-disabled", + .cbs = { + .modify = lib_route_map_optimization_disabled_modify, + } + }, + { .xpath = "/frr-route-map:lib/route-map/entry", .cbs = { .create = lib_route_map_entry_create, |
