]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-zebra.yang
bgpd: Refactor subgroup_announce_table() to reuse an existing helpers
[mirror_frr.git] / yang / frr-zebra.yang
1 module frr-zebra {
2 yang-version 1.1;
3 namespace "http://frrouting.org/yang/zebra";
4 prefix frr-zebra;
5
6 import ietf-yang-types {
7 prefix yang;
8 }
9
10 import ietf-inet-types {
11 prefix inet;
12 }
13
14 import frr-affinity-map {
15 prefix frr-affinity-map;
16 }
17
18 import frr-route-map {
19 prefix frr-route-map;
20 }
21
22 import frr-route-types {
23 prefix frr-route-types;
24 }
25
26 import ietf-routing-types {
27 prefix rt-types;
28 }
29
30 import frr-nexthop {
31 prefix frr-nh;
32 }
33
34 import frr-routing {
35 prefix frr-rt;
36 }
37
38 import frr-interface {
39 prefix frr-interface;
40 }
41
42 import frr-vrf {
43 prefix frr-vrf;
44 }
45
46 organization
47 "FRRouting";
48 contact
49 "FRR Users List: <mailto:frog@lists.frrouting.org>
50 FRR Development List: <mailto:dev@lists.frrouting.org>";
51 description
52 "This module defines a model for managing the FRR zebra daemon.
53
54 Copyright 2020 FRRouting
55
56 Redistribution and use in source and binary forms, with or without
57 modification, are permitted provided that the following conditions
58 are met:
59
60 1. Redistributions of source code must retain the above copyright notice,
61 this list of conditions and the following disclaimer.
62
63 2. Redistributions in binary form must reproduce the above copyright
64 notice, this list of conditions and the following disclaimer in the
65 documentation and/or other materials provided with the distribution.
66
67 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
68 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
69 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
70 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
71 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
72 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
73 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
74 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
75 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
76 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
77 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
78
79 revision 2019-06-01 {
80 description
81 "Initial revision.";
82 }
83
84 typedef unix-timestamp {
85 type uint32;
86 units "seconds";
87 description
88 "An absolute time in seconds since the unix epoch.";
89 }
90
91 identity zebra-interface-type {
92 description
93 "zebra interface type.";
94 }
95
96 identity zif-other {
97 base zebra-interface-type;
98 description
99 "Zebra interface type other.";
100 }
101
102 identity zif-bridge {
103 base zebra-interface-type;
104 description
105 "Zebra interface type bridge.";
106 }
107
108 identity zif-vlan {
109 base zebra-interface-type;
110 description
111 "Zebra interface type vlan.";
112 }
113
114 identity zif-vxlan {
115 base zebra-interface-type;
116 description
117 "Zebra interface type vxlan.";
118 }
119
120 identity zif-vrf {
121 base zebra-interface-type;
122 description
123 "Zebra interface type vrf.";
124 }
125
126 identity zif-veth {
127 base zebra-interface-type;
128 description
129 "Zebra interface type veth.";
130 }
131
132 identity zif-bond {
133 base zebra-interface-type;
134 description
135 "Zebra interface type bond.";
136 }
137
138 identity zif-bond-slave {
139 base zebra-interface-type;
140 description
141 "Zebra interface type bond slave.";
142 }
143
144 identity zif-macvlan {
145 base zebra-interface-type;
146 description
147 "Zebra interface type macvlan.";
148 }
149
150 /*
151 * Multicast RPF mode configurable type
152 */
153
154 typedef mcast-rpf-lookup-mode {
155 type enumeration {
156 enum "none" {
157 value 0;
158 description
159 "No mode set.";
160 }
161 enum "mrib-only" {
162 value 1;
163 description
164 "Lookup in unicast RIB only.";
165 }
166 enum "urib-only" {
167 value 2;
168 description
169 "Lookup in multicast RIB only.";
170 }
171 enum "mrib-then-urib" {
172 value 3;
173 description
174 "Try multicast RIB first, fall back to unicast RIB.";
175 }
176 enum "lower-distance" {
177 value 4;
178 description
179 "Lookup both unicast and mcast, use entry with lower distance.";
180 }
181 enum "longer-prefix" {
182 value 5;
183 description
184 "Lookup both unicast and mcast, use entry with longer prefix.";
185 }
186 }
187 description
188 "Multicast RPF lookup behavior";
189 }
190
191 // End of ip6-route
192 /*
193 * VxLAN Network Identifier type
194 */
195
196 typedef vni-id-type {
197 type uint32 {
198 range "0..16777215";
199 }
200 description
201 "A VxLAN network identifier value.";
202 }
203
204 typedef vni-vtep-flood-type {
205 type enumeration {
206 enum "head-end-repl" {
207 value 0;
208 description
209 "Head-end replication.";
210 }
211 enum "disabled" {
212 value 1;
213 description
214 "Flooding disabled.";
215 }
216 enum "pim-sm" {
217 value 2;
218 description
219 "Multicast PIM-SM.";
220 }
221 }
222 }
223
224 /*
225 * Common route data, shared by v4 and v6 routes.
226 */
227
228 grouping route-common {
229 description
230 "Common information about a route.";
231
232 leaf distance {
233 type uint8;
234 description
235 "Admin distance based on routing protocol.";
236 }
237
238 leaf metric {
239 type uint32;
240 description
241 "Route metric value.";
242 }
243
244 leaf tag {
245 type uint32 {
246 range "1..4294967295";
247 }
248 description
249 "Route tag value.";
250 }
251
252 leaf selected {
253 type empty;
254 description
255 "Route is the selected or preferred route for the prefix.";
256 }
257
258 leaf installed {
259 type empty;
260 description
261 "Route is installed in the FIB.";
262 }
263
264 leaf failed {
265 type empty;
266 description
267 "Route installation in FIB has failed.";
268 }
269
270 leaf queued {
271 type empty;
272 description
273 "Route has a pending FIB operation that has not completed.";
274 }
275
276 leaf internal-flags {
277 type int32;
278 description
279 "Internal flags for the route.";
280 }
281
282 leaf internal-status {
283 type int32;
284 description
285 "Internal status for the route.";
286 }
287
288 leaf uptime {
289 type yang:date-and-time;
290 description
291 "Uptime for the route.";
292 }
293
294 uses frr-nh:frr-nexthop-group-operational;
295 }
296
297 // End of route-common
298 /*
299 * IPv4 Route object.
300 */
301
302 grouping ip4-route {
303 description
304 "An IPv4 route.";
305 leaf prefix {
306 type inet:ipv4-prefix;
307 description
308 "IP address (in the form A.B.C.D) and prefix length,
309 separated by the slash (/) character. The range of
310 values for the prefix-length is 0 to 32.";
311 }
312
313 leaf protocol {
314 type frr-route-types:frr-route-types-v4;
315 description
316 "The protocol owning the route.";
317 }
318
319 uses route-common;
320 }
321
322 // End of ip4-route
323 /*
324 * IPv6 Route object.
325 */
326
327 grouping ip6-route {
328 description
329 "An IPv6 route.";
330 leaf prefix {
331 type inet:ipv6-prefix;
332 description
333 "The route's IPv6 prefix.";
334 }
335
336 leaf protocol {
337 type frr-route-types:frr-route-types-v6;
338 description
339 "The protocol owning the route.";
340 }
341
342 uses route-common;
343 }
344 // End of ip6-route
345
346 /*
347 * Information about EVPN VNIs
348 */
349
350 grouping vni-information {
351 choice type-choice {
352 case l2 {
353 leaf is-layer2 {
354 type empty;
355 description
356 "Information about an L2 VNI.";
357 }
358
359 leaf vtep-count {
360 type uint32;
361 description
362 "Number of VTEPs.";
363 }
364 }
365
366 case l3 {
367 leaf is-layer3 {
368 type empty;
369 description
370 "Information about an L3 VNI.";
371 }
372 }
373 }
374
375 leaf vni-id {
376 type vni-id-type;
377 description
378 "The VNI identifier.";
379 }
380
381 leaf vxlan-ifname {
382 type frr-interface:interface-ref;
383 description
384 "The VxLAN interface name.";
385 }
386
387 leaf mac-count {
388 type uint32;
389 description
390 "Number of valid MACs.";
391 }
392
393 leaf neighbor-count {
394 type uint32;
395 description
396 "Number of neighbors.";
397 }
398
399 leaf vrf {
400 type frr-vrf:vrf-ref;
401 description
402 "The tenant VRF.";
403 }
404
405 leaf local-vtep-addr {
406 type inet:ipv4-address;
407 description
408 "The local VTEP IP address.";
409 }
410 }
411
412 /*
413 * Detailed EVPN VNI information for L2.
414 */
415
416 grouping vni-l2-detail {
417 leaf if-index {
418 type uint32;
419 description
420 "The VxLAN ifindex.";
421 }
422
423 leaf advertise-gw {
424 type empty;
425 description
426 "The gateway MAC-IP is being advertised.";
427 }
428
429 leaf mcast-group {
430 type rt-types:ipv4-multicast-group-address;
431 description
432 "The VNI multicast group for BUM traffic.";
433 }
434
435 list remote-vtep-list {
436 leaf remote-vtep {
437 type inet:ipv4-address;
438 description
439 "The remote VTEP IP address.";
440 }
441
442 leaf vtep-flood {
443 type vni-vtep-flood-type;
444 }
445 }
446 }
447
448 /*
449 * Detailed EVPN VNI information for L3.
450 */
451
452 grouping vni-l3-detail {
453 leaf svi-interface {
454 type frr-interface:interface-ref;
455 description
456 "The SVI interface.";
457 }
458
459 leaf is-up {
460 type empty;
461 description
462 "The state is active.";
463 }
464
465 leaf prefix-only {
466 type empty;
467 description
468 "Prefix routes only";
469 }
470
471 leaf router-mac {
472 type yang:mac-address;
473 description
474 "The VNI Router MAC address.";
475 }
476
477 list vni-list {
478 description
479 "A list of the associated L2 VNIs.";
480 leaf vni-id {
481 type vni-id-type;
482 description
483 "An L2 VNI identifier.";
484 }
485 }
486 }
487
488 /*
489 * Debug options
490 */
491
492 grouping zebra-debugs {
493 leaf debug-events {
494 type boolean;
495 description
496 "Debug ZAPI events.";
497 }
498
499 leaf debug-zapi-send {
500 type boolean;
501 description
502 "Debug ZAPI messages sent.";
503 }
504
505 leaf debug-zapi-recv {
506 type boolean;
507 description
508 "Debug ZAPI messages received.";
509 }
510
511 leaf debug-zapi-detail {
512 type boolean;
513 description
514 "Debug ZAPI details.";
515 }
516
517 leaf debug-kernel {
518 type boolean;
519 description
520 "Debug kernel events.";
521 }
522
523 leaf debug-kernel-msg-send {
524 type boolean;
525 description
526 "Debug kernel messages sent.";
527 }
528
529 leaf debug-kernel-msg-recv {
530 type boolean;
531 description
532 "Debug kernel messages received.";
533 }
534
535 leaf debug-rib {
536 type boolean;
537 description
538 "Debug RIB processing.";
539 }
540
541 leaf debug-rib-detail {
542 type boolean;
543 description
544 "Debug RIB processing details.";
545 }
546
547 leaf debug-fpm {
548 type boolean;
549 description
550 "Debug the FIB Push Interface subsystem.";
551 }
552
553 leaf debug-nht {
554 type boolean;
555 description
556 "Debug Nexthop-tracking.";
557 }
558
559 leaf debug-nht-detail {
560 type boolean;
561 description
562 "Debug Nexthop-tracking details.";
563 }
564
565 leaf debug-mpls {
566 type boolean;
567 description
568 "Debug MPLS.";
569 }
570
571 leaf debug-vxlan {
572 type boolean;
573 description
574 "Debug VxLAN.";
575 }
576
577 leaf debug-pw {
578 type boolean;
579 description
580 "Debug pseudowires.";
581 }
582
583 leaf debug-dplane {
584 type boolean;
585 description
586 "Debug the dataplane subsystem.";
587 }
588
589 leaf debug-dplane-detail {
590 type boolean;
591 description
592 "Debug dataplane subsystem details.";
593 }
594
595 leaf debug-mlag {
596 type boolean;
597 description
598 "Debug MLAG.";
599 }
600 }
601
602 grouping ribs {
603 container ribs {
604 config false;
605 description
606 "RIBs supported by FRR.";
607 list rib {
608 key "afi-safi-name table-id";
609 leaf afi-safi-name {
610 type identityref {
611 base frr-rt:afi-safi-type;
612 }
613 description
614 "AFI, SAFI name.";
615 }
616
617 leaf table-id {
618 type uint32;
619 description
620 "Routing Table id (default id - 254).";
621 }
622
623 list route {
624 key "prefix";
625 leaf prefix {
626 type inet:ip-prefix;
627 description
628 "The route's prefix.";
629 }
630
631 list route-entry {
632 key "protocol";
633 leaf protocol {
634 type frr-route-types:frr-route-types;
635 description
636 "The protocol owning the route.";
637 }
638
639 leaf instance {
640 type uint16;
641 must "../protocol = \"ospf\"";
642 description
643 "Retrieve routes from a specific OSPF instance.";
644 }
645
646 uses route-common;
647 }
648 }
649 }
650 }
651 }
652
653 grouping vrf-vni-mapping {
654 description
655 "EVPN L3-VNI mapping corresponding to a VRF.";
656 leaf l3vni-id {
657 type vni-id-type;
658 description
659 "EVPN L3-VNI id to map to the VRF.";
660 }
661
662 leaf prefix-only {
663 type boolean;
664 default "false";
665 description
666 "EVPN asymmetric mode advertise prefix routes only.";
667 }
668 }
669
670 // End of zebra container
671 /*
672 * RPCs
673 */
674
675 rpc get-route-information {
676 description
677 "Retrieve IPv4 or IPv6 unicast routes.";
678 input {
679 choice ip-type {
680 case v4 {
681 leaf ipv4 {
682 type empty;
683 mandatory true;
684 description
685 "Retrieve IPv4 routes.";
686 }
687
688 leaf prefix-v4 {
689 type inet:ipv4-prefix;
690 description
691 "Retrieve routes matching a specific prefix.";
692 }
693
694 leaf supernets-only {
695 type empty;
696 description
697 "Skip routes that are subnets of classful prefix sizes.";
698 }
699 }
700
701 case v6 {
702 leaf ipv6 {
703 type empty;
704 mandatory true;
705 description
706 "Retrieve IPv6 routes.";
707 }
708
709 leaf prefix-v6 {
710 type inet:ipv6-prefix;
711 description
712 "Retrieve routes matching a specific prefix.";
713 }
714 }
715 }
716
717 choice vrf-choice {
718 case single {
719 leaf vrf {
720 type frr-vrf:vrf-ref;
721 description
722 "Retrieve routes in a non-default vrf.";
723 }
724 }
725
726 case all {
727 leaf all-vrfs {
728 type empty;
729 description
730 "Retrieve routes from all vrfs.";
731 }
732 }
733 }
734
735 leaf fib-routes {
736 type empty;
737 description
738 "Retrieve FIB routes rather than RIB routes.";
739 }
740
741 leaf table-id {
742 type uint32 {
743 range "1..4294967295";
744 }
745 description
746 "Routing table id to retrieve.";
747 }
748
749 leaf protocol {
750 type frr-route-types:frr-route-types-v4;
751 description
752 "Retrieve routes from a specific protocol daemon.";
753 }
754
755 leaf ospf-instance {
756 type uint32 {
757 range "1..65535";
758 }
759 must "../protocol = \"ospf\"";
760 description
761 "Retrieve routes from a specific OSPF instance.";
762 }
763
764 choice detail {
765 case det {
766 leaf include-detail {
767 type empty;
768 description
769 "Include detailed information.";
770 }
771 }
772
773 case summ {
774 leaf summary {
775 type empty;
776 description
777 "Include summary information only.";
778 }
779 }
780 }
781 }
782 // End of input
783 output {
784 choice route-list {
785 case v4 {
786 container routes-v4 {
787 description
788 "IPv4 route information.";
789 list route {
790 uses ip4-route;
791 }
792 }
793 }
794
795 case v6 {
796 container routes-v6 {
797 description
798 "IPv6 route information.";
799 list route {
800 uses ip6-route;
801 }
802 }
803 }
804 }
805 }
806 // End of output
807 }
808
809 // End get-route-information
810
811 rpc get-v6-mroute-info {
812 description
813 "Retrieve IPv6 multicast routes.";
814 input {
815 choice vrf-choice {
816 case single {
817 leaf vrf {
818 type frr-vrf:vrf-ref;
819 description
820 "Retrieve routes in a non-default vrf.";
821 }
822 }
823
824 case all {
825 leaf all-vrfs {
826 type empty;
827 description
828 "Retrieve routes from all vrfs.";
829 }
830 }
831 }
832 }
833
834 output {
835 container routes {
836 description
837 "IPv6 mcast route information.";
838 list route {
839 uses ip6-route;
840 }
841 }
842 }
843 }
844
845 // End get-v6-mroute-info
846
847 rpc get-vrf-info {
848 description
849 "Retrieve VRF information; the default VRF is elided.";
850 // Note: no input clause.
851 output {
852 list vrf-list {
853 leaf name {
854 type frr-vrf:vrf-ref;
855 description
856 "The VRF name";
857 }
858
859 leaf is-user-config {
860 type empty;
861 description
862 "The VRF was configured by an admin.";
863 }
864
865 leaf vrf-id {
866 type uint32;
867 description
868 "The VRF id.";
869 }
870
871 choice vrf-type {
872 case inactive {
873 leaf is-inactive {
874 type empty;
875 description
876 "The VRF is inactive.";
877 }
878 }
879
880 case netns {
881 leaf netns-name {
882 type string;
883 description
884 "The net namespace name associated with the VRF.";
885 }
886 }
887
888 case table {
889 leaf table-id {
890 type uint32;
891 description
892 "The table-id associated with the VRF.";
893 }
894 }
895 }
896 }
897 }
898 }
899
900 // End get-vrf-info
901
902 rpc get-vrf-vni-info {
903 description
904 "Retrieve mappings between EVPN VNI and VRF.";
905 // Note: no input clause.
906 output {
907 list vrf-vni-list {
908 leaf vrf-name {
909 type frr-vrf:vrf-ref;
910 description
911 "The VRF name.";
912 }
913
914 leaf vni-id {
915 type vni-id-type;
916 description
917 "The EVPN VNI.";
918 }
919
920 leaf vxlan-if-name {
921 type frr-interface:interface-ref;
922 description
923 "The VxLAN interface name.";
924 }
925
926 leaf svi-if-name {
927 type frr-interface:interface-ref;
928 description
929 "The SVI interface name.";
930 }
931
932 leaf router-mac-addr {
933 type yang:mac-address;
934 description
935 "Router MAC address.";
936 }
937
938 leaf is-up {
939 type empty;
940 description
941 "The state is active.";
942 }
943 }
944 }
945 }
946
947 // End get-vrf-vni-info
948
949 rpc get-evpn-info {
950 description
951 "Retrieve global information about EVPN.";
952 // Note: No input clause.
953 output {
954 leaf l2vni-count {
955 type uint32;
956 description
957 "Number of L2 VNIs.";
958 }
959
960 leaf l3vni-count {
961 type uint32;
962 description
963 "Number of L3 VNIs.";
964 }
965
966 leaf advertise-gateway {
967 type empty;
968 description
969 "Advertise the gateway MAC-IP.";
970 }
971
972 leaf advertise-svi {
973 type empty;
974 description
975 "Advertise SVI MAC-IP.";
976 }
977
978 leaf dup-detect {
979 type empty;
980 description
981 "Duplicate address detection is enabled.";
982 }
983
984 leaf dad-max-moves {
985 type uint32;
986 description
987 "Maximum moves allowed before address is considered duplicate.";
988 }
989
990 leaf dad-timeout {
991 type uint32;
992 units "seconds";
993 description
994 "Duplicate address detection timeout.";
995 }
996
997 leaf dad-freeze {
998 type empty;
999 description
1000 "Duplicate address detection freeze enabled.";
1001 }
1002
1003 choice dad-freeze-choice {
1004 case freeze-permanent {
1005 leaf dad-freeze-perm {
1006 type empty;
1007 description
1008 "Duplicate address detection freeze is permanent.";
1009 }
1010 }
1011
1012 case freeze-time {
1013 leaf dad-freeze-time {
1014 type uint32;
1015 units "seconds";
1016 description
1017 "Duplicate address detection freeze timer.";
1018 }
1019 }
1020 }
1021 }
1022 }
1023
1024 // End get-evpn-info
1025
1026 rpc get-vni-info {
1027 // If no vni is specified, retrieve global list.
1028 input {
1029 choice vni-choice {
1030 default "all-vnis";
1031 case all-vnis {
1032 leaf all-vnis {
1033 type empty;
1034 description
1035 "Retrieve information about all VNIs.";
1036 }
1037 }
1038
1039 case single-vni {
1040 leaf vni-id {
1041 type vni-id-type;
1042 description
1043 "Retrieve information about a specific EVPN VNI.";
1044 }
1045 }
1046 }
1047
1048 leaf detailed-info {
1049 type empty;
1050 description
1051 "Retrieve detailed information.";
1052 }
1053 }
1054
1055 output {
1056 list vni-list {
1057 description
1058 "Information about EVPN VNI objects.";
1059 uses vni-information;
1060
1061 choice detail-choice {
1062 case l2 {
1063 description
1064 "Detailed L2 information.";
1065 uses vni-l2-detail;
1066 }
1067
1068 case l3 {
1069 description
1070 "Detailed L3 information.";
1071 uses vni-l3-detail;
1072 }
1073 }
1074 }
1075 }
1076 }
1077
1078 // End get-vni-info
1079
1080 rpc get-evpn-vni-rmac {
1081 description
1082 "Retrieve information about VxLAN VNI RMACs.";
1083 input {
1084 choice vni-choice {
1085 default "all-vnis";
1086 case all-vnis {
1087 leaf all-vnis {
1088 type empty;
1089 description
1090 "Retrieve information about all VNIs.";
1091 }
1092 }
1093
1094 case single-vni {
1095 leaf vni-id {
1096 type vni-id-type;
1097 description
1098 "Retrieve information about a specific EVPN VNI.";
1099 }
1100
1101 leaf vni-rmac {
1102 type yang:mac-address;
1103 description
1104 "A single RMAC address.";
1105 }
1106 }
1107 }
1108 }
1109
1110 output {
1111 list rmac-info-list {
1112 leaf rmac {
1113 type yang:mac-address;
1114 description
1115 "The RMAC address.";
1116 }
1117
1118 leaf remote-vtep {
1119 type inet:ipv4-address;
1120 description
1121 "The remote VTEP IP address.";
1122 }
1123
1124 leaf refcount {
1125 type uint32;
1126 description
1127 "The refcount of the RMAC.";
1128 }
1129
1130 list prefix-list {
1131 leaf prefix-item {
1132 type inet:ip-prefix;
1133 description
1134 "IP prefixes associated with the RMAC.";
1135 }
1136 }
1137 }
1138 }
1139 }
1140
1141 // End get-evpn-vni-rmac
1142
1143 rpc get-evpn-vni-nexthops {
1144 description
1145 "Retrieve information about EVPN nexthops.";
1146 input {
1147 choice vni-choice {
1148 default "all-vnis";
1149 case all-vnis {
1150 leaf all-vnis {
1151 type empty;
1152 description
1153 "Retrieve information about all VNIs.";
1154 }
1155 }
1156
1157 case single-vni {
1158 leaf vni-id {
1159 type vni-id-type;
1160 description
1161 "Retrieve information about a specific EVPN VNI.";
1162 }
1163
1164 leaf vni-ipaddr {
1165 type inet:ip-address;
1166 description
1167 "A single host IP address (v4 or v6).";
1168 }
1169 }
1170 }
1171 }
1172
1173 output {
1174 list nh-info-list {
1175 leaf ip-addr {
1176 type inet:ip-address;
1177 description
1178 "The nexthop IP address.";
1179 }
1180
1181 leaf mac-addr {
1182 type yang:mac-address;
1183 description
1184 "The nexthop MAC address.";
1185 }
1186
1187 leaf refcount {
1188 type uint32;
1189 description
1190 "The refcount of the RMAC.";
1191 }
1192
1193 list prefix-list {
1194 leaf prefix-item {
1195 type inet:ip-prefix;
1196 description
1197 "IP prefixes associated with the RMAC.";
1198 }
1199 }
1200 }
1201 }
1202 }
1203
1204 // End get-evpn-vni-vteps
1205
1206 rpc clear-evpn-dup-addr {
1207 description
1208 "Clear duplicate address detection state for one or all VNIs.";
1209 input {
1210 choice clear-dup-choice {
1211 case all-case {
1212 leaf all-vnis {
1213 type empty;
1214 description
1215 "Clear all VNIs.";
1216 }
1217 }
1218
1219 case single-case {
1220 leaf vni-id {
1221 type vni-id-type;
1222 description
1223 "Clear state for a single EVPN VNI.";
1224 }
1225
1226 choice ip-mac-choice {
1227 description
1228 "Clear state for a specific MAC or IP address.";
1229 case ip-case {
1230 leaf vni-ipaddr {
1231 type inet:ip-address;
1232 description
1233 "A specific IP address (v4 or v6).";
1234 }
1235 }
1236
1237 case mac-case {
1238 leaf mac-addr {
1239 type yang:mac-address;
1240 description
1241 "A specific MAC address.";
1242 }
1243 }
1244 }
1245 }
1246 }
1247 }
1248 }
1249
1250 // End clear-evpn-dup-addr
1251
1252 rpc get-evpn-macs {
1253 description
1254 "Retrieve information about EVPN MAC addresses.";
1255 input {
1256 choice all-choice {
1257 default "all-vni";
1258 case all-vni {
1259 leaf all-vnis {
1260 type empty;
1261 description
1262 "Retrieve information for all VNIs.";
1263 }
1264
1265 choice all-choices {
1266 case detail-case {
1267 leaf all-detail {
1268 type empty;
1269 description
1270 "Include detailed results.";
1271 }
1272 }
1273
1274 case vtep-case {
1275 leaf all-vtep-addr {
1276 type inet:ipv4-address;
1277 description
1278 "A single VTEP address.";
1279 }
1280 }
1281
1282 case dup-case {
1283 leaf all-dup {
1284 type empty;
1285 description
1286 "Show duplicate addresses.";
1287 }
1288 }
1289 }
1290 }
1291
1292 case single-vni {
1293 leaf vni-id {
1294 type vni-id-type;
1295 description
1296 "Retrieve information for a single VNI.";
1297 }
1298
1299 choice single-choices {
1300 case detail-case {
1301 leaf single-detail {
1302 type empty;
1303 description
1304 "Include detailed results.";
1305 }
1306 }
1307
1308 case mac-case {
1309 leaf single-mac {
1310 type yang:mac-address;
1311 description
1312 "A specific MAC address.";
1313 }
1314 }
1315
1316 case vtep-case {
1317 leaf single-vtep {
1318 type inet:ipv4-address;
1319 description
1320 "A single VTEP address.";
1321 }
1322 }
1323
1324 case dup-case {
1325 leaf single-dup {
1326 type empty;
1327 description
1328 "Show duplicate addresses.";
1329 }
1330 }
1331 }
1332 }
1333 }
1334 }
1335 // End of input section
1336 output {
1337 list mac-list {
1338 leaf mac-addr {
1339 type yang:mac-address;
1340 description
1341 "The MAC address.";
1342 }
1343
1344 leaf vni {
1345 type vni-id-type;
1346 description
1347 "The VNI value.";
1348 }
1349
1350 leaf local-sequence {
1351 type uint32;
1352 description
1353 "Local sequence number.";
1354 }
1355
1356 leaf remote-sequence {
1357 type uint32;
1358 description
1359 "Remote sequence number.";
1360 }
1361
1362 leaf dad-count {
1363 type uint32;
1364 description
1365 "Duplicate detection counter.";
1366 }
1367
1368 leaf is-duplicate {
1369 type empty;
1370 description
1371 "Duplicate MAC detected.";
1372 }
1373
1374 leaf dup-detect-time {
1375 type unix-timestamp;
1376 description
1377 "If a duplicate, the detection time.";
1378 }
1379
1380 container dup-detect-started {
1381 leaf dup-detect-start {
1382 type unix-timestamp;
1383 description
1384 "Duplicate detection process start time.";
1385 }
1386
1387 leaf dup-count {
1388 type uint32;
1389 description
1390 "Duplicate detection count.";
1391 }
1392 }
1393
1394 leaf is-auto {
1395 type empty;
1396 description
1397 "This is an Auto MAC.";
1398 }
1399
1400 leaf is-sticky {
1401 type empty;
1402 description
1403 "This is a sticky MAC.";
1404 }
1405
1406 leaf is-default-gw {
1407 type empty;
1408 description
1409 "This is a default-gateway MAC.";
1410 }
1411
1412 leaf is-remote-gw {
1413 type empty;
1414 description
1415 "This is a remote-gateway MAC.";
1416 }
1417
1418 list neighbor-list {
1419 leaf neighbor-addr {
1420 type inet:ip-address;
1421 description
1422 "Neighbor address.";
1423 }
1424
1425 leaf is-active {
1426 type empty;
1427 description
1428 "Neighbor is active.";
1429 }
1430 }
1431
1432 leaf mac-count {
1433 type uint32;
1434 description
1435 "Number of MACs (local and remote).";
1436 }
1437
1438 choice local-rem-choice {
1439 case local-case {
1440 leaf intf {
1441 type frr-interface:interface-ref;
1442 description
1443 "The local interface name.";
1444 }
1445
1446 leaf vlan {
1447 type uint32;
1448 description
1449 "A VLAN id.";
1450 }
1451 }
1452
1453 case remote-case {
1454 leaf vtep-addr {
1455 type inet:ipv4-address;
1456 description
1457 "The remote VTEP IP address.";
1458 }
1459 }
1460 }
1461 }
1462 }
1463 }
1464
1465 // End get-evpn-macs
1466
1467 rpc get-evpn-arp-cache {
1468 description
1469 "Retrieve information about EVPN neighbor cache entries.";
1470 input {
1471 choice all-choice {
1472 default "all-vni";
1473 case all-vni {
1474 leaf all-vnis {
1475 type empty;
1476 description
1477 "Retrieve information for all VNIs.";
1478 }
1479
1480 choice all-choices {
1481 case detail-case {
1482 leaf all-detail {
1483 type empty;
1484 description
1485 "Include detailed results.";
1486 }
1487 }
1488
1489 case dup-case {
1490 leaf all-dup {
1491 type empty;
1492 description
1493 "Show duplicates.";
1494 }
1495 }
1496 }
1497 }
1498
1499 case single-vni {
1500 leaf vni-id {
1501 type vni-id-type;
1502 description
1503 "Retrieve information for a single VNI.";
1504 }
1505
1506 choice single-choices {
1507 case vtep-case {
1508 leaf single-vtep {
1509 type inet:ipv4-address;
1510 description
1511 "A single VTEP address.";
1512 }
1513 }
1514
1515 case neighbor-case {
1516 leaf neighbor-addr {
1517 type inet:ip-address;
1518 description
1519 "A single neighbor address.";
1520 }
1521 }
1522
1523 case dup-case {
1524 leaf single-dup {
1525 type empty;
1526 description
1527 "Show duplicates.";
1528 }
1529 }
1530 }
1531 }
1532 }
1533 }
1534 // End input section
1535 output {
1536 list vni-list {
1537 container vni-container {
1538 description
1539 "Information for one VNI.";
1540 leaf vni-id {
1541 type vni-id-type;
1542 description
1543 "The VNI id.";
1544 }
1545
1546 list neigh-list {
1547 description
1548 "Information about a VNI's neighbor cache.";
1549 leaf mac-addr {
1550 type yang:mac-address;
1551 description
1552 "A neighbor MAC address.";
1553 }
1554
1555 leaf ip-addr {
1556 type inet:ip-address;
1557 description
1558 "A neighbor IP address.";
1559 }
1560
1561 leaf state-active {
1562 type empty;
1563 description
1564 "Indicates whether the entry is active.";
1565 }
1566
1567 choice local-remote-choice {
1568 case local-case {
1569 leaf is-local {
1570 type empty;
1571 description
1572 "The entry is local.";
1573 }
1574 }
1575
1576 case remote-case {
1577 leaf is-remote {
1578 type empty;
1579 description
1580 "The entry is remote.";
1581 }
1582 }
1583 }
1584
1585 leaf is-dup {
1586 type empty;
1587 description
1588 "The entry is a detected duplicate.";
1589 }
1590
1591 leaf is-default-gw {
1592 type empty;
1593 description
1594 "The entry is a default gateway.";
1595 }
1596
1597 leaf is-router {
1598 type empty;
1599 description
1600 "The entry is a router.";
1601 }
1602
1603 leaf local-sequence {
1604 type uint32;
1605 description
1606 "The local sequence number.";
1607 }
1608
1609 leaf remote-sequence {
1610 type uint32;
1611 description
1612 "The remote sequence number.";
1613 }
1614
1615 leaf remote-vtep {
1616 type inet:ipv4-address;
1617 description
1618 "The remote VTEP address.";
1619 }
1620 }
1621 }
1622 }
1623 }
1624 }
1625
1626 // End get-evpn-arp-cache
1627
1628 rpc get-pbr-ipset {
1629 input {
1630 leaf name {
1631 type string {
1632 length "1..32";
1633 }
1634 description
1635 "An optional specific IPset name.";
1636 }
1637 }
1638
1639 output {
1640 list ipset-list {
1641 leaf name {
1642 type string {
1643 length "1..32";
1644 }
1645 description
1646 "The IPset name.";
1647 }
1648
1649 leaf ipset-type {
1650 type enumeration {
1651 enum "net-net" {
1652 value 1;
1653 description
1654 "";
1655 }
1656 enum "net-port-net" {
1657 value 2;
1658 description
1659 "";
1660 }
1661 enum "net-port" {
1662 value 3;
1663 description
1664 "";
1665 }
1666 enum "net" {
1667 value 4;
1668 description
1669 "";
1670 }
1671 }
1672 }
1673
1674 leaf src-prefix {
1675 type inet:ip-prefix;
1676 description
1677 "";
1678 }
1679
1680 leaf dest-prefix {
1681 type inet:ip-prefix;
1682 description
1683 "";
1684 }
1685
1686 leaf src-port {
1687 type inet:port-number;
1688 description
1689 "";
1690 }
1691
1692 leaf dest-port {
1693 type inet:port-number;
1694 description
1695 "";
1696 }
1697
1698 choice proto-choice {
1699 description
1700 "Filter UDP/TCP only, or a specific protocol number.";
1701 case udp-tcp-case {
1702 leaf is-udp-tcp {
1703 type empty;
1704 description
1705 "Filter TCP/UDP ports only.";
1706 }
1707 }
1708
1709 case proto-case {
1710 leaf proto {
1711 type uint32;
1712 description
1713 "Filter a specific protocol number.";
1714 }
1715 }
1716 }
1717
1718 container icmp-info {
1719 description
1720 "Additional information for ICMP filters.";
1721 leaf type-min {
1722 type uint8;
1723 description
1724 "";
1725 }
1726
1727 leaf type-max {
1728 type uint8;
1729 description
1730 "";
1731 }
1732
1733 leaf code-min {
1734 type uint8;
1735 description
1736 "";
1737 }
1738
1739 leaf code-max {
1740 type uint8;
1741 description
1742 "";
1743 }
1744 }
1745
1746 container ipset-stats {
1747 leaf is-unique {
1748 type empty;
1749 description
1750 "";
1751 }
1752
1753 leaf packet-counter {
1754 type uint64;
1755 description
1756 "";
1757 }
1758
1759 leaf bytes-counter {
1760 type uint64;
1761 description
1762 "";
1763 }
1764 }
1765 }
1766 }
1767 }
1768
1769 // End get-pbr-ipset
1770
1771 rpc get-pbr-iptable {
1772 input {
1773 leaf name {
1774 type string {
1775 length "1..32";
1776 }
1777 description
1778 "An optional single IPtable name.";
1779 }
1780 }
1781
1782 output {
1783 list iptable-list {
1784 leaf name {
1785 type string {
1786 length "1..32";
1787 }
1788 description
1789 "The IPtable name.";
1790 }
1791
1792 leaf unique-val {
1793 type uint32;
1794 description
1795 "";
1796 }
1797
1798 choice action-choice {
1799 description
1800 "The table action.";
1801 case drop-case {
1802 leaf action-drop {
1803 type empty;
1804 description
1805 "";
1806 }
1807 }
1808
1809 case redirect-case {
1810 leaf action-redirect {
1811 type empty;
1812 description
1813 "";
1814 }
1815 }
1816 }
1817
1818 leaf min-packet {
1819 type uint32;
1820 description
1821 "";
1822 }
1823
1824 leaf max-packet {
1825 type uint32;
1826 description
1827 "";
1828 }
1829
1830 leaf lookup-src-port {
1831 type empty;
1832 description
1833 "";
1834 }
1835
1836 leaf lookup-dst-port {
1837 type empty;
1838 description
1839 "";
1840 }
1841
1842 leaf tcp-flags {
1843 type uint16;
1844 description
1845 "";
1846 }
1847
1848 leaf tcp-flags-mask {
1849 type uint16;
1850 description
1851 "";
1852 }
1853
1854 leaf protocol-val {
1855 type uint32;
1856 description
1857 "An IP protocol number.";
1858 }
1859
1860 container dscp-info {
1861 leaf dscp-value {
1862 type uint32;
1863 description
1864 "A DSCP value to match.";
1865 }
1866
1867 leaf invert-match {
1868 type empty;
1869 description
1870 "If set, exclude the specified value";
1871 }
1872 }
1873
1874 container fragment-info {
1875 leaf fragment-val {
1876 type uint32;
1877 description
1878 "An IP fragment value.";
1879 }
1880
1881 leaf invert-match {
1882 type empty;
1883 description
1884 "If set, exclude the specified value.";
1885 }
1886 }
1887
1888 container iptable-stats {
1889 leaf packet-counter {
1890 type uint64;
1891 description
1892 "";
1893 }
1894
1895 leaf bytes-counter {
1896 type uint64;
1897 description
1898 "";
1899 }
1900 }
1901
1902 container rule-info {
1903 description
1904 "Information about a rule, for redirect tables.";
1905 leaf table-id {
1906 type uint32;
1907 description
1908 "The rule table id.";
1909 }
1910
1911 leaf table-fwmark {
1912 type uint32;
1913 description
1914 "The firewall mark for the rule.";
1915 }
1916 }
1917 }
1918 }
1919 }
1920
1921 // End get-pbr-iptable
1922 /*
1923 * Handy 'all-at-once' api to retrieve debugs
1924 */
1925
1926 rpc get-debugs {
1927 output {
1928 uses zebra-debugs;
1929 }
1930 }
1931
1932 // End get-debugs
1933
1934 augment "/frr-interface:lib/frr-interface:interface" {
1935 description
1936 "Extends interface model with Zebra-related parameters.";
1937 container zebra {
1938 list ip-addrs {
1939 key "address-family ip-prefix";
1940 description
1941 "IP prefixes for an interface.";
1942 uses frr-rt:address-family {
1943 description
1944 "Address family of the RIB.";
1945 }
1946
1947 leaf ip-prefix {
1948 type inet:ip-prefix;
1949 description
1950 "IP address prefix.";
1951 }
1952
1953 leaf label {
1954 type string;
1955 description
1956 "Optional string label for the address.";
1957 }
1958
1959 leaf ip4-peer {
1960 when "derived-from-or-self(../address-family, 'frr-rt:ipv4')";
1961 type inet:ipv4-prefix;
1962 description
1963 "Peer prefix, for peer-to-peer interfaces.";
1964 }
1965 }
1966
1967 leaf multicast {
1968 type boolean;
1969 description
1970 "Multicast flag for the interface.";
1971 }
1972
1973 leaf link-detect {
1974 type boolean;
1975 description
1976 "Link-detection for the interface.";
1977 }
1978
1979 leaf shutdown {
1980 type boolean;
1981 description
1982 "Interface admin status.";
1983 }
1984
1985 leaf bandwidth {
1986 type uint32 {
1987 range "1..100000";
1988 }
1989 description
1990 "Link bandwidth informational parameter, in megabits.";
1991 }
1992 container link-params {
1993 description
1994 "link-params for Traffic-Engineering (TE) use in IGP extensions.";
1995 choice admin-group-mode {
1996 description "Admin-group mode";
1997 case legacy {
1998 description
1999 "Legacy mode. Only support standard admin-group (RFC3630/5305/5329)";
2000 leaf legacy-admin-group {
2001 description "Admin-Group value";
2002 type uint32;
2003 }
2004 }
2005 case affinity {
2006 container affinities {
2007 leaf-list affinity {
2008 type string;
2009 max-elements "256";
2010 description
2011 "Array of Attribute Names";
2012 }
2013 }
2014 }
2015 }
2016 leaf affinity-mode {
2017 description
2018 "Affinity mode";
2019 default "extended";
2020 type enumeration {
2021 enum extended {
2022 value 0;
2023 description
2024 "Extended Admin-Group only (RFC7308)";
2025 }
2026 enum standard {
2027 value 1;
2028 description
2029 "Standard Admin-Group only (RFC3630/5305/5329)";
2030 }
2031 enum both {
2032 value 2;
2033 description
2034 "Standard and extended Admin-Group";
2035 }
2036 }
2037 }
2038 // TODO -- other link-params options
2039 // for (experimental/partial TE use in IGP extensions)
2040 }
2041 container state {
2042 config false;
2043 description
2044 "Operational data.";
2045 leaf up-count {
2046 type uint16;
2047 description
2048 "Interface Up count.";
2049 }
2050
2051 leaf down-count {
2052 type uint16;
2053 description
2054 "Interface Down count.";
2055 }
2056
2057 leaf zif-type {
2058 type identityref {
2059 base zebra-interface-type;
2060 }
2061 description
2062 "zebra interface type.";
2063 }
2064
2065 leaf ptm-status {
2066 type string;
2067 default "disabled";
2068 description
2069 "Interface PTM status.";
2070 }
2071
2072 leaf vlan-id {
2073 type uint16 {
2074 range "1..4094";
2075 }
2076 description
2077 "A VLAN id.";
2078 }
2079
2080 leaf vni-id {
2081 type vni-id-type;
2082 }
2083
2084 leaf remote-vtep {
2085 type inet:ipv4-address;
2086 description
2087 "The remote VTEP IP address.";
2088 }
2089
2090 leaf mcast-group {
2091 type rt-types:ipv4-multicast-group-address;
2092 description
2093 "The VNI multicast group for BUM traffic.";
2094 }
2095 }
2096 }
2097 }
2098
2099 augment "/frr-vrf:lib/frr-vrf:vrf" {
2100 description
2101 "Extends VRF model with Zebra-related parameters.";
2102 container zebra {
2103 description
2104 "Zebra's vrf specific configuration and operational model.";
2105 uses ribs;
2106
2107 uses vrf-vni-mapping;
2108 }
2109 }
2110
2111 augment "/frr-vrf:lib/frr-vrf:vrf/frr-zebra:zebra/ribs/rib/route/route-entry/nexthop-group/nexthop" {
2112 uses frr-nh:frr-nexthop-operational;
2113 }
2114
2115 /*
2116 * Main zebra container
2117 */
2118
2119 container zebra {
2120 description
2121 "Data model for the Zebra daemon.";
2122 leaf mcast-rpf-lookup {
2123 type frr-zebra:mcast-rpf-lookup-mode;
2124 default "mrib-then-urib";
2125 description
2126 "Multicast RPF lookup behavior.";
2127 }
2128 leaf ip-forwarding {
2129 type boolean;
2130 description
2131 "IP forwarding status.";
2132 }
2133 leaf ipv6-forwarding {
2134 type enumeration {
2135 enum unknown {
2136 value -1;
2137 description
2138 "Unknown state.";
2139 }
2140 enum off {
2141 value 0;
2142 description
2143 "IPv6 forwarding disabled.";
2144 }
2145 enum on {
2146 value 1;
2147 description
2148 "IPv6 forwarding enabled.";
2149 }
2150 }
2151 description
2152 "IPv6 forwarding status.";
2153 }
2154 leaf workqueue-hold-timer {
2155 type uint32 {
2156 range "0..10000";
2157 }
2158 units "milliseconds";
2159 default "10";
2160 description
2161 "Work-queue processing hold timer, in milliseconds.";
2162 }
2163 leaf zapi-packets {
2164 type uint32 {
2165 range "1..10000";
2166 }
2167 default "1000";
2168 description
2169 "Number of ZAPI packets to process before relinquishing
2170 the main thread.";
2171 }
2172 container import-kernel-table {
2173 description
2174 "Parameters to use when importing IPv4 routes from a non-main kernel
2175 routing table.";
2176 leaf table-id {
2177 type uint32 {
2178 range "1..252";
2179 }
2180 description
2181 "The kernel table id.";
2182 }
2183 leaf distance {
2184 type uint32 {
2185 range "1..255";
2186 }
2187 default "15";
2188 description
2189 "The admin distance to use for imported routes.";
2190 }
2191 leaf route-map {
2192 type frr-route-map:route-map-ref;
2193 description
2194 "A route-map to filter imported routes.";
2195 }
2196 }
2197 leaf allow-external-route-update {
2198 type empty;
2199 description
2200 "Allow FRR-controlled routes to be overwritten by external processes";
2201 }
2202 leaf dplane-queue-limit {
2203 type uint32 {
2204 range "0..10000";
2205 }
2206 default "200";
2207 description
2208 "Limit on the number of updates queued to the dataplane subsystem.";
2209 }
2210 /*
2211 * Debug options
2212 */
2213 container debugs {
2214 uses zebra-debugs;
2215 }
2216 /* End of debugs */
2217 /*
2218 * End of configuration attributes
2219 */
2220 /*
2221 * Operational data.
2222 */
2223 container state {
2224 config false;
2225 description
2226 "Operational data.";
2227 }
2228 // End of operational / state container
2229 }
2230 }