]> git.proxmox.com Git - mirror_frr.git/blob - ripd/rip_northbound.c
ripd: retrofit the 'distance source' commands to the new northbound model
[mirror_frr.git] / ripd / rip_northbound.c
1 /*
2 * Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
3 * Copyright (C) 2018 NetDEF, Inc.
4 * Renato Westphal
5 *
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)
9 * any later version.
10 *
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
14 * more details.
15 *
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
19 */
20
21 #include <zebra.h>
22
23 #include "if.h"
24 #include "vrf.h"
25 #include "log.h"
26 #include "prefix.h"
27 #include "table.h"
28 #include "command.h"
29 #include "northbound.h"
30 #include "libfrr.h"
31
32 #include "ripd/ripd.h"
33 #include "ripd/rip_cli.h"
34
35 /*
36 * XPath: /frr-ripd:ripd/instance
37 */
38 static int ripd_instance_create(enum nb_event event,
39 const struct lyd_node *dnode,
40 union nb_resource *resource)
41 {
42 int socket;
43
44 switch (event) {
45 case NB_EV_VALIDATE:
46 break;
47 case NB_EV_PREPARE:
48 socket = rip_create_socket();
49 if (socket < 0)
50 return NB_ERR_RESOURCE;
51 resource->fd = socket;
52 break;
53 case NB_EV_ABORT:
54 socket = resource->fd;
55 close(socket);
56 break;
57 case NB_EV_APPLY:
58 socket = resource->fd;
59 rip_create(socket);
60 break;
61 }
62
63 return NB_OK;
64 }
65
66 static int ripd_instance_delete(enum nb_event event,
67 const struct lyd_node *dnode)
68 {
69 if (event != NB_EV_APPLY)
70 return NB_OK;
71
72 rip_clean();
73
74 return NB_OK;
75 }
76
77 /*
78 * XPath: /frr-ripd:ripd/instance/allow-ecmp
79 */
80 static int ripd_instance_allow_ecmp_modify(enum nb_event event,
81 const struct lyd_node *dnode,
82 union nb_resource *resource)
83 {
84 if (event != NB_EV_APPLY)
85 return NB_OK;
86
87 rip->ecmp = yang_dnode_get_bool(dnode, NULL);
88 if (!rip->ecmp)
89 rip_ecmp_disable();
90
91 return NB_OK;
92 }
93
94 /*
95 * XPath: /frr-ripd:ripd/instance/default-information-originate
96 */
97 static int
98 ripd_instance_default_information_originate_modify(enum nb_event event,
99 const struct lyd_node *dnode,
100 union nb_resource *resource)
101 {
102 bool default_information;
103 struct prefix_ipv4 p;
104
105 if (event != NB_EV_APPLY)
106 return NB_OK;
107
108 default_information = yang_dnode_get_bool(dnode, NULL);
109
110 memset(&p, 0, sizeof(struct prefix_ipv4));
111 p.family = AF_INET;
112 if (default_information) {
113 struct nexthop nh;
114
115 memset(&nh, 0, sizeof(nh));
116 nh.type = NEXTHOP_TYPE_IPV4;
117 rip_redistribute_add(ZEBRA_ROUTE_RIP, RIP_ROUTE_DEFAULT, &p,
118 &nh, 0, 0, 0);
119 } else {
120 rip_redistribute_delete(ZEBRA_ROUTE_RIP, RIP_ROUTE_DEFAULT, &p,
121 0);
122 }
123
124 return NB_OK;
125 }
126
127 /*
128 * XPath: /frr-ripd:ripd/instance/default-metric
129 */
130 static int ripd_instance_default_metric_modify(enum nb_event event,
131 const struct lyd_node *dnode,
132 union nb_resource *resource)
133 {
134 if (event != NB_EV_APPLY)
135 return NB_OK;
136
137 rip->default_metric = yang_dnode_get_uint8(dnode, NULL);
138 /* rip_update_default_metric (); */
139
140 return NB_OK;
141 }
142
143 /*
144 * XPath: /frr-ripd:ripd/instance/distance/default
145 */
146 static int ripd_instance_distance_default_modify(enum nb_event event,
147 const struct lyd_node *dnode,
148 union nb_resource *resource)
149 {
150 if (event != NB_EV_APPLY)
151 return NB_OK;
152
153 rip->distance = yang_dnode_get_uint8(dnode, NULL);
154
155 return NB_OK;
156 }
157
158 /*
159 * XPath: /frr-ripd:ripd/instance/distance/source
160 */
161 static int ripd_instance_distance_source_create(enum nb_event event,
162 const struct lyd_node *dnode,
163 union nb_resource *resource)
164 {
165 struct prefix_ipv4 prefix;
166 struct route_node *rn;
167
168 if (event != NB_EV_APPLY)
169 return NB_OK;
170
171 yang_dnode_get_ipv4p(&prefix, dnode, "./prefix");
172
173 /* Get RIP distance node. */
174 rn = route_node_get(rip_distance_table, (struct prefix *)&prefix);
175 rn->info = rip_distance_new();
176 yang_dnode_set_entry(dnode, rn);
177
178 return NB_OK;
179 }
180
181 static int ripd_instance_distance_source_delete(enum nb_event event,
182 const struct lyd_node *dnode)
183 {
184 struct route_node *rn;
185 struct rip_distance *rdistance;
186
187 if (event != NB_EV_APPLY)
188 return NB_OK;
189
190 rn = yang_dnode_get_entry(dnode);
191 rdistance = rn->info;
192 if (rdistance->access_list)
193 free(rdistance->access_list);
194 rip_distance_free(rdistance);
195
196 rn->info = NULL;
197 route_unlock_node(rn);
198
199 return NB_OK;
200 }
201
202 /*
203 * XPath: /frr-ripd:ripd/instance/distance/source/distance
204 */
205 static int
206 ripd_instance_distance_source_distance_modify(enum nb_event event,
207 const struct lyd_node *dnode,
208 union nb_resource *resource)
209 {
210 struct route_node *rn;
211 uint8_t distance;
212 struct rip_distance *rdistance;
213
214 if (event != NB_EV_APPLY)
215 return NB_OK;
216
217 /* Set distance value. */
218 rn = yang_dnode_get_entry(dnode);
219 distance = yang_dnode_get_uint8(dnode, NULL);
220 rdistance = rn->info;
221 rdistance->distance = distance;
222
223 return NB_OK;
224 }
225
226 /*
227 * XPath: /frr-ripd:ripd/instance/distance/source/access-list
228 */
229 static int
230 ripd_instance_distance_source_access_list_modify(enum nb_event event,
231 const struct lyd_node *dnode,
232 union nb_resource *resource)
233 {
234 const char *acl_name;
235 struct route_node *rn;
236 struct rip_distance *rdistance;
237
238 if (event != NB_EV_APPLY)
239 return NB_OK;
240
241 acl_name = yang_dnode_get_string(dnode, NULL);
242
243 /* Set access-list */
244 rn = yang_dnode_get_entry(dnode);
245 rdistance = rn->info;
246 if (rdistance->access_list)
247 free(rdistance->access_list);
248 rdistance->access_list = strdup(acl_name);
249
250 return NB_OK;
251 }
252
253 static int
254 ripd_instance_distance_source_access_list_delete(enum nb_event event,
255 const struct lyd_node *dnode)
256 {
257 struct route_node *rn;
258 struct rip_distance *rdistance;
259
260 if (event != NB_EV_APPLY)
261 return NB_OK;
262
263 /* Reset access-list configuration. */
264 rn = yang_dnode_get_entry(dnode);
265 rdistance = rn->info;
266 free(rdistance->access_list);
267 rdistance->access_list = NULL;
268
269 return NB_OK;
270 }
271
272 /*
273 * XPath: /frr-ripd:ripd/instance/explicit-neighbor
274 */
275 static int ripd_instance_explicit_neighbor_create(enum nb_event event,
276 const struct lyd_node *dnode,
277 union nb_resource *resource)
278 {
279 /* TODO: implement me. */
280 return NB_OK;
281 }
282
283 static int ripd_instance_explicit_neighbor_delete(enum nb_event event,
284 const struct lyd_node *dnode)
285 {
286 /* TODO: implement me. */
287 return NB_OK;
288 }
289
290 /*
291 * XPath: /frr-ripd:ripd/instance/network
292 */
293 static int ripd_instance_network_create(enum nb_event event,
294 const struct lyd_node *dnode,
295 union nb_resource *resource)
296 {
297 /* TODO: implement me. */
298 return NB_OK;
299 }
300
301 static int ripd_instance_network_delete(enum nb_event event,
302 const struct lyd_node *dnode)
303 {
304 /* TODO: implement me. */
305 return NB_OK;
306 }
307
308 /*
309 * XPath: /frr-ripd:ripd/instance/interface
310 */
311 static int ripd_instance_interface_create(enum nb_event event,
312 const struct lyd_node *dnode,
313 union nb_resource *resource)
314 {
315 /* TODO: implement me. */
316 return NB_OK;
317 }
318
319 static int ripd_instance_interface_delete(enum nb_event event,
320 const struct lyd_node *dnode)
321 {
322 /* TODO: implement me. */
323 return NB_OK;
324 }
325
326 /*
327 * XPath: /frr-ripd:ripd/instance/offset-list
328 */
329 static int ripd_instance_offset_list_create(enum nb_event event,
330 const struct lyd_node *dnode,
331 union nb_resource *resource)
332 {
333 /* TODO: implement me. */
334 return NB_OK;
335 }
336
337 static int ripd_instance_offset_list_delete(enum nb_event event,
338 const struct lyd_node *dnode)
339 {
340 /* TODO: implement me. */
341 return NB_OK;
342 }
343
344 /*
345 * XPath: /frr-ripd:ripd/instance/offset-list/access-list
346 */
347 static int
348 ripd_instance_offset_list_access_list_modify(enum nb_event event,
349 const struct lyd_node *dnode,
350 union nb_resource *resource)
351 {
352 /* TODO: implement me. */
353 return NB_OK;
354 }
355
356 /*
357 * XPath: /frr-ripd:ripd/instance/offset-list/metric
358 */
359 static int ripd_instance_offset_list_metric_modify(enum nb_event event,
360 const struct lyd_node *dnode,
361 union nb_resource *resource)
362 {
363 /* TODO: implement me. */
364 return NB_OK;
365 }
366
367 /*
368 * XPath: /frr-ripd:ripd/instance/passive-default
369 */
370 static int ripd_instance_passive_default_modify(enum nb_event event,
371 const struct lyd_node *dnode,
372 union nb_resource *resource)
373 {
374 /* TODO: implement me. */
375 return NB_OK;
376 }
377
378 /*
379 * XPath: /frr-ripd:ripd/instance/passive-interface
380 */
381 static int ripd_instance_passive_interface_create(enum nb_event event,
382 const struct lyd_node *dnode,
383 union nb_resource *resource)
384 {
385 /* TODO: implement me. */
386 return NB_OK;
387 }
388
389 static int ripd_instance_passive_interface_delete(enum nb_event event,
390 const struct lyd_node *dnode)
391 {
392 /* TODO: implement me. */
393 return NB_OK;
394 }
395
396 /*
397 * XPath: /frr-ripd:ripd/instance/non-passive-interface
398 */
399 static int
400 ripd_instance_non_passive_interface_create(enum nb_event event,
401 const struct lyd_node *dnode,
402 union nb_resource *resource)
403 {
404 /* TODO: implement me. */
405 return NB_OK;
406 }
407
408 static int
409 ripd_instance_non_passive_interface_delete(enum nb_event event,
410 const struct lyd_node *dnode)
411 {
412 /* TODO: implement me. */
413 return NB_OK;
414 }
415
416 /*
417 * XPath: /frr-ripd:ripd/instance/redistribute
418 */
419 static int ripd_instance_redistribute_create(enum nb_event event,
420 const struct lyd_node *dnode,
421 union nb_resource *resource)
422 {
423 /* TODO: implement me. */
424 return NB_OK;
425 }
426
427 static int ripd_instance_redistribute_delete(enum nb_event event,
428 const struct lyd_node *dnode)
429 {
430 /* TODO: implement me. */
431 return NB_OK;
432 }
433
434 /*
435 * XPath: /frr-ripd:ripd/instance/redistribute/route-map
436 */
437 static int
438 ripd_instance_redistribute_route_map_modify(enum nb_event event,
439 const struct lyd_node *dnode,
440 union nb_resource *resource)
441 {
442 /* TODO: implement me. */
443 return NB_OK;
444 }
445
446 static int
447 ripd_instance_redistribute_route_map_delete(enum nb_event event,
448 const struct lyd_node *dnode)
449 {
450 /* TODO: implement me. */
451 return NB_OK;
452 }
453
454 /*
455 * XPath: /frr-ripd:ripd/instance/redistribute/metric
456 */
457 static int
458 ripd_instance_redistribute_metric_modify(enum nb_event event,
459 const struct lyd_node *dnode,
460 union nb_resource *resource)
461 {
462 /* TODO: implement me. */
463 return NB_OK;
464 }
465
466 static int
467 ripd_instance_redistribute_metric_delete(enum nb_event event,
468 const struct lyd_node *dnode)
469 {
470 /* TODO: implement me. */
471 return NB_OK;
472 }
473
474 /*
475 * XPath: /frr-ripd:ripd/instance/static-route
476 */
477 static int ripd_instance_static_route_create(enum nb_event event,
478 const struct lyd_node *dnode,
479 union nb_resource *resource)
480 {
481 /* TODO: implement me. */
482 return NB_OK;
483 }
484
485 static int ripd_instance_static_route_delete(enum nb_event event,
486 const struct lyd_node *dnode)
487 {
488 /* TODO: implement me. */
489 return NB_OK;
490 }
491
492 /*
493 * XPath: /frr-ripd:ripd/instance/timers/flush-interval
494 */
495 static int
496 ripd_instance_timers_flush_interval_modify(enum nb_event event,
497 const struct lyd_node *dnode,
498 union nb_resource *resource)
499 {
500 /* TODO: implement me. */
501 return NB_OK;
502 }
503
504 /*
505 * XPath: /frr-ripd:ripd/instance/timers/holddown-interval
506 */
507 static int
508 ripd_instance_timers_holddown_interval_modify(enum nb_event event,
509 const struct lyd_node *dnode,
510 union nb_resource *resource)
511 {
512 /* TODO: implement me. */
513 return NB_OK;
514 }
515
516 /*
517 * XPath: /frr-ripd:ripd/instance/timers/update-interval
518 */
519 static int
520 ripd_instance_timers_update_interval_modify(enum nb_event event,
521 const struct lyd_node *dnode,
522 union nb_resource *resource)
523 {
524 /* TODO: implement me. */
525 return NB_OK;
526 }
527
528 /*
529 * XPath: /frr-ripd:ripd/instance/version/receive
530 */
531 static int ripd_instance_version_receive_modify(enum nb_event event,
532 const struct lyd_node *dnode,
533 union nb_resource *resource)
534 {
535 /* TODO: implement me. */
536 return NB_OK;
537 }
538
539 /*
540 * XPath: /frr-ripd:ripd/instance/version/send
541 */
542 static int ripd_instance_version_send_modify(enum nb_event event,
543 const struct lyd_node *dnode,
544 union nb_resource *resource)
545 {
546 /* TODO: implement me. */
547 return NB_OK;
548 }
549
550 /*
551 * XPath: /frr-interface:lib/interface/frr-ripd:rip/split-horizon
552 */
553 static int lib_interface_rip_split_horizon_modify(enum nb_event event,
554 const struct lyd_node *dnode,
555 union nb_resource *resource)
556 {
557 /* TODO: implement me. */
558 return NB_OK;
559 }
560
561 /*
562 * XPath: /frr-interface:lib/interface/frr-ripd:rip/v2-broadcast
563 */
564 static int lib_interface_rip_v2_broadcast_modify(enum nb_event event,
565 const struct lyd_node *dnode,
566 union nb_resource *resource)
567 {
568 /* TODO: implement me. */
569 return NB_OK;
570 }
571
572 /*
573 * XPath: /frr-interface:lib/interface/frr-ripd:rip/version-receive
574 */
575 static int
576 lib_interface_rip_version_receive_modify(enum nb_event event,
577 const struct lyd_node *dnode,
578 union nb_resource *resource)
579 {
580 /* TODO: implement me. */
581 return NB_OK;
582 }
583
584 /*
585 * XPath: /frr-interface:lib/interface/frr-ripd:rip/version-send
586 */
587 static int lib_interface_rip_version_send_modify(enum nb_event event,
588 const struct lyd_node *dnode,
589 union nb_resource *resource)
590 {
591 /* TODO: implement me. */
592 return NB_OK;
593 }
594
595 /*
596 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/mode
597 */
598 static int lib_interface_rip_authentication_scheme_mode_modify(
599 enum nb_event event, const struct lyd_node *dnode,
600 union nb_resource *resource)
601 {
602 /* TODO: implement me. */
603 return NB_OK;
604 }
605
606 /*
607 * XPath:
608 * /frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/md5-auth-length
609 */
610 static int lib_interface_rip_authentication_scheme_md5_auth_length_modify(
611 enum nb_event event, const struct lyd_node *dnode,
612 union nb_resource *resource)
613 {
614 /* TODO: implement me. */
615 return NB_OK;
616 }
617
618 static int lib_interface_rip_authentication_scheme_md5_auth_length_delete(
619 enum nb_event event, const struct lyd_node *dnode)
620 {
621 /* TODO: implement me. */
622 return NB_OK;
623 }
624
625 /*
626 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-password
627 */
628 static int
629 lib_interface_rip_authentication_password_modify(enum nb_event event,
630 const struct lyd_node *dnode,
631 union nb_resource *resource)
632 {
633 /* TODO: implement me. */
634 return NB_OK;
635 }
636
637 static int
638 lib_interface_rip_authentication_password_delete(enum nb_event event,
639 const struct lyd_node *dnode)
640 {
641 /* TODO: implement me. */
642 return NB_OK;
643 }
644
645 /*
646 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-key-chain
647 */
648 static int
649 lib_interface_rip_authentication_key_chain_modify(enum nb_event event,
650 const struct lyd_node *dnode,
651 union nb_resource *resource)
652 {
653 /* TODO: implement me. */
654 return NB_OK;
655 }
656
657 static int
658 lib_interface_rip_authentication_key_chain_delete(enum nb_event event,
659 const struct lyd_node *dnode)
660 {
661 /* TODO: implement me. */
662 return NB_OK;
663 }
664
665 /*
666 * XPath: /frr-ripd:ripd/state/neighbors/neighbor
667 */
668 static const void *
669 ripd_state_neighbors_neighbor_get_next(const char *xpath,
670 const void *list_entry)
671 {
672 /* TODO: implement me. */
673 return NULL;
674 }
675
676 static int ripd_state_neighbors_neighbor_get_keys(const void *list_entry,
677 struct yang_list_keys *keys)
678 {
679 /* TODO: implement me. */
680 return NB_OK;
681 }
682
683 static const void *
684 ripd_state_neighbors_neighbor_lookup_entry(const struct yang_list_keys *keys)
685 {
686 /* TODO: implement me. */
687 return NULL;
688 }
689
690 /*
691 * XPath: /frr-ripd:ripd/state/neighbors/neighbor/address
692 */
693 static struct yang_data *
694 ripd_state_neighbors_neighbor_address_get_elem(const char *xpath,
695 const void *list_entry)
696 {
697 /* TODO: implement me. */
698 return NULL;
699 }
700
701 /*
702 * XPath: /frr-ripd:ripd/state/neighbors/neighbor/last-update
703 */
704 static struct yang_data *
705 ripd_state_neighbors_neighbor_last_update_get_elem(const char *xpath,
706 const void *list_entry)
707 {
708 /* TODO: implement me. */
709 return NULL;
710 }
711
712 /*
713 * XPath: /frr-ripd:ripd/state/neighbors/neighbor/bad-packets-rcvd
714 */
715 static struct yang_data *
716 ripd_state_neighbors_neighbor_bad_packets_rcvd_get_elem(const char *xpath,
717 const void *list_entry)
718 {
719 /* TODO: implement me. */
720 return NULL;
721 }
722
723 /*
724 * XPath: /frr-ripd:ripd/state/neighbors/neighbor/bad-routes-rcvd
725 */
726 static struct yang_data *
727 ripd_state_neighbors_neighbor_bad_routes_rcvd_get_elem(const char *xpath,
728 const void *list_entry)
729 {
730 /* TODO: implement me. */
731 return NULL;
732 }
733
734 /*
735 * XPath: /frr-ripd:ripd/state/routes/route
736 */
737 static const void *ripd_state_routes_route_get_next(const char *xpath,
738 const void *list_entry)
739 {
740 /* TODO: implement me. */
741 return NULL;
742 }
743
744 static int ripd_state_routes_route_get_keys(const void *list_entry,
745 struct yang_list_keys *keys)
746 {
747 /* TODO: implement me. */
748 return NB_OK;
749 }
750
751 static const void *
752 ripd_state_routes_route_lookup_entry(const struct yang_list_keys *keys)
753 {
754 /* TODO: implement me. */
755 return NULL;
756 }
757
758 /*
759 * XPath: /frr-ripd:ripd/state/routes/route/prefix
760 */
761 static struct yang_data *
762 ripd_state_routes_route_prefix_get_elem(const char *xpath,
763 const void *list_entry)
764 {
765 /* TODO: implement me. */
766 return NULL;
767 }
768
769 /*
770 * XPath: /frr-ripd:ripd/state/routes/route/next-hop
771 */
772 static struct yang_data *
773 ripd_state_routes_route_next_hop_get_elem(const char *xpath,
774 const void *list_entry)
775 {
776 /* TODO: implement me. */
777 return NULL;
778 }
779
780 /*
781 * XPath: /frr-ripd:ripd/state/routes/route/interface
782 */
783 static struct yang_data *
784 ripd_state_routes_route_interface_get_elem(const char *xpath,
785 const void *list_entry)
786 {
787 /* TODO: implement me. */
788 return NULL;
789 }
790
791 /*
792 * XPath: /frr-ripd:ripd/state/routes/route/metric
793 */
794 static struct yang_data *
795 ripd_state_routes_route_metric_get_elem(const char *xpath,
796 const void *list_entry)
797 {
798 /* TODO: implement me. */
799 return NULL;
800 }
801
802 /*
803 * XPath: /frr-ripd:clear-rip-route
804 */
805 static int clear_rip_route_rpc(const char *xpath, const struct list *input,
806 struct list *output)
807 {
808 /* TODO: implement me. */
809 return NB_OK;
810 }
811
812 /* clang-format off */
813 const struct frr_yang_module_info frr_ripd_info = {
814 .name = "frr-ripd",
815 .nodes = {
816 {
817 .xpath = "/frr-ripd:ripd/instance",
818 .cbs.create = ripd_instance_create,
819 .cbs.delete = ripd_instance_delete,
820 .cbs.cli_show = cli_show_router_rip,
821 },
822 {
823 .xpath = "/frr-ripd:ripd/instance/allow-ecmp",
824 .cbs.modify = ripd_instance_allow_ecmp_modify,
825 .cbs.cli_show = cli_show_rip_allow_ecmp,
826 },
827 {
828 .xpath = "/frr-ripd:ripd/instance/default-information-originate",
829 .cbs.modify = ripd_instance_default_information_originate_modify,
830 .cbs.cli_show = cli_show_rip_default_information_originate,
831 },
832 {
833 .xpath = "/frr-ripd:ripd/instance/default-metric",
834 .cbs.modify = ripd_instance_default_metric_modify,
835 .cbs.cli_show = cli_show_rip_default_metric,
836 },
837 {
838 .xpath = "/frr-ripd:ripd/instance/distance/default",
839 .cbs.modify = ripd_instance_distance_default_modify,
840 .cbs.cli_show = cli_show_rip_distance,
841 },
842 {
843 .xpath = "/frr-ripd:ripd/instance/distance/source",
844 .cbs.create = ripd_instance_distance_source_create,
845 .cbs.delete = ripd_instance_distance_source_delete,
846 .cbs.cli_show = cli_show_rip_distance_source,
847 },
848 {
849 .xpath = "/frr-ripd:ripd/instance/distance/source/distance",
850 .cbs.modify = ripd_instance_distance_source_distance_modify,
851 },
852 {
853 .xpath = "/frr-ripd:ripd/instance/distance/source/access-list",
854 .cbs.modify = ripd_instance_distance_source_access_list_modify,
855 .cbs.delete = ripd_instance_distance_source_access_list_delete,
856 },
857 {
858 .xpath = "/frr-ripd:ripd/instance/explicit-neighbor",
859 .cbs.create = ripd_instance_explicit_neighbor_create,
860 .cbs.delete = ripd_instance_explicit_neighbor_delete,
861 },
862 {
863 .xpath = "/frr-ripd:ripd/instance/network",
864 .cbs.create = ripd_instance_network_create,
865 .cbs.delete = ripd_instance_network_delete,
866 },
867 {
868 .xpath = "/frr-ripd:ripd/instance/interface",
869 .cbs.create = ripd_instance_interface_create,
870 .cbs.delete = ripd_instance_interface_delete,
871 },
872 {
873 .xpath = "/frr-ripd:ripd/instance/offset-list",
874 .cbs.create = ripd_instance_offset_list_create,
875 .cbs.delete = ripd_instance_offset_list_delete,
876 },
877 {
878 .xpath = "/frr-ripd:ripd/instance/offset-list/access-list",
879 .cbs.modify = ripd_instance_offset_list_access_list_modify,
880 },
881 {
882 .xpath = "/frr-ripd:ripd/instance/offset-list/metric",
883 .cbs.modify = ripd_instance_offset_list_metric_modify,
884 },
885 {
886 .xpath = "/frr-ripd:ripd/instance/passive-default",
887 .cbs.modify = ripd_instance_passive_default_modify,
888 },
889 {
890 .xpath = "/frr-ripd:ripd/instance/passive-interface",
891 .cbs.create = ripd_instance_passive_interface_create,
892 .cbs.delete = ripd_instance_passive_interface_delete,
893 },
894 {
895 .xpath = "/frr-ripd:ripd/instance/non-passive-interface",
896 .cbs.create = ripd_instance_non_passive_interface_create,
897 .cbs.delete = ripd_instance_non_passive_interface_delete,
898 },
899 {
900 .xpath = "/frr-ripd:ripd/instance/redistribute",
901 .cbs.create = ripd_instance_redistribute_create,
902 .cbs.delete = ripd_instance_redistribute_delete,
903 },
904 {
905 .xpath = "/frr-ripd:ripd/instance/redistribute/route-map",
906 .cbs.modify = ripd_instance_redistribute_route_map_modify,
907 .cbs.delete = ripd_instance_redistribute_route_map_delete,
908 },
909 {
910 .xpath = "/frr-ripd:ripd/instance/redistribute/metric",
911 .cbs.modify = ripd_instance_redistribute_metric_modify,
912 .cbs.delete = ripd_instance_redistribute_metric_delete,
913 },
914 {
915 .xpath = "/frr-ripd:ripd/instance/static-route",
916 .cbs.create = ripd_instance_static_route_create,
917 .cbs.delete = ripd_instance_static_route_delete,
918 },
919 {
920 .xpath = "/frr-ripd:ripd/instance/timers/flush-interval",
921 .cbs.modify = ripd_instance_timers_flush_interval_modify,
922 },
923 {
924 .xpath = "/frr-ripd:ripd/instance/timers/holddown-interval",
925 .cbs.modify = ripd_instance_timers_holddown_interval_modify,
926 },
927 {
928 .xpath = "/frr-ripd:ripd/instance/timers/update-interval",
929 .cbs.modify = ripd_instance_timers_update_interval_modify,
930 },
931 {
932 .xpath = "/frr-ripd:ripd/instance/version/receive",
933 .cbs.modify = ripd_instance_version_receive_modify,
934 },
935 {
936 .xpath = "/frr-ripd:ripd/instance/version/send",
937 .cbs.modify = ripd_instance_version_send_modify,
938 },
939 {
940 .xpath = "/frr-interface:lib/interface/frr-ripd:rip/split-horizon",
941 .cbs.modify = lib_interface_rip_split_horizon_modify,
942 },
943 {
944 .xpath = "/frr-interface:lib/interface/frr-ripd:rip/v2-broadcast",
945 .cbs.modify = lib_interface_rip_v2_broadcast_modify,
946 },
947 {
948 .xpath = "/frr-interface:lib/interface/frr-ripd:rip/version-receive",
949 .cbs.modify = lib_interface_rip_version_receive_modify,
950 },
951 {
952 .xpath = "/frr-interface:lib/interface/frr-ripd:rip/version-send",
953 .cbs.modify = lib_interface_rip_version_send_modify,
954 },
955 {
956 .xpath = "/frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/mode",
957 .cbs.modify = lib_interface_rip_authentication_scheme_mode_modify,
958 },
959 {
960 .xpath = "/frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/md5-auth-length",
961 .cbs.modify = lib_interface_rip_authentication_scheme_md5_auth_length_modify,
962 .cbs.delete = lib_interface_rip_authentication_scheme_md5_auth_length_delete,
963 },
964 {
965 .xpath = "/frr-interface:lib/interface/frr-ripd:rip/authentication-password",
966 .cbs.modify = lib_interface_rip_authentication_password_modify,
967 .cbs.delete = lib_interface_rip_authentication_password_delete,
968 },
969 {
970 .xpath = "/frr-interface:lib/interface/frr-ripd:rip/authentication-key-chain",
971 .cbs.modify = lib_interface_rip_authentication_key_chain_modify,
972 .cbs.delete = lib_interface_rip_authentication_key_chain_delete,
973 },
974 {
975 .xpath = "/frr-ripd:ripd/state/neighbors/neighbor",
976 .cbs.get_next = ripd_state_neighbors_neighbor_get_next,
977 .cbs.get_keys = ripd_state_neighbors_neighbor_get_keys,
978 .cbs.lookup_entry = ripd_state_neighbors_neighbor_lookup_entry,
979 },
980 {
981 .xpath = "/frr-ripd:ripd/state/neighbors/neighbor/address",
982 .cbs.get_elem = ripd_state_neighbors_neighbor_address_get_elem,
983 },
984 {
985 .xpath = "/frr-ripd:ripd/state/neighbors/neighbor/last-update",
986 .cbs.get_elem = ripd_state_neighbors_neighbor_last_update_get_elem,
987 },
988 {
989 .xpath = "/frr-ripd:ripd/state/neighbors/neighbor/bad-packets-rcvd",
990 .cbs.get_elem = ripd_state_neighbors_neighbor_bad_packets_rcvd_get_elem,
991 },
992 {
993 .xpath = "/frr-ripd:ripd/state/neighbors/neighbor/bad-routes-rcvd",
994 .cbs.get_elem = ripd_state_neighbors_neighbor_bad_routes_rcvd_get_elem,
995 },
996 {
997 .xpath = "/frr-ripd:ripd/state/routes/route",
998 .cbs.get_next = ripd_state_routes_route_get_next,
999 .cbs.get_keys = ripd_state_routes_route_get_keys,
1000 .cbs.lookup_entry = ripd_state_routes_route_lookup_entry,
1001 },
1002 {
1003 .xpath = "/frr-ripd:ripd/state/routes/route/prefix",
1004 .cbs.get_elem = ripd_state_routes_route_prefix_get_elem,
1005 },
1006 {
1007 .xpath = "/frr-ripd:ripd/state/routes/route/next-hop",
1008 .cbs.get_elem = ripd_state_routes_route_next_hop_get_elem,
1009 },
1010 {
1011 .xpath = "/frr-ripd:ripd/state/routes/route/interface",
1012 .cbs.get_elem = ripd_state_routes_route_interface_get_elem,
1013 },
1014 {
1015 .xpath = "/frr-ripd:ripd/state/routes/route/metric",
1016 .cbs.get_elem = ripd_state_routes_route_metric_get_elem,
1017 },
1018 {
1019 .xpath = "/frr-ripd:clear-rip-route",
1020 .cbs.rpc = clear_rip_route_rpc,
1021 },
1022 {
1023 .xpath = NULL,
1024 },
1025 }
1026 };