blob: 6e6a193c28164d644ab1e4774e5b20a3d4d62e96 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
|
module frr-route-map {
yang-version 1.1;
namespace "http://frrouting.org/yang/route-map";
prefix frr-route-map;
import ietf-inet-types {
prefix inet;
}
import frr-filter {
prefix filter;
}
import frr-interface {
prefix frr-interface;
}
organization "FRRouting";
contact
"FRR Users List: <mailto:frog@lists.frrouting.org>
FRR Development List: <mailto:dev@lists.frrouting.org>";
description "This module defines route map settings";
revision 2019-07-01 {
description "Initial revision";
}
/*
* Types.
*/
typedef route-map-sequence {
description "Route map valid sequence numbers";
type uint16 {
range "1..65535";
}
}
typedef route-map-name {
description "Route map name format";
type string;
}
/*
* Operational data.
*/
container lib {
list route-map {
description "Route map instance";
key "name";
leaf name {
description "Route map instance name";
type route-map-name;
}
list entry {
description "Route map entry";
key "sequence";
leaf sequence {
description
"Route map instance priority (low number means higher priority)";
type route-map-sequence;
}
leaf description {
description "Route map description";
type string;
}
leaf action {
description
"Route map actions: permit (executes action), deny (quits evaluation)";
mandatory true;
type enumeration {
enum permit {
description
"Executes configured action and permits the prefix/route
if the conditions matched. An alternative exit action can
be configured to continue processing the route map list
or jump to process another route map.";
value 0;
}
enum deny {
description
"If all conditions are met the prefix/route is denied and
route map processing stops.";
value 1;
}
}
}
leaf call {
description
"Call another route map before calling `exit-policy`. If the
called route map returns deny then this route map will also
return deny";
type route-map-name;
}
leaf exit-policy {
description "What do to after route map successful match, set and call";
type enumeration {
enum permit-or-deny {
description "End route map evaluation and return";
value 0;
}
enum next {
description
"Proceed evaluating next route map entry per sequence";
value 1;
}
enum goto {
description
"Go to route map entry with the provided sequence number";
value 2;
}
}
default "permit-or-deny";
}
leaf goto-value {
when "../exit-policy = 'goto'";
description
"Sequence number to jump (when using `goto` exit policy)";
mandatory true;
type route-map-sequence;
}
list match-condition {
description "Route map match conditions";
key "condition";
leaf condition {
description "Match condition";
type enumeration {
enum interface {
description "Match interface";
value 0;
}
enum ipv4-address-list {
description "Match an IPv4 access-list";
value 1;
}
enum ipv4-prefix-list {
description "Match an IPv4 prefix-list";
value 2;
}
enum ipv4-next-hop-list {
description "Match an IPv4 next-hop";
value 3;
}
enum ipv4-next-hop-prefix-list {
description "Match an IPv4 next-hop prefix list";
value 4;
}
enum ipv4-next-hop-type {
description "Match an IPv4 next-hop type";
value 5;
}
enum ipv6-address-list {
description "Match an IPv6 access-list";
value 6;
}
enum ipv6-prefix-list {
description "Match an IPv6 prefix-list";
value 7;
}
enum ipv6-next-hop-type {
description "Match an IPv6 next-hop type";
value 8;
}
enum metric {
description "Match a route metric";
value 9;
}
enum tag {
description "Match a route tag";
value 10;
}
/*
* Protocol YANG models should augment the parent node to
* contain the routing protocol specific value. The protocol
* must also augment `condition-value` to include its specific
* values or expand the `when` statement on the existing cases.
*/
enum routing-protocol-specific {
description "Match a routing protocol specific type";
value 100;
}
}
}
choice condition-value {
description
"Value to match (interpretation depends on condition type)";
mandatory true;
case interface {
when "./condition = 'interface'";
leaf interface {
type frr-interface:interface-ref;
}
}
case access-list-num {
when "./condition = 'ipv4-address-list' or
./condition = 'ipv4-next-hop-list'";
leaf access-list-num {
type filter:access-list-standard;
}
}
case access-list-num-extended {
when "./condition = 'ipv4-address-list' or
./condition = 'ipv4-next-hop-list'";
leaf access-list-num-extended {
type filter:access-list-extended;
}
}
case list-name {
when "./condition = 'ipv4-address-list' or
./condition = 'ipv4-prefix-list' or
./condition = 'ipv4-next-hop-list' or
./condition = 'ipv4-next-hop-prefix-list' or
./condition = 'ipv6-address-list' or
./condition = 'ipv6-prefix-list'";
leaf list-name {
type filter:access-list-name;
}
}
case ipv4-next-hop-type {
when "./condition = 'ipv4-next-hop-type'";
leaf ipv4-next-hop-type {
type enumeration {
enum blackhole {
value 0;
}
}
}
}
case ipv6-next-hop-type {
when "./condition = 'ipv6-next-hop-type'";
leaf ipv6-next-hop-type {
type enumeration {
enum blackhole {
value 0;
}
}
}
}
case metric {
when "./condition = 'metric'";
leaf metric {
type uint32 {
range "1..4294967295";
}
}
}
case tag {
when "./condition = 'tag'";
leaf tag {
type uint32 {
range "1..4294967295";
}
}
}
}
}
list set-action {
description "Route map set actions";
key "action";
leaf action {
description "Action to do when the route map matches";
type enumeration {
enum ipv4-next-hop {
description "Set IPv4 address of the next hop";
value 0;
}
enum ipv6-next-hop {
description "Set IPv6 address of the next hop";
value 1;
}
enum metric {
description "Set prefix/route metric";
value 2;
}
enum tag {
description "Set tag";
value 3;
}
/*
* Protocol YANG models should augment the parent node to
* contain the routing protocol specific value. The protocol
* must also augment `action-value` to include its specific
* values or expand the `when` statement on the existing cases.
*/
enum routing-protocol-specific {
description "Set a routing protocol specific action";
value 100;
}
}
}
choice action-value {
description
"Value to set (interpretation depends on action-type)";
case ipv4-address {
when "./action = 'ipv4-next-hop'";
leaf ipv4-address {
description "IPv4 address";
type inet:ipv4-address;
}
}
case ipv6-address {
when "./action = 'ipv6-next-hop'";
leaf ipv6-address {
description "IPv6 address";
type inet:ipv6-address;
}
}
case metric {
when "./action = 'metric'";
choice metric-value {
description "Metric to set or use";
case value {
leaf value {
description "Use the following metric value";
type uint32 {
range "0..4294967295";
}
}
}
case add-metric {
leaf add-metric {
description "Add unit to metric";
type boolean;
}
}
case subtract-metric {
leaf subtract-metric {
description "Subtract unit from metric";
type boolean;
}
}
case use-round-trip-time {
leaf use-round-trip-time {
description "Use the round trip time as metric";
type boolean;
}
}
case add-round-trip-time {
leaf add-round-trip-time {
description "Add round trip time to metric";
type boolean;
}
}
case subtract-round-trip-time {
leaf subtract-round-trip-time {
description "Subtract round trip time to metric";
type boolean;
}
}
}
}
case tag {
when "./action = 'tag'";
leaf tag {
description "Tag value";
type uint32 {
range "0..4294967295";
}
}
}
}
}
}
}
}
}
|