3 namespace "http://frrouting.org/yang/route-map";
6 import ietf-inet-types {
12 import frr-interface {
16 organization "Free Range Routing";
18 "FRR Users List: <mailto:frog@lists.frrouting.org>
19 FRR Development List: <mailto:dev@lists.frrouting.org>";
20 description "This module defines route map settings";
23 description "Initial revision";
29 typedef route-map-sequence {
30 description "Route map valid sequence numbers";
36 typedef route-map-name {
37 description "Route map name format";
46 description "Route map instance";
51 description "Route map instance name";
56 description "Route map entry";
62 "Route map instance priority (low number means higher priority)";
63 type route-map-sequence;
67 description "Route map description";
73 "Route map actions: permit (executes action), deny (quits evaluation)";
78 "Executes configured action and permits the prefix/route
79 if the conditions matched. An alternative exit action can
80 be configured to continue processing the route map list
81 or jump to process another route map.";
86 "If all conditions are met the prefix/route is denied and
87 route map processing stops.";
95 "Call another route map before calling `exit-policy`. If the
96 called route map returns deny then this route map will also
102 description "What do to after route map successful match, set and call";
104 enum permit-or-deny {
105 description "End route map evaluation and return";
110 "Proceed evaluating next route map entry per sequence";
115 "Go to route map entry with the provided sequence number";
119 default "permit-or-deny";
123 when "../exit-policy = 'goto'";
125 "Sequence number to jump (when using `goto` exit policy)";
127 type route-map-sequence;
130 list match-condition {
131 description "Route map match conditions";
136 description "Match condition";
139 description "Match interface";
142 enum ipv4-address-list {
143 description "Match an IPv4 access-list";
146 enum ipv4-prefix-list {
147 description "Match an IPv4 prefix-list";
150 enum ipv4-next-hop-list {
151 description "Match an IPv4 next-hop";
154 enum ipv4-next-hop-prefix-list {
155 description "Match an IPv4 next-hop prefix list";
158 enum ipv4-next-hop-type {
159 description "Match an IPv4 next-hop type";
162 enum ipv6-address-list {
163 description "Match an IPv6 access-list";
166 enum ipv6-prefix-list {
167 description "Match an IPv6 prefix-list";
170 enum ipv6-next-hop-type {
171 description "Match an IPv6 next-hop type";
175 description "Match a route metric";
179 description "Match a route tag";
182 /* zebra specific conditions. */
183 enum ipv4-prefix-length {
184 description "Match IPv4 prefix length";
187 enum ipv6-prefix-length {
188 description "Match IPv6 prefix length";
191 enum ipv4-next-hop-prefix-length {
192 description "Match next-hop prefix length";
195 enum source-protocol {
196 description "Match prefix length";
199 enum source-instance {
200 description "Match prefix length";
206 choice condition-value {
208 "Value to match (interpretation depends on condition type)";
211 when "./condition = 'interface'";
213 type frr-interface:interface-ref;
216 case access-list-num {
217 when "./condition = 'ipv4-address-list' or
218 ./condition = 'ipv4-next-hop-list'";
219 leaf access-list-num {
220 type filter:access-list-standard;
223 case access-list-num-extended {
224 when "./condition = 'ipv4-address-list' or
225 ./condition = 'ipv4-next-hop-list'";
226 leaf access-list-num-extended {
227 type filter:access-list-extended;
231 when "./condition = 'ipv4-address-list' or
232 ./condition = 'ipv4-prefix-list' or
233 ./condition = 'ipv4-next-hop-list' or
234 ./condition = 'ipv4-next-hop-prefix-list' or
235 ./condition = 'ipv6-address-list' or
236 ./condition = 'ipv6-prefix-list'";
238 type filter:access-list-name;
241 case ipv4-next-hop-type {
242 when "./condition = 'ipv4-next-hop-type'";
243 leaf ipv4-next-hop-type {
251 case ipv6-next-hop-type {
252 when "./condition = 'ipv6-next-hop-type'";
253 leaf ipv6-next-hop-type {
262 when "./condition = 'metric'";
265 range "1..4294967295";
270 when "./condition = 'tag'";
273 range "1..4294967295";
281 description "Route map set actions";
286 description "Action to do when the route map matches";
289 description "Set IPv4 address of the next hop";
293 description "Set IPv6 address of the next hop";
297 description "Set prefix/route metric";
301 description "Set tag";
304 /* zebra specific conditions. */
306 description "Set source address for route";
312 choice action-value {
314 "Value to set (interpretation depends on action-type)";
316 when "./action = 'ipv4-next-hop'";
318 description "IPv4 address";
319 type inet:ipv4-address;
323 when "./action = 'ipv6-next-hop'";
325 description "IPv6 address";
326 type inet:ipv6-address;
330 when "./action = 'metric'";
331 choice metric-value {
332 description "Metric to set or use";
335 description "Use the following metric value";
337 range "0..4294967295";
343 description "Add unit to metric";
347 case subtract-metric {
348 leaf subtract-metric {
349 description "Subtract unit from metric";
353 case use-round-trip-time {
354 leaf use-round-trip-time {
355 description "Use the round trip time as metric";
359 case add-round-trip-time {
360 leaf add-round-trip-time {
361 description "Add round trip time to metric";
365 case subtract-round-trip-time {
366 leaf subtract-round-trip-time {
367 description "Subtract round trip time to metric";
374 when "./action = 'tag'";
376 description "Tag value";
378 range "0..4294967295";