]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-filter.yang
Merge pull request #6509 from donaldsharp/mlag_missed_upstream
[mirror_frr.git] / yang / frr-filter.yang
1 module frr-filter {
2 yang-version 1.1;
3 namespace "http://frrouting.org/yang/filter";
4 prefix frr-filter;
5
6 import ietf-inet-types {
7 prefix inet;
8 }
9 import ietf-yang-types {
10 prefix yang;
11 }
12
13 organization "FRRouting";
14 contact
15 "FRR Users List: <mailto:frog@lists.frrouting.org>
16 FRR Development List: <mailto:dev@lists.frrouting.org>";
17 description
18 "This module defines filter settings
19
20 Copyright 2020 FRRouting
21
22 Redistribution and use in source and binary forms, with or without
23 modification, are permitted provided that the following conditions
24 are met:
25
26 1. Redistributions of source code must retain the above copyright notice,
27 this list of conditions and the following disclaimer.
28
29 2. Redistributions in binary form must reproduce the above copyright
30 notice, this list of conditions and the following disclaimer in the
31 documentation and/or other materials provided with the distribution.
32
33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
36 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
37 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
39 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
40 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
41 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
43 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
44
45 revision 2019-07-04 {
46 description "Initial revision";
47 }
48
49 /*
50 * Types.
51 */
52 typedef access-list-standard {
53 description "Standard IPv4 access list (any, host or a prefix)";
54 type uint16 {
55 range "1..99 | 1300..1999";
56 }
57 }
58
59 typedef access-list-extended {
60 description
61 "Extended IPv4 access list (source / destination any, hosts or prefixes)";
62 type uint16 {
63 range "100..199 | 2000..2699";
64 }
65 }
66
67 typedef access-list-legacy {
68 description "Standard/Extended IPv4 access list";
69 type uint16 {
70 range "1..199 | 1300..2699";
71 }
72 }
73
74 typedef access-list-name {
75 description "Access list name formatting";
76 type string {
77 length 1..128;
78 }
79 }
80
81 typedef access-list-sequence {
82 description "Access list sequence number";
83 type uint32 {
84 range "1..4294967295";
85 }
86 }
87
88 typedef access-list-action {
89 description "Access list return action on match";
90 type enumeration {
91 enum deny {
92 description "Deny an entry";
93 value 0;
94 }
95 enum permit {
96 description "Accept an entry";
97 value 1;
98 }
99 }
100 }
101
102 /*
103 * Configuration data.
104 */
105 container lib {
106 list access-list-legacy {
107 description "Access list legacy instance";
108
109 key "number";
110
111 leaf number {
112 description "Access list sequence value";
113 type access-list-legacy;
114 }
115
116 leaf remark {
117 description "Access list remark";
118 type string;
119 }
120
121 list entry {
122 description "Access list legacy entry";
123
124 key "sequence";
125
126 leaf sequence {
127 description "Access list sequence value";
128 type access-list-sequence;
129 }
130
131 leaf action {
132 description "Access list action on match";
133 type access-list-action;
134 mandatory true;
135 }
136
137 choice value {
138 description
139 "Standard access list: value to match.
140 Extended access list: source value to match.";
141 mandatory true;
142
143 leaf host {
144 description "Host to match";
145 type inet:ipv4-address;
146 }
147 leaf network {
148 description "Network to match";
149 type inet:ipv4-prefix;
150 }
151 leaf any {
152 description "Match any";
153 type empty;
154 }
155 }
156
157 choice extended-value {
158 when "../number >= 100 and ../number <= 199 or
159 ../number >= 2000 and ../number <= 2699";
160 description "Destination value to match";
161 mandatory true;
162
163 leaf destination-host {
164 description "Host to match";
165 type inet:ipv4-address;
166 }
167 leaf destination-network {
168 description "Network to match";
169 type inet:ipv4-prefix;
170 }
171 leaf destination-any {
172 description "Match any";
173 type empty;
174 }
175 }
176 }
177 }
178
179 list access-list {
180 description "Access list instance";
181
182 key "type name";
183
184 leaf type {
185 description "Access list content type";
186 type enumeration {
187 enum ipv4 {
188 description "Internet Protocol address version 4";
189 value 0;
190 }
191 enum ipv6 {
192 description "Internet Protocol address version 6";
193 value 1;
194 }
195 enum mac {
196 description "Media Access Control address";
197 value 2;
198 }
199 }
200 }
201
202 leaf name {
203 description "Access list name";
204 type access-list-name;
205 }
206
207 leaf remark {
208 description "Access list remark";
209 type string;
210 }
211
212 list entry {
213 description "Access list entry";
214
215 key "sequence";
216
217 leaf sequence {
218 description "Access list sequence value";
219 type access-list-sequence;
220 }
221
222 leaf action {
223 description "Access list action on match";
224 type access-list-action;
225 mandatory true;
226 }
227
228 choice value {
229 description "Access list value to match";
230 mandatory true;
231
232 case ipv4-prefix {
233 when "../type = 'ipv4'";
234
235 leaf ipv4-prefix {
236 description "Configure IPv4 prefix to match";
237 type inet:ipv4-prefix;
238 }
239
240 leaf ipv4-exact-match {
241 description "Exact match of prefix";
242 type boolean;
243 default false;
244 }
245 }
246 case ipv6-prefix {
247 when "../type = 'ipv6'";
248
249 leaf ipv6-prefix {
250 description "Configure IPv6 prefix to match";
251 type inet:ipv6-prefix;
252 }
253
254 leaf ipv6-exact-match {
255 description "Exact match of prefix";
256 type boolean;
257 default false;
258 }
259 }
260 case mac {
261 when "../type = 'mac'";
262
263 leaf mac {
264 description "Configure MAC address to match";
265 type yang:mac-address;
266 }
267 }
268 case any {
269 leaf any {
270 description "Match anything";
271 type empty;
272 }
273 }
274 }
275 }
276 }
277
278 list prefix-list {
279 description "Prefix list instance";
280
281 key "type name";
282
283 leaf type {
284 description "Prefix list type";
285 type enumeration {
286 enum ipv4 {
287 description "Internet Protocol address version 4";
288 value 0;
289 }
290 enum ipv6 {
291 description "Internet Protocol address version 6";
292 value 1;
293 }
294 }
295 }
296
297 leaf name {
298 description "Prefix list name";
299 type access-list-name;
300 }
301
302 leaf remark {
303 description "Prefix list user description";
304 type string;
305 }
306
307 list entry {
308 description "Prefix list entry";
309
310 key "sequence";
311
312 leaf sequence {
313 description "Access list sequence value";
314 type access-list-sequence;
315 }
316
317 leaf action {
318 description "Prefix list action on match";
319 type access-list-action;
320 mandatory true;
321 }
322
323 choice value {
324 description "Prefix list value to match";
325 mandatory true;
326
327 case ipv4-prefix {
328 when "../type = 'ipv4'";
329
330 leaf ipv4-prefix {
331 description "Configure IPv4 prefix to match";
332 type inet:ipv4-prefix;
333 }
334
335 leaf ipv4-prefix-length-greater-or-equal {
336 description
337 "Specifies if matching prefixes with length greater than
338 or equal to value";
339 type uint8 {
340 range "0..32";
341 }
342 }
343
344 leaf ipv4-prefix-length-lesser-or-equal {
345 description
346 "Specifies if matching prefixes with length lesser than
347 or equal to value";
348 type uint8 {
349 range "0..32";
350 }
351 }
352 }
353 case ipv6-prefix {
354 when "../type = 'ipv6'";
355
356 leaf ipv6-prefix {
357 description "Configure IPv6 prefix to match";
358 type inet:ipv6-prefix;
359 }
360
361 leaf ipv6-prefix-length-greater-or-equal {
362 description
363 "Specifies if matching prefixes with length greater than
364 or equal to value";
365 type uint8 {
366 range "0..128";
367 }
368 }
369
370 leaf ipv6-prefix-length-lesser-or-equal {
371 description
372 "Specifies if matching prefixes with length lesser than
373 or equal to value";
374 type uint8 {
375 range "0..128";
376 }
377 }
378 }
379 case any {
380 leaf any {
381 description "Match anything";
382 type empty;
383 }
384 }
385 }
386 }
387 }
388 }
389 }