2 * Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
3 * Copyright (C) 2018 NetDEF, Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 #include "northbound.h"
33 #include "ripd/ripd.h"
34 #include "ripd/rip_debug.h"
35 #include "ripd/rip_cli.h"
38 * XPath: /frr-ripd:ripd/instance
40 static int ripd_instance_create(enum nb_event event
,
41 const struct lyd_node
*dnode
,
42 union nb_resource
*resource
)
49 vrf_name
= yang_dnode_get_string(dnode
, "./vrf");
50 vrf
= vrf_lookup_by_name(vrf_name
);
53 * Try to create a RIP socket only if the VRF is enabled, otherwise
54 * create a disabled RIP instance and wait for the VRF to be enabled.
60 if (!vrf
|| !vrf_is_enabled(vrf
))
63 socket
= rip_create_socket(vrf
);
65 return NB_ERR_RESOURCE
;
66 resource
->fd
= socket
;
69 if (!vrf
|| !vrf_is_enabled(vrf
))
72 socket
= resource
->fd
;
76 if (vrf
&& vrf_is_enabled(vrf
))
77 socket
= resource
->fd
;
81 rip
= rip_create(vrf_name
, vrf
, socket
);
82 yang_dnode_set_entry(dnode
, rip
);
89 static int ripd_instance_destroy(enum nb_event event
,
90 const struct lyd_node
*dnode
)
94 if (event
!= NB_EV_APPLY
)
97 rip
= yang_dnode_get_entry(dnode
, true);
103 static const void *ripd_instance_get_next(const void *parent_list_entry
,
104 const void *list_entry
)
106 const struct rip
*rip
= list_entry
;
108 if (list_entry
== NULL
)
109 rip
= RB_MIN(rip_instance_head
, &rip_instances
);
111 rip
= RB_NEXT(rip_instance_head
, (struct rip
*)rip
);
116 static int ripd_instance_get_keys(const void *list_entry
,
117 struct yang_list_keys
*keys
)
119 const struct rip
*rip
= list_entry
;
122 strlcpy(keys
->key
[0], rip
->vrf_name
, sizeof(keys
->key
[0]));
127 static const void *ripd_instance_lookup_entry(const void *parent_list_entry
,
128 const struct yang_list_keys
*keys
)
130 const char *vrf_name
= keys
->key
[0];
132 return rip_lookup_by_vrf_name(vrf_name
);
136 * XPath: /frr-ripd:ripd/instance/allow-ecmp
138 static int ripd_instance_allow_ecmp_modify(enum nb_event event
,
139 const struct lyd_node
*dnode
,
140 union nb_resource
*resource
)
144 if (event
!= NB_EV_APPLY
)
147 rip
= yang_dnode_get_entry(dnode
, true);
148 rip
->ecmp
= yang_dnode_get_bool(dnode
, NULL
);
150 rip_ecmp_disable(rip
);
156 * XPath: /frr-ripd:ripd/instance/default-information-originate
159 ripd_instance_default_information_originate_modify(enum nb_event event
,
160 const struct lyd_node
*dnode
,
161 union nb_resource
*resource
)
164 bool default_information
;
165 struct prefix_ipv4 p
;
167 if (event
!= NB_EV_APPLY
)
170 rip
= yang_dnode_get_entry(dnode
, true);
171 default_information
= yang_dnode_get_bool(dnode
, NULL
);
173 memset(&p
, 0, sizeof(struct prefix_ipv4
));
175 if (default_information
) {
178 memset(&nh
, 0, sizeof(nh
));
179 nh
.type
= NEXTHOP_TYPE_IPV4
;
180 rip_redistribute_add(rip
, ZEBRA_ROUTE_RIP
, RIP_ROUTE_DEFAULT
,
183 rip_redistribute_delete(rip
, ZEBRA_ROUTE_RIP
, RIP_ROUTE_DEFAULT
,
191 * XPath: /frr-ripd:ripd/instance/default-metric
193 static int ripd_instance_default_metric_modify(enum nb_event event
,
194 const struct lyd_node
*dnode
,
195 union nb_resource
*resource
)
199 if (event
!= NB_EV_APPLY
)
202 rip
= yang_dnode_get_entry(dnode
, true);
203 rip
->default_metric
= yang_dnode_get_uint8(dnode
, NULL
);
204 /* rip_update_default_metric (); */
210 * XPath: /frr-ripd:ripd/instance/distance/default
212 static int ripd_instance_distance_default_modify(enum nb_event event
,
213 const struct lyd_node
*dnode
,
214 union nb_resource
*resource
)
218 if (event
!= NB_EV_APPLY
)
221 rip
= yang_dnode_get_entry(dnode
, true);
222 rip
->distance
= yang_dnode_get_uint8(dnode
, NULL
);
228 * XPath: /frr-ripd:ripd/instance/distance/source
230 static int ripd_instance_distance_source_create(enum nb_event event
,
231 const struct lyd_node
*dnode
,
232 union nb_resource
*resource
)
235 struct prefix_ipv4 prefix
;
236 struct route_node
*rn
;
238 if (event
!= NB_EV_APPLY
)
241 yang_dnode_get_ipv4p(&prefix
, dnode
, "./prefix");
242 apply_mask_ipv4(&prefix
);
244 /* Get RIP distance node. */
245 rip
= yang_dnode_get_entry(dnode
, true);
246 rn
= route_node_get(rip
->distance_table
, (struct prefix
*)&prefix
);
247 rn
->info
= rip_distance_new();
248 yang_dnode_set_entry(dnode
, rn
);
253 static int ripd_instance_distance_source_destroy(enum nb_event event
,
254 const struct lyd_node
*dnode
)
256 struct route_node
*rn
;
257 struct rip_distance
*rdistance
;
259 if (event
!= NB_EV_APPLY
)
262 rn
= yang_dnode_get_entry(dnode
, true);
263 rdistance
= rn
->info
;
264 rip_distance_free(rdistance
);
266 route_unlock_node(rn
);
272 * XPath: /frr-ripd:ripd/instance/distance/source/distance
275 ripd_instance_distance_source_distance_modify(enum nb_event event
,
276 const struct lyd_node
*dnode
,
277 union nb_resource
*resource
)
279 struct route_node
*rn
;
281 struct rip_distance
*rdistance
;
283 if (event
!= NB_EV_APPLY
)
286 /* Set distance value. */
287 rn
= yang_dnode_get_entry(dnode
, true);
288 distance
= yang_dnode_get_uint8(dnode
, NULL
);
289 rdistance
= rn
->info
;
290 rdistance
->distance
= distance
;
296 * XPath: /frr-ripd:ripd/instance/distance/source/access-list
299 ripd_instance_distance_source_access_list_modify(enum nb_event event
,
300 const struct lyd_node
*dnode
,
301 union nb_resource
*resource
)
303 const char *acl_name
;
304 struct route_node
*rn
;
305 struct rip_distance
*rdistance
;
307 if (event
!= NB_EV_APPLY
)
310 acl_name
= yang_dnode_get_string(dnode
, NULL
);
312 /* Set access-list */
313 rn
= yang_dnode_get_entry(dnode
, true);
314 rdistance
= rn
->info
;
315 if (rdistance
->access_list
)
316 free(rdistance
->access_list
);
317 rdistance
->access_list
= strdup(acl_name
);
323 ripd_instance_distance_source_access_list_destroy(enum nb_event event
,
324 const struct lyd_node
*dnode
)
326 struct route_node
*rn
;
327 struct rip_distance
*rdistance
;
329 if (event
!= NB_EV_APPLY
)
332 /* Reset access-list configuration. */
333 rn
= yang_dnode_get_entry(dnode
, true);
334 rdistance
= rn
->info
;
335 free(rdistance
->access_list
);
336 rdistance
->access_list
= NULL
;
342 * XPath: /frr-ripd:ripd/instance/explicit-neighbor
344 static int ripd_instance_explicit_neighbor_create(enum nb_event event
,
345 const struct lyd_node
*dnode
,
346 union nb_resource
*resource
)
349 struct prefix_ipv4 p
;
351 if (event
!= NB_EV_APPLY
)
354 rip
= yang_dnode_get_entry(dnode
, true);
356 p
.prefixlen
= IPV4_MAX_BITLEN
;
357 yang_dnode_get_ipv4(&p
.prefix
, dnode
, NULL
);
359 return rip_neighbor_add(rip
, &p
);
362 static int ripd_instance_explicit_neighbor_destroy(enum nb_event event
,
363 const struct lyd_node
*dnode
)
366 struct prefix_ipv4 p
;
368 if (event
!= NB_EV_APPLY
)
371 rip
= yang_dnode_get_entry(dnode
, true);
373 p
.prefixlen
= IPV4_MAX_BITLEN
;
374 yang_dnode_get_ipv4(&p
.prefix
, dnode
, NULL
);
376 return rip_neighbor_delete(rip
, &p
);
380 * XPath: /frr-ripd:ripd/instance/network
382 static int ripd_instance_network_create(enum nb_event event
,
383 const struct lyd_node
*dnode
,
384 union nb_resource
*resource
)
389 if (event
!= NB_EV_APPLY
)
392 rip
= yang_dnode_get_entry(dnode
, true);
393 yang_dnode_get_ipv4p(&p
, dnode
, NULL
);
394 apply_mask_ipv4((struct prefix_ipv4
*)&p
);
396 return rip_enable_network_add(rip
, &p
);
399 static int ripd_instance_network_destroy(enum nb_event event
,
400 const struct lyd_node
*dnode
)
405 if (event
!= NB_EV_APPLY
)
408 rip
= yang_dnode_get_entry(dnode
, true);
409 yang_dnode_get_ipv4p(&p
, dnode
, NULL
);
410 apply_mask_ipv4((struct prefix_ipv4
*)&p
);
412 return rip_enable_network_delete(rip
, &p
);
416 * XPath: /frr-ripd:ripd/instance/interface
418 static int ripd_instance_interface_create(enum nb_event event
,
419 const struct lyd_node
*dnode
,
420 union nb_resource
*resource
)
425 if (event
!= NB_EV_APPLY
)
428 rip
= yang_dnode_get_entry(dnode
, true);
429 ifname
= yang_dnode_get_string(dnode
, NULL
);
431 return rip_enable_if_add(rip
, ifname
);
434 static int ripd_instance_interface_destroy(enum nb_event event
,
435 const struct lyd_node
*dnode
)
440 if (event
!= NB_EV_APPLY
)
443 rip
= yang_dnode_get_entry(dnode
, true);
444 ifname
= yang_dnode_get_string(dnode
, NULL
);
446 return rip_enable_if_delete(rip
, ifname
);
450 * XPath: /frr-ripd:ripd/instance/offset-list
452 static int ripd_instance_offset_list_create(enum nb_event event
,
453 const struct lyd_node
*dnode
,
454 union nb_resource
*resource
)
458 struct rip_offset_list
*offset
;
460 if (event
!= NB_EV_APPLY
)
463 rip
= yang_dnode_get_entry(dnode
, true);
464 ifname
= yang_dnode_get_string(dnode
, "./interface");
466 offset
= rip_offset_list_new(rip
, ifname
);
467 yang_dnode_set_entry(dnode
, offset
);
472 static int ripd_instance_offset_list_destroy(enum nb_event event
,
473 const struct lyd_node
*dnode
)
476 struct rip_offset_list
*offset
;
478 if (event
!= NB_EV_APPLY
)
481 direct
= yang_dnode_get_enum(dnode
, "./direction");
483 offset
= yang_dnode_get_entry(dnode
, true);
484 if (offset
->direct
[direct
].alist_name
) {
485 free(offset
->direct
[direct
].alist_name
);
486 offset
->direct
[direct
].alist_name
= NULL
;
488 if (offset
->direct
[RIP_OFFSET_LIST_IN
].alist_name
== NULL
489 && offset
->direct
[RIP_OFFSET_LIST_OUT
].alist_name
== NULL
)
490 offset_list_del(offset
);
496 * XPath: /frr-ripd:ripd/instance/offset-list/access-list
499 ripd_instance_offset_list_access_list_modify(enum nb_event event
,
500 const struct lyd_node
*dnode
,
501 union nb_resource
*resource
)
504 struct rip_offset_list
*offset
;
505 const char *alist_name
;
507 if (event
!= NB_EV_APPLY
)
510 direct
= yang_dnode_get_enum(dnode
, "../direction");
511 alist_name
= yang_dnode_get_string(dnode
, NULL
);
513 offset
= yang_dnode_get_entry(dnode
, true);
514 if (offset
->direct
[direct
].alist_name
)
515 free(offset
->direct
[direct
].alist_name
);
516 offset
->direct
[direct
].alist_name
= strdup(alist_name
);
522 * XPath: /frr-ripd:ripd/instance/offset-list/metric
524 static int ripd_instance_offset_list_metric_modify(enum nb_event event
,
525 const struct lyd_node
*dnode
,
526 union nb_resource
*resource
)
530 struct rip_offset_list
*offset
;
532 if (event
!= NB_EV_APPLY
)
535 direct
= yang_dnode_get_enum(dnode
, "../direction");
536 metric
= yang_dnode_get_uint8(dnode
, NULL
);
538 offset
= yang_dnode_get_entry(dnode
, true);
539 offset
->direct
[direct
].metric
= metric
;
545 * XPath: /frr-ripd:ripd/instance/passive-default
547 static int ripd_instance_passive_default_modify(enum nb_event event
,
548 const struct lyd_node
*dnode
,
549 union nb_resource
*resource
)
553 if (event
!= NB_EV_APPLY
)
556 rip
= yang_dnode_get_entry(dnode
, true);
557 rip
->passive_default
= yang_dnode_get_bool(dnode
, NULL
);
558 rip_passive_nondefault_clean(rip
);
564 * XPath: /frr-ripd:ripd/instance/passive-interface
566 static int ripd_instance_passive_interface_create(enum nb_event event
,
567 const struct lyd_node
*dnode
,
568 union nb_resource
*resource
)
573 if (event
!= NB_EV_APPLY
)
576 rip
= yang_dnode_get_entry(dnode
, true);
577 ifname
= yang_dnode_get_string(dnode
, NULL
);
579 return rip_passive_nondefault_set(rip
, ifname
);
582 static int ripd_instance_passive_interface_destroy(enum nb_event event
,
583 const struct lyd_node
*dnode
)
588 if (event
!= NB_EV_APPLY
)
591 rip
= yang_dnode_get_entry(dnode
, true);
592 ifname
= yang_dnode_get_string(dnode
, NULL
);
594 return rip_passive_nondefault_unset(rip
, ifname
);
598 * XPath: /frr-ripd:ripd/instance/non-passive-interface
601 ripd_instance_non_passive_interface_create(enum nb_event event
,
602 const struct lyd_node
*dnode
,
603 union nb_resource
*resource
)
608 if (event
!= NB_EV_APPLY
)
611 rip
= yang_dnode_get_entry(dnode
, true);
612 ifname
= yang_dnode_get_string(dnode
, NULL
);
614 return rip_passive_nondefault_unset(rip
, ifname
);
618 ripd_instance_non_passive_interface_destroy(enum nb_event event
,
619 const struct lyd_node
*dnode
)
624 if (event
!= NB_EV_APPLY
)
627 rip
= yang_dnode_get_entry(dnode
, true);
628 ifname
= yang_dnode_get_string(dnode
, NULL
);
630 return rip_passive_nondefault_set(rip
, ifname
);
634 * XPath: /frr-ripd:ripd/instance/redistribute
636 static int ripd_instance_redistribute_create(enum nb_event event
,
637 const struct lyd_node
*dnode
,
638 union nb_resource
*resource
)
643 if (event
!= NB_EV_APPLY
)
646 rip
= yang_dnode_get_entry(dnode
, true);
647 type
= yang_dnode_get_enum(dnode
, "./protocol");
649 rip
->redist
[type
].enabled
= true;
654 static int ripd_instance_redistribute_destroy(enum nb_event event
,
655 const struct lyd_node
*dnode
)
660 if (event
!= NB_EV_APPLY
)
663 rip
= yang_dnode_get_entry(dnode
, true);
664 type
= yang_dnode_get_enum(dnode
, "./protocol");
666 rip
->redist
[type
].enabled
= false;
667 if (rip
->redist
[type
].route_map
.name
) {
668 free(rip
->redist
[type
].route_map
.name
);
669 rip
->redist
[type
].route_map
.name
= NULL
;
670 rip
->redist
[type
].route_map
.map
= NULL
;
672 rip
->redist
[type
].metric_config
= false;
673 rip
->redist
[type
].metric
= 0;
676 rip_redistribute_conf_delete(rip
, type
);
682 ripd_instance_redistribute_apply_finish(const struct lyd_node
*dnode
)
687 rip
= yang_dnode_get_entry(dnode
, true);
688 type
= yang_dnode_get_enum(dnode
, "./protocol");
691 rip_redistribute_conf_update(rip
, type
);
695 * XPath: /frr-ripd:ripd/instance/redistribute/route-map
698 ripd_instance_redistribute_route_map_modify(enum nb_event event
,
699 const struct lyd_node
*dnode
,
700 union nb_resource
*resource
)
704 const char *rmap_name
;
706 if (event
!= NB_EV_APPLY
)
709 rip
= yang_dnode_get_entry(dnode
, true);
710 type
= yang_dnode_get_enum(dnode
, "../protocol");
711 rmap_name
= yang_dnode_get_string(dnode
, NULL
);
713 if (rip
->redist
[type
].route_map
.name
)
714 free(rip
->redist
[type
].route_map
.name
);
715 rip
->redist
[type
].route_map
.name
= strdup(rmap_name
);
716 rip
->redist
[type
].route_map
.map
= route_map_lookup_by_name(rmap_name
);
722 ripd_instance_redistribute_route_map_destroy(enum nb_event event
,
723 const struct lyd_node
*dnode
)
728 if (event
!= NB_EV_APPLY
)
731 rip
= yang_dnode_get_entry(dnode
, true);
732 type
= yang_dnode_get_enum(dnode
, "../protocol");
734 free(rip
->redist
[type
].route_map
.name
);
735 rip
->redist
[type
].route_map
.name
= NULL
;
736 rip
->redist
[type
].route_map
.map
= NULL
;
742 * XPath: /frr-ripd:ripd/instance/redistribute/metric
745 ripd_instance_redistribute_metric_modify(enum nb_event event
,
746 const struct lyd_node
*dnode
,
747 union nb_resource
*resource
)
753 if (event
!= NB_EV_APPLY
)
756 rip
= yang_dnode_get_entry(dnode
, true);
757 type
= yang_dnode_get_enum(dnode
, "../protocol");
758 metric
= yang_dnode_get_uint8(dnode
, NULL
);
760 rip
->redist
[type
].metric_config
= true;
761 rip
->redist
[type
].metric
= metric
;
767 ripd_instance_redistribute_metric_destroy(enum nb_event event
,
768 const struct lyd_node
*dnode
)
773 if (event
!= NB_EV_APPLY
)
776 rip
= yang_dnode_get_entry(dnode
, true);
777 type
= yang_dnode_get_enum(dnode
, "../protocol");
779 rip
->redist
[type
].metric_config
= false;
780 rip
->redist
[type
].metric
= 0;
786 * XPath: /frr-ripd:ripd/instance/static-route
788 static int ripd_instance_static_route_create(enum nb_event event
,
789 const struct lyd_node
*dnode
,
790 union nb_resource
*resource
)
794 struct prefix_ipv4 p
;
796 if (event
!= NB_EV_APPLY
)
799 rip
= yang_dnode_get_entry(dnode
, true);
800 yang_dnode_get_ipv4p(&p
, dnode
, NULL
);
803 memset(&nh
, 0, sizeof(nh
));
804 nh
.type
= NEXTHOP_TYPE_IPV4
;
805 rip_redistribute_add(rip
, ZEBRA_ROUTE_RIP
, RIP_ROUTE_STATIC
, &p
, &nh
, 0,
811 static int ripd_instance_static_route_destroy(enum nb_event event
,
812 const struct lyd_node
*dnode
)
815 struct prefix_ipv4 p
;
817 if (event
!= NB_EV_APPLY
)
820 rip
= yang_dnode_get_entry(dnode
, true);
821 yang_dnode_get_ipv4p(&p
, dnode
, NULL
);
824 rip_redistribute_delete(rip
, ZEBRA_ROUTE_RIP
, RIP_ROUTE_STATIC
, &p
, 0);
830 * XPath: /frr-ripd:ripd/instance/timers/
832 static void ripd_instance_timers_apply_finish(const struct lyd_node
*dnode
)
836 rip
= yang_dnode_get_entry(dnode
, true);
838 /* Reset update timer thread. */
839 rip_event(rip
, RIP_UPDATE_EVENT
, 0);
843 * XPath: /frr-ripd:ripd/instance/timers/flush-interval
846 ripd_instance_timers_flush_interval_modify(enum nb_event event
,
847 const struct lyd_node
*dnode
,
848 union nb_resource
*resource
)
852 if (event
!= NB_EV_APPLY
)
855 rip
= yang_dnode_get_entry(dnode
, true);
856 rip
->garbage_time
= yang_dnode_get_uint32(dnode
, NULL
);
862 * XPath: /frr-ripd:ripd/instance/timers/holddown-interval
865 ripd_instance_timers_holddown_interval_modify(enum nb_event event
,
866 const struct lyd_node
*dnode
,
867 union nb_resource
*resource
)
871 if (event
!= NB_EV_APPLY
)
874 rip
= yang_dnode_get_entry(dnode
, true);
875 rip
->timeout_time
= yang_dnode_get_uint32(dnode
, NULL
);
881 * XPath: /frr-ripd:ripd/instance/timers/update-interval
884 ripd_instance_timers_update_interval_modify(enum nb_event event
,
885 const struct lyd_node
*dnode
,
886 union nb_resource
*resource
)
890 if (event
!= NB_EV_APPLY
)
893 rip
= yang_dnode_get_entry(dnode
, true);
894 rip
->update_time
= yang_dnode_get_uint32(dnode
, NULL
);
900 * XPath: /frr-ripd:ripd/instance/version/receive
902 static int ripd_instance_version_receive_modify(enum nb_event event
,
903 const struct lyd_node
*dnode
,
904 union nb_resource
*resource
)
908 if (event
!= NB_EV_APPLY
)
911 rip
= yang_dnode_get_entry(dnode
, true);
912 rip
->version_recv
= yang_dnode_get_enum(dnode
, NULL
);
918 * XPath: /frr-ripd:ripd/instance/version/send
920 static int ripd_instance_version_send_modify(enum nb_event event
,
921 const struct lyd_node
*dnode
,
922 union nb_resource
*resource
)
926 if (event
!= NB_EV_APPLY
)
929 rip
= yang_dnode_get_entry(dnode
, true);
930 rip
->version_send
= yang_dnode_get_enum(dnode
, NULL
);
936 * XPath: /frr-interface:lib/interface/frr-ripd:rip/split-horizon
938 static int lib_interface_rip_split_horizon_modify(enum nb_event event
,
939 const struct lyd_node
*dnode
,
940 union nb_resource
*resource
)
942 struct interface
*ifp
;
943 struct rip_interface
*ri
;
945 if (event
!= NB_EV_APPLY
)
948 ifp
= yang_dnode_get_entry(dnode
, true);
950 ri
->split_horizon
= yang_dnode_get_enum(dnode
, NULL
);
956 * XPath: /frr-interface:lib/interface/frr-ripd:rip/v2-broadcast
958 static int lib_interface_rip_v2_broadcast_modify(enum nb_event event
,
959 const struct lyd_node
*dnode
,
960 union nb_resource
*resource
)
962 struct interface
*ifp
;
963 struct rip_interface
*ri
;
965 if (event
!= NB_EV_APPLY
)
968 ifp
= yang_dnode_get_entry(dnode
, true);
970 ri
->v2_broadcast
= yang_dnode_get_bool(dnode
, NULL
);
976 * XPath: /frr-interface:lib/interface/frr-ripd:rip/version-receive
979 lib_interface_rip_version_receive_modify(enum nb_event event
,
980 const struct lyd_node
*dnode
,
981 union nb_resource
*resource
)
983 struct interface
*ifp
;
984 struct rip_interface
*ri
;
986 if (event
!= NB_EV_APPLY
)
989 ifp
= yang_dnode_get_entry(dnode
, true);
991 ri
->ri_receive
= yang_dnode_get_enum(dnode
, NULL
);
997 * XPath: /frr-interface:lib/interface/frr-ripd:rip/version-send
999 static int lib_interface_rip_version_send_modify(enum nb_event event
,
1000 const struct lyd_node
*dnode
,
1001 union nb_resource
*resource
)
1003 struct interface
*ifp
;
1004 struct rip_interface
*ri
;
1006 if (event
!= NB_EV_APPLY
)
1009 ifp
= yang_dnode_get_entry(dnode
, true);
1011 ri
->ri_send
= yang_dnode_get_enum(dnode
, NULL
);
1017 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/mode
1019 static int lib_interface_rip_authentication_scheme_mode_modify(
1020 enum nb_event event
, const struct lyd_node
*dnode
,
1021 union nb_resource
*resource
)
1023 struct interface
*ifp
;
1024 struct rip_interface
*ri
;
1026 if (event
!= NB_EV_APPLY
)
1029 ifp
= yang_dnode_get_entry(dnode
, true);
1031 ri
->auth_type
= yang_dnode_get_enum(dnode
, NULL
);
1038 * /frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/md5-auth-length
1040 static int lib_interface_rip_authentication_scheme_md5_auth_length_modify(
1041 enum nb_event event
, const struct lyd_node
*dnode
,
1042 union nb_resource
*resource
)
1044 struct interface
*ifp
;
1045 struct rip_interface
*ri
;
1047 if (event
!= NB_EV_APPLY
)
1050 ifp
= yang_dnode_get_entry(dnode
, true);
1052 ri
->md5_auth_len
= yang_dnode_get_enum(dnode
, NULL
);
1057 static int lib_interface_rip_authentication_scheme_md5_auth_length_destroy(
1058 enum nb_event event
, const struct lyd_node
*dnode
)
1060 struct interface
*ifp
;
1061 struct rip_interface
*ri
;
1063 if (event
!= NB_EV_APPLY
)
1066 ifp
= yang_dnode_get_entry(dnode
, true);
1068 ri
->md5_auth_len
= yang_get_default_enum(
1069 "%s/authentication-scheme/md5-auth-length", RIP_IFACE
);
1075 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-password
1078 lib_interface_rip_authentication_password_modify(enum nb_event event
,
1079 const struct lyd_node
*dnode
,
1080 union nb_resource
*resource
)
1082 struct interface
*ifp
;
1083 struct rip_interface
*ri
;
1085 if (event
!= NB_EV_APPLY
)
1088 ifp
= yang_dnode_get_entry(dnode
, true);
1090 XFREE(MTYPE_RIP_INTERFACE_STRING
, ri
->auth_str
);
1091 ri
->auth_str
= XSTRDUP(MTYPE_RIP_INTERFACE_STRING
,
1092 yang_dnode_get_string(dnode
, NULL
));
1098 lib_interface_rip_authentication_password_destroy(enum nb_event event
,
1099 const struct lyd_node
*dnode
)
1101 struct interface
*ifp
;
1102 struct rip_interface
*ri
;
1104 if (event
!= NB_EV_APPLY
)
1107 ifp
= yang_dnode_get_entry(dnode
, true);
1109 XFREE(MTYPE_RIP_INTERFACE_STRING
, ri
->auth_str
);
1115 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-key-chain
1118 lib_interface_rip_authentication_key_chain_modify(enum nb_event event
,
1119 const struct lyd_node
*dnode
,
1120 union nb_resource
*resource
)
1122 struct interface
*ifp
;
1123 struct rip_interface
*ri
;
1125 if (event
!= NB_EV_APPLY
)
1128 ifp
= yang_dnode_get_entry(dnode
, true);
1130 XFREE(MTYPE_RIP_INTERFACE_STRING
, ri
->key_chain
);
1131 ri
->key_chain
= XSTRDUP(MTYPE_RIP_INTERFACE_STRING
,
1132 yang_dnode_get_string(dnode
, NULL
));
1138 lib_interface_rip_authentication_key_chain_destroy(enum nb_event event
,
1139 const struct lyd_node
*dnode
)
1141 struct interface
*ifp
;
1142 struct rip_interface
*ri
;
1144 if (event
!= NB_EV_APPLY
)
1147 ifp
= yang_dnode_get_entry(dnode
, true);
1149 XFREE(MTYPE_RIP_INTERFACE_STRING
, ri
->key_chain
);
1155 * XPath: /frr-ripd:ripd/instance/state/neighbors/neighbor
1158 ripd_instance_state_neighbors_neighbor_get_next(const void *parent_list_entry
,
1159 const void *list_entry
)
1161 const struct rip
*rip
= parent_list_entry
;
1162 struct listnode
*node
;
1164 if (list_entry
== NULL
)
1165 node
= listhead(rip
->peer_list
);
1167 node
= listnextnode((struct listnode
*)list_entry
);
1173 ripd_instance_state_neighbors_neighbor_get_keys(const void *list_entry
,
1174 struct yang_list_keys
*keys
)
1176 const struct listnode
*node
= list_entry
;
1177 const struct rip_peer
*peer
= listgetdata(node
);
1180 (void)inet_ntop(AF_INET
, &peer
->addr
, keys
->key
[0],
1181 sizeof(keys
->key
[0]));
1186 static const void *ripd_instance_state_neighbors_neighbor_lookup_entry(
1187 const void *parent_list_entry
, const struct yang_list_keys
*keys
)
1189 const struct rip
*rip
= parent_list_entry
;
1190 struct in_addr address
;
1191 struct rip_peer
*peer
;
1192 struct listnode
*node
;
1194 yang_str2ipv4(keys
->key
[0], &address
);
1196 for (ALL_LIST_ELEMENTS_RO(rip
->peer_list
, node
, peer
)) {
1197 if (IPV4_ADDR_SAME(&peer
->addr
, &address
))
1205 * XPath: /frr-ripd:ripd/instance/state/neighbors/neighbor/address
1207 static struct yang_data
*
1208 ripd_instance_state_neighbors_neighbor_address_get_elem(const char *xpath
,
1209 const void *list_entry
)
1211 const struct listnode
*node
= list_entry
;
1212 const struct rip_peer
*peer
= listgetdata(node
);
1214 return yang_data_new_ipv4(xpath
, &peer
->addr
);
1218 * XPath: /frr-ripd:ripd/instance/state/neighbors/neighbor/last-update
1220 static struct yang_data
*
1221 ripd_instance_state_neighbors_neighbor_last_update_get_elem(
1222 const char *xpath
, const void *list_entry
)
1224 /* TODO: yang:date-and-time is tricky */
1229 * XPath: /frr-ripd:ripd/instance/state/neighbors/neighbor/bad-packets-rcvd
1231 static struct yang_data
*
1232 ripd_instance_state_neighbors_neighbor_bad_packets_rcvd_get_elem(
1233 const char *xpath
, const void *list_entry
)
1235 const struct listnode
*node
= list_entry
;
1236 const struct rip_peer
*peer
= listgetdata(node
);
1238 return yang_data_new_uint32(xpath
, peer
->recv_badpackets
);
1242 * XPath: /frr-ripd:ripd/instance/state/neighbors/neighbor/bad-routes-rcvd
1244 static struct yang_data
*
1245 ripd_instance_state_neighbors_neighbor_bad_routes_rcvd_get_elem(
1246 const char *xpath
, const void *list_entry
)
1248 const struct listnode
*node
= list_entry
;
1249 const struct rip_peer
*peer
= listgetdata(node
);
1251 return yang_data_new_uint32(xpath
, peer
->recv_badroutes
);
1255 * XPath: /frr-ripd:ripd/instance/state/routes/route
1258 ripd_instance_state_routes_route_get_next(const void *parent_list_entry
,
1259 const void *list_entry
)
1261 const struct rip
*rip
= parent_list_entry
;
1262 struct route_node
*rn
;
1264 if (list_entry
== NULL
)
1265 rn
= route_top(rip
->table
);
1267 rn
= route_next((struct route_node
*)list_entry
);
1268 while (rn
&& rn
->info
== NULL
)
1269 rn
= route_next(rn
);
1275 ripd_instance_state_routes_route_get_keys(const void *list_entry
,
1276 struct yang_list_keys
*keys
)
1278 const struct route_node
*rn
= list_entry
;
1281 (void)prefix2str(&rn
->p
, keys
->key
[0], sizeof(keys
->key
[0]));
1287 ripd_instance_state_routes_route_lookup_entry(const void *parent_list_entry
,
1288 const struct yang_list_keys
*keys
)
1290 const struct rip
*rip
= parent_list_entry
;
1291 struct prefix prefix
;
1292 struct route_node
*rn
;
1294 yang_str2ipv4p(keys
->key
[0], &prefix
);
1296 rn
= route_node_lookup(rip
->table
, &prefix
);
1297 if (!rn
|| !rn
->info
)
1300 route_unlock_node(rn
);
1306 * XPath: /frr-ripd:ripd/instance/state/routes/route/prefix
1308 static struct yang_data
*
1309 ripd_instance_state_routes_route_prefix_get_elem(const char *xpath
,
1310 const void *list_entry
)
1312 const struct route_node
*rn
= list_entry
;
1313 const struct rip_info
*rinfo
= listnode_head(rn
->info
);
1315 return yang_data_new_ipv4p(xpath
, &rinfo
->rp
->p
);
1319 * XPath: /frr-ripd:ripd/instance/state/routes/route/next-hop
1321 static struct yang_data
*
1322 ripd_instance_state_routes_route_next_hop_get_elem(const char *xpath
,
1323 const void *list_entry
)
1325 const struct route_node
*rn
= list_entry
;
1326 const struct rip_info
*rinfo
= listnode_head(rn
->info
);
1328 switch (rinfo
->nh
.type
) {
1329 case NEXTHOP_TYPE_IPV4
:
1330 case NEXTHOP_TYPE_IPV4_IFINDEX
:
1331 return yang_data_new_ipv4(xpath
, &rinfo
->nh
.gate
.ipv4
);
1338 * XPath: /frr-ripd:ripd/instance/state/routes/route/interface
1340 static struct yang_data
*
1341 ripd_instance_state_routes_route_interface_get_elem(const char *xpath
,
1342 const void *list_entry
)
1344 const struct route_node
*rn
= list_entry
;
1345 const struct rip_info
*rinfo
= listnode_head(rn
->info
);
1346 const struct rip
*rip
= rip_info_get_instance(rinfo
);
1348 switch (rinfo
->nh
.type
) {
1349 case NEXTHOP_TYPE_IFINDEX
:
1350 case NEXTHOP_TYPE_IPV4_IFINDEX
:
1351 return yang_data_new_string(
1353 ifindex2ifname(rinfo
->nh
.ifindex
, rip
->vrf
->vrf_id
));
1360 * XPath: /frr-ripd:ripd/instance/state/routes/route/metric
1362 static struct yang_data
*
1363 ripd_instance_state_routes_route_metric_get_elem(const char *xpath
,
1364 const void *list_entry
)
1366 const struct route_node
*rn
= list_entry
;
1367 const struct rip_info
*rinfo
= listnode_head(rn
->info
);
1369 return yang_data_new_uint8(xpath
, rinfo
->metric
);
1373 * XPath: /frr-ripd:clear-rip-route
1375 static void clear_rip_route(struct rip
*rip
)
1377 struct route_node
*rp
;
1379 if (IS_RIP_DEBUG_EVENT
)
1380 zlog_debug("Clearing all RIP routes (VRF %s)", rip
->vrf_name
);
1382 /* Clear received RIP routes */
1383 for (rp
= route_top(rip
->table
); rp
; rp
= route_next(rp
)) {
1385 struct listnode
*listnode
;
1386 struct rip_info
*rinfo
;
1392 for (ALL_LIST_ELEMENTS_RO(list
, listnode
, rinfo
)) {
1393 if (!rip_route_rte(rinfo
))
1396 if (CHECK_FLAG(rinfo
->flags
, RIP_RTF_FIB
))
1397 rip_zebra_ipv4_delete(rip
, rp
);
1402 RIP_TIMER_OFF(rinfo
->t_timeout
);
1403 RIP_TIMER_OFF(rinfo
->t_garbage_collect
);
1404 listnode_delete(list
, rinfo
);
1405 rip_info_free(rinfo
);
1408 if (list_isempty(list
)) {
1411 route_unlock_node(rp
);
1416 static int clear_rip_route_rpc(const char *xpath
, const struct list
*input
,
1417 struct list
*output
)
1420 struct yang_data
*yang_vrf
;
1422 yang_vrf
= yang_data_list_find(input
, "%s/%s", xpath
, "input/vrf");
1424 rip
= rip_lookup_by_vrf_name(yang_vrf
->value
);
1426 clear_rip_route(rip
);
1430 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
1435 clear_rip_route(rip
);
1443 * XPath: /frr-ripd:authentication-type-failure
1445 void ripd_notif_send_auth_type_failure(const char *ifname
)
1447 const char *xpath
= "/frr-ripd:authentication-type-failure";
1448 struct list
*arguments
;
1449 char xpath_arg
[XPATH_MAXLEN
];
1450 struct yang_data
*data
;
1452 arguments
= yang_data_list_new();
1454 snprintf(xpath_arg
, sizeof(xpath_arg
), "%s/interface-name", xpath
);
1455 data
= yang_data_new_string(xpath_arg
, ifname
);
1456 listnode_add(arguments
, data
);
1458 nb_notification_send(xpath
, arguments
);
1462 * XPath: /frr-ripd:authentication-failure
1464 void ripd_notif_send_auth_failure(const char *ifname
)
1466 const char *xpath
= "/frr-ripd:authentication-failure";
1467 struct list
*arguments
;
1468 char xpath_arg
[XPATH_MAXLEN
];
1469 struct yang_data
*data
;
1471 arguments
= yang_data_list_new();
1473 snprintf(xpath_arg
, sizeof(xpath_arg
), "%s/interface-name", xpath
);
1474 data
= yang_data_new_string(xpath_arg
, ifname
);
1475 listnode_add(arguments
, data
);
1477 nb_notification_send(xpath
, arguments
);
1480 /* clang-format off */
1481 const struct frr_yang_module_info frr_ripd_info
= {
1485 .xpath
= "/frr-ripd:ripd/instance",
1486 .cbs
.create
= ripd_instance_create
,
1487 .cbs
.destroy
= ripd_instance_destroy
,
1488 .cbs
.get_next
= ripd_instance_get_next
,
1489 .cbs
.get_keys
= ripd_instance_get_keys
,
1490 .cbs
.lookup_entry
= ripd_instance_lookup_entry
,
1491 .cbs
.cli_show
= cli_show_router_rip
,
1494 .xpath
= "/frr-ripd:ripd/instance/allow-ecmp",
1495 .cbs
.modify
= ripd_instance_allow_ecmp_modify
,
1496 .cbs
.cli_show
= cli_show_rip_allow_ecmp
,
1499 .xpath
= "/frr-ripd:ripd/instance/default-information-originate",
1500 .cbs
.modify
= ripd_instance_default_information_originate_modify
,
1501 .cbs
.cli_show
= cli_show_rip_default_information_originate
,
1504 .xpath
= "/frr-ripd:ripd/instance/default-metric",
1505 .cbs
.modify
= ripd_instance_default_metric_modify
,
1506 .cbs
.cli_show
= cli_show_rip_default_metric
,
1509 .xpath
= "/frr-ripd:ripd/instance/distance/default",
1510 .cbs
.modify
= ripd_instance_distance_default_modify
,
1511 .cbs
.cli_show
= cli_show_rip_distance
,
1514 .xpath
= "/frr-ripd:ripd/instance/distance/source",
1515 .cbs
.create
= ripd_instance_distance_source_create
,
1516 .cbs
.destroy
= ripd_instance_distance_source_destroy
,
1517 .cbs
.cli_show
= cli_show_rip_distance_source
,
1520 .xpath
= "/frr-ripd:ripd/instance/distance/source/distance",
1521 .cbs
.modify
= ripd_instance_distance_source_distance_modify
,
1524 .xpath
= "/frr-ripd:ripd/instance/distance/source/access-list",
1525 .cbs
.modify
= ripd_instance_distance_source_access_list_modify
,
1526 .cbs
.destroy
= ripd_instance_distance_source_access_list_destroy
,
1529 .xpath
= "/frr-ripd:ripd/instance/explicit-neighbor",
1530 .cbs
.create
= ripd_instance_explicit_neighbor_create
,
1531 .cbs
.destroy
= ripd_instance_explicit_neighbor_destroy
,
1532 .cbs
.cli_show
= cli_show_rip_neighbor
,
1535 .xpath
= "/frr-ripd:ripd/instance/network",
1536 .cbs
.create
= ripd_instance_network_create
,
1537 .cbs
.destroy
= ripd_instance_network_destroy
,
1538 .cbs
.cli_show
= cli_show_rip_network_prefix
,
1541 .xpath
= "/frr-ripd:ripd/instance/interface",
1542 .cbs
.create
= ripd_instance_interface_create
,
1543 .cbs
.destroy
= ripd_instance_interface_destroy
,
1544 .cbs
.cli_show
= cli_show_rip_network_interface
,
1547 .xpath
= "/frr-ripd:ripd/instance/offset-list",
1548 .cbs
.create
= ripd_instance_offset_list_create
,
1549 .cbs
.destroy
= ripd_instance_offset_list_destroy
,
1550 .cbs
.cli_show
= cli_show_rip_offset_list
,
1553 .xpath
= "/frr-ripd:ripd/instance/offset-list/access-list",
1554 .cbs
.modify
= ripd_instance_offset_list_access_list_modify
,
1557 .xpath
= "/frr-ripd:ripd/instance/offset-list/metric",
1558 .cbs
.modify
= ripd_instance_offset_list_metric_modify
,
1561 .xpath
= "/frr-ripd:ripd/instance/passive-default",
1562 .cbs
.modify
= ripd_instance_passive_default_modify
,
1563 .cbs
.cli_show
= cli_show_rip_passive_default
,
1566 .xpath
= "/frr-ripd:ripd/instance/passive-interface",
1567 .cbs
.create
= ripd_instance_passive_interface_create
,
1568 .cbs
.destroy
= ripd_instance_passive_interface_destroy
,
1569 .cbs
.cli_show
= cli_show_rip_passive_interface
,
1572 .xpath
= "/frr-ripd:ripd/instance/non-passive-interface",
1573 .cbs
.create
= ripd_instance_non_passive_interface_create
,
1574 .cbs
.destroy
= ripd_instance_non_passive_interface_destroy
,
1575 .cbs
.cli_show
= cli_show_rip_non_passive_interface
,
1578 .xpath
= "/frr-ripd:ripd/instance/redistribute",
1579 .cbs
.create
= ripd_instance_redistribute_create
,
1580 .cbs
.destroy
= ripd_instance_redistribute_destroy
,
1581 .cbs
.apply_finish
= ripd_instance_redistribute_apply_finish
,
1582 .cbs
.cli_show
= cli_show_rip_redistribute
,
1585 .xpath
= "/frr-ripd:ripd/instance/redistribute/route-map",
1586 .cbs
.modify
= ripd_instance_redistribute_route_map_modify
,
1587 .cbs
.destroy
= ripd_instance_redistribute_route_map_destroy
,
1590 .xpath
= "/frr-ripd:ripd/instance/redistribute/metric",
1591 .cbs
.modify
= ripd_instance_redistribute_metric_modify
,
1592 .cbs
.destroy
= ripd_instance_redistribute_metric_destroy
,
1595 .xpath
= "/frr-ripd:ripd/instance/static-route",
1596 .cbs
.create
= ripd_instance_static_route_create
,
1597 .cbs
.destroy
= ripd_instance_static_route_destroy
,
1598 .cbs
.cli_show
= cli_show_rip_route
,
1601 .xpath
= "/frr-ripd:ripd/instance/timers",
1602 .cbs
.apply_finish
= ripd_instance_timers_apply_finish
,
1603 .cbs
.cli_show
= cli_show_rip_timers
,
1606 .xpath
= "/frr-ripd:ripd/instance/timers/flush-interval",
1607 .cbs
.modify
= ripd_instance_timers_flush_interval_modify
,
1610 .xpath
= "/frr-ripd:ripd/instance/timers/holddown-interval",
1611 .cbs
.modify
= ripd_instance_timers_holddown_interval_modify
,
1614 .xpath
= "/frr-ripd:ripd/instance/timers/update-interval",
1615 .cbs
.modify
= ripd_instance_timers_update_interval_modify
,
1618 .xpath
= "/frr-ripd:ripd/instance/version",
1619 .cbs
.cli_show
= cli_show_rip_version
,
1622 .xpath
= "/frr-ripd:ripd/instance/version/receive",
1623 .cbs
.modify
= ripd_instance_version_receive_modify
,
1626 .xpath
= "/frr-ripd:ripd/instance/version/send",
1627 .cbs
.modify
= ripd_instance_version_send_modify
,
1630 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/split-horizon",
1631 .cbs
.modify
= lib_interface_rip_split_horizon_modify
,
1632 .cbs
.cli_show
= cli_show_ip_rip_split_horizon
,
1635 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/v2-broadcast",
1636 .cbs
.modify
= lib_interface_rip_v2_broadcast_modify
,
1637 .cbs
.cli_show
= cli_show_ip_rip_v2_broadcast
,
1640 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/version-receive",
1641 .cbs
.modify
= lib_interface_rip_version_receive_modify
,
1642 .cbs
.cli_show
= cli_show_ip_rip_receive_version
,
1645 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/version-send",
1646 .cbs
.modify
= lib_interface_rip_version_send_modify
,
1647 .cbs
.cli_show
= cli_show_ip_rip_send_version
,
1650 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/authentication-scheme",
1651 .cbs
.cli_show
= cli_show_ip_rip_authentication_scheme
,
1654 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/mode",
1655 .cbs
.modify
= lib_interface_rip_authentication_scheme_mode_modify
,
1658 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/md5-auth-length",
1659 .cbs
.modify
= lib_interface_rip_authentication_scheme_md5_auth_length_modify
,
1660 .cbs
.destroy
= lib_interface_rip_authentication_scheme_md5_auth_length_destroy
,
1663 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/authentication-password",
1664 .cbs
.modify
= lib_interface_rip_authentication_password_modify
,
1665 .cbs
.destroy
= lib_interface_rip_authentication_password_destroy
,
1666 .cbs
.cli_show
= cli_show_ip_rip_authentication_string
,
1669 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/authentication-key-chain",
1670 .cbs
.modify
= lib_interface_rip_authentication_key_chain_modify
,
1671 .cbs
.destroy
= lib_interface_rip_authentication_key_chain_destroy
,
1672 .cbs
.cli_show
= cli_show_ip_rip_authentication_key_chain
,
1675 .xpath
= "/frr-ripd:ripd/instance/state/neighbors/neighbor",
1676 .cbs
.get_next
= ripd_instance_state_neighbors_neighbor_get_next
,
1677 .cbs
.get_keys
= ripd_instance_state_neighbors_neighbor_get_keys
,
1678 .cbs
.lookup_entry
= ripd_instance_state_neighbors_neighbor_lookup_entry
,
1681 .xpath
= "/frr-ripd:ripd/instance/state/neighbors/neighbor/address",
1682 .cbs
.get_elem
= ripd_instance_state_neighbors_neighbor_address_get_elem
,
1685 .xpath
= "/frr-ripd:ripd/instance/state/neighbors/neighbor/last-update",
1686 .cbs
.get_elem
= ripd_instance_state_neighbors_neighbor_last_update_get_elem
,
1689 .xpath
= "/frr-ripd:ripd/instance/state/neighbors/neighbor/bad-packets-rcvd",
1690 .cbs
.get_elem
= ripd_instance_state_neighbors_neighbor_bad_packets_rcvd_get_elem
,
1693 .xpath
= "/frr-ripd:ripd/instance/state/neighbors/neighbor/bad-routes-rcvd",
1694 .cbs
.get_elem
= ripd_instance_state_neighbors_neighbor_bad_routes_rcvd_get_elem
,
1697 .xpath
= "/frr-ripd:ripd/instance/state/routes/route",
1698 .cbs
.get_next
= ripd_instance_state_routes_route_get_next
,
1699 .cbs
.get_keys
= ripd_instance_state_routes_route_get_keys
,
1700 .cbs
.lookup_entry
= ripd_instance_state_routes_route_lookup_entry
,
1703 .xpath
= "/frr-ripd:ripd/instance/state/routes/route/prefix",
1704 .cbs
.get_elem
= ripd_instance_state_routes_route_prefix_get_elem
,
1707 .xpath
= "/frr-ripd:ripd/instance/state/routes/route/next-hop",
1708 .cbs
.get_elem
= ripd_instance_state_routes_route_next_hop_get_elem
,
1711 .xpath
= "/frr-ripd:ripd/instance/state/routes/route/interface",
1712 .cbs
.get_elem
= ripd_instance_state_routes_route_interface_get_elem
,
1715 .xpath
= "/frr-ripd:ripd/instance/state/routes/route/metric",
1716 .cbs
.get_elem
= ripd_instance_state_routes_route_metric_get_elem
,
1719 .xpath
= "/frr-ripd:clear-rip-route",
1720 .cbs
.rpc
= clear_rip_route_rpc
,