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.";
164 type frr-nexthop:optional-ip-address;
166 "The nexthop gateway address.";
170 type frr-interface:interface-ref;
172 "The nexthop egress interface.";
176 when "../nh-type = 'blackhole'";
179 "A blackhole sub-type, if the nexthop is a blackhole type.";
183 when "../nh-type = 'ip4-ifindex' or
184 ../nh-type = 'ip6-ifindex'";
188 "Nexthop is directly connected.";
192 when "../nh-type = 'ip4' or
193 ../nh-type = 'ip6' or
194 ../nh-type = 'ip4-ifindex' or
195 ../nh-type = 'ip6-ifindex'";
198 "The nexthop SR-TE color";
201 uses rt-types:mpls-label-stack {
203 "Nexthop's MPLS label stack.";
208 * operational common attributes for nexthop
210 grouping frr-nexthop-operational {
222 "Nexthop resolved through another gateway.";
229 "Nexthop is active.";
236 "Nexthop is installed in fib.";
243 "Weight to be used by the nexthop for purposes of ECMP";
247 grouping nexthop-grouping {
249 key "nh-type vrf gateway interface";
252 "A list of nexthop objects.";
253 uses frr-nexthop-attributes;
258 * Single nexthop grouping.
260 grouping frr-nexthop {
261 container frr-nexthops {
263 "FRR nexthop object.";
264 uses nexthop-grouping;
270 * Container for FRR nexthop group.
272 grouping frr-nexthop-grouping {
273 list nexthop-groups {
276 "List of nexthop groups, each contains group of nexthops";
280 "The nexthop-group name.";
287 /* Operational nexthop-group */
288 grouping frr-nexthop-group-operational {
289 container nexthop-group {
291 "A group of nexthops.";
295 "The nexthop-group id.";
298 uses nexthop-grouping;
302 container frr-nexthop-group {
304 "A nexthop-group, represented as a list of nexthop objects.";
305 uses frr-nexthop-grouping;
309 * Augment weight attributes to nexthop group.
311 augment "/frr-nexthop-group/nexthop-groups/frr-nexthops/nexthop" {
315 "Weight to be used by the nexthop for purposes of ECMP";