1 // SPDX-License-Identifier: BSD-2-Clause
4 namespace "http://frrouting.org/yang/filter";
7 import ietf-inet-types {
10 import ietf-yang-types {
14 organization "FRRouting";
16 "FRR Users List: <mailto:frog@lists.frrouting.org>
17 FRR Development List: <mailto:dev@lists.frrouting.org>";
19 "This module defines filter settings
21 Copyright 2020 FRRouting
23 Redistribution and use in source and binary forms, with or without
24 modification, are permitted provided that the following conditions
27 1. Redistributions of source code must retain the above copyright notice,
28 this list of conditions and the following disclaimer.
30 2. Redistributions in binary form must reproduce the above copyright
31 notice, this list of conditions and the following disclaimer in the
32 documentation and/or other materials provided with the distribution.
34 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
37 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
47 description "Initial revision";
53 typedef access-list-name {
54 description "Access list name formatting";
60 typedef access-list-sequence {
61 description "Access list sequence number";
63 range "1..4294967295";
67 typedef access-list-action {
68 description "Access list return action on match";
71 description "Deny an entry";
75 description "Accept an entry";
86 description "Access list instance";
91 description "Access list content type";
94 description "Internet Protocol address version 4";
98 description "Internet Protocol address version 6";
102 description "Media Access Control address";
109 description "Access list name";
110 type access-list-name;
114 description "Access list remark";
119 description "Access list entry";
124 description "Access list sequence value";
125 type access-list-sequence;
129 description "Access list action on match";
130 type access-list-action;
135 description "Access list value to match";
139 when "../type = 'ipv4'";
142 description "Access list entry style selection: zebra or cisco.";
147 description "Configure IPv4 prefix to match";
148 type inet:ipv4-prefix;
152 leaf ipv4-exact-match {
153 description "Exact match of prefix";
159 choice standard-value {
160 description "Source value to match";
163 description "Host to match";
164 type inet:ipv4-address;
169 description "Network address part.";
170 type inet:ipv4-address;
174 description "Network mask/wildcard part.";
175 type inet:ipv4-address;
180 * Was `any`, however it conflicts with `any` leaf
181 * outside this choice.
183 description "Match any";
188 choice extended-value {
189 description "Destination value to match";
191 leaf destination-host {
192 description "Host to match";
193 type inet:ipv4-address;
195 container destination-network {
198 description "Network address part.";
199 type inet:ipv4-address;
203 description "Network mask/wildcard part.";
204 type inet:ipv4-address;
207 leaf destination-any {
208 description "Match any";
216 when "../type = 'ipv6'";
219 description "Configure IPv6 prefix to match";
220 type inet:ipv6-prefix;
224 leaf ipv6-exact-match {
225 description "Exact match of prefix";
231 when "../type = 'mac'";
234 description "Configure MAC address to match";
235 type yang:mac-address;
240 description "Match anything";
249 description "Prefix list instance";
254 description "Prefix list type";
257 description "Internet Protocol address version 4";
261 description "Internet Protocol address version 6";
268 description "Prefix list name";
269 type access-list-name;
273 description "Prefix list user description";
278 description "Prefix list entry";
283 description "Prefix list sequence value";
284 type access-list-sequence;
288 description "Prefix list action on match";
289 type access-list-action;
294 description "Prefix list value to match";
299 description "Configure IPv4 prefix to match";
300 type inet:ipv4-prefix;
304 leaf ipv4-prefix-length-greater-or-equal {
306 "Specifies if matching prefixes with length greater than
313 leaf ipv4-prefix-length-lesser-or-equal {
315 "Specifies if matching prefixes with length lesser than
324 description "Configure IPv6 prefix to match";
325 type inet:ipv6-prefix;
329 leaf ipv6-prefix-length-greater-or-equal {
331 "Specifies if matching prefixes with length greater than
338 leaf ipv6-prefix-length-lesser-or-equal {
340 "Specifies if matching prefixes with length lesser than
349 description "Match anything";