]>
git.proxmox.com Git - mirror_frr.git/blob - ripngd/ripng_nb_rpcs.c
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2018 NetDEF, Inc.
16 #include "agg_table.h"
17 #include "northbound.h"
20 #include "ripngd/ripngd.h"
21 #include "ripngd/ripng_nb.h"
22 #include "ripngd/ripng_debug.h"
23 #include "ripngd/ripng_route.h"
26 * XPath: /frr-ripngd:clear-ripng-route
28 static void clear_ripng_route(struct ripng
*ripng
)
32 if (IS_RIPNG_DEBUG_EVENT
)
33 zlog_debug("Clearing all RIPng routes (VRF %s)",
36 /* Clear received RIPng routes */
37 for (rp
= agg_route_top(ripng
->table
); rp
; rp
= agg_route_next(rp
)) {
39 struct listnode
*listnode
;
40 struct ripng_info
*rinfo
;
46 for (ALL_LIST_ELEMENTS_RO(list
, listnode
, rinfo
)) {
47 if (!ripng_route_rte(rinfo
))
50 if (CHECK_FLAG(rinfo
->flags
, RIPNG_RTF_FIB
))
51 ripng_zebra_ipv6_delete(ripng
, rp
);
56 EVENT_OFF(rinfo
->t_timeout
);
57 EVENT_OFF(rinfo
->t_garbage_collect
);
58 listnode_delete(list
, rinfo
);
59 ripng_info_free(rinfo
);
62 if (list_isempty(list
)) {
70 int clear_ripng_route_rpc(struct nb_cb_rpc_args
*args
)
73 struct yang_data
*yang_vrf
;
75 yang_vrf
= yang_data_list_find(args
->input
, "%s/%s", args
->xpath
,
78 ripng
= ripng_lookup_by_vrf_name(yang_vrf
->value
);
80 clear_ripng_route(ripng
);
84 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
89 clear_ripng_route(ripng
);