]> git.proxmox.com Git - mirror_frr.git/blame - yang/frr-nexthop.yang
lib: increase xpath maxlen
[mirror_frr.git] / yang / frr-nexthop.yang
CommitLineData
fdd5c6e8
MS
1module frr-nexthop {
2 yang-version 1.1;
3 namespace "http://frrouting.org/yang/nexthop";
4 prefix frr-nexthop;
5
6 import ietf-inet-types {
7 prefix inet;
8 }
9
10 import ietf-routing-types {
11 prefix rt-types;
12 }
f8614910 13
1b9468cc
CS
14 import frr-interface {
15 prefix frr-interface;
16 }
fdd5c6e8 17
f8614910
S
18 import frr-vrf {
19 prefix "frr-vrf";
20 }
21
fdd5c6e8 22 organization
8678d638 23 "FRRouting";
fdd5c6e8
MS
24 contact
25 "FRR Users List: <mailto:frog@lists.frrouting.org>
26 FRR Development List: <mailto:dev@lists.frrouting.org>";
27 description
28 "This module defines a model for managing FRR nexthop information.";
29
30 revision 2019-08-15 {
31 description
32 "Initial revision.";
33 }
34
f8614910
S
35 typedef optional-ip-address {
36 type union {
37 type inet:ip-address;
38 type string {
39 pattern
40 '';
41 }
42 }
fdd5c6e8
MS
43 }
44
f8614910
S
45 /*
46 * Nexthop types.
47 */
fdd5c6e8
MS
48 typedef nexthop-type {
49 type enumeration {
50 enum "ifindex" {
3d2ab385
CS
51 value 1;
52 description
53 "Specific interface.";
fdd5c6e8
MS
54 }
55 enum "ip4" {
3d2ab385
CS
56 value 2;
57 description
58 "IPv4 address.";
fdd5c6e8
MS
59 }
60 enum "ip4-ifindex" {
3d2ab385
CS
61 value 3;
62 description
63 "IPv4 address and interface.";
fdd5c6e8
MS
64 }
65 enum "ip6" {
3d2ab385
CS
66 value 4;
67 description
68 "IPv6 address.";
fdd5c6e8
MS
69 }
70 enum "ip6-ifindex" {
3d2ab385
CS
71 value 5;
72 description
73 "IPv6 address and interface.";
fdd5c6e8
MS
74 }
75 enum "blackhole" {
3d2ab385
CS
76 value 6;
77 description
78 "Unreachable or prohibited.";
fdd5c6e8
MS
79 }
80 }
81 description
82 "Nexthop types.";
83 }
84
f8614910
S
85 /*
86 * Blockhole nexthop type.
87 */
fdd5c6e8
MS
88 typedef blackhole-type {
89 type enumeration {
90 enum "unspec" {
3d2ab385
CS
91 value 0;
92 description
93 "Generic unreachable.";
fdd5c6e8
MS
94 }
95 enum "null" {
3d2ab385
CS
96 value 1;
97 description
98 "Null type.";
fdd5c6e8
MS
99 }
100 enum "reject" {
3d2ab385
CS
101 value 2;
102 description
103 "ICMP unreachable.";
fdd5c6e8
MS
104 }
105 enum "prohibited" {
3d2ab385
CS
106 value 3;
107 description
108 "ICMP admin-prohibited.";
fdd5c6e8
MS
109 }
110 }
111 default "null";
112 description
113 "Nexthop blackhole types.";
114 }
115
116 /*
f8614910 117 * Common nexthop attributes grouping.
fdd5c6e8 118 */
f8614910 119 grouping frr-nexthop-attributes {
fdd5c6e8
MS
120 leaf nh-type {
121 type nexthop-type;
122 mandatory true;
123 description
3d2ab385 124 "The nexthop type.";
fdd5c6e8 125 }
fdd5c6e8 126 leaf vrf {
f8614910 127 type frr-vrf:vrf-ref;
fdd5c6e8 128 description
3d2ab385 129 "The nexthop vrf name, if different from the route.";
fdd5c6e8 130 }
f8614910
S
131 leaf gateway {
132 type frr-nexthop:optional-ip-address;
133 description
134 "The nexthop gateway address.";
135 }
fdd5c6e8 136 leaf interface {
1b9468cc 137 type frr-interface:interface-ref;
fdd5c6e8 138 description
3d2ab385 139 "The nexthop egress interface.";
fdd5c6e8 140 }
fdd5c6e8 141 leaf bh-type {
f8614910 142 when "../nh-type = 'blackhole'";
fdd5c6e8
MS
143 type blackhole-type;
144 description
3d2ab385 145 "A blackhole sub-type, if the nexthop is a blackhole type.";
fdd5c6e8 146 }
f8614910
S
147 leaf onlink {
148 when "../nh-type = 'ip4-ifindex' or
149 ../nh-type = 'ip6-ifindex'";
150 type boolean;
151 default false;
fdd5c6e8 152 description
f8614910 153 "Nexthop is directly connected.";
fdd5c6e8 154 }
f8614910 155 uses rt-types:mpls-label-stack {
fdd5c6e8 156 description
f8614910 157 "Nexthop's MPLS label stack.";
fdd5c6e8 158 }
f8614910 159 }
3d2ab385 160
f8614910
S
161 /*
162 * operational common attributes for nexthop
163 */
164 grouping frr-nexthop-operational {
165 leaf duplicate {
166 config false;
fdd5c6e8
MS
167 type empty;
168 description
f8614910 169 "Duplicate nexthop";
fdd5c6e8 170 }
f8614910
S
171 leaf recursive {
172 config false;
fdd5c6e8
MS
173 type empty;
174 description
f8614910 175 "Nexthop resolved through another gateway.";
fdd5c6e8 176 }
f8614910
S
177 leaf active {
178 config false;
fdd5c6e8
MS
179 type empty;
180 description
3d2ab385 181 "Nexthop is active.";
fdd5c6e8 182 }
f8614910
S
183 leaf fib {
184 config false;
185 type empty;
fdd5c6e8 186 description
f8614910 187 "Nexthop is installed in fib.";
fdd5c6e8 188 }
f8614910 189 }
fdd5c6e8 190
f8614910
S
191 /*
192 * Single nexthop grouping.
193 */
194 grouping frr-nexthop {
195 container frr-nexthops {
fdd5c6e8 196 description
f8614910
S
197 "FRR nexthop object.";
198 list nexthop {
199 key "nh-type gateway interface";
200 description
201 "A list of nexthop objects.";
202
203 uses frr-nexthop-attributes;
204 }
fdd5c6e8 205 }
3d2ab385 206 }
fdd5c6e8 207
f8614910 208
fdd5c6e8 209 /*
f8614910 210 * Container for FRR nexthop group.
fdd5c6e8 211 */
f8614910
S
212 grouping frr-nexthop-grouping {
213 list nexthop-group {
214 key "name";
fdd5c6e8 215 description
f8614910 216 "A group of nexthops.";
fdd5c6e8 217
f8614910
S
218 leaf name {
219 type string;
fdd5c6e8 220 description
f8614910 221 "The nexthop-group name.";
fdd5c6e8
MS
222 }
223
224 uses frr-nexthop;
fdd5c6e8 225 }
3d2ab385 226 }
fdd5c6e8 227
f8614910
S
228 container frr-nexthop-group {
229 description
230 "A nexthop-group, represented as a list of nexthop objects.";
231
232 uses frr-nexthop-grouping;
233 }
234
235 /*
236 * Agument weight attributes to nexthop group.
237 */
238 augment "/frr-nexthop-group/nexthop-group/frr-nexthops/nexthop" {
239 leaf weight {
240 type uint8;
241 description
242 "Weight to be used by the nexthop for purposes of ECMP";
243 }
244 }
fdd5c6e8 245}