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"
36 #include "ripd/rip_interface.h"
39 * XPath: /frr-ripd:ripd/instance
41 static int ripd_instance_create(enum nb_event event
,
42 const struct lyd_node
*dnode
,
43 union nb_resource
*resource
)
50 vrf_name
= yang_dnode_get_string(dnode
, "./vrf");
51 vrf
= vrf_lookup_by_name(vrf_name
);
54 * Try to create a RIP socket only if the VRF is enabled, otherwise
55 * create a disabled RIP instance and wait for the VRF to be enabled.
61 if (!vrf
|| !vrf_is_enabled(vrf
))
64 socket
= rip_create_socket(vrf
);
66 return NB_ERR_RESOURCE
;
67 resource
->fd
= socket
;
70 if (!vrf
|| !vrf_is_enabled(vrf
))
73 socket
= resource
->fd
;
77 if (vrf
&& vrf_is_enabled(vrf
))
78 socket
= resource
->fd
;
82 rip
= rip_create(vrf_name
, vrf
, socket
);
83 nb_running_set_entry(dnode
, rip
);
90 static int ripd_instance_destroy(enum nb_event event
,
91 const struct lyd_node
*dnode
)
95 if (event
!= NB_EV_APPLY
)
98 rip
= nb_running_unset_entry(dnode
);
104 static const void *ripd_instance_get_next(const void *parent_list_entry
,
105 const void *list_entry
)
107 struct rip
*rip
= (struct rip
*)list_entry
;
109 if (list_entry
== NULL
)
110 rip
= RB_MIN(rip_instance_head
, &rip_instances
);
112 rip
= RB_NEXT(rip_instance_head
, rip
);
117 static int ripd_instance_get_keys(const void *list_entry
,
118 struct yang_list_keys
*keys
)
120 const struct rip
*rip
= list_entry
;
123 strlcpy(keys
->key
[0], rip
->vrf_name
, sizeof(keys
->key
[0]));
128 static const void *ripd_instance_lookup_entry(const void *parent_list_entry
,
129 const struct yang_list_keys
*keys
)
131 const char *vrf_name
= keys
->key
[0];
133 return rip_lookup_by_vrf_name(vrf_name
);
137 * XPath: /frr-ripd:ripd/instance/allow-ecmp
139 static int ripd_instance_allow_ecmp_modify(enum nb_event event
,
140 const struct lyd_node
*dnode
,
141 union nb_resource
*resource
)
145 if (event
!= NB_EV_APPLY
)
148 rip
= nb_running_get_entry(dnode
, NULL
, true);
149 rip
->ecmp
= yang_dnode_get_bool(dnode
, NULL
);
151 rip_ecmp_disable(rip
);
157 * XPath: /frr-ripd:ripd/instance/default-information-originate
160 ripd_instance_default_information_originate_modify(enum nb_event event
,
161 const struct lyd_node
*dnode
,
162 union nb_resource
*resource
)
165 bool default_information
;
166 struct prefix_ipv4 p
;
168 if (event
!= NB_EV_APPLY
)
171 rip
= nb_running_get_entry(dnode
, NULL
, true);
172 default_information
= yang_dnode_get_bool(dnode
, NULL
);
174 memset(&p
, 0, sizeof(struct prefix_ipv4
));
176 if (default_information
) {
179 memset(&nh
, 0, sizeof(nh
));
180 nh
.type
= NEXTHOP_TYPE_IPV4
;
181 rip_redistribute_add(rip
, ZEBRA_ROUTE_RIP
, RIP_ROUTE_DEFAULT
,
184 rip_redistribute_delete(rip
, ZEBRA_ROUTE_RIP
, RIP_ROUTE_DEFAULT
,
192 * XPath: /frr-ripd:ripd/instance/default-metric
194 static int ripd_instance_default_metric_modify(enum nb_event event
,
195 const struct lyd_node
*dnode
,
196 union nb_resource
*resource
)
200 if (event
!= NB_EV_APPLY
)
203 rip
= nb_running_get_entry(dnode
, NULL
, true);
204 rip
->default_metric
= yang_dnode_get_uint8(dnode
, NULL
);
205 /* rip_update_default_metric (); */
211 * XPath: /frr-ripd:ripd/instance/distance/default
213 static int ripd_instance_distance_default_modify(enum nb_event event
,
214 const struct lyd_node
*dnode
,
215 union nb_resource
*resource
)
219 if (event
!= NB_EV_APPLY
)
222 rip
= nb_running_get_entry(dnode
, NULL
, true);
223 rip
->distance
= yang_dnode_get_uint8(dnode
, NULL
);
229 * XPath: /frr-ripd:ripd/instance/distance/source
231 static int ripd_instance_distance_source_create(enum nb_event event
,
232 const struct lyd_node
*dnode
,
233 union nb_resource
*resource
)
236 struct prefix_ipv4 prefix
;
237 struct route_node
*rn
;
239 if (event
!= NB_EV_APPLY
)
242 yang_dnode_get_ipv4p(&prefix
, dnode
, "./prefix");
243 apply_mask_ipv4(&prefix
);
245 /* Get RIP distance node. */
246 rip
= nb_running_get_entry(dnode
, NULL
, true);
247 rn
= route_node_get(rip
->distance_table
, (struct prefix
*)&prefix
);
248 rn
->info
= rip_distance_new();
249 nb_running_set_entry(dnode
, rn
);
254 static int ripd_instance_distance_source_destroy(enum nb_event event
,
255 const struct lyd_node
*dnode
)
257 struct route_node
*rn
;
258 struct rip_distance
*rdistance
;
260 if (event
!= NB_EV_APPLY
)
263 rn
= nb_running_unset_entry(dnode
);
264 rdistance
= rn
->info
;
265 rip_distance_free(rdistance
);
267 route_unlock_node(rn
);
273 * XPath: /frr-ripd:ripd/instance/distance/source/distance
276 ripd_instance_distance_source_distance_modify(enum nb_event event
,
277 const struct lyd_node
*dnode
,
278 union nb_resource
*resource
)
280 struct route_node
*rn
;
282 struct rip_distance
*rdistance
;
284 if (event
!= NB_EV_APPLY
)
287 /* Set distance value. */
288 rn
= nb_running_get_entry(dnode
, NULL
, true);
289 distance
= yang_dnode_get_uint8(dnode
, NULL
);
290 rdistance
= rn
->info
;
291 rdistance
->distance
= distance
;
297 * XPath: /frr-ripd:ripd/instance/distance/source/access-list
300 ripd_instance_distance_source_access_list_modify(enum nb_event event
,
301 const struct lyd_node
*dnode
,
302 union nb_resource
*resource
)
304 const char *acl_name
;
305 struct route_node
*rn
;
306 struct rip_distance
*rdistance
;
308 if (event
!= NB_EV_APPLY
)
311 acl_name
= yang_dnode_get_string(dnode
, NULL
);
313 /* Set access-list */
314 rn
= nb_running_get_entry(dnode
, NULL
, true);
315 rdistance
= rn
->info
;
316 if (rdistance
->access_list
)
317 free(rdistance
->access_list
);
318 rdistance
->access_list
= strdup(acl_name
);
324 ripd_instance_distance_source_access_list_destroy(enum nb_event event
,
325 const struct lyd_node
*dnode
)
327 struct route_node
*rn
;
328 struct rip_distance
*rdistance
;
330 if (event
!= NB_EV_APPLY
)
333 /* Reset access-list configuration. */
334 rn
= nb_running_get_entry(dnode
, NULL
, true);
335 rdistance
= rn
->info
;
336 free(rdistance
->access_list
);
337 rdistance
->access_list
= NULL
;
343 * XPath: /frr-ripd:ripd/instance/explicit-neighbor
345 static int ripd_instance_explicit_neighbor_create(enum nb_event event
,
346 const struct lyd_node
*dnode
,
347 union nb_resource
*resource
)
350 struct prefix_ipv4 p
;
352 if (event
!= NB_EV_APPLY
)
355 rip
= nb_running_get_entry(dnode
, NULL
, true);
357 p
.prefixlen
= IPV4_MAX_BITLEN
;
358 yang_dnode_get_ipv4(&p
.prefix
, dnode
, NULL
);
360 return rip_neighbor_add(rip
, &p
);
363 static int ripd_instance_explicit_neighbor_destroy(enum nb_event event
,
364 const struct lyd_node
*dnode
)
367 struct prefix_ipv4 p
;
369 if (event
!= NB_EV_APPLY
)
372 rip
= nb_running_get_entry(dnode
, NULL
, true);
374 p
.prefixlen
= IPV4_MAX_BITLEN
;
375 yang_dnode_get_ipv4(&p
.prefix
, dnode
, NULL
);
377 return rip_neighbor_delete(rip
, &p
);
381 * XPath: /frr-ripd:ripd/instance/network
383 static int ripd_instance_network_create(enum nb_event event
,
384 const struct lyd_node
*dnode
,
385 union nb_resource
*resource
)
390 if (event
!= NB_EV_APPLY
)
393 rip
= nb_running_get_entry(dnode
, NULL
, true);
394 yang_dnode_get_ipv4p(&p
, dnode
, NULL
);
395 apply_mask_ipv4((struct prefix_ipv4
*)&p
);
397 return rip_enable_network_add(rip
, &p
);
400 static int ripd_instance_network_destroy(enum nb_event event
,
401 const struct lyd_node
*dnode
)
406 if (event
!= NB_EV_APPLY
)
409 rip
= nb_running_get_entry(dnode
, NULL
, true);
410 yang_dnode_get_ipv4p(&p
, dnode
, NULL
);
411 apply_mask_ipv4((struct prefix_ipv4
*)&p
);
413 return rip_enable_network_delete(rip
, &p
);
417 * XPath: /frr-ripd:ripd/instance/interface
419 static int ripd_instance_interface_create(enum nb_event event
,
420 const struct lyd_node
*dnode
,
421 union nb_resource
*resource
)
426 if (event
!= NB_EV_APPLY
)
429 rip
= nb_running_get_entry(dnode
, NULL
, true);
430 ifname
= yang_dnode_get_string(dnode
, NULL
);
432 return rip_enable_if_add(rip
, ifname
);
435 static int ripd_instance_interface_destroy(enum nb_event event
,
436 const struct lyd_node
*dnode
)
441 if (event
!= NB_EV_APPLY
)
444 rip
= nb_running_get_entry(dnode
, NULL
, true);
445 ifname
= yang_dnode_get_string(dnode
, NULL
);
447 return rip_enable_if_delete(rip
, ifname
);
451 * XPath: /frr-ripd:ripd/instance/offset-list
453 static int ripd_instance_offset_list_create(enum nb_event event
,
454 const struct lyd_node
*dnode
,
455 union nb_resource
*resource
)
459 struct rip_offset_list
*offset
;
461 if (event
!= NB_EV_APPLY
)
464 rip
= nb_running_get_entry(dnode
, NULL
, true);
465 ifname
= yang_dnode_get_string(dnode
, "./interface");
467 offset
= rip_offset_list_new(rip
, ifname
);
468 nb_running_set_entry(dnode
, offset
);
473 static int ripd_instance_offset_list_destroy(enum nb_event event
,
474 const struct lyd_node
*dnode
)
477 struct rip_offset_list
*offset
;
479 if (event
!= NB_EV_APPLY
)
482 direct
= yang_dnode_get_enum(dnode
, "./direction");
484 offset
= nb_running_unset_entry(dnode
);
485 if (offset
->direct
[direct
].alist_name
) {
486 free(offset
->direct
[direct
].alist_name
);
487 offset
->direct
[direct
].alist_name
= NULL
;
489 if (offset
->direct
[RIP_OFFSET_LIST_IN
].alist_name
== NULL
490 && offset
->direct
[RIP_OFFSET_LIST_OUT
].alist_name
== NULL
)
491 offset_list_del(offset
);
497 * XPath: /frr-ripd:ripd/instance/offset-list/access-list
500 ripd_instance_offset_list_access_list_modify(enum nb_event event
,
501 const struct lyd_node
*dnode
,
502 union nb_resource
*resource
)
505 struct rip_offset_list
*offset
;
506 const char *alist_name
;
508 if (event
!= NB_EV_APPLY
)
511 direct
= yang_dnode_get_enum(dnode
, "../direction");
512 alist_name
= yang_dnode_get_string(dnode
, NULL
);
514 offset
= nb_running_get_entry(dnode
, NULL
, true);
515 if (offset
->direct
[direct
].alist_name
)
516 free(offset
->direct
[direct
].alist_name
);
517 offset
->direct
[direct
].alist_name
= strdup(alist_name
);
523 * XPath: /frr-ripd:ripd/instance/offset-list/metric
525 static int ripd_instance_offset_list_metric_modify(enum nb_event event
,
526 const struct lyd_node
*dnode
,
527 union nb_resource
*resource
)
531 struct rip_offset_list
*offset
;
533 if (event
!= NB_EV_APPLY
)
536 direct
= yang_dnode_get_enum(dnode
, "../direction");
537 metric
= yang_dnode_get_uint8(dnode
, NULL
);
539 offset
= nb_running_get_entry(dnode
, NULL
, true);
540 offset
->direct
[direct
].metric
= metric
;
546 * XPath: /frr-ripd:ripd/instance/passive-default
548 static int ripd_instance_passive_default_modify(enum nb_event event
,
549 const struct lyd_node
*dnode
,
550 union nb_resource
*resource
)
554 if (event
!= NB_EV_APPLY
)
557 rip
= nb_running_get_entry(dnode
, NULL
, true);
558 rip
->passive_default
= yang_dnode_get_bool(dnode
, NULL
);
559 rip_passive_nondefault_clean(rip
);
565 * XPath: /frr-ripd:ripd/instance/passive-interface
567 static int ripd_instance_passive_interface_create(enum nb_event event
,
568 const struct lyd_node
*dnode
,
569 union nb_resource
*resource
)
574 if (event
!= NB_EV_APPLY
)
577 rip
= nb_running_get_entry(dnode
, NULL
, true);
578 ifname
= yang_dnode_get_string(dnode
, NULL
);
580 return rip_passive_nondefault_set(rip
, ifname
);
583 static int ripd_instance_passive_interface_destroy(enum nb_event event
,
584 const struct lyd_node
*dnode
)
589 if (event
!= NB_EV_APPLY
)
592 rip
= nb_running_get_entry(dnode
, NULL
, true);
593 ifname
= yang_dnode_get_string(dnode
, NULL
);
595 return rip_passive_nondefault_unset(rip
, ifname
);
599 * XPath: /frr-ripd:ripd/instance/non-passive-interface
602 ripd_instance_non_passive_interface_create(enum nb_event event
,
603 const struct lyd_node
*dnode
,
604 union nb_resource
*resource
)
609 if (event
!= NB_EV_APPLY
)
612 rip
= nb_running_get_entry(dnode
, NULL
, true);
613 ifname
= yang_dnode_get_string(dnode
, NULL
);
615 return rip_passive_nondefault_unset(rip
, ifname
);
619 ripd_instance_non_passive_interface_destroy(enum nb_event event
,
620 const struct lyd_node
*dnode
)
625 if (event
!= NB_EV_APPLY
)
628 rip
= nb_running_get_entry(dnode
, NULL
, true);
629 ifname
= yang_dnode_get_string(dnode
, NULL
);
631 return rip_passive_nondefault_set(rip
, ifname
);
635 * XPath: /frr-ripd:ripd/instance/redistribute
637 static int ripd_instance_redistribute_create(enum nb_event event
,
638 const struct lyd_node
*dnode
,
639 union nb_resource
*resource
)
644 if (event
!= NB_EV_APPLY
)
647 rip
= nb_running_get_entry(dnode
, NULL
, true);
648 type
= yang_dnode_get_enum(dnode
, "./protocol");
650 rip
->redist
[type
].enabled
= true;
655 static int ripd_instance_redistribute_destroy(enum nb_event event
,
656 const struct lyd_node
*dnode
)
661 if (event
!= NB_EV_APPLY
)
664 rip
= nb_running_get_entry(dnode
, NULL
, true);
665 type
= yang_dnode_get_enum(dnode
, "./protocol");
667 rip
->redist
[type
].enabled
= false;
668 if (rip
->redist
[type
].route_map
.name
) {
669 free(rip
->redist
[type
].route_map
.name
);
670 rip
->redist
[type
].route_map
.name
= NULL
;
671 rip
->redist
[type
].route_map
.map
= NULL
;
673 rip
->redist
[type
].metric_config
= false;
674 rip
->redist
[type
].metric
= 0;
677 rip_redistribute_conf_delete(rip
, type
);
683 ripd_instance_redistribute_apply_finish(const struct lyd_node
*dnode
)
688 rip
= nb_running_get_entry(dnode
, NULL
, true);
689 type
= yang_dnode_get_enum(dnode
, "./protocol");
692 rip_redistribute_conf_update(rip
, type
);
696 * XPath: /frr-ripd:ripd/instance/redistribute/route-map
699 ripd_instance_redistribute_route_map_modify(enum nb_event event
,
700 const struct lyd_node
*dnode
,
701 union nb_resource
*resource
)
705 const char *rmap_name
;
707 if (event
!= NB_EV_APPLY
)
710 rip
= nb_running_get_entry(dnode
, NULL
, true);
711 type
= yang_dnode_get_enum(dnode
, "../protocol");
712 rmap_name
= yang_dnode_get_string(dnode
, NULL
);
714 if (rip
->redist
[type
].route_map
.name
)
715 free(rip
->redist
[type
].route_map
.name
);
716 rip
->redist
[type
].route_map
.name
= strdup(rmap_name
);
717 rip
->redist
[type
].route_map
.map
= route_map_lookup_by_name(rmap_name
);
723 ripd_instance_redistribute_route_map_destroy(enum nb_event event
,
724 const struct lyd_node
*dnode
)
729 if (event
!= NB_EV_APPLY
)
732 rip
= nb_running_get_entry(dnode
, NULL
, true);
733 type
= yang_dnode_get_enum(dnode
, "../protocol");
735 free(rip
->redist
[type
].route_map
.name
);
736 rip
->redist
[type
].route_map
.name
= NULL
;
737 rip
->redist
[type
].route_map
.map
= NULL
;
743 * XPath: /frr-ripd:ripd/instance/redistribute/metric
746 ripd_instance_redistribute_metric_modify(enum nb_event event
,
747 const struct lyd_node
*dnode
,
748 union nb_resource
*resource
)
754 if (event
!= NB_EV_APPLY
)
757 rip
= nb_running_get_entry(dnode
, NULL
, true);
758 type
= yang_dnode_get_enum(dnode
, "../protocol");
759 metric
= yang_dnode_get_uint8(dnode
, NULL
);
761 rip
->redist
[type
].metric_config
= true;
762 rip
->redist
[type
].metric
= metric
;
768 ripd_instance_redistribute_metric_destroy(enum nb_event event
,
769 const struct lyd_node
*dnode
)
774 if (event
!= NB_EV_APPLY
)
777 rip
= nb_running_get_entry(dnode
, NULL
, true);
778 type
= yang_dnode_get_enum(dnode
, "../protocol");
780 rip
->redist
[type
].metric_config
= false;
781 rip
->redist
[type
].metric
= 0;
787 * XPath: /frr-ripd:ripd/instance/static-route
789 static int ripd_instance_static_route_create(enum nb_event event
,
790 const struct lyd_node
*dnode
,
791 union nb_resource
*resource
)
795 struct prefix_ipv4 p
;
797 if (event
!= NB_EV_APPLY
)
800 rip
= nb_running_get_entry(dnode
, NULL
, true);
801 yang_dnode_get_ipv4p(&p
, dnode
, NULL
);
804 memset(&nh
, 0, sizeof(nh
));
805 nh
.type
= NEXTHOP_TYPE_IPV4
;
806 rip_redistribute_add(rip
, ZEBRA_ROUTE_RIP
, RIP_ROUTE_STATIC
, &p
, &nh
, 0,
812 static int ripd_instance_static_route_destroy(enum nb_event event
,
813 const struct lyd_node
*dnode
)
816 struct prefix_ipv4 p
;
818 if (event
!= NB_EV_APPLY
)
821 rip
= nb_running_get_entry(dnode
, NULL
, true);
822 yang_dnode_get_ipv4p(&p
, dnode
, NULL
);
825 rip_redistribute_delete(rip
, ZEBRA_ROUTE_RIP
, RIP_ROUTE_STATIC
, &p
, 0);
831 * XPath: /frr-ripd:ripd/instance/timers/
833 static void ripd_instance_timers_apply_finish(const struct lyd_node
*dnode
)
837 rip
= nb_running_get_entry(dnode
, NULL
, true);
839 /* Reset update timer thread. */
840 rip_event(rip
, RIP_UPDATE_EVENT
, 0);
844 * XPath: /frr-ripd:ripd/instance/timers/flush-interval
847 ripd_instance_timers_flush_interval_modify(enum nb_event event
,
848 const struct lyd_node
*dnode
,
849 union nb_resource
*resource
)
853 if (event
!= NB_EV_APPLY
)
856 rip
= nb_running_get_entry(dnode
, NULL
, true);
857 rip
->garbage_time
= yang_dnode_get_uint32(dnode
, NULL
);
863 * XPath: /frr-ripd:ripd/instance/timers/holddown-interval
866 ripd_instance_timers_holddown_interval_modify(enum nb_event event
,
867 const struct lyd_node
*dnode
,
868 union nb_resource
*resource
)
872 if (event
!= NB_EV_APPLY
)
875 rip
= nb_running_get_entry(dnode
, NULL
, true);
876 rip
->timeout_time
= yang_dnode_get_uint32(dnode
, NULL
);
882 * XPath: /frr-ripd:ripd/instance/timers/update-interval
885 ripd_instance_timers_update_interval_modify(enum nb_event event
,
886 const struct lyd_node
*dnode
,
887 union nb_resource
*resource
)
891 if (event
!= NB_EV_APPLY
)
894 rip
= nb_running_get_entry(dnode
, NULL
, true);
895 rip
->update_time
= yang_dnode_get_uint32(dnode
, NULL
);
901 * XPath: /frr-ripd:ripd/instance/version/receive
903 static int ripd_instance_version_receive_modify(enum nb_event event
,
904 const struct lyd_node
*dnode
,
905 union nb_resource
*resource
)
909 if (event
!= NB_EV_APPLY
)
912 rip
= nb_running_get_entry(dnode
, NULL
, true);
913 rip
->version_recv
= yang_dnode_get_enum(dnode
, NULL
);
919 * XPath: /frr-ripd:ripd/instance/version/send
921 static int ripd_instance_version_send_modify(enum nb_event event
,
922 const struct lyd_node
*dnode
,
923 union nb_resource
*resource
)
927 if (event
!= NB_EV_APPLY
)
930 rip
= nb_running_get_entry(dnode
, NULL
, true);
931 rip
->version_send
= yang_dnode_get_enum(dnode
, NULL
);
937 * XPath: /frr-interface:lib/interface/frr-ripd:rip/split-horizon
939 static int lib_interface_rip_split_horizon_modify(enum nb_event event
,
940 const struct lyd_node
*dnode
,
941 union nb_resource
*resource
)
943 struct interface
*ifp
;
944 struct rip_interface
*ri
;
946 if (event
!= NB_EV_APPLY
)
949 ifp
= nb_running_get_entry(dnode
, NULL
, true);
951 ri
->split_horizon
= yang_dnode_get_enum(dnode
, NULL
);
957 * XPath: /frr-interface:lib/interface/frr-ripd:rip/v2-broadcast
959 static int lib_interface_rip_v2_broadcast_modify(enum nb_event event
,
960 const struct lyd_node
*dnode
,
961 union nb_resource
*resource
)
963 struct interface
*ifp
;
964 struct rip_interface
*ri
;
966 if (event
!= NB_EV_APPLY
)
969 ifp
= nb_running_get_entry(dnode
, NULL
, true);
971 ri
->v2_broadcast
= yang_dnode_get_bool(dnode
, NULL
);
977 * XPath: /frr-interface:lib/interface/frr-ripd:rip/version-receive
980 lib_interface_rip_version_receive_modify(enum nb_event event
,
981 const struct lyd_node
*dnode
,
982 union nb_resource
*resource
)
984 struct interface
*ifp
;
985 struct rip_interface
*ri
;
987 if (event
!= NB_EV_APPLY
)
990 ifp
= nb_running_get_entry(dnode
, NULL
, true);
992 ri
->ri_receive
= yang_dnode_get_enum(dnode
, NULL
);
998 * XPath: /frr-interface:lib/interface/frr-ripd:rip/version-send
1000 static int lib_interface_rip_version_send_modify(enum nb_event event
,
1001 const struct lyd_node
*dnode
,
1002 union nb_resource
*resource
)
1004 struct interface
*ifp
;
1005 struct rip_interface
*ri
;
1007 if (event
!= NB_EV_APPLY
)
1010 ifp
= nb_running_get_entry(dnode
, NULL
, true);
1012 ri
->ri_send
= yang_dnode_get_enum(dnode
, NULL
);
1018 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/mode
1020 static int lib_interface_rip_authentication_scheme_mode_modify(
1021 enum nb_event event
, const struct lyd_node
*dnode
,
1022 union nb_resource
*resource
)
1024 struct interface
*ifp
;
1025 struct rip_interface
*ri
;
1027 if (event
!= NB_EV_APPLY
)
1030 ifp
= nb_running_get_entry(dnode
, NULL
, true);
1032 ri
->auth_type
= yang_dnode_get_enum(dnode
, NULL
);
1039 * /frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/md5-auth-length
1041 static int lib_interface_rip_authentication_scheme_md5_auth_length_modify(
1042 enum nb_event event
, const struct lyd_node
*dnode
,
1043 union nb_resource
*resource
)
1045 struct interface
*ifp
;
1046 struct rip_interface
*ri
;
1048 if (event
!= NB_EV_APPLY
)
1051 ifp
= nb_running_get_entry(dnode
, NULL
, true);
1053 ri
->md5_auth_len
= yang_dnode_get_enum(dnode
, NULL
);
1058 static int lib_interface_rip_authentication_scheme_md5_auth_length_destroy(
1059 enum nb_event event
, const struct lyd_node
*dnode
)
1061 struct interface
*ifp
;
1062 struct rip_interface
*ri
;
1064 if (event
!= NB_EV_APPLY
)
1067 ifp
= nb_running_get_entry(dnode
, NULL
, true);
1069 ri
->md5_auth_len
= yang_get_default_enum(
1070 "%s/authentication-scheme/md5-auth-length", RIP_IFACE
);
1076 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-password
1079 lib_interface_rip_authentication_password_modify(enum nb_event event
,
1080 const struct lyd_node
*dnode
,
1081 union nb_resource
*resource
)
1083 struct interface
*ifp
;
1084 struct rip_interface
*ri
;
1086 if (event
!= NB_EV_APPLY
)
1089 ifp
= nb_running_get_entry(dnode
, NULL
, true);
1091 XFREE(MTYPE_RIP_INTERFACE_STRING
, ri
->auth_str
);
1092 ri
->auth_str
= XSTRDUP(MTYPE_RIP_INTERFACE_STRING
,
1093 yang_dnode_get_string(dnode
, NULL
));
1099 lib_interface_rip_authentication_password_destroy(enum nb_event event
,
1100 const struct lyd_node
*dnode
)
1102 struct interface
*ifp
;
1103 struct rip_interface
*ri
;
1105 if (event
!= NB_EV_APPLY
)
1108 ifp
= nb_running_get_entry(dnode
, NULL
, true);
1110 XFREE(MTYPE_RIP_INTERFACE_STRING
, ri
->auth_str
);
1116 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-key-chain
1119 lib_interface_rip_authentication_key_chain_modify(enum nb_event event
,
1120 const struct lyd_node
*dnode
,
1121 union nb_resource
*resource
)
1123 struct interface
*ifp
;
1124 struct rip_interface
*ri
;
1126 if (event
!= NB_EV_APPLY
)
1129 ifp
= nb_running_get_entry(dnode
, NULL
, true);
1131 XFREE(MTYPE_RIP_INTERFACE_STRING
, ri
->key_chain
);
1132 ri
->key_chain
= XSTRDUP(MTYPE_RIP_INTERFACE_STRING
,
1133 yang_dnode_get_string(dnode
, NULL
));
1139 lib_interface_rip_authentication_key_chain_destroy(enum nb_event event
,
1140 const struct lyd_node
*dnode
)
1142 struct interface
*ifp
;
1143 struct rip_interface
*ri
;
1145 if (event
!= NB_EV_APPLY
)
1148 ifp
= nb_running_get_entry(dnode
, NULL
, true);
1150 XFREE(MTYPE_RIP_INTERFACE_STRING
, ri
->key_chain
);
1156 * XPath: /frr-ripd:ripd/instance/state/neighbors/neighbor
1159 ripd_instance_state_neighbors_neighbor_get_next(const void *parent_list_entry
,
1160 const void *list_entry
)
1162 const struct rip
*rip
= parent_list_entry
;
1163 struct listnode
*node
;
1165 if (list_entry
== NULL
)
1166 node
= listhead(rip
->peer_list
);
1168 node
= listnextnode((struct listnode
*)list_entry
);
1174 ripd_instance_state_neighbors_neighbor_get_keys(const void *list_entry
,
1175 struct yang_list_keys
*keys
)
1177 const struct listnode
*node
= list_entry
;
1178 const struct rip_peer
*peer
= listgetdata(node
);
1181 (void)inet_ntop(AF_INET
, &peer
->addr
, keys
->key
[0],
1182 sizeof(keys
->key
[0]));
1187 static const void *ripd_instance_state_neighbors_neighbor_lookup_entry(
1188 const void *parent_list_entry
, const struct yang_list_keys
*keys
)
1190 const struct rip
*rip
= parent_list_entry
;
1191 struct in_addr address
;
1192 struct rip_peer
*peer
;
1193 struct listnode
*node
;
1195 yang_str2ipv4(keys
->key
[0], &address
);
1197 for (ALL_LIST_ELEMENTS_RO(rip
->peer_list
, node
, peer
)) {
1198 if (IPV4_ADDR_SAME(&peer
->addr
, &address
))
1206 * XPath: /frr-ripd:ripd/instance/state/neighbors/neighbor/address
1208 static struct yang_data
*
1209 ripd_instance_state_neighbors_neighbor_address_get_elem(const char *xpath
,
1210 const void *list_entry
)
1212 const struct listnode
*node
= list_entry
;
1213 const struct rip_peer
*peer
= listgetdata(node
);
1215 return yang_data_new_ipv4(xpath
, &peer
->addr
);
1219 * XPath: /frr-ripd:ripd/instance/state/neighbors/neighbor/last-update
1221 static struct yang_data
*
1222 ripd_instance_state_neighbors_neighbor_last_update_get_elem(
1223 const char *xpath
, const void *list_entry
)
1225 /* TODO: yang:date-and-time is tricky */
1230 * XPath: /frr-ripd:ripd/instance/state/neighbors/neighbor/bad-packets-rcvd
1232 static struct yang_data
*
1233 ripd_instance_state_neighbors_neighbor_bad_packets_rcvd_get_elem(
1234 const char *xpath
, const void *list_entry
)
1236 const struct listnode
*node
= list_entry
;
1237 const struct rip_peer
*peer
= listgetdata(node
);
1239 return yang_data_new_uint32(xpath
, peer
->recv_badpackets
);
1243 * XPath: /frr-ripd:ripd/instance/state/neighbors/neighbor/bad-routes-rcvd
1245 static struct yang_data
*
1246 ripd_instance_state_neighbors_neighbor_bad_routes_rcvd_get_elem(
1247 const char *xpath
, const void *list_entry
)
1249 const struct listnode
*node
= list_entry
;
1250 const struct rip_peer
*peer
= listgetdata(node
);
1252 return yang_data_new_uint32(xpath
, peer
->recv_badroutes
);
1256 * XPath: /frr-ripd:ripd/instance/state/routes/route
1259 ripd_instance_state_routes_route_get_next(const void *parent_list_entry
,
1260 const void *list_entry
)
1262 const struct rip
*rip
= parent_list_entry
;
1263 struct route_node
*rn
;
1265 if (list_entry
== NULL
)
1266 rn
= route_top(rip
->table
);
1268 rn
= route_next((struct route_node
*)list_entry
);
1269 while (rn
&& rn
->info
== NULL
)
1270 rn
= route_next(rn
);
1276 ripd_instance_state_routes_route_get_keys(const void *list_entry
,
1277 struct yang_list_keys
*keys
)
1279 const struct route_node
*rn
= list_entry
;
1282 (void)prefix2str(&rn
->p
, keys
->key
[0], sizeof(keys
->key
[0]));
1288 ripd_instance_state_routes_route_lookup_entry(const void *parent_list_entry
,
1289 const struct yang_list_keys
*keys
)
1291 const struct rip
*rip
= parent_list_entry
;
1292 struct prefix prefix
;
1293 struct route_node
*rn
;
1295 yang_str2ipv4p(keys
->key
[0], &prefix
);
1297 rn
= route_node_lookup(rip
->table
, &prefix
);
1298 if (!rn
|| !rn
->info
)
1301 route_unlock_node(rn
);
1307 * XPath: /frr-ripd:ripd/instance/state/routes/route/prefix
1309 static struct yang_data
*
1310 ripd_instance_state_routes_route_prefix_get_elem(const char *xpath
,
1311 const void *list_entry
)
1313 const struct route_node
*rn
= list_entry
;
1314 const struct rip_info
*rinfo
= listnode_head(rn
->info
);
1316 return yang_data_new_ipv4p(xpath
, &rinfo
->rp
->p
);
1320 * XPath: /frr-ripd:ripd/instance/state/routes/route/next-hop
1322 static struct yang_data
*
1323 ripd_instance_state_routes_route_next_hop_get_elem(const char *xpath
,
1324 const void *list_entry
)
1326 const struct route_node
*rn
= list_entry
;
1327 const struct rip_info
*rinfo
= listnode_head(rn
->info
);
1329 switch (rinfo
->nh
.type
) {
1330 case NEXTHOP_TYPE_IPV4
:
1331 case NEXTHOP_TYPE_IPV4_IFINDEX
:
1332 return yang_data_new_ipv4(xpath
, &rinfo
->nh
.gate
.ipv4
);
1339 * XPath: /frr-ripd:ripd/instance/state/routes/route/interface
1341 static struct yang_data
*
1342 ripd_instance_state_routes_route_interface_get_elem(const char *xpath
,
1343 const void *list_entry
)
1345 const struct route_node
*rn
= list_entry
;
1346 const struct rip_info
*rinfo
= listnode_head(rn
->info
);
1347 const struct rip
*rip
= rip_info_get_instance(rinfo
);
1349 switch (rinfo
->nh
.type
) {
1350 case NEXTHOP_TYPE_IFINDEX
:
1351 case NEXTHOP_TYPE_IPV4_IFINDEX
:
1352 return yang_data_new_string(
1354 ifindex2ifname(rinfo
->nh
.ifindex
, rip
->vrf
->vrf_id
));
1361 * XPath: /frr-ripd:ripd/instance/state/routes/route/metric
1363 static struct yang_data
*
1364 ripd_instance_state_routes_route_metric_get_elem(const char *xpath
,
1365 const void *list_entry
)
1367 const struct route_node
*rn
= list_entry
;
1368 const struct rip_info
*rinfo
= listnode_head(rn
->info
);
1370 return yang_data_new_uint8(xpath
, rinfo
->metric
);
1374 * XPath: /frr-ripd:clear-rip-route
1376 static void clear_rip_route(struct rip
*rip
)
1378 struct route_node
*rp
;
1380 if (IS_RIP_DEBUG_EVENT
)
1381 zlog_debug("Clearing all RIP routes (VRF %s)", rip
->vrf_name
);
1383 /* Clear received RIP routes */
1384 for (rp
= route_top(rip
->table
); rp
; rp
= route_next(rp
)) {
1386 struct listnode
*listnode
;
1387 struct rip_info
*rinfo
;
1393 for (ALL_LIST_ELEMENTS_RO(list
, listnode
, rinfo
)) {
1394 if (!rip_route_rte(rinfo
))
1397 if (CHECK_FLAG(rinfo
->flags
, RIP_RTF_FIB
))
1398 rip_zebra_ipv4_delete(rip
, rp
);
1403 RIP_TIMER_OFF(rinfo
->t_timeout
);
1404 RIP_TIMER_OFF(rinfo
->t_garbage_collect
);
1405 listnode_delete(list
, rinfo
);
1406 rip_info_free(rinfo
);
1409 if (list_isempty(list
)) {
1412 route_unlock_node(rp
);
1417 static int clear_rip_route_rpc(const char *xpath
, const struct list
*input
,
1418 struct list
*output
)
1421 struct yang_data
*yang_vrf
;
1423 yang_vrf
= yang_data_list_find(input
, "%s/%s", xpath
, "input/vrf");
1425 rip
= rip_lookup_by_vrf_name(yang_vrf
->value
);
1427 clear_rip_route(rip
);
1431 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
1436 clear_rip_route(rip
);
1444 * XPath: /frr-ripd:authentication-type-failure
1446 void ripd_notif_send_auth_type_failure(const char *ifname
)
1448 const char *xpath
= "/frr-ripd:authentication-type-failure";
1449 struct list
*arguments
;
1450 char xpath_arg
[XPATH_MAXLEN
];
1451 struct yang_data
*data
;
1453 arguments
= yang_data_list_new();
1455 snprintf(xpath_arg
, sizeof(xpath_arg
), "%s/interface-name", xpath
);
1456 data
= yang_data_new_string(xpath_arg
, ifname
);
1457 listnode_add(arguments
, data
);
1459 nb_notification_send(xpath
, arguments
);
1463 * XPath: /frr-ripd:authentication-failure
1465 void ripd_notif_send_auth_failure(const char *ifname
)
1467 const char *xpath
= "/frr-ripd:authentication-failure";
1468 struct list
*arguments
;
1469 char xpath_arg
[XPATH_MAXLEN
];
1470 struct yang_data
*data
;
1472 arguments
= yang_data_list_new();
1474 snprintf(xpath_arg
, sizeof(xpath_arg
), "%s/interface-name", xpath
);
1475 data
= yang_data_new_string(xpath_arg
, ifname
);
1476 listnode_add(arguments
, data
);
1478 nb_notification_send(xpath
, arguments
);
1481 /* clang-format off */
1482 const struct frr_yang_module_info frr_ripd_info
= {
1486 .xpath
= "/frr-ripd:ripd/instance",
1488 .cli_show
= cli_show_router_rip
,
1489 .create
= ripd_instance_create
,
1490 .destroy
= ripd_instance_destroy
,
1491 .get_keys
= ripd_instance_get_keys
,
1492 .get_next
= ripd_instance_get_next
,
1493 .lookup_entry
= ripd_instance_lookup_entry
,
1497 .xpath
= "/frr-ripd:ripd/instance/allow-ecmp",
1499 .cli_show
= cli_show_rip_allow_ecmp
,
1500 .modify
= ripd_instance_allow_ecmp_modify
,
1504 .xpath
= "/frr-ripd:ripd/instance/default-information-originate",
1506 .cli_show
= cli_show_rip_default_information_originate
,
1507 .modify
= ripd_instance_default_information_originate_modify
,
1511 .xpath
= "/frr-ripd:ripd/instance/default-metric",
1513 .cli_show
= cli_show_rip_default_metric
,
1514 .modify
= ripd_instance_default_metric_modify
,
1518 .xpath
= "/frr-ripd:ripd/instance/distance/default",
1520 .cli_show
= cli_show_rip_distance
,
1521 .modify
= ripd_instance_distance_default_modify
,
1525 .xpath
= "/frr-ripd:ripd/instance/distance/source",
1527 .cli_show
= cli_show_rip_distance_source
,
1528 .create
= ripd_instance_distance_source_create
,
1529 .destroy
= ripd_instance_distance_source_destroy
,
1533 .xpath
= "/frr-ripd:ripd/instance/distance/source/distance",
1535 .modify
= ripd_instance_distance_source_distance_modify
,
1539 .xpath
= "/frr-ripd:ripd/instance/distance/source/access-list",
1541 .destroy
= ripd_instance_distance_source_access_list_destroy
,
1542 .modify
= ripd_instance_distance_source_access_list_modify
,
1546 .xpath
= "/frr-ripd:ripd/instance/explicit-neighbor",
1548 .cli_show
= cli_show_rip_neighbor
,
1549 .create
= ripd_instance_explicit_neighbor_create
,
1550 .destroy
= ripd_instance_explicit_neighbor_destroy
,
1554 .xpath
= "/frr-ripd:ripd/instance/network",
1556 .cli_show
= cli_show_rip_network_prefix
,
1557 .create
= ripd_instance_network_create
,
1558 .destroy
= ripd_instance_network_destroy
,
1562 .xpath
= "/frr-ripd:ripd/instance/interface",
1564 .cli_show
= cli_show_rip_network_interface
,
1565 .create
= ripd_instance_interface_create
,
1566 .destroy
= ripd_instance_interface_destroy
,
1570 .xpath
= "/frr-ripd:ripd/instance/offset-list",
1572 .cli_show
= cli_show_rip_offset_list
,
1573 .create
= ripd_instance_offset_list_create
,
1574 .destroy
= ripd_instance_offset_list_destroy
,
1578 .xpath
= "/frr-ripd:ripd/instance/offset-list/access-list",
1580 .modify
= ripd_instance_offset_list_access_list_modify
,
1584 .xpath
= "/frr-ripd:ripd/instance/offset-list/metric",
1586 .modify
= ripd_instance_offset_list_metric_modify
,
1590 .xpath
= "/frr-ripd:ripd/instance/passive-default",
1592 .cli_show
= cli_show_rip_passive_default
,
1593 .modify
= ripd_instance_passive_default_modify
,
1597 .xpath
= "/frr-ripd:ripd/instance/passive-interface",
1599 .cli_show
= cli_show_rip_passive_interface
,
1600 .create
= ripd_instance_passive_interface_create
,
1601 .destroy
= ripd_instance_passive_interface_destroy
,
1605 .xpath
= "/frr-ripd:ripd/instance/non-passive-interface",
1607 .cli_show
= cli_show_rip_non_passive_interface
,
1608 .create
= ripd_instance_non_passive_interface_create
,
1609 .destroy
= ripd_instance_non_passive_interface_destroy
,
1613 .xpath
= "/frr-ripd:ripd/instance/redistribute",
1615 .apply_finish
= ripd_instance_redistribute_apply_finish
,
1616 .cli_show
= cli_show_rip_redistribute
,
1617 .create
= ripd_instance_redistribute_create
,
1618 .destroy
= ripd_instance_redistribute_destroy
,
1622 .xpath
= "/frr-ripd:ripd/instance/redistribute/route-map",
1624 .destroy
= ripd_instance_redistribute_route_map_destroy
,
1625 .modify
= ripd_instance_redistribute_route_map_modify
,
1629 .xpath
= "/frr-ripd:ripd/instance/redistribute/metric",
1631 .destroy
= ripd_instance_redistribute_metric_destroy
,
1632 .modify
= ripd_instance_redistribute_metric_modify
,
1636 .xpath
= "/frr-ripd:ripd/instance/static-route",
1638 .cli_show
= cli_show_rip_route
,
1639 .create
= ripd_instance_static_route_create
,
1640 .destroy
= ripd_instance_static_route_destroy
,
1644 .xpath
= "/frr-ripd:ripd/instance/timers",
1646 .apply_finish
= ripd_instance_timers_apply_finish
,
1647 .cli_show
= cli_show_rip_timers
,
1651 .xpath
= "/frr-ripd:ripd/instance/timers/flush-interval",
1653 .modify
= ripd_instance_timers_flush_interval_modify
,
1657 .xpath
= "/frr-ripd:ripd/instance/timers/holddown-interval",
1659 .modify
= ripd_instance_timers_holddown_interval_modify
,
1663 .xpath
= "/frr-ripd:ripd/instance/timers/update-interval",
1665 .modify
= ripd_instance_timers_update_interval_modify
,
1669 .xpath
= "/frr-ripd:ripd/instance/version",
1671 .cli_show
= cli_show_rip_version
,
1675 .xpath
= "/frr-ripd:ripd/instance/version/receive",
1677 .modify
= ripd_instance_version_receive_modify
,
1681 .xpath
= "/frr-ripd:ripd/instance/version/send",
1683 .modify
= ripd_instance_version_send_modify
,
1687 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/split-horizon",
1689 .cli_show
= cli_show_ip_rip_split_horizon
,
1690 .modify
= lib_interface_rip_split_horizon_modify
,
1694 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/v2-broadcast",
1696 .cli_show
= cli_show_ip_rip_v2_broadcast
,
1697 .modify
= lib_interface_rip_v2_broadcast_modify
,
1701 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/version-receive",
1703 .cli_show
= cli_show_ip_rip_receive_version
,
1704 .modify
= lib_interface_rip_version_receive_modify
,
1708 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/version-send",
1710 .cli_show
= cli_show_ip_rip_send_version
,
1711 .modify
= lib_interface_rip_version_send_modify
,
1715 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/authentication-scheme",
1717 .cli_show
= cli_show_ip_rip_authentication_scheme
,
1721 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/mode",
1723 .modify
= lib_interface_rip_authentication_scheme_mode_modify
,
1727 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/md5-auth-length",
1729 .destroy
= lib_interface_rip_authentication_scheme_md5_auth_length_destroy
,
1730 .modify
= lib_interface_rip_authentication_scheme_md5_auth_length_modify
,
1734 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/authentication-password",
1736 .cli_show
= cli_show_ip_rip_authentication_string
,
1737 .destroy
= lib_interface_rip_authentication_password_destroy
,
1738 .modify
= lib_interface_rip_authentication_password_modify
,
1742 .xpath
= "/frr-interface:lib/interface/frr-ripd:rip/authentication-key-chain",
1744 .cli_show
= cli_show_ip_rip_authentication_key_chain
,
1745 .destroy
= lib_interface_rip_authentication_key_chain_destroy
,
1746 .modify
= lib_interface_rip_authentication_key_chain_modify
,
1750 .xpath
= "/frr-ripd:ripd/instance/state/neighbors/neighbor",
1752 .get_keys
= ripd_instance_state_neighbors_neighbor_get_keys
,
1753 .get_next
= ripd_instance_state_neighbors_neighbor_get_next
,
1754 .lookup_entry
= ripd_instance_state_neighbors_neighbor_lookup_entry
,
1758 .xpath
= "/frr-ripd:ripd/instance/state/neighbors/neighbor/address",
1760 .get_elem
= ripd_instance_state_neighbors_neighbor_address_get_elem
,
1764 .xpath
= "/frr-ripd:ripd/instance/state/neighbors/neighbor/last-update",
1766 .get_elem
= ripd_instance_state_neighbors_neighbor_last_update_get_elem
,
1770 .xpath
= "/frr-ripd:ripd/instance/state/neighbors/neighbor/bad-packets-rcvd",
1772 .get_elem
= ripd_instance_state_neighbors_neighbor_bad_packets_rcvd_get_elem
,
1776 .xpath
= "/frr-ripd:ripd/instance/state/neighbors/neighbor/bad-routes-rcvd",
1778 .get_elem
= ripd_instance_state_neighbors_neighbor_bad_routes_rcvd_get_elem
,
1782 .xpath
= "/frr-ripd:ripd/instance/state/routes/route",
1784 .get_keys
= ripd_instance_state_routes_route_get_keys
,
1785 .get_next
= ripd_instance_state_routes_route_get_next
,
1786 .lookup_entry
= ripd_instance_state_routes_route_lookup_entry
,
1790 .xpath
= "/frr-ripd:ripd/instance/state/routes/route/prefix",
1792 .get_elem
= ripd_instance_state_routes_route_prefix_get_elem
,
1796 .xpath
= "/frr-ripd:ripd/instance/state/routes/route/next-hop",
1798 .get_elem
= ripd_instance_state_routes_route_next_hop_get_elem
,
1802 .xpath
= "/frr-ripd:ripd/instance/state/routes/route/interface",
1804 .get_elem
= ripd_instance_state_routes_route_interface_get_elem
,
1808 .xpath
= "/frr-ripd:ripd/instance/state/routes/route/metric",
1810 .get_elem
= ripd_instance_state_routes_route_metric_get_elem
,
1814 .xpath
= "/frr-ripd:clear-rip-route",
1816 .rpc
= clear_rip_route_rpc
,