3 namespace "http://frrouting.org/yang/nexthop";
6 import ietf-inet-types {
10 import ietf-routing-types {
14 import frr-interface {
25 "FRR Users List: <mailto:frog@lists.frrouting.org>
26 FRR Development List: <mailto:dev@lists.frrouting.org>";
28 "This module defines a model for managing FRR nexthop information.
30 Copyright 2020 FRRouting
32 Redistribution and use in source and binary forms, with or without
33 modification, are permitted provided that the following conditions
36 1. Redistributions of source code must retain the above copyright notice,
37 this list of conditions and the following disclaimer.
39 2. Redistributions in binary form must reproduce the above copyright
40 notice, this list of conditions and the following disclaimer in the
41 documentation and/or other materials provided with the distribution.
43 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
60 typedef optional-ip-address {
72 typedef nexthop-type {
77 "Specific interface.";
87 "IPv4 address and interface.";
97 "IPv6 address and interface.";
102 "Unreachable or prohibited.";
110 * Blockhole nexthop type.
112 typedef blackhole-type {
117 "Generic unreachable.";
132 "ICMP admin-prohibited.";
137 "Nexthop blackhole types.";
140 typedef nexthop-group-ref {
142 path "/frr-nexthop:frr-nexthop-group/frr-nexthop:nexthop-groups/frr-nexthop:name";
143 require-instance false;
148 * Common nexthop attributes grouping.
150 grouping frr-nexthop-attributes {
159 type frr-vrf:vrf-ref;
161 "The nexthop vrf name, if different from the route.";
165 type frr-nexthop:optional-ip-address;
167 "The nexthop gateway address.";
171 type frr-interface:interface-ref;
173 "The nexthop egress interface.";
179 "A blackhole sub-type, if the nexthop is a blackhole type.";
186 "Nexthop is directly connected.";
190 when "../nh-type = 'ip4' or
191 ../nh-type = 'ip6' or
192 ../nh-type = 'ip4-ifindex' or
193 ../nh-type = 'ip6-ifindex'";
196 "The nexthop SR-TE color";
199 uses rt-types:mpls-label-stack {
201 "Nexthop's MPLS label stack.";
206 * operational common attributes for nexthop
208 grouping frr-nexthop-operational {
220 "Nexthop resolved through another gateway.";
227 "Nexthop is active.";
234 "Nexthop is installed in fib.";
241 "Weight to be used by the nexthop for purposes of ECMP";
245 grouping nexthop-grouping {
247 key "nh-type vrf gateway interface";
250 "A list of nexthop objects.";
251 uses frr-nexthop-attributes;
256 * Single nexthop grouping.
258 grouping frr-nexthop {
259 container frr-nexthops {
261 "FRR nexthop object.";
262 uses nexthop-grouping;
268 * Container for FRR nexthop group.
270 grouping frr-nexthop-grouping {
271 list nexthop-groups {
274 "List of nexthop groups, each contains group of nexthops";
278 "The nexthop-group name.";
285 /* Operational nexthop-group */
286 grouping frr-nexthop-group-operational {
287 container nexthop-group {
289 "A group of nexthops.";
293 "The nexthop-group id.";
296 uses nexthop-grouping;
300 container frr-nexthop-group {
302 "A nexthop-group, represented as a list of nexthop objects.";
303 uses frr-nexthop-grouping;
307 * Augment weight attributes to nexthop group.
309 augment "/frr-nexthop-group/nexthop-groups/frr-nexthops/nexthop" {
313 "Weight to be used by the nexthop for purposes of ECMP";