]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-interface.yang
Merge pull request #12816 from gpnaveen/stc_rte_err_msg
[mirror_frr.git] / yang / frr-interface.yang
1 // SPDX-License-Identifier: BSD-2-Clause
2 module frr-interface {
3 yang-version 1.1;
4 namespace "http://frrouting.org/yang/interface";
5 prefix frr-interface;
6
7 import frr-vrf {
8 prefix frr-vrf;
9 }
10
11 import ietf-interfaces {
12 prefix ietf-if;
13 }
14
15 import ietf-yang-types {
16 prefix yang;
17 }
18
19 organization
20 "FRRouting";
21 contact
22 "FRR Users List: <mailto:frog@lists.frrouting.org>
23 FRR Development List: <mailto:dev@lists.frrouting.org>";
24 description
25 "This module defines a model for managing FRR interfaces.
26
27 Copyright 2020 FRRouting
28
29 Redistribution and use in source and binary forms, with or without
30 modification, are permitted provided that the following conditions
31 are met:
32
33 1. Redistributions of source code must retain the above copyright notice,
34 this list of conditions and the following disclaimer.
35
36 2. Redistributions in binary form must reproduce the above copyright
37 notice, this list of conditions and the following disclaimer in the
38 documentation and/or other materials provided with the distribution.
39
40 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
51
52 revision 2020-02-05 {
53 description
54 "Added operational data";
55 }
56 revision 2019-09-09 {
57 description
58 "Added interface-ref typedef";
59 }
60 revision 2018-03-28 {
61 description
62 "Initial revision.";
63 }
64
65 identity other {
66 base ietf-if:interface-type;
67 description
68 "Other type";
69 }
70
71 identity unknown {
72 base ietf-if:interface-type;
73 description
74 "Unknown type";
75 }
76
77 identity ethernet {
78 base ietf-if:interface-type;
79 description
80 "Ethernet type";
81 }
82
83 identity exper-ethernet {
84 base ietf-if:interface-type;
85 description
86 "Experimental Ethernet type";
87 }
88
89 identity loopback {
90 base ietf-if:interface-type;
91 description
92 "Loopback type";
93 }
94
95 identity pimreg {
96 base ietf-if:interface-type;
97 description
98 "PIMSM Registration.";
99 }
100
101 identity ipip {
102 base ietf-if:interface-type;
103 description
104 "IPIP Tunnel.";
105 }
106
107 identity ipip6 {
108 base ietf-if:interface-type;
109 description
110 "IPIP6 Tunnel.";
111 }
112
113 identity ipgre {
114 base ietf-if:interface-type;
115 description
116 "GRE over IP.";
117 }
118
119 typedef interface-ref {
120 type leafref {
121 path "/frr-interface:lib/frr-interface:interface/frr-interface:name";
122 require-instance false;
123 }
124 description
125 "Reference to an interface";
126 }
127
128 typedef if-flags-type {
129 type enumeration {
130 enum "up" {
131 value 1;
132 description
133 "Active and ready to transfer packets.";
134 }
135 enum "broadcast" {
136 value 2;
137 description
138 "Broadcast enabled.";
139 }
140 enum "debug" {
141 value 3;
142 description
143 "Debug mode.";
144 }
145 enum "loopback" {
146 value 4;
147 description
148 "Loopback interface.";
149 }
150 enum "point-to-point" {
151 value 5;
152 description
153 "Point-to-Point link.";
154 }
155 enum "notrailers" {
156 value 6;
157 description
158 "This flag is unused in Linux, but it exists for BSD compatibility.
159 Avoid use of trailers";
160 }
161 enum "running" {
162 value 7;
163 description
164 "Up and Running.";
165 }
166 enum "noarp" {
167 value 8;
168 description
169 "Can't perform address resolution protocol.";
170 }
171 enum "promisc" {
172 value 9;
173 description
174 "Promiscuous mode. Receive all packets.";
175 }
176 enum "allmulti" {
177 value 10;
178 description
179 "Receive all multicast packets.";
180 }
181 enum "simplex" {
182 value 11;
183 description
184 "Does not Rx or Tx at the sametime.";
185 }
186 enum "link0" {
187 value 12;
188 description
189 "Link0.";
190 }
191 enum "link1" {
192 value 13;
193 description
194 "Link1.";
195 }
196 enum "link2" {
197 value 14;
198 description
199 "Link2.";
200 }
201 enum "multicast" {
202 value 15;
203 description
204 "Supports multicast transmission.";
205 }
206 enum "notransmit" {
207 value 16;
208 description
209 "Interface is no transmit mode.";
210 }
211 enum "nortexch" {
212 value 17;
213 description
214 "No routing info exchange.";
215 }
216 enum "virtual" {
217 value 18;
218 description
219 "Virtual interface.";
220 }
221 enum "ipv4" {
222 value 19;
223 description
224 "IPv4 enabled.";
225 }
226 enum "ipv6" {
227 value 20;
228 description
229 "IPv6 enabled.";
230 }
231 }
232 }
233
234 grouping if-common-operational {
235 leaf if-index {
236 type int32 {
237 range "0..2147483647";
238 }
239 description
240 "Interface index.";
241 }
242
243 leaf mtu {
244 type uint16;
245 description
246 "The size of the largest IPV4 packet that the interface
247 will send and receive.";
248 }
249
250 leaf mtu6 {
251 type uint32;
252 description
253 "The size of the largest IPV6 packet that the interface
254 will send and receive.";
255 }
256
257 leaf speed {
258 type uint32;
259 description
260 "Interface speed.";
261 }
262
263 leaf metric {
264 type uint32;
265 description
266 "Interface metric.";
267 }
268
269 leaf flags {
270 type if-flags-type;
271 description
272 "Interface flags.";
273 }
274
275 leaf type {
276 type identityref {
277 base ietf-if:interface-type;
278 }
279 description
280 "The link type of the interface.";
281 }
282
283 leaf phy-address {
284 type yang:mac-address;
285 description
286 "The interface's MAC address.";
287 }
288 }
289
290 container lib {
291 list interface {
292 key "name";
293 description
294 "Interface.";
295 leaf name {
296 type string;
297 description
298 "Interface name.";
299 }
300
301 leaf vrf {
302 type frr-vrf:vrf-ref;
303 description
304 "VRF this interface is associated with.";
305 config false;
306 }
307
308 leaf description {
309 type string;
310 description
311 "Interface description.";
312 }
313
314 container state {
315 config false;
316 uses if-common-operational;
317 }
318 }
319 }
320 }