diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2024-03-18 19:08:23 +0200 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2024-04-22 16:36:22 +0300 |
| commit | 58a8ebc1fca07ba963faf60d54d77336f36e5ded (patch) | |
| tree | 861d58a483ac4907ff4e4c43d3dbdb9cce840cd9 /ripngd/ripng_nb_rpcs.c | |
| parent | 7f7bcb1ffa636318659abb16c7690d9875577ef9 (diff) | |
lib: rework northbound RPC callback
Change input/output arguments of the RPC callback from lists of
(xpath/value) tuples to YANG data trees.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ripngd/ripng_nb_rpcs.c')
| -rw-r--r-- | ripngd/ripng_nb_rpcs.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ripngd/ripng_nb_rpcs.c b/ripngd/ripng_nb_rpcs.c index b23572d492..5498bbfc8e 100644 --- a/ripngd/ripng_nb_rpcs.c +++ b/ripngd/ripng_nb_rpcs.c @@ -70,12 +70,11 @@ static void clear_ripng_route(struct ripng *ripng) int clear_ripng_route_rpc(struct nb_cb_rpc_args *args) { struct ripng *ripng; - struct yang_data *yang_vrf; - yang_vrf = yang_data_list_find(args->input, "%s/%s", args->xpath, - "input/vrf"); - if (yang_vrf) { - ripng = ripng_lookup_by_vrf_name(yang_vrf->value); + if (args->input && yang_dnode_exists(args->input, "vrf")) { + const char *name = yang_dnode_get_string(args->input, "vrf"); + + ripng = ripng_lookup_by_vrf_name(name); if (ripng) clear_ripng_route(ripng); } else { |
