1 // SPDX-License-Identifier: BSD-2-Clause
4 namespace "http://frrouting.org/yang/nexthop";
7 import ietf-inet-types {
11 import ietf-routing-types {
15 import frr-interface {
26 "FRR Users List: <mailto:frog@lists.frrouting.org>
27 FRR Development List: <mailto:dev@lists.frrouting.org>";
29 "This module defines a model for managing FRR nexthop information.
31 Copyright 2020 FRRouting
33 Redistribution and use in source and binary forms, with or without
34 modification, are permitted provided that the following conditions
37 1. Redistributions of source code must retain the above copyright notice,
38 this list of conditions and the following disclaimer.
40 2. Redistributions in binary form must reproduce the above copyright
41 notice, this list of conditions and the following disclaimer in the
42 documentation and/or other materials provided with the distribution.
44 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
45 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
46 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
47 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
48 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
49 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
50 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
51 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
52 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
53 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
54 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
61 typedef optional-ip-address {
73 typedef nexthop-type {
78 "Specific interface.";
88 "IPv4 address and interface.";
98 "IPv6 address and interface.";
103 "Unreachable or prohibited.";
111 * Blockhole nexthop type.
113 typedef blackhole-type {
118 "Generic unreachable.";
133 "ICMP admin-prohibited.";
138 "Nexthop blackhole types.";
141 typedef nexthop-group-ref {
143 path "/frr-nexthop:frr-nexthop-group/frr-nexthop:nexthop-groups/frr-nexthop:name";
144 require-instance false;
149 * Common nexthop attributes grouping.
151 grouping frr-nexthop-attributes {
160 type frr-vrf:vrf-ref;
162 "The nexthop vrf name, if different from the route.";
166 type frr-nexthop:optional-ip-address;
168 "The nexthop gateway address.";
172 type frr-interface:interface-ref;
174 "The nexthop egress interface.";
180 "A blackhole sub-type, if the nexthop is a blackhole type.";
187 "Nexthop is directly connected.";
191 when "../nh-type = 'ip4' or
192 ../nh-type = 'ip6' or
193 ../nh-type = 'ip4-ifindex' or
194 ../nh-type = 'ip6-ifindex'";
197 "The nexthop SR-TE color";
200 uses rt-types:mpls-label-stack {
202 "Nexthop's MPLS label stack.";
207 * operational common attributes for nexthop
209 grouping frr-nexthop-operational {
221 "Nexthop resolved through another gateway.";
228 "Nexthop is active.";
235 "Nexthop is installed in fib.";
242 "Weight to be used by the nexthop for purposes of ECMP";
246 grouping nexthop-grouping {
248 key "nh-type vrf gateway interface";
251 "A list of nexthop objects.";
252 uses frr-nexthop-attributes;
257 * Single nexthop grouping.
259 grouping frr-nexthop {
260 container frr-nexthops {
262 "FRR nexthop object.";
263 uses nexthop-grouping;
269 * Container for FRR nexthop group.
271 grouping frr-nexthop-grouping {
272 list nexthop-groups {
275 "List of nexthop groups, each contains group of nexthops";
279 "The nexthop-group name.";
286 /* Operational nexthop-group */
287 grouping frr-nexthop-group-operational {
288 container nexthop-group {
290 "A group of nexthops.";
294 "The nexthop-group id.";
297 uses nexthop-grouping;
301 container frr-nexthop-group {
303 "A nexthop-group, represented as a list of nexthop objects.";
304 uses frr-nexthop-grouping;
308 * Augment weight attributes to nexthop group.
310 augment "/frr-nexthop-group/nexthop-groups/frr-nexthops/nexthop" {
314 "Weight to be used by the nexthop for purposes of ECMP";