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