3 namespace "http://frrouting.org/yang/route-map";
6 import ietf-inet-types {
14 import frr-interface {
21 "FRR Users List: <mailto:frog@lists.frrouting.org>
22 FRR Development List: <mailto:dev@lists.frrouting.org>";
24 "This module defines route map settings
26 Copyright 2020 FRRouting
28 Redistribution and use in source and binary forms, with or without
29 modification, are permitted provided that the following conditions
32 1. Redistributions of source code must retain the above copyright notice,
33 this list of conditions and the following disclaimer.
35 2. Redistributions in binary form must reproduce the above copyright
36 notice, this list of conditions and the following disclaimer in the
37 documentation and/or other materials provided with the distribution.
39 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
40 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
41 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
42 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
43 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
45 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
46 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
47 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
48 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
49 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
56 identity rmap-match-type {
58 "Base route-map match-condition";
67 identity ipv4-address-list {
70 "Match an IPv4 access-list";
73 identity ipv4-prefix-list {
76 "Match an IPv4 prefix-list";
79 identity ipv4-next-hop-list {
82 "Match an IPv4 next-hop";
85 identity ipv4-next-hop-prefix-list {
88 "Match an IPv4 next-hop prefix list";
91 identity ipv4-next-hop-type {
94 "Match an IPv4 next-hop type";
97 identity ipv6-address-list {
100 "Match an IPv6 access-list";
103 identity ipv6-prefix-list {
104 base rmap-match-type;
106 "Match an IPv6 prefix-list";
109 identity ipv6-next-hop-type {
110 base rmap-match-type;
112 "Match an IPv6 next-hop type";
115 identity match-metric {
116 base rmap-match-type;
118 "Match a route metric";
122 base rmap-match-type;
127 identity rmap-set-type {
129 "Base route-map set-action";
132 identity ipv4-next-hop {
135 "Set IPv4 address of the next hop";
138 identity ipv6-next-hop {
141 "Set IPv6 address of the next hop";
144 identity set-metric {
147 "Set prefix/route metric";
156 identity set-sr-te-color {
159 "Set Color of the SR-TE";
162 typedef route-map-sequence {
167 "Route map valid sequence numbers";
170 typedef route-map-name {
173 "Route map name format";
176 typedef route-map-ref {
178 path "/frr-route-map:lib/frr-route-map:route-map/frr-route-map:name";
179 require-instance false;
182 "Reference to a route-map.";
185 grouping rmap-match-condition {
186 container rmap-match-condition {
187 choice match-condition {
189 "Value to match (interpretation depends on condition type)";
191 when "derived-from-or-self(../condition, 'interface')";
193 type frr-interface:interface-ref;
198 when "derived-from-or-self(../condition, 'ipv4-address-list') or "
199 + "derived-from-or-self(../condition, 'ipv4-prefix-list') or "
200 + "derived-from-or-self(../condition, 'ipv4-next-hop-list') or "
201 + "derived-from-or-self(../condition, 'ipv4-next-hop-prefix-list') or "
202 + "derived-from-or-self(../condition, 'ipv6-address-list') or "
203 + "derived-from-or-self(../condition, 'ipv6-prefix-list')";
205 type filter:access-list-name;
209 case ipv4-next-hop-type {
210 when "derived-from-or-self(../condition, 'ipv4-next-hop-type')";
211 leaf ipv4-next-hop-type {
220 case ipv6-next-hop-type {
221 when "derived-from-or-self(../condition, 'ipv6-next-hop-type')";
222 leaf ipv6-next-hop-type {
232 when "derived-from-or-self(../condition, 'match-metric')";
235 range "1..4294967295";
241 when "derived-from-or-self(../condition, 'match-tag')";
244 range "1..4294967295";
252 grouping rmap-set-action {
253 container rmap-set-action {
256 "Value to set (interpretation depends on action-type)";
258 when "derived-from-or-self(../action, 'ipv4-next-hop')";
260 type inet:ipv4-address;
267 when "derived-from-or-self(../action, 'ipv6-next-hop')";
269 type inet:ipv6-address;
276 when "derived-from-or-self(../action, 'set-metric')";
277 choice metric-value {
279 "Metric to set or use";
283 range "0..4294967295";
286 "Use the following metric value";
292 description "Add value to metric.";
294 range "0..4294967295";
299 case subtract-metric {
300 leaf subtract-metric {
301 description "Subtract value from metric.";
303 range "0..4294967295";
308 case use-round-trip-time {
309 leaf use-round-trip-time {
312 "Use the round trip time as metric";
316 case add-round-trip-time {
317 leaf add-round-trip-time {
320 "Add round trip time to metric";
324 case subtract-round-trip-time {
325 leaf subtract-round-trip-time {
328 "Subtract round trip time to metric";
335 when "derived-from-or-self(../action, 'set-tag')";
338 range "0..4294967295";
345 case set-sr-te-color {
346 when "derived-from-or-self(../action, 'set-sr-te-color')";
350 "Color of the SR-TE Policies to match with";
361 "Route map instance";
365 "Route map instance name";
367 leaf optimization-disabled {
370 description "Disables or enables the optimization";
378 type route-map-sequence;
380 "Route map instance priority (low number means higher priority)";
386 "Route map description";
394 "Executes configured action and permits the prefix/route
395 if the conditions matched. An alternative exit action can
396 be configured to continue processing the route map list
397 or jump to process another route map.";
402 "If all conditions are met the prefix/route is denied and
403 route map processing stops.";
408 "Route map actions: permit (executes action), deny (quits evaluation)";
414 "Call another route map before calling `exit-policy`. If the
415 called route map returns deny then this route map will also
421 enum "permit-or-deny" {
424 "End route map evaluation and return";
429 "Proceed evaluating next route map entry per sequence";
434 "Go to route map entry with the provided sequence number";
437 default "permit-or-deny";
439 "What do to after route map successful match, set and call";
443 when "../exit-policy = 'goto'";
444 type route-map-sequence;
447 "Sequence number to jump (when using `goto` exit policy)";
450 list match-condition {
453 "Route map match conditions";
456 base rmap-match-type;
462 uses rmap-match-condition;
468 "Route map set actions";
474 "Action to do when the route map matches";
477 uses rmap-set-action;