3 namespace "http://frrouting.org/yang/route-map";
6 import ietf-inet-types {
13 organization "Free Range Routing";
15 "FRR Users List: <mailto:frog@lists.frrouting.org>
16 FRR Development List: <mailto:dev@lists.frrouting.org>";
17 description "This module defines route map settings";
20 description "Initial revision";
26 typedef route-map-sequence {
27 description "Route map valid sequence numbers";
33 typedef route-map-name {
34 description "Route map name format";
43 description "Route map instance";
48 description "Route map instance name";
54 "Route map instance priority (low number means higher priority)";
55 type route-map-sequence;
59 description "Route map description";
65 "Route map actions: permit (executes action), deny (quits evaluation)";
70 "Executes configured action and permits the prefix/route
71 if the conditions matched. An alternative exit action can
72 be configured to continue processing the route map list
73 or jump to process another route map.";
78 "If all conditions are met the prefix/route is denied and
79 route map processing stops.";
85 list match-condition {
86 description "Route map match conditions";
91 description "Match condition";
94 description "Match interface";
97 enum ipv4-address-list {
98 description "Match an IPv4 access-list";
101 enum ipv4-prefix-list {
102 description "Match an IPv4 prefix-list";
105 enum ipv4-prefix-length {
106 description "Match an IPv4 prefix length";
109 enum ipv4-next-hop-list {
110 description "Match an IPv4 next-hop";
113 enum ipv4-next-hop-prefix-list {
114 description "Match an IPv4 next-hop prefix list";
117 enum ipv4-next-hop-prefix-length {
118 description "Match an IPv4 next-hop prefix length";
121 enum ipv4-next-hop-type {
122 description "Match an IPv4 next-hop type";
125 enum ipv6-address-list {
126 description "Match an IPv6 access-list";
129 enum ipv6-prefix-list {
130 description "Match an IPv6 prefix-list";
133 enum ipv6-prefix-length {
134 description "Match an IPv6 prefix length";
138 description "Match an IPv6 next-hop";
141 enum ipv6-next-hop-type {
142 description "Match an IPv6 next-hop type";
146 description "Match a route metric";
150 description "Match a route tag";
155 * Protocol YANG models should augment the parent node to
156 * contain the routing protocol specific value. The protocol
157 * must also augment `condition-value` to include its specific
158 * values or expand the `when` statement on the existing cases.
160 enum routing-protocol-specific {
161 description "Match a routing protocol specific type";
167 choice condition-value {
169 "Value to match (interpretation depends on condition type)";
170 case access-list-num {
171 when "./condition = 'ipv4-address-list' or
172 ./condition = 'ipv4-next-hop-list'";
173 leaf access-list-num {
174 type filter:access-list-standard;
177 case access-list-num-extended {
178 when "./condition = 'ipv4-address-list' or
179 ./condition = 'ipv4-next-hop-list'";
180 leaf access-list-num-extended {
181 type filter:access-list-extended;
185 when "./condition = 'ipv4-address-list' or
186 ./condition = 'ipv4-prefix-list' or
187 ./condition = 'ipv4-next-hop-list' or
188 ./condition = 'ipv4-next-hop-prefix-list' or
189 ./condition = 'ipv6-address-list' or
190 ./condition = 'ipv6-prefix-list'";
192 type filter:access-list-name;
196 when "./condition = 'ipv6-next-hop'";
198 type inet:ipv6-address;
201 case ipv4-prefix-length {
202 when "./condition = 'ipv4-prefix-length' or
203 ./condition = 'ipv4-next-hop-prefix-length'";
204 leaf ipv4-prefix-length {
210 case ipv6-prefix-length {
211 when "./condition = 'ipv6-prefix-length'";
212 leaf ipv6-prefix-length {
218 case ipv4-next-hop-type {
219 when "./condition = 'ipv4-next-hop-type'";
220 leaf ipv4-next-hop-type {
228 case ipv6-next-hop-type {
229 when "./condition = 'ipv6-next-hop-type'";
230 leaf ipv6-next-hop-type {
239 when "./condition = 'metric'";
242 range "1..4294967295";
247 when "./condition = 'tag'";
250 range "1..4294967295";
258 description "Route map set actions";
263 description "Action to do when the route map matches";
266 description "Set IPv4 address of the next hop";
270 description "Set IPv6 address of the next hop";
274 description "Set prefix/route metric";
278 description "Set tag";
283 * Protocol YANG models should augment the parent node to
284 * contain the routing protocol specific value. The protocol
285 * must also augment `action-value` to include its specific
286 * values or expand the `when` statement on the existing cases.
288 enum routing-protocol-specific {
289 description "Set a routing protocol specific action";
295 choice action-value {
297 "Value to set (interpretation depends on action-type)";
299 when "./action = 'ipv4-next-hop'";
301 description "IPv4 address";
302 type inet:ipv4-address;
306 when "./action = 'ipv6-next-hop'";
308 description "IPv6 address";
309 type inet:ipv6-address;
313 when "./action = 'metric'";
314 choice metric-value {
315 description "Metric to set or use";
318 description "Use the following metric value";
320 range "0..4294967295";
326 description "Add unit to metric";
330 case subtract-metric {
331 leaf subtract-metric {
332 description "Subtract unit from metric";
336 case use-round-trip-time {
337 leaf use-round-trip-time {
338 description "Use the round trip time as metric";
342 case add-round-trip-time {
343 leaf add-round-trip-time {
344 description "Add round trip time to metric";
348 case subtract-round-trip-time {
349 leaf subtract-round-trip-time {
350 description "Subtract round trip time to metric";
358 description "Tag value";
360 range "0..4294967295";
369 "Call another route map before calling `exit-policy`. If the
370 called route map returns deny then this route map will also
376 description "What do to after route map successful match, set and call";
378 enum permit-or-deny {
379 description "End route map evaluation and return";
384 "Proceed evaluating next route map entry per sequence";
389 "Go to route map entry with the provided sequence number";
393 default "permit-or-deny";
397 when "../exit-policy = 'goto'";
399 "Sequence number to jump (when using `goto` exit policy)";
400 type route-map-sequence;