]> git.proxmox.com Git - mirror_frr.git/blame - yang/frr-route-types.yang
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / yang / frr-route-types.yang
CommitLineData
41db488c 1// SPDX-License-Identifier: BSD-2-Clause
707656ec
RW
2module frr-route-types {
3 yang-version 1.1;
4 namespace "http://frrouting.org/yang/route-types";
5 prefix frr-route-types;
6
e51da3f8
RZ
7 import ietf-inet-types {
8 prefix inet;
9 }
10
707656ec 11 organization
8678d638 12 "FRRouting";
707656ec
RW
13 contact
14 "FRR Users List: <mailto:frog@lists.frrouting.org>
15 FRR Development List: <mailto:dev@lists.frrouting.org>";
16 description
fe3b629a
RW
17 "This module defines typedefs for route types.
18
19 Copyright 2020 FRRouting
20
21 Redistribution and use in source and binary forms, with or without
22 modification, are permitted provided that the following conditions
23 are met:
24
25 1. Redistributions of source code must retain the above copyright notice,
26 this list of conditions and the following disclaimer.
27
28 2. Redistributions in binary form must reproduce the above copyright
29 notice, this list of conditions and the following disclaimer in the
30 documentation and/or other materials provided with the distribution.
31
32 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
39 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
40 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
42 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
707656ec
RW
43
44 revision 2018-03-28 {
45 description
46 "Initial revision.";
47 }
48
49 typedef frr-route-types-v4 {
50 type enumeration {
51 enum kernel {
52 value 1;
53 }
54 enum connected {
55 value 2;
56 }
57 enum static {
58 value 3;
59 }
60 enum rip {
61 value 4;
62 }
63 enum ospf {
64 value 6;
65 }
66 enum isis {
67 value 8;
68 }
69 enum bgp {
70 value 9;
71 }
72 enum eigrp {
73 value 11;
74 }
75 enum nhrp {
76 value 12;
77 }
78 enum table {
79 value 15;
80 }
81 enum vnc {
82 value 17;
83 }
3b66fcef
CS
84 enum vnc-direct {
85 value 18;
86 }
707656ec
RW
87 enum babel {
88 value 22;
89 }
90 enum sharp {
91 value 23;
92 }
93 enum openfabric {
94 value 26;
95 }
96 }
97 }
98
99 typedef frr-route-types-v6 {
100 type enumeration {
101 enum kernel {
102 value 1;
103 }
104 enum connected {
105 value 2;
106 }
107 enum static {
108 value 3;
109 }
110 enum ripng {
111 value 5;
112 }
113 enum ospf6 {
114 value 7;
115 }
116 enum isis {
117 value 8;
118 }
119 enum bgp {
120 value 9;
121 }
122 enum nhrp {
123 value 12;
124 }
125 enum table {
126 value 15;
127 }
128 enum vnc {
129 value 17;
130 }
3b66fcef
CS
131 enum vnc-direct {
132 value 18;
133 }
707656ec
RW
134 enum babel {
135 value 22;
136 }
137 enum sharp {
138 value 23;
139 }
140 enum openfabric {
141 value 26;
142 }
143 }
144 }
fe362bf4
RZ
145
146 typedef frr-route-types {
147 description "Route types as enumerated in `lib/route_types.txt`";
2c3e1f1f
RZ
148 type union {
149 type frr-route-types-v4;
150 type frr-route-types-v6;
fe362bf4
RZ
151 }
152 }
e51da3f8
RZ
153
154 typedef ipv4-multicast-group-prefix {
155 type inet:ipv4-prefix {
156 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])))';
157 }
158 description
159 "This type represents an IPv4 multicast group prefix,
160 which is in the range from 224.0.0.0 to 239.255.255.255.";
161 }
162
163 typedef ipv6-multicast-group-prefix {
164 type inet:ipv6-prefix {
165 pattern
3a7ef7a7 166 '(([fF]{2}[0-9a-fA-F]{2}):).*';
e51da3f8
RZ
167 }
168 description
169 "This type represents an IPv6 multicast group prefix,
170 which is in the range of FF00::/8.";
171 }
172
173 typedef ip-multicast-group-prefix {
174 description "The IP-Multicast-Group-Address-Prefix type represents an IP multicast address
175 prefix and is IP version neutral. The format of the textual representations implies the IP
176 version. It includes a prefix-length, separated by a '/' sign.";
177 type union {
178 type ipv4-multicast-group-prefix;
179 type ipv6-multicast-group-prefix;
180 }
181 }
707656ec 182}