1 module frr-route-types {
3 namespace "http://frrouting.org/yang/route-types";
4 prefix frr-route-types;
6 import ietf-inet-types {
13 "FRR Users List: <mailto:frog@lists.frrouting.org>
14 FRR Development List: <mailto:dev@lists.frrouting.org>";
16 "This module defines typedefs for route types.
18 Copyright 2020 FRRouting
20 Redistribution and use in source and binary forms, with or without
21 modification, are permitted provided that the following conditions
24 1. Redistributions of source code must retain the above copyright notice,
25 this list of conditions and the following disclaimer.
27 2. Redistributions in binary form must reproduce the above copyright
28 notice, this list of conditions and the following disclaimer in the
29 documentation and/or other materials provided with the distribution.
31 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
34 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
36 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
37 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
38 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
39 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
48 typedef frr-route-types-v4 {
98 typedef frr-route-types-v6 {
145 typedef frr-route-types {
146 description "Route types as enumerated in `lib/route_types.txt`";
148 type frr-route-types-v4;
149 type frr-route-types-v6;
153 typedef ipv4-multicast-group-prefix {
154 type inet:ipv4-prefix {
155 pattern '(2((2[4-9])|(3[0-9]))\.)(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(/(([4-9])|([1-2][0-9])|(3[0-2])))';
158 "This type represents an IPv4 multicast group prefix,
159 which is in the range from 224.0.0.0 to 239.255.255.255.";
162 typedef ipv6-multicast-group-prefix {
163 type inet:ipv6-prefix {
165 '(((FF|ff)[0-9a-fA-F]{2}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/((1[6-9])|([2-9][0-9])|(1[0-1][0-9])|(12[0-8])))';
167 '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(/.+)';
170 "This type represents an IPv6 multicast group prefix,
171 which is in the range of FF00::/8.";
174 typedef ip-multicast-group-prefix {
175 description "The IP-Multicast-Group-Address-Prefix type represents an IP multicast address
176 prefix and is IP version neutral. The format of the textual representations implies the IP
177 version. It includes a prefix-length, separated by a '/' sign.";
179 type ipv4-multicast-group-prefix;
180 type ipv6-multicast-group-prefix;