3 namespace "http://frrouting.org/yang/zebra";
6 import ietf-yang-types {
10 import ietf-inet-types {
14 import frr-affinity-map {
15 prefix frr-affinity-map;
18 import frr-route-map {
22 import frr-route-types {
23 prefix frr-route-types;
26 import ietf-routing-types {
38 import frr-interface {
49 "FRR Users List: <mailto:frog@lists.frrouting.org>
50 FRR Development List: <mailto:dev@lists.frrouting.org>";
52 "This module defines a model for managing the FRR zebra daemon.
54 Copyright 2020 FRRouting
56 Redistribution and use in source and binary forms, with or without
57 modification, are permitted provided that the following conditions
60 1. Redistributions of source code must retain the above copyright notice,
61 this list of conditions and the following disclaimer.
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.
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.";
84 typedef unix-timestamp {
88 "An absolute time in seconds since the unix epoch.";
91 identity zebra-interface-type {
93 "zebra interface type.";
97 base zebra-interface-type;
99 "Zebra interface type other.";
102 identity zif-bridge {
103 base zebra-interface-type;
105 "Zebra interface type bridge.";
109 base zebra-interface-type;
111 "Zebra interface type vlan.";
115 base zebra-interface-type;
117 "Zebra interface type vxlan.";
121 base zebra-interface-type;
123 "Zebra interface type vrf.";
127 base zebra-interface-type;
129 "Zebra interface type veth.";
133 base zebra-interface-type;
135 "Zebra interface type bond.";
138 identity zif-bond-slave {
139 base zebra-interface-type;
141 "Zebra interface type bond slave.";
144 identity zif-macvlan {
145 base zebra-interface-type;
147 "Zebra interface type macvlan.";
151 * Multicast RPF mode configurable type
154 typedef mcast-rpf-lookup-mode {
164 "Lookup in unicast RIB only.";
169 "Lookup in multicast RIB only.";
171 enum "mrib-then-urib" {
174 "Try multicast RIB first, fall back to unicast RIB.";
176 enum "lower-distance" {
179 "Lookup both unicast and mcast, use entry with lower distance.";
181 enum "longer-prefix" {
184 "Lookup both unicast and mcast, use entry with longer prefix.";
188 "Multicast RPF lookup behavior";
193 * VxLAN Network Identifier type
196 typedef vni-id-type {
201 "A VxLAN network identifier value.";
204 typedef vni-vtep-flood-type {
206 enum "head-end-repl" {
209 "Head-end replication.";
214 "Flooding disabled.";
225 * Common route data, shared by v4 and v6 routes.
228 grouping route-common {
230 "Common information about a route.";
235 "Admin distance based on routing protocol.";
241 "Route metric value.";
246 range "1..4294967295";
255 "Route is the selected or preferred route for the prefix.";
261 "Route is installed in the FIB.";
267 "Route installation in FIB has failed.";
273 "Route has a pending FIB operation that has not completed.";
276 leaf internal-flags {
279 "Internal flags for the route.";
282 leaf internal-status {
285 "Internal status for the route.";
289 type yang:date-and-time;
291 "Uptime for the route.";
294 uses frr-nh:frr-nexthop-group-operational;
297 // End of route-common
306 type inet:ipv4-prefix;
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.";
314 type frr-route-types:frr-route-types-v4;
316 "The protocol owning the route.";
331 type inet:ipv6-prefix;
333 "The route's IPv6 prefix.";
337 type frr-route-types:frr-route-types-v6;
339 "The protocol owning the route.";
347 * Information about EVPN VNIs
350 grouping vni-information {
356 "Information about an L2 VNI.";
370 "Information about an L3 VNI.";
378 "The VNI identifier.";
382 type frr-interface:interface-ref;
384 "The VxLAN interface name.";
390 "Number of valid MACs.";
393 leaf neighbor-count {
396 "Number of neighbors.";
400 type frr-vrf:vrf-ref;
405 leaf local-vtep-addr {
406 type inet:ipv4-address;
408 "The local VTEP IP address.";
413 * Detailed EVPN VNI information for L2.
416 grouping vni-l2-detail {
420 "The VxLAN ifindex.";
426 "The gateway MAC-IP is being advertised.";
430 type rt-types:ipv4-multicast-group-address;
432 "The VNI multicast group for BUM traffic.";
435 list remote-vtep-list {
437 type inet:ipv4-address;
439 "The remote VTEP IP address.";
443 type vni-vtep-flood-type;
449 * Detailed EVPN VNI information for L3.
452 grouping vni-l3-detail {
454 type frr-interface:interface-ref;
456 "The SVI interface.";
462 "The state is active.";
468 "Prefix routes only";
472 type yang:mac-address;
474 "The VNI Router MAC address.";
479 "A list of the associated L2 VNIs.";
483 "An L2 VNI identifier.";
492 grouping zebra-debugs {
496 "Debug ZAPI events.";
499 leaf debug-zapi-send {
502 "Debug ZAPI messages sent.";
505 leaf debug-zapi-recv {
508 "Debug ZAPI messages received.";
511 leaf debug-zapi-detail {
514 "Debug ZAPI details.";
520 "Debug kernel events.";
523 leaf debug-kernel-msg-send {
526 "Debug kernel messages sent.";
529 leaf debug-kernel-msg-recv {
532 "Debug kernel messages received.";
538 "Debug RIB processing.";
541 leaf debug-rib-detail {
544 "Debug RIB processing details.";
550 "Debug the FIB Push Interface subsystem.";
556 "Debug Nexthop-tracking.";
559 leaf debug-nht-detail {
562 "Debug Nexthop-tracking details.";
580 "Debug pseudowires.";
586 "Debug the dataplane subsystem.";
589 leaf debug-dplane-detail {
592 "Debug dataplane subsystem details.";
606 "RIBs supported by FRR.";
608 key "afi-safi-name table-id";
611 base frr-rt:afi-safi-type;
620 "Routing Table id (default id - 254).";
628 "The route's prefix.";
634 type frr-route-types:frr-route-types;
636 "The protocol owning the route.";
641 must "../protocol = \"ospf\"";
643 "Retrieve routes from a specific OSPF instance.";
653 grouping vrf-vni-mapping {
655 "EVPN L3-VNI mapping corresponding to a VRF.";
659 "EVPN L3-VNI id to map to the VRF.";
666 "EVPN asymmetric mode advertise prefix routes only.";
670 // End of zebra container
675 rpc get-route-information {
677 "Retrieve IPv4 or IPv6 unicast routes.";
685 "Retrieve IPv4 routes.";
689 type inet:ipv4-prefix;
691 "Retrieve routes matching a specific prefix.";
694 leaf supernets-only {
697 "Skip routes that are subnets of classful prefix sizes.";
706 "Retrieve IPv6 routes.";
710 type inet:ipv6-prefix;
712 "Retrieve routes matching a specific prefix.";
720 type frr-vrf:vrf-ref;
722 "Retrieve routes in a non-default vrf.";
730 "Retrieve routes from all vrfs.";
738 "Retrieve FIB routes rather than RIB routes.";
743 range "1..4294967295";
746 "Routing table id to retrieve.";
750 type frr-route-types:frr-route-types-v4;
752 "Retrieve routes from a specific protocol daemon.";
759 must "../protocol = \"ospf\"";
761 "Retrieve routes from a specific OSPF instance.";
766 leaf include-detail {
769 "Include detailed information.";
777 "Include summary information only.";
786 container routes-v4 {
788 "IPv4 route information.";
796 container routes-v6 {
798 "IPv6 route information.";
809 // End get-route-information
811 rpc get-v6-mroute-info {
813 "Retrieve IPv6 multicast routes.";
818 type frr-vrf:vrf-ref;
820 "Retrieve routes in a non-default vrf.";
828 "Retrieve routes from all vrfs.";
837 "IPv6 mcast route information.";
845 // End get-v6-mroute-info
849 "Retrieve VRF information; the default VRF is elided.";
850 // Note: no input clause.
854 type frr-vrf:vrf-ref;
859 leaf is-user-config {
862 "The VRF was configured by an admin.";
876 "The VRF is inactive.";
884 "The net namespace name associated with the VRF.";
892 "The table-id associated with the VRF.";
902 rpc get-vrf-vni-info {
904 "Retrieve mappings between EVPN VNI and VRF.";
905 // Note: no input clause.
909 type frr-vrf:vrf-ref;
921 type frr-interface:interface-ref;
923 "The VxLAN interface name.";
927 type frr-interface:interface-ref;
929 "The SVI interface name.";
932 leaf router-mac-addr {
933 type yang:mac-address;
935 "Router MAC address.";
941 "The state is active.";
947 // End get-vrf-vni-info
951 "Retrieve global information about EVPN.";
952 // Note: No input clause.
957 "Number of L2 VNIs.";
963 "Number of L3 VNIs.";
966 leaf advertise-gateway {
969 "Advertise the gateway MAC-IP.";
975 "Advertise SVI MAC-IP.";
981 "Duplicate address detection is enabled.";
987 "Maximum moves allowed before address is considered duplicate.";
994 "Duplicate address detection timeout.";
1000 "Duplicate address detection freeze enabled.";
1003 choice dad-freeze-choice {
1004 case freeze-permanent {
1005 leaf dad-freeze-perm {
1008 "Duplicate address detection freeze is permanent.";
1013 leaf dad-freeze-time {
1017 "Duplicate address detection freeze timer.";
1024 // End get-evpn-info
1027 // If no vni is specified, retrieve global list.
1035 "Retrieve information about all VNIs.";
1043 "Retrieve information about a specific EVPN VNI.";
1048 leaf detailed-info {
1051 "Retrieve detailed information.";
1058 "Information about EVPN VNI objects.";
1059 uses vni-information;
1061 choice detail-choice {
1064 "Detailed L2 information.";
1070 "Detailed L3 information.";
1080 rpc get-evpn-vni-rmac {
1082 "Retrieve information about VxLAN VNI RMACs.";
1090 "Retrieve information about all VNIs.";
1098 "Retrieve information about a specific EVPN VNI.";
1102 type yang:mac-address;
1104 "A single RMAC address.";
1111 list rmac-info-list {
1113 type yang:mac-address;
1115 "The RMAC address.";
1119 type inet:ipv4-address;
1121 "The remote VTEP IP address.";
1127 "The refcount of the RMAC.";
1132 type inet:ip-prefix;
1134 "IP prefixes associated with the RMAC.";
1141 // End get-evpn-vni-rmac
1143 rpc get-evpn-vni-nexthops {
1145 "Retrieve information about EVPN nexthops.";
1153 "Retrieve information about all VNIs.";
1161 "Retrieve information about a specific EVPN VNI.";
1165 type inet:ip-address;
1167 "A single host IP address (v4 or v6).";
1176 type inet:ip-address;
1178 "The nexthop IP address.";
1182 type yang:mac-address;
1184 "The nexthop MAC address.";
1190 "The refcount of the RMAC.";
1195 type inet:ip-prefix;
1197 "IP prefixes associated with the RMAC.";
1204 // End get-evpn-vni-vteps
1206 rpc clear-evpn-dup-addr {
1208 "Clear duplicate address detection state for one or all VNIs.";
1210 choice clear-dup-choice {
1223 "Clear state for a single EVPN VNI.";
1226 choice ip-mac-choice {
1228 "Clear state for a specific MAC or IP address.";
1231 type inet:ip-address;
1233 "A specific IP address (v4 or v6).";
1239 type yang:mac-address;
1241 "A specific MAC address.";
1250 // End clear-evpn-dup-addr
1254 "Retrieve information about EVPN MAC addresses.";
1262 "Retrieve information for all VNIs.";
1265 choice all-choices {
1270 "Include detailed results.";
1275 leaf all-vtep-addr {
1276 type inet:ipv4-address;
1278 "A single VTEP address.";
1286 "Show duplicate addresses.";
1296 "Retrieve information for a single VNI.";
1299 choice single-choices {
1301 leaf single-detail {
1304 "Include detailed results.";
1310 type yang:mac-address;
1312 "A specific MAC address.";
1318 type inet:ipv4-address;
1320 "A single VTEP address.";
1328 "Show duplicate addresses.";
1335 // End of input section
1339 type yang:mac-address;
1350 leaf local-sequence {
1353 "Local sequence number.";
1356 leaf remote-sequence {
1359 "Remote sequence number.";
1365 "Duplicate detection counter.";
1371 "Duplicate MAC detected.";
1374 leaf dup-detect-time {
1375 type unix-timestamp;
1377 "If a duplicate, the detection time.";
1380 container dup-detect-started {
1381 leaf dup-detect-start {
1382 type unix-timestamp;
1384 "Duplicate detection process start time.";
1390 "Duplicate detection count.";
1397 "This is an Auto MAC.";
1403 "This is a sticky MAC.";
1406 leaf is-default-gw {
1409 "This is a default-gateway MAC.";
1415 "This is a remote-gateway MAC.";
1418 list neighbor-list {
1419 leaf neighbor-addr {
1420 type inet:ip-address;
1422 "Neighbor address.";
1428 "Neighbor is active.";
1435 "Number of MACs (local and remote).";
1438 choice local-rem-choice {
1441 type frr-interface:interface-ref;
1443 "The local interface name.";
1455 type inet:ipv4-address;
1457 "The remote VTEP IP address.";
1465 // End get-evpn-macs
1467 rpc get-evpn-arp-cache {
1469 "Retrieve information about EVPN neighbor cache entries.";
1477 "Retrieve information for all VNIs.";
1480 choice all-choices {
1485 "Include detailed results.";
1503 "Retrieve information for a single VNI.";
1506 choice single-choices {
1509 type inet:ipv4-address;
1511 "A single VTEP address.";
1515 case neighbor-case {
1516 leaf neighbor-addr {
1517 type inet:ip-address;
1519 "A single neighbor address.";
1534 // End input section
1537 container vni-container {
1539 "Information for one VNI.";
1548 "Information about a VNI's neighbor cache.";
1550 type yang:mac-address;
1552 "A neighbor MAC address.";
1556 type inet:ip-address;
1558 "A neighbor IP address.";
1564 "Indicates whether the entry is active.";
1567 choice local-remote-choice {
1572 "The entry is local.";
1580 "The entry is remote.";
1588 "The entry is a detected duplicate.";
1591 leaf is-default-gw {
1594 "The entry is a default gateway.";
1600 "The entry is a router.";
1603 leaf local-sequence {
1606 "The local sequence number.";
1609 leaf remote-sequence {
1612 "The remote sequence number.";
1616 type inet:ipv4-address;
1618 "The remote VTEP address.";
1626 // End get-evpn-arp-cache
1635 "An optional specific IPset name.";
1656 enum "net-port-net" {
1675 type inet:ip-prefix;
1681 type inet:ip-prefix;
1687 type inet:port-number;
1693 type inet:port-number;
1698 choice proto-choice {
1700 "Filter UDP/TCP only, or a specific protocol number.";
1705 "Filter TCP/UDP ports only.";
1713 "Filter a specific protocol number.";
1718 container icmp-info {
1720 "Additional information for ICMP filters.";
1746 container ipset-stats {
1753 leaf packet-counter {
1759 leaf bytes-counter {
1769 // End get-pbr-ipset
1771 rpc get-pbr-iptable {
1778 "An optional single IPtable name.";
1789 "The IPtable name.";
1798 choice action-choice {
1800 "The table action.";
1809 case redirect-case {
1810 leaf action-redirect {
1830 leaf lookup-src-port {
1836 leaf lookup-dst-port {
1848 leaf tcp-flags-mask {
1857 "An IP protocol number.";
1860 container dscp-info {
1864 "A DSCP value to match.";
1870 "If set, exclude the specified value";
1874 container fragment-info {
1878 "An IP fragment value.";
1884 "If set, exclude the specified value.";
1888 container iptable-stats {
1889 leaf packet-counter {
1895 leaf bytes-counter {
1902 container rule-info {
1904 "Information about a rule, for redirect tables.";
1908 "The rule table id.";
1914 "The firewall mark for the rule.";
1921 // End get-pbr-iptable
1923 * Handy 'all-at-once' api to retrieve debugs
1934 augment "/frr-interface:lib/frr-interface:interface" {
1936 "Extends interface model with Zebra-related parameters.";
1939 key "address-family ip-prefix";
1941 "IP prefixes for an interface.";
1942 uses frr-rt:address-family {
1944 "Address family of the RIB.";
1948 type inet:ip-prefix;
1950 "IP address prefix.";
1956 "Optional string label for the address.";
1960 when "derived-from-or-self(../address-family, 'frr-rt:ipv4')";
1961 type inet:ipv4-prefix;
1963 "Peer prefix, for peer-to-peer interfaces.";
1970 "Multicast flag for the interface.";
1976 "Link-detection for the interface.";
1982 "Interface admin status.";
1990 "Link bandwidth informational parameter, in megabits.";
1992 container link-params {
1994 "link-params for Traffic-Engineering (TE) use in IGP extensions.";
1995 choice admin-group-mode {
1996 description "Admin-group mode";
1999 "Legacy mode. Only support standard admin-group (RFC3630/5305/5329)";
2000 leaf legacy-admin-group {
2001 description "Admin-Group value";
2006 container affinities {
2007 leaf-list affinity {
2011 "Array of Attribute Names";
2016 leaf affinity-mode {
2024 "Extended Admin-Group only (RFC7308)";
2029 "Standard Admin-Group only (RFC3630/5305/5329)";
2034 "Standard and extended Admin-Group";
2038 // TODO -- other link-params options
2039 // for (experimental/partial TE use in IGP extensions)
2044 "Operational data.";
2048 "Interface Up count.";
2054 "Interface Down count.";
2059 base zebra-interface-type;
2062 "zebra interface type.";
2069 "Interface PTM status.";
2085 type inet:ipv4-address;
2087 "The remote VTEP IP address.";
2091 type rt-types:ipv4-multicast-group-address;
2093 "The VNI multicast group for BUM traffic.";
2099 augment "/frr-vrf:lib/frr-vrf:vrf" {
2101 "Extends VRF model with Zebra-related parameters.";
2104 "Zebra's vrf specific configuration and operational model.";
2107 uses vrf-vni-mapping;
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;
2116 * Main zebra container
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";
2126 "Multicast RPF lookup behavior.";
2128 leaf ip-forwarding {
2131 "IP forwarding status.";
2133 leaf ipv6-forwarding {
2143 "IPv6 forwarding disabled.";
2148 "IPv6 forwarding enabled.";
2152 "IPv6 forwarding status.";
2154 leaf workqueue-hold-timer {
2158 units "milliseconds";
2161 "Work-queue processing hold timer, in milliseconds.";
2169 "Number of ZAPI packets to process before relinquishing
2172 container import-kernel-table {
2174 "Parameters to use when importing IPv4 routes from a non-main kernel
2181 "The kernel table id.";
2189 "The admin distance to use for imported routes.";
2192 type frr-route-map:route-map-ref;
2194 "A route-map to filter imported routes.";
2197 leaf allow-external-route-update {
2200 "Allow FRR-controlled routes to be overwritten by external processes";
2202 leaf dplane-queue-limit {
2208 "Limit on the number of updates queued to the dataplane subsystem.";
2218 * End of configuration attributes
2226 "Operational data.";
2228 // End of operational / state container