3 namespace "http://frrouting.org/yang/zebra";
6 import ietf-yang-types {
10 import ietf-inet-types {
14 import frr-route-map {
18 import frr-route-types {
19 prefix frr-route-types;
22 import ietf-routing-types {
34 import frr-interface {
45 "FRR Users List: <mailto:frog@lists.frrouting.org>
46 FRR Development List: <mailto:dev@lists.frrouting.org>";
48 "This module defines a model for managing the FRR zebra daemon.
50 Copyright 2020 FRRouting
52 Redistribution and use in source and binary forms, with or without
53 modification, are permitted provided that the following conditions
56 1. Redistributions of source code must retain the above copyright notice,
57 this list of conditions and the following disclaimer.
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.
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.";
80 typedef unix-timestamp {
84 "An absolute time in seconds since the unix epoch.";
87 identity zebra-interface-type {
89 "zebra interface type.";
93 base zebra-interface-type;
95 "Zebra interface type other.";
99 base zebra-interface-type;
101 "Zebra interface type bridge.";
105 base zebra-interface-type;
107 "Zebra interface type vlan.";
111 base zebra-interface-type;
113 "Zebra interface type vxlan.";
117 base zebra-interface-type;
119 "Zebra interface type vrf.";
123 base zebra-interface-type;
125 "Zebra interface type veth.";
129 base zebra-interface-type;
131 "Zebra interface type bond.";
134 identity zif-bond-slave {
135 base zebra-interface-type;
137 "Zebra interface type bond slave.";
140 identity zif-macvlan {
141 base zebra-interface-type;
143 "Zebra interface type macvlan.";
147 * Multicast RPF mode configurable type
150 typedef mcast-rpf-lookup-mode {
160 "Lookup in unicast RIB only.";
165 "Lookup in multicast RIB only.";
167 enum "mrib-then-urib" {
170 "Try multicast RIB first, fall back to unicast RIB.";
172 enum "lower-distance" {
175 "Lookup both unicast and mcast, use entry with lower distance.";
177 enum "longer-prefix" {
180 "Lookup both unicast and mcast, use entry with longer prefix.";
184 "Multicast RPF lookup behavior";
189 * VxLAN Network Identifier type
192 typedef vni-id-type {
197 "A VxLAN network identifier value.";
200 typedef vni-vtep-flood-type {
202 enum "head-end-repl" {
205 "Head-end replication.";
210 "Flooding disabled.";
221 * Common route data, shared by v4 and v6 routes.
224 grouping route-common {
226 "Common information about a route.";
231 "Admin distance based on routing protocol.";
237 "Route metric value.";
242 range "1..4294967295";
251 "Route is the selected or preferred route for the prefix.";
257 "Route is installed in the FIB.";
263 "Route installation in FIB has failed.";
269 "Route has a pending FIB operation that has not completed.";
272 leaf internal-flags {
275 "Internal flags for the route.";
278 leaf internal-status {
281 "Internal status for the route.";
285 type yang:date-and-time;
287 "Uptime for the route.";
290 uses frr-nh:frr-nexthop-group-operational;
293 // End of route-common
302 type inet:ipv4-prefix;
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.";
310 type frr-route-types:frr-route-types-v4;
312 "The protocol owning the route.";
327 type inet:ipv6-prefix;
329 "The route's IPv6 prefix.";
333 type frr-route-types:frr-route-types-v6;
335 "The protocol owning the route.";
343 * Information about EVPN VNIs
346 grouping vni-information {
352 "Information about an L2 VNI.";
366 "Information about an L3 VNI.";
374 "The VNI identifier.";
378 type frr-interface:interface-ref;
380 "The VxLAN interface name.";
386 "Number of valid MACs.";
389 leaf neighbor-count {
392 "Number of neighbors.";
396 type frr-vrf:vrf-ref;
401 leaf local-vtep-addr {
402 type inet:ipv4-address;
404 "The local VTEP IP address.";
409 * Detailed EVPN VNI information for L2.
412 grouping vni-l2-detail {
416 "The VxLAN ifindex.";
422 "The gateway MAC-IP is being advertised.";
426 type rt-types:ipv4-multicast-group-address;
428 "The VNI multicast group for BUM traffic.";
431 list remote-vtep-list {
433 type inet:ipv4-address;
435 "The remote VTEP IP address.";
439 type vni-vtep-flood-type;
445 * Detailed EVPN VNI information for L3.
448 grouping vni-l3-detail {
450 type frr-interface:interface-ref;
452 "The SVI interface.";
458 "The state is active.";
464 "Prefix routes only";
468 type yang:mac-address;
470 "The VNI Router MAC address.";
475 "A list of the associated L2 VNIs.";
479 "An L2 VNI identifier.";
488 grouping zebra-debugs {
492 "Debug ZAPI events.";
495 leaf debug-zapi-send {
498 "Debug ZAPI messages sent.";
501 leaf debug-zapi-recv {
504 "Debug ZAPI messages received.";
507 leaf debug-zapi-detail {
510 "Debug ZAPI details.";
516 "Debug kernel events.";
519 leaf debug-kernel-msg-send {
522 "Debug kernel messages sent.";
525 leaf debug-kernel-msg-recv {
528 "Debug kernel messages received.";
534 "Debug RIB processing.";
537 leaf debug-rib-detail {
540 "Debug RIB processing details.";
546 "Debug the FIB Push Interface subsystem.";
552 "Debug Nexthop-tracking.";
555 leaf debug-nht-detail {
558 "Debug Nexthop-tracking details.";
576 "Debug pseudowires.";
582 "Debug the dataplane subsystem.";
585 leaf debug-dplane-detail {
588 "Debug dataplane subsystem details.";
602 "RIBs supported by FRR.";
604 key "afi-safi-name table-id";
607 base frr-rt:afi-safi-type;
616 "Routing Table id (default id - 254).";
624 "The route's prefix.";
630 type frr-route-types:frr-route-types;
632 "The protocol owning the route.";
637 must "../protocol = \"ospf\"";
639 "Retrieve routes from a specific OSPF instance.";
649 grouping vrf-vni-mapping {
651 "EVPN L3-VNI mapping corresponding to a VRF.";
655 "EVPN L3-VNI id to map to the VRF.";
662 "EVPN asymmetric mode advertise prefix routes only.";
666 // End of zebra container
671 rpc get-route-information {
673 "Retrieve IPv4 or IPv6 unicast routes.";
681 "Retrieve IPv4 routes.";
685 type inet:ipv4-prefix;
687 "Retrieve routes matching a specific prefix.";
690 leaf supernets-only {
693 "Skip routes that are subnets of classful prefix sizes.";
702 "Retrieve IPv6 routes.";
706 type inet:ipv6-prefix;
708 "Retrieve routes matching a specific prefix.";
716 type frr-vrf:vrf-ref;
718 "Retrieve routes in a non-default vrf.";
726 "Retrieve routes from all vrfs.";
734 "Retrieve FIB routes rather than RIB routes.";
739 range "1..4294967295";
742 "Routing table id to retrieve.";
746 type frr-route-types:frr-route-types-v4;
748 "Retrieve routes from a specific protocol daemon.";
755 must "../protocol = \"ospf\"";
757 "Retrieve routes from a specific OSPF instance.";
762 leaf include-detail {
765 "Include detailed information.";
773 "Include summary information only.";
782 container routes-v4 {
784 "IPv4 route information.";
792 container routes-v6 {
794 "IPv6 route information.";
805 // End get-route-information
807 rpc get-v6-mroute-info {
809 "Retrieve IPv6 multicast routes.";
814 type frr-vrf:vrf-ref;
816 "Retrieve routes in a non-default vrf.";
824 "Retrieve routes from all vrfs.";
833 "IPv6 mcast route information.";
841 // End get-v6-mroute-info
845 "Retrieve VRF information; the default VRF is elided.";
846 // Note: no input clause.
850 type frr-vrf:vrf-ref;
855 leaf is-user-config {
858 "The VRF was configured by an admin.";
872 "The VRF is inactive.";
880 "The net namespace name associated with the VRF.";
888 "The table-id associated with the VRF.";
898 rpc get-vrf-vni-info {
900 "Retrieve mappings between EVPN VNI and VRF.";
901 // Note: no input clause.
905 type frr-vrf:vrf-ref;
917 type frr-interface:interface-ref;
919 "The VxLAN interface name.";
923 type frr-interface:interface-ref;
925 "The SVI interface name.";
928 leaf router-mac-addr {
929 type yang:mac-address;
931 "Router MAC address.";
937 "The state is active.";
943 // End get-vrf-vni-info
947 "Retrieve global information about EVPN.";
948 // Note: No input clause.
953 "Number of L2 VNIs.";
959 "Number of L3 VNIs.";
962 leaf advertise-gateway {
965 "Advertise the gateway MAC-IP.";
971 "Advertise SVI MAC-IP.";
977 "Duplicate address detection is enabled.";
983 "Maximum moves allowed before address is considered duplicate.";
990 "Duplicate address detection timeout.";
996 "Duplicate address detection freeze enabled.";
999 choice dad-freeze-choice {
1000 case freeze-permanent {
1001 leaf dad-freeze-perm {
1004 "Duplicate address detection freeze is permanent.";
1009 leaf dad-freeze-time {
1013 "Duplicate address detection freeze timer.";
1020 // End get-evpn-info
1023 // If no vni is specified, retrieve global list.
1031 "Retrieve information about all VNIs.";
1039 "Retrieve information about a specific EVPN VNI.";
1044 leaf detailed-info {
1047 "Retrieve detailed information.";
1054 "Information about EVPN VNI objects.";
1055 uses vni-information;
1057 choice detail-choice {
1060 "Detailed L2 information.";
1066 "Detailed L3 information.";
1076 rpc get-evpn-vni-rmac {
1078 "Retrieve information about VxLAN VNI RMACs.";
1086 "Retrieve information about all VNIs.";
1094 "Retrieve information about a specific EVPN VNI.";
1098 type yang:mac-address;
1100 "A single RMAC address.";
1107 list rmac-info-list {
1109 type yang:mac-address;
1111 "The RMAC address.";
1115 type inet:ipv4-address;
1117 "The remote VTEP IP address.";
1123 "The refcount of the RMAC.";
1128 type inet:ip-prefix;
1130 "IP prefixes associated with the RMAC.";
1137 // End get-evpn-vni-rmac
1139 rpc get-evpn-vni-nexthops {
1141 "Retrieve information about EVPN nexthops.";
1149 "Retrieve information about all VNIs.";
1157 "Retrieve information about a specific EVPN VNI.";
1161 type inet:ip-address;
1163 "A single host IP address (v4 or v6).";
1172 type inet:ip-address;
1174 "The nexthop IP address.";
1178 type yang:mac-address;
1180 "The nexthop MAC address.";
1186 "The refcount of the RMAC.";
1191 type inet:ip-prefix;
1193 "IP prefixes associated with the RMAC.";
1200 // End get-evpn-vni-vteps
1202 rpc clear-evpn-dup-addr {
1204 "Clear duplicate address detection state for one or all VNIs.";
1206 choice clear-dup-choice {
1219 "Clear state for a single EVPN VNI.";
1222 choice ip-mac-choice {
1224 "Clear state for a specific MAC or IP address.";
1227 type inet:ip-address;
1229 "A specific IP address (v4 or v6).";
1235 type yang:mac-address;
1237 "A specific MAC address.";
1246 // End clear-evpn-dup-addr
1250 "Retrieve information about EVPN MAC addresses.";
1258 "Retrieve information for all VNIs.";
1261 choice all-choices {
1266 "Include detailed results.";
1271 leaf all-vtep-addr {
1272 type inet:ipv4-address;
1274 "A single VTEP address.";
1282 "Show duplicate addresses.";
1292 "Retrieve information for a single VNI.";
1295 choice single-choices {
1297 leaf single-detail {
1300 "Include detailed results.";
1306 type yang:mac-address;
1308 "A specific MAC address.";
1314 type inet:ipv4-address;
1316 "A single VTEP address.";
1324 "Show duplicate addresses.";
1331 // End of input section
1335 type yang:mac-address;
1346 leaf local-sequence {
1349 "Local sequence number.";
1352 leaf remote-sequence {
1355 "Remote sequence number.";
1361 "Duplicate detection counter.";
1367 "Duplicate MAC detected.";
1370 leaf dup-detect-time {
1371 type unix-timestamp;
1373 "If a duplicate, the detection time.";
1376 container dup-detect-started {
1377 leaf dup-detect-start {
1378 type unix-timestamp;
1380 "Duplicate detection process start time.";
1386 "Duplicate detection count.";
1393 "This is an Auto MAC.";
1399 "This is a sticky MAC.";
1402 leaf is-default-gw {
1405 "This is a default-gateway MAC.";
1411 "This is a remote-gateway MAC.";
1414 list neighbor-list {
1415 leaf neighbor-addr {
1416 type inet:ip-address;
1418 "Neighbor address.";
1424 "Neighbor is active.";
1431 "Number of MACs (local and remote).";
1434 choice local-rem-choice {
1437 type frr-interface:interface-ref;
1439 "The local interface name.";
1451 type inet:ipv4-address;
1453 "The remote VTEP IP address.";
1461 // End get-evpn-macs
1463 rpc get-evpn-arp-cache {
1465 "Retrieve information about EVPN neighbor cache entries.";
1473 "Retrieve information for all VNIs.";
1476 choice all-choices {
1481 "Include detailed results.";
1499 "Retrieve information for a single VNI.";
1502 choice single-choices {
1505 type inet:ipv4-address;
1507 "A single VTEP address.";
1511 case neighbor-case {
1512 leaf neighbor-addr {
1513 type inet:ip-address;
1515 "A single neighbor address.";
1530 // End input section
1533 container vni-container {
1535 "Information for one VNI.";
1544 "Information about a VNI's neighbor cache.";
1546 type yang:mac-address;
1548 "A neighbor MAC address.";
1552 type inet:ip-address;
1554 "A neighbor IP address.";
1560 "Indicates whether the entry is active.";
1563 choice local-remote-choice {
1568 "The entry is local.";
1576 "The entry is remote.";
1584 "The entry is a detected duplicate.";
1587 leaf is-default-gw {
1590 "The entry is a default gateway.";
1596 "The entry is a router.";
1599 leaf local-sequence {
1602 "The local sequence number.";
1605 leaf remote-sequence {
1608 "The remote sequence number.";
1612 type inet:ipv4-address;
1614 "The remote VTEP address.";
1622 // End get-evpn-arp-cache
1631 "An optional specific IPset name.";
1652 enum "net-port-net" {
1671 type inet:ip-prefix;
1677 type inet:ip-prefix;
1683 type inet:port-number;
1689 type inet:port-number;
1694 choice proto-choice {
1696 "Filter UDP/TCP only, or a specific protocol number.";
1701 "Filter TCP/UDP ports only.";
1709 "Filter a specific protocol number.";
1714 container icmp-info {
1716 "Additional information for ICMP filters.";
1742 container ipset-stats {
1749 leaf packet-counter {
1755 leaf bytes-counter {
1765 // End get-pbr-ipset
1767 rpc get-pbr-iptable {
1774 "An optional single IPtable name.";
1785 "The IPtable name.";
1794 choice action-choice {
1796 "The table action.";
1805 case redirect-case {
1806 leaf action-redirect {
1826 leaf lookup-src-port {
1832 leaf lookup-dst-port {
1844 leaf tcp-flags-mask {
1853 "An IP protocol number.";
1856 container dscp-info {
1860 "A DSCP value to match.";
1866 "If set, exclude the specified value";
1870 container fragment-info {
1874 "An IP fragment value.";
1880 "If set, exclude the specified value.";
1884 container iptable-stats {
1885 leaf packet-counter {
1891 leaf bytes-counter {
1898 container rule-info {
1900 "Information about a rule, for redirect tables.";
1904 "The rule table id.";
1910 "The firewall mark for the rule.";
1917 // End get-pbr-iptable
1919 * Handy 'all-at-once' api to retrieve debugs
1930 augment "/frr-interface:lib/frr-interface:interface" {
1932 "Extends interface model with Zebra-related parameters.";
1935 key "address-family ip-prefix";
1937 "IP prefixes for an interface.";
1938 uses frr-rt:address-family {
1940 "Address family of the RIB.";
1944 type inet:ip-prefix;
1946 "IP address prefix.";
1952 "Optional string label for the address.";
1956 when "derived-from-or-self(../address-family, 'frr-rt:ipv4')";
1957 type inet:ipv4-prefix;
1959 "Peer prefix, for peer-to-peer interfaces.";
1966 "Multicast flag for the interface.";
1972 "Link-detection for the interface.";
1978 "Interface admin status.";
1986 "Link bandwidth informational parameter, in megabits.";
1988 // TODO -- link-params for (experimental/partial TE use in IGP extensions)
1992 "Operational data.";
1996 "Interface Up count.";
2002 "Interface Down count.";
2007 base zebra-interface-type;
2010 "zebra interface type.";
2017 "Interface PTM status.";
2033 type inet:ipv4-address;
2035 "The remote VTEP IP address.";
2039 type rt-types:ipv4-multicast-group-address;
2041 "The VNI multicast group for BUM traffic.";
2047 augment "/frr-vrf:lib/frr-vrf:vrf" {
2049 "Extends VRF model with Zebra-related parameters.";
2052 "Zebra's vrf specific configuration and operational model.";
2055 uses vrf-vni-mapping;
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;
2064 * Main zebra container
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";
2074 "Multicast RPF lookup behavior.";
2076 leaf ip-forwarding {
2079 "IP forwarding status.";
2081 leaf ipv6-forwarding {
2091 "IPv6 forwarding disabled.";
2096 "IPv6 forwarding enabled.";
2100 "IPv6 forwarding status.";
2102 leaf workqueue-hold-timer {
2106 units "milliseconds";
2109 "Work-queue processing hold timer, in milliseconds.";
2117 "Number of ZAPI packets to process before relinquishing
2120 container import-kernel-table {
2122 "Parameters to use when importing IPv4 routes from a non-main kernel
2129 "The kernel table id.";
2137 "The admin distance to use for imported routes.";
2140 type frr-route-map:route-map-ref;
2142 "A route-map to filter imported routes.";
2145 leaf allow-external-route-update {
2148 "Allow FRR-controlled routes to be overwritten by external processes";
2150 leaf dplane-queue-limit {
2156 "Limit on the number of updates queued to the dataplane subsystem.";
2166 * End of configuration attributes
2174 "Operational data.";
2176 // End of operational / state container