]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-filter.yang
Merge pull request #5644 from donaldsharp/more_pim_doc
[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 "Free Range Routing";
14 contact
15 "FRR Users List: <mailto:frog@lists.frrouting.org>
16 FRR Development List: <mailto:dev@lists.frrouting.org>";
17 description "This module defines filter settings";
18
19 revision 2019-07-04 {
20 description "Initial revision";
21 }
22
23 /*
24 * Types.
25 */
26 typedef access-list-standard {
27 description "Standard IPv4 access list (any, host or a prefix)";
28 type uint16 {
29 range "1..99 | 1300..1999";
30 }
31 }
32
33 typedef access-list-extended {
34 description
35 "Extended IPv4 access list (source / destination any, hosts or prefixes)";
36 type uint16 {
37 range "100..199 | 2000..2699";
38 }
39 }
40
41 typedef access-list-legacy {
42 description "Standard/Extended IPv4 access list";
43 type uint16 {
44 range "1..199 | 1300..2699";
45 }
46 }
47
48 typedef access-list-name {
49 description "Access list name formatting";
50 type string;
51 }
52
53 typedef access-list-sequence {
54 description "Access list sequence number";
55 type uint32 {
56 range "1..4294967295";
57 }
58 }
59
60 typedef access-list-action {
61 description "Access list return action on match";
62 type enumeration {
63 enum deny {
64 description "Deny an entry";
65 value 0;
66 }
67 enum permit {
68 description "Accept an entry";
69 value 1;
70 }
71 }
72 }
73
74 /*
75 * Configuration data.
76 */
77 container filter-list {
78 list access-list-legacy {
79 description "Access list legacy instance";
80
81 key "number sequence";
82
83 leaf number {
84 description "Access list sequence value";
85 type access-list-legacy;
86 }
87
88 leaf sequence {
89 description "Access list sequence value";
90 type access-list-sequence;
91 }
92
93 leaf action {
94 description "Access list action on match";
95 type access-list-action;
96 mandatory true;
97 }
98
99 leaf remark {
100 description "Access list remark";
101 type string;
102 }
103
104 choice value {
105 description
106 "Standard access list: value to match.
107 Extended access list: source value to match.";
108 mandatory true;
109
110 leaf host {
111 description "Host to match";
112 type inet:ipv4-address;
113 }
114 leaf network {
115 description "Network to match";
116 type inet:ipv4-prefix;
117 }
118 leaf any {
119 description "Match any";
120 type empty;
121 }
122 }
123
124 choice extended-value {
125 when "./sequence >= 100 and ./sequence <= 199 or
126 ./sequence >= 2000 and ./sequence <= 2699";
127 description "Destination value to match";
128
129 leaf destination-host {
130 description "Host to match";
131 type inet:ipv4-address;
132 }
133 leaf destination-network {
134 description "Network to match";
135 type inet:ipv4-prefix;
136 }
137 leaf destination-any {
138 description "Match any";
139 type empty;
140 }
141 }
142 }
143
144 list access-list {
145 description "Access list instance";
146
147 key "type identifier sequence";
148
149 leaf type {
150 description "Access list content type";
151 type enumeration {
152 enum ipv4 {
153 description "Internet Protocol address version 4";
154 value 0;
155 }
156 enum ipv6 {
157 description "Internet Protocol address version 6";
158 value 1;
159 }
160 enum mac {
161 description "Media Access Control address";
162 value 2;
163 }
164
165 /*
166 * Protocol YANG models should augment the parent node to
167 * contain the routing protocol specific value. The protocol
168 * must also augment `value` leaf to include its specific
169 * values or expand the `when` statement on the existing cases.
170 */
171 enum custom {
172 description "Custom data type";
173 value 100;
174 }
175 }
176 }
177
178 leaf identifier {
179 description "Access list identifier";
180 type access-list-name;
181 }
182
183 leaf sequence {
184 description "Access list sequence value";
185 type access-list-sequence;
186 }
187
188 leaf action {
189 description "Access list action on match";
190 type access-list-action;
191 mandatory true;
192 }
193
194 leaf remark {
195 description "Access list remark";
196 type string;
197 }
198
199 choice value {
200 description "Access list value to match";
201 mandatory true;
202
203 case ipv4-prefix {
204 when "./type = 'ipv4'";
205
206 leaf ipv4-prefix {
207 description "Configure IPv4 prefix to match";
208 type inet:ipv4-prefix;
209 }
210
211 leaf ipv4-exact-match {
212 description "Exact match of prefix";
213 type boolean;
214 default false;
215 }
216 }
217 case ipv6-prefix {
218 when "./type = 'ipv6'";
219
220 leaf ipv6-prefix {
221 description "Configure IPv6 prefix to match";
222 type inet:ipv6-prefix;
223 }
224
225 leaf ipv6-exact-match {
226 description "Exact match of prefix";
227 type boolean;
228 default false;
229 }
230 }
231 case mac {
232 when "./type = 'mac'";
233
234 leaf mac {
235 description "Configure MAC address to match";
236 type yang:mac-address;
237 }
238 }
239 case any {
240 leaf any {
241 description "Match anything";
242 type empty;
243 }
244 }
245 }
246 }
247
248 list prefix-list {
249 description "Prefix list instance";
250
251 key "type name sequence";
252
253 leaf type {
254 description "Prefix list type";
255 type enumeration {
256 enum ipv4 {
257 description "Internet Protocol address version 4";
258 value 0;
259 }
260 enum ipv6 {
261 description "Internet Protocol address version 6";
262 value 1;
263 }
264 }
265 }
266
267 leaf name {
268 description "Prefix list name";
269 type access-list-name;
270 }
271
272 leaf sequence {
273 description "Access list sequence value";
274 type access-list-sequence;
275 }
276
277 leaf action {
278 description "Prefix list action on match";
279 type access-list-action;
280 mandatory true;
281 }
282
283 leaf description {
284 description "Prefix list user description";
285 type string;
286 }
287
288 choice value {
289 description "Prefix list value to match";
290 mandatory true;
291
292 case ipv4-prefix {
293 when "./type = 'ipv4'";
294
295 leaf ipv4-prefix {
296 description "Configure IPv4 prefix to match";
297 type inet:ipv4-prefix;
298 }
299
300 leaf ipv4-prefix-length-greater-or-equal {
301 description
302 "Specifies if matching prefixes with length greater than
303 or equal to value";
304 type uint8 {
305 range "0..32";
306 }
307 }
308
309 leaf ipv4-prefix-length-lesser-or-equal {
310 description
311 "Specifies if matching prefixes with length lesser than
312 or equal to value";
313 type uint8 {
314 range "0..32";
315 }
316 }
317 }
318 case ipv6-prefix {
319 when "./type = 'ipv6'";
320
321 leaf ipv6-prefix {
322 description "Configure IPv6 prefix to match";
323 type inet:ipv6-prefix;
324 }
325
326 leaf ipv6-prefix-length-greater-or-equal {
327 description
328 "Specifies if matching prefixes with length greater than
329 or equal to value";
330 type uint8 {
331 range "0..128";
332 }
333 }
334
335 leaf ipv6-prefix-length-lesser-or-equal {
336 description
337 "Specifies if matching prefixes with length lesser than
338 or equal to value";
339 type uint8 {
340 range "0..128";
341 }
342 }
343 }
344 case any {
345 leaf any {
346 description "Match anything";
347 type empty;
348 }
349 }
350 }
351 }
352 }
353 }