3 namespace "http://frrouting.org/yang/filter";
6 import ietf-inet-types {
9 import ietf-yang-types {
13 organization "FRRouting";
15 "FRR Users List: <mailto:frog@lists.frrouting.org>
16 FRR Development List: <mailto:dev@lists.frrouting.org>";
18 "This module defines filter settings
20 Copyright 2020 FRRouting
22 Redistribution and use in source and binary forms, with or without
23 modification, are permitted provided that the following conditions
26 1. Redistributions of source code must retain the above copyright notice,
27 this list of conditions and the following disclaimer.
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.
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.";
46 description "Initial revision";
52 typedef access-list-standard {
53 description "Standard IPv4 access list (any, host or a prefix)";
55 range "1..99 | 1300..1999";
59 typedef access-list-extended {
61 "Extended IPv4 access list (source / destination any, hosts or prefixes)";
63 range "100..199 | 2000..2699";
67 typedef access-list-legacy {
68 description "Standard/Extended IPv4 access list";
70 range "1..199 | 1300..2699";
74 typedef access-list-name {
75 description "Access list name formatting";
81 typedef access-list-sequence {
82 description "Access list sequence number";
84 range "1..4294967295";
88 typedef access-list-action {
89 description "Access list return action on match";
92 description "Deny an entry";
96 description "Accept an entry";
103 * Configuration data.
106 list access-list-legacy {
107 description "Access list legacy instance";
112 description "Access list sequence value";
113 type access-list-legacy;
117 description "Access list remark";
122 description "Access list legacy entry";
127 description "Access list sequence value";
128 type access-list-sequence;
132 description "Access list action on match";
133 type access-list-action;
139 "Standard access list: value to match.
140 Extended access list: source value to match.";
144 description "Host to match";
145 type inet:ipv4-address;
148 description "Network to match";
149 type inet:ipv4-prefix;
152 description "Match any";
157 choice extended-value {
158 when "../number >= 100 and ../number <= 199 or
159 ../number >= 2000 and ../number <= 2699";
160 description "Destination value to match";
163 leaf destination-host {
164 description "Host to match";
165 type inet:ipv4-address;
167 leaf destination-network {
168 description "Network to match";
169 type inet:ipv4-prefix;
171 leaf destination-any {
172 description "Match any";
180 description "Access list instance";
185 description "Access list content type";
188 description "Internet Protocol address version 4";
192 description "Internet Protocol address version 6";
196 description "Media Access Control address";
203 description "Access list name";
204 type access-list-name;
208 description "Access list remark";
213 description "Access list entry";
218 description "Access list sequence value";
219 type access-list-sequence;
223 description "Access list action on match";
224 type access-list-action;
229 description "Access list value to match";
233 when "../type = 'ipv4'";
236 description "Configure IPv4 prefix to match";
237 type inet:ipv4-prefix;
240 leaf ipv4-exact-match {
241 description "Exact match of prefix";
247 when "../type = 'ipv6'";
250 description "Configure IPv6 prefix to match";
251 type inet:ipv6-prefix;
254 leaf ipv6-exact-match {
255 description "Exact match of prefix";
261 when "../type = 'mac'";
264 description "Configure MAC address to match";
265 type yang:mac-address;
270 description "Match anything";
279 description "Prefix list instance";
284 description "Prefix list type";
287 description "Internet Protocol address version 4";
291 description "Internet Protocol address version 6";
298 description "Prefix list name";
299 type access-list-name;
303 description "Prefix list user description";
308 description "Prefix list entry";
313 description "Access list sequence value";
314 type access-list-sequence;
318 description "Prefix list action on match";
319 type access-list-action;
324 description "Prefix list value to match";
328 when "../type = 'ipv4'";
331 description "Configure IPv4 prefix to match";
332 type inet:ipv4-prefix;
335 leaf ipv4-prefix-length-greater-or-equal {
337 "Specifies if matching prefixes with length greater than
344 leaf ipv4-prefix-length-lesser-or-equal {
346 "Specifies if matching prefixes with length lesser than
354 when "../type = 'ipv6'";
357 description "Configure IPv6 prefix to match";
358 type inet:ipv6-prefix;
361 leaf ipv6-prefix-length-greater-or-equal {
363 "Specifies if matching prefixes with length greater than
370 leaf ipv6-prefix-length-lesser-or-equal {
372 "Specifies if matching prefixes with length lesser than
381 description "Match anything";