3 namespace "http://frrouting.org/yang/route-map";
6 import ietf-inet-types {
12 import frr-interface {
16 organization "FRRouting";
18 "FRR Users List: <mailto:frog@lists.frrouting.org>
19 FRR Development List: <mailto:dev@lists.frrouting.org>";
21 "This module defines route map settings
23 Copyright 2020 FRRouting
25 Redistribution and use in source and binary forms, with or without
26 modification, are permitted provided that the following conditions
29 1. Redistributions of source code must retain the above copyright notice,
30 this list of conditions and the following disclaimer.
32 2. Redistributions in binary form must reproduce the above copyright
33 notice, this list of conditions and the following disclaimer in the
34 documentation and/or other materials provided with the distribution.
36 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
37 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
38 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
39 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
40 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
43 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
45 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
49 description "Initial revision";
55 typedef route-map-sequence {
56 description "Route map valid sequence numbers";
62 typedef route-map-name {
63 description "Route map name format";
72 description "Route map instance";
77 description "Route map instance name";
82 description "Route map entry";
88 "Route map instance priority (low number means higher priority)";
89 type route-map-sequence;
93 description "Route map description";
99 "Route map actions: permit (executes action), deny (quits evaluation)";
104 "Executes configured action and permits the prefix/route
105 if the conditions matched. An alternative exit action can
106 be configured to continue processing the route map list
107 or jump to process another route map.";
112 "If all conditions are met the prefix/route is denied and
113 route map processing stops.";
121 "Call another route map before calling `exit-policy`. If the
122 called route map returns deny then this route map will also
128 description "What do to after route map successful match, set and call";
130 enum permit-or-deny {
131 description "End route map evaluation and return";
136 "Proceed evaluating next route map entry per sequence";
141 "Go to route map entry with the provided sequence number";
145 default "permit-or-deny";
149 when "../exit-policy = 'goto'";
151 "Sequence number to jump (when using `goto` exit policy)";
153 type route-map-sequence;
156 list match-condition {
157 description "Route map match conditions";
162 description "Match condition";
165 description "Match interface";
168 enum ipv4-address-list {
169 description "Match an IPv4 access-list";
172 enum ipv4-prefix-list {
173 description "Match an IPv4 prefix-list";
176 enum ipv4-next-hop-list {
177 description "Match an IPv4 next-hop";
180 enum ipv4-next-hop-prefix-list {
181 description "Match an IPv4 next-hop prefix list";
184 enum ipv4-next-hop-type {
185 description "Match an IPv4 next-hop type";
188 enum ipv6-address-list {
189 description "Match an IPv6 access-list";
192 enum ipv6-prefix-list {
193 description "Match an IPv6 prefix-list";
196 enum ipv6-next-hop-type {
197 description "Match an IPv6 next-hop type";
201 description "Match a route metric";
205 description "Match a route tag";
208 /* zebra specific conditions. */
209 enum ipv4-prefix-length {
210 description "Match IPv4 prefix length";
213 enum ipv6-prefix-length {
214 description "Match IPv6 prefix length";
217 enum ipv4-next-hop-prefix-length {
218 description "Match next-hop prefix length";
221 enum source-protocol {
222 description "Match source protocol";
225 enum source-instance {
226 description "Match source protocol instance";
232 choice condition-value {
234 "Value to match (interpretation depends on condition type)";
237 when "./condition = 'interface'";
242 case access-list-num {
243 when "./condition = 'ipv4-address-list' or
244 ./condition = 'ipv4-next-hop-list'";
245 leaf access-list-num {
246 type filter:access-list-standard;
249 case access-list-num-extended {
250 when "./condition = 'ipv4-address-list' or
251 ./condition = 'ipv4-next-hop-list'";
252 leaf access-list-num-extended {
253 type filter:access-list-extended;
257 when "./condition = 'ipv4-address-list' or
258 ./condition = 'ipv4-prefix-list' or
259 ./condition = 'ipv4-next-hop-list' or
260 ./condition = 'ipv4-next-hop-prefix-list' or
261 ./condition = 'ipv6-address-list' or
262 ./condition = 'ipv6-prefix-list'";
264 type filter:access-list-name;
267 case ipv4-next-hop-type {
268 when "./condition = 'ipv4-next-hop-type'";
269 leaf ipv4-next-hop-type {
277 case ipv6-next-hop-type {
278 when "./condition = 'ipv6-next-hop-type'";
279 leaf ipv6-next-hop-type {
288 when "./condition = 'metric'";
291 range "1..4294967295";
296 when "./condition = 'tag'";
299 range "1..4294967295";
307 description "Route map set actions";
312 description "Action to do when the route map matches";
315 description "Set IPv4 address of the next hop";
319 description "Set IPv6 address of the next hop";
323 description "Set prefix/route metric";
327 description "Set tag";
330 /* zebra specific conditions. */
332 description "Set source address for route";
338 choice action-value {
340 "Value to set (interpretation depends on action-type)";
342 when "./action = 'ipv4-next-hop'";
344 description "IPv4 address";
345 type inet:ipv4-address;
349 when "./action = 'ipv6-next-hop'";
351 description "IPv6 address";
352 type inet:ipv6-address;
356 when "./action = 'metric'";
357 choice metric-value {
358 description "Metric to set or use";
361 description "Use the following metric value";
363 range "0..4294967295";
369 description "Add unit to metric";
373 case subtract-metric {
374 leaf subtract-metric {
375 description "Subtract unit from metric";
379 case use-round-trip-time {
380 leaf use-round-trip-time {
381 description "Use the round trip time as metric";
385 case add-round-trip-time {
386 leaf add-round-trip-time {
387 description "Add round trip time to metric";
391 case subtract-round-trip-time {
392 leaf subtract-round-trip-time {
393 description "Subtract round trip time to metric";
400 when "./action = 'tag'";
402 description "Tag value";
404 range "0..4294967295";