]> git.proxmox.com Git - mirror_frr.git/blob - yang/ietf/ietf-routing-types.yang
ospfd: fix GR helper initialization and termination
[mirror_frr.git] / yang / ietf / ietf-routing-types.yang
1 module ietf-routing-types {
2 namespace "urn:ietf:params:xml:ns:yang:ietf-routing-types";
3 prefix rt-types;
4
5 import ietf-yang-types {
6 prefix yang;
7 }
8 import ietf-inet-types {
9 prefix inet;
10 }
11
12 organization
13 "IETF RTGWG - Routing Area Working Group";
14 contact
15 "WG Web: <https://datatracker.ietf.org/wg/rtgwg/>
16 WG List: <mailto:rtgwg@ietf.org>
17 Editors: Xufeng Liu
18 <mailto:Xufeng_Liu@jabail.com>
19 Yingzhen Qu
20 <mailto:yingzhen.qu@huawei.com>
21 Acee Lindem
22 <mailto:acee@cisco.com>
23 Christian Hopps
24 <mailto:chopps@chopps.org>
25 Lou Berger
26 <mailto:lberger@labn.com>";
27
28 description
29 "This module contains a collection of YANG data types
30 considered generally useful for routing protocols.
31 Copyright (c) 2017 IETF Trust and the persons
32 identified as authors of the code. All rights reserved.
33 Redistribution and use in source and binary forms, with or
34 without modification, is permitted pursuant to, and subject
35 to the license terms contained in, the Simplified BSD License
36 set forth in Section 4.c of the IETF Trust's Legal Provisions
37 Relating to IETF Documents
38 (https://trustee.ietf.org/license-info).
39 This version of this YANG module is part of RFC 8294; see
40 the RFC itself for full legal notices.";
41 revision 2017-12-04 {
42 description "Initial revision.";
43 reference
44 "RFC 8294: Common YANG Data Types for the Routing Area.
45 Section 3.";
46 }
47
48 /*** Identities related to MPLS/GMPLS ***/
49
50 identity mpls-label-special-purpose-value {
51 description
52 "Base identity for deriving identities describing
53 special-purpose Multiprotocol Label Switching (MPLS) label
54 values.";
55 reference
56 "RFC 7274: Allocating and Retiring Special-Purpose MPLS
57 Labels.";
58 }
59
60 identity ipv4-explicit-null-label {
61 base mpls-label-special-purpose-value;
62 description
63 "This identity represents the IPv4 Explicit NULL Label.";
64 reference
65 "RFC 3032: MPLS Label Stack Encoding. Section 2.1.";
66 }
67
68 identity router-alert-label {
69 base mpls-label-special-purpose-value;
70 description
71 "This identity represents the Router Alert Label.";
72 reference
73 "RFC 3032: MPLS Label Stack Encoding. Section 2.1.";
74 }
75
76 identity ipv6-explicit-null-label {
77 base mpls-label-special-purpose-value;
78 description
79 "This identity represents the IPv6 Explicit NULL Label.";
80 reference
81 "RFC 3032: MPLS Label Stack Encoding. Section 2.1.";
82 }
83
84 identity implicit-null-label {
85 base mpls-label-special-purpose-value;
86 description
87 "This identity represents the Implicit NULL Label.";
88 reference
89 "RFC 3032: MPLS Label Stack Encoding. Section 2.1.";
90 }
91
92 identity entropy-label-indicator {
93 base mpls-label-special-purpose-value;
94 description
95 "This identity represents the Entropy Label Indicator.";
96 reference
97 "RFC 6790: The Use of Entropy Labels in MPLS Forwarding.
98 Sections 3 and 10.1.";
99 }
100
101 identity gal-label {
102 base mpls-label-special-purpose-value;
103 description
104 "This identity represents the Generic Associated Channel
105 (G-ACh) Label (GAL).";
106 reference
107 "RFC 5586: MPLS Generic Associated Channel.
108 Sections 4 and 10.";
109 }
110
111 identity oam-alert-label {
112 base mpls-label-special-purpose-value;
113 description
114 "This identity represents the OAM Alert Label.";
115 reference
116 "RFC 3429: Assignment of the 'OAM Alert Label' for
117 Multiprotocol Label Switching Architecture (MPLS)
118 Operation and Maintenance (OAM) Functions.
119 Sections 3 and 6.";
120 }
121
122 identity extension-label {
123 base mpls-label-special-purpose-value;
124 description
125 "This identity represents the Extension Label.";
126 reference
127 "RFC 7274: Allocating and Retiring Special-Purpose MPLS
128 Labels. Sections 3.1 and 5.";
129 }
130
131 /*** Collection of types related to routing ***/
132
133 typedef router-id {
134 type yang:dotted-quad;
135 description
136 "A 32-bit number in the dotted-quad format assigned to each
137 router. This number uniquely identifies the router within
138 an Autonomous System.";
139 }
140
141 /*** Collection of types related to VPNs ***/
142
143 typedef route-target {
144 type string {
145 pattern
146 '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
147 + '6[0-4][0-9]{3}|'
148 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
149 + '42949672[0-8][0-9]|'
150 + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
151 + '42949[0-5][0-9]{4}|'
152 + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
153 + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
154 + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
155 + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
156 + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
157 + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
158 + '655[0-2][0-9]|'
159 + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
160 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
161 + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
162 + '4294967[01][0-9]{2}|'
163 + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
164 + '4294[0-8][0-9]{5}|'
165 + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
166 + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
167 + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
168 + '6[0-4][0-9]{3}|'
169 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
170 + '(6(:[a-fA-F0-9]{2}){6})|'
171 + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
172 + '[0-9a-fA-F]{1,12})';
173 }
174
175 description
176 "A Route Target is an 8-octet BGP extended community
177 initially identifying a set of sites in a BGP VPN
178 (RFC 4364). However, it has since taken on a more general
179 role in BGP route filtering. A Route Target consists of two
180 or three fields: a 2-octet Type field, an administrator
181 field, and, optionally, an assigned number field.
182 According to the data formats for types 0, 1, 2, and 6 as
183 defined in RFC 4360, RFC 5668, and RFC 7432, the encoding
184 pattern is defined as:
185 0:2-octet-asn:4-octet-number
186 1:4-octet-ipv4addr:2-octet-number
187 2:4-octet-asn:2-octet-number
188 6:6-octet-mac-address
189 Additionally, a generic pattern is defined for future
190 Route Target types:
191 2-octet-other-hex-number:6-octet-hex-number
192 Some valid examples are 0:100:100, 1:1.1.1.1:100,
193 2:1234567890:203, and 6:26:00:08:92:78:00.";
194 reference
195 "RFC 4360: BGP Extended Communities Attribute.
196 RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).
197 RFC 5668: 4-Octet AS Specific BGP Extended Community.
198 RFC 7432: BGP MPLS-Based Ethernet VPN.";
199 }
200
201 typedef ipv6-route-target {
202 type string {
203 pattern
204 '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
205 + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
206 + '(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}'
207 + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))'
208 + ':'
209 + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
210 + '6[0-4][0-9]{3}|'
211 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
212 pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
213 + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))'
214 + ':'
215 + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
216 + '6[0-4][0-9]{3}|'
217 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
218 }
219 description
220 "An IPv6 Route Target is a 20-octet BGP IPv6 Address
221 Specific Extended Community serving the same function
222 as a standard 8-octet Route Target, except that it only
223 allows an IPv6 address as the global administrator.
224 The format is <ipv6-address:2-octet-number>.
225 Two valid examples are 2001:db8::1:6544 and
226 2001:db8::5eb1:791:6b37:17958.";
227 reference
228 "RFC 5701: IPv6 Address Specific BGP Extended Community
229 Attribute.";
230 }
231
232 typedef route-target-type {
233 type enumeration {
234 enum import {
235 value 0;
236 description
237 "The Route Target applies to route import.";
238 }
239 enum export {
240 value 1;
241 description
242 "The Route Target applies to route export.";
243 }
244
245 enum both {
246 value 2;
247 description
248 "The Route Target applies to both route import and
249 route export.";
250 }
251 }
252 description
253 "Indicates the role a Route Target takes in route filtering.";
254 reference
255 "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).";
256 }
257
258 typedef route-distinguisher {
259 type string {
260 pattern
261 '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
262 + '6[0-4][0-9]{3}|'
263 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
264 + '42949672[0-8][0-9]|'
265 + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
266 + '42949[0-5][0-9]{4}|'
267 + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
268 + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
269 + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
270 + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
271 + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
272 + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
273 + '655[0-2][0-9]|'
274 + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
275 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
276 + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
277 + '4294967[01][0-9]{2}|'
278 + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
279 + '4294[0-8][0-9]{5}|'
280 + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
281 + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
282 + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
283 + '6[0-4][0-9]{3}|'
284 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
285 + '(6(:[a-fA-F0-9]{2}){6})|'
286 + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
287 + '[0-9a-fA-F]{1,12})';
288 }
289
290 description
291 "A Route Distinguisher is an 8-octet value used to
292 distinguish routes from different BGP VPNs (RFC 4364).
293 A Route Distinguisher will have the same format as a
294 Route Target as per RFC 4360 and will consist of
295 two or three fields: a 2-octet Type field, an administrator
296 field, and, optionally, an assigned number field.
297 According to the data formats for types 0, 1, 2, and 6 as
298 defined in RFC 4360, RFC 5668, and RFC 7432, the encoding
299 pattern is defined as:
300 0:2-octet-asn:4-octet-number
301 1:4-octet-ipv4addr:2-octet-number
302 2:4-octet-asn:2-octet-number
303 6:6-octet-mac-address
304 Additionally, a generic pattern is defined for future
305 route discriminator types:
306 2-octet-other-hex-number:6-octet-hex-number
307 Some valid examples are 0:100:100, 1:1.1.1.1:100,
308 2:1234567890:203, and 6:26:00:08:92:78:00.";
309 reference
310 "RFC 4360: BGP Extended Communities Attribute.
311 RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).
312 RFC 5668: 4-Octet AS Specific BGP Extended Community.
313 RFC 7432: BGP MPLS-Based Ethernet VPN.";
314 }
315
316 typedef route-origin {
317 type string {
318 pattern
319 '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
320 + '6[0-4][0-9]{3}|'
321 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
322 + '42949672[0-8][0-9]|'
323 + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
324 + '42949[0-5][0-9]{4}|'
325 + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
326 + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
327 + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
328 + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
329 + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
330 + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
331 + '655[0-2][0-9]|'
332 + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
333 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
334 + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
335 + '4294967[01][0-9]{2}|'
336 + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
337 + '4294[0-8][0-9]{5}|'
338 + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
339 + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
340 + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
341 + '6[0-4][0-9]{3}|'
342 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
343 + '(6(:[a-fA-F0-9]{2}){6})|'
344 + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
345 + '[0-9a-fA-F]{1,12})';
346 }
347 description
348 "A Route Origin is an 8-octet BGP extended community
349 identifying the set of sites where the BGP route
350 originated (RFC 4364). A Route Origin will have the same
351 format as a Route Target as per RFC 4360 and will consist
352 of two or three fields: a 2-octet Type field, an
353 administrator field, and, optionally, an assigned number
354 field.
355 According to the data formats for types 0, 1, 2, and 6 as
356 defined in RFC 4360, RFC 5668, and RFC 7432, the encoding
357 pattern is defined as:
358 0:2-octet-asn:4-octet-number
359 1:4-octet-ipv4addr:2-octet-number
360 2:4-octet-asn:2-octet-number
361 6:6-octet-mac-address
362 Additionally, a generic pattern is defined for future
363 Route Origin types:
364 2-octet-other-hex-number:6-octet-hex-number
365 Some valid examples are 0:100:100, 1:1.1.1.1:100,
366 2:1234567890:203, and 6:26:00:08:92:78:00.";
367 reference
368 "RFC 4360: BGP Extended Communities Attribute.
369 RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).
370 RFC 5668: 4-Octet AS Specific BGP Extended Community.
371 RFC 7432: BGP MPLS-Based Ethernet VPN.";
372 }
373
374 typedef ipv6-route-origin {
375 type string {
376 pattern
377 '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
378 + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
379 + '(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}'
380 + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))'
381 + ':'
382 + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
383 + '6[0-4][0-9]{3}|'
384 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
385 pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
386 + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))'
387 + ':'
388 + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
389 + '6[0-4][0-9]{3}|'
390 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
391 }
392 description
393 "An IPv6 Route Origin is a 20-octet BGP IPv6 Address
394 Specific Extended Community serving the same function
395 as a standard 8-octet route, except that it only allows
396 an IPv6 address as the global administrator. The format
397 is <ipv6-address:2-octet-number>.
398 Two valid examples are 2001:db8::1:6544 and
399 2001:db8::5eb1:791:6b37:17958.";
400 reference
401 "RFC 5701: IPv6 Address Specific BGP Extended Community
402 Attribute.";
403 }
404
405 /*** Collection of types common to multicast ***/
406
407 typedef ipv4-multicast-group-address {
408 type inet:ipv4-address {
409 pattern '(2((2[4-9])|(3[0-9]))\.).*';
410 }
411 description
412 "This type represents an IPv4 multicast group address,
413 which is in the range of 224.0.0.0 to 239.255.255.255.";
414 reference
415 "RFC 1112: Host Extensions for IP Multicasting.";
416 }
417
418 typedef ipv6-multicast-group-address {
419 type inet:ipv6-address {
420 pattern '(([fF]{2}[0-9a-fA-F]{2}):).*';
421 }
422 description
423 "This type represents an IPv6 multicast group address,
424 which is in the range of ff00::/8.";
425 reference
426 "RFC 4291: IP Version 6 Addressing Architecture. Section 2.7.
427 RFC 7346: IPv6 Multicast Address Scopes.";
428 }
429
430 typedef ip-multicast-group-address {
431 type union {
432 type ipv4-multicast-group-address;
433 type ipv6-multicast-group-address;
434 }
435 description
436 "This type represents a version-neutral IP multicast group
437 address. The format of the textual representation implies
438 the IP version.";
439 }
440
441 typedef ipv4-multicast-source-address {
442 type union {
443 type enumeration {
444 enum * {
445 description
446 "Any source address.";
447 }
448 }
449 type inet:ipv4-address;
450 }
451 description
452 "Multicast source IPv4 address type.";
453 }
454
455 typedef ipv6-multicast-source-address {
456 type union {
457 type enumeration {
458 enum * {
459 description
460 "Any source address.";
461 }
462 }
463 type inet:ipv6-address;
464 }
465 description
466 "Multicast source IPv6 address type.";
467 }
468
469 /*** Collection of types common to protocols ***/
470
471 typedef bandwidth-ieee-float32 {
472 type string {
473 pattern
474 '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|'
475 + '1(\.([0-9a-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|'
476 + '1[01][0-9]|0?[0-9]?[0-9])?)';
477 }
478 description
479 "Bandwidth in IEEE 754 floating-point 32-bit binary format:
480 (-1)**(S) * 2**(Exponent-127) * (1 + Fraction),
481 where Exponent uses 8 bits and Fraction uses 23 bits.
482 The units are octets per second.
483 The encoding format is the external hexadecimal-significant
484 character sequences specified in IEEE 754 and ISO/IEC C99.
485 The format is restricted to be normalized, non-negative, and
486 non-fraction: 0x1.hhhhhhp{+}d, 0X1.HHHHHHP{+}D, or 0x0p0,
487 where 'h' and 'H' are hexadecimal digits and 'd' and 'D' are
488 integers in the range of [0..127].
489 When six hexadecimal digits are used for 'hhhhhh' or
490 'HHHHHH', the least significant digit must be an even
491 number. 'x' and 'X' indicate hexadecimal; 'p' and 'P'
492 indicate a power of two. Some examples are 0x0p0, 0x1p10,
493 and 0x1.abcde2p+20.";
494 reference
495 "IEEE Std 754-2008: IEEE Standard for Floating-Point
496 Arithmetic.
497 ISO/IEC C99: Information technology - Programming
498 Languages - C.";
499 }
500
501 typedef link-access-type {
502 type enumeration {
503 enum broadcast {
504 description
505 "Specify broadcast multi-access network.";
506 }
507 enum non-broadcast-multiaccess {
508 description
509 "Specify Non-Broadcast Multi-Access (NBMA) network.";
510 }
511 enum point-to-multipoint {
512 description
513 "Specify point-to-multipoint network.";
514 }
515 enum point-to-point {
516 description
517 "Specify point-to-point network.";
518 }
519 }
520 description
521 "Link access type.";
522 }
523
524 typedef timer-multiplier {
525 type uint8;
526 description
527 "The number of timer value intervals that should be
528 interpreted as a failure.";
529 }
530
531 typedef timer-value-seconds16 {
532 type union {
533 type uint16 {
534 range "1..65535";
535 }
536 type enumeration {
537 enum infinity {
538 description
539 "The timer is set to infinity.";
540 }
541 enum not-set {
542 description
543 "The timer is not set.";
544 }
545 }
546 }
547 units "seconds";
548 description
549 "Timer value type, in seconds (16-bit range).";
550 }
551
552 typedef timer-value-seconds32 {
553 type union {
554 type uint32 {
555 range "1..4294967295";
556 }
557 type enumeration {
558 enum infinity {
559 description
560 "The timer is set to infinity.";
561 }
562 enum not-set {
563 description
564 "The timer is not set.";
565 }
566 }
567 }
568 units "seconds";
569 description
570 "Timer value type, in seconds (32-bit range).";
571 }
572
573 typedef timer-value-milliseconds {
574 type union {
575 type uint32 {
576 range "1..4294967295";
577 }
578 type enumeration {
579 enum infinity {
580 description
581 "The timer is set to infinity.";
582 }
583 enum not-set {
584 description
585 "The timer is not set.";
586 }
587 }
588 }
589 units "milliseconds";
590 description
591 "Timer value type, in milliseconds.";
592 }
593
594 typedef percentage {
595 type uint8 {
596 range "0..100";
597 }
598 description
599 "Integer indicating a percentage value.";
600 }
601
602 typedef timeticks64 {
603 type uint64;
604 description
605 "This type is based on the timeticks type defined in
606 RFC 6991, but with 64-bit width. It represents the time,
607 modulo 2^64, in hundredths of a second between two epochs.";
608 reference
609 "RFC 6991: Common YANG Data Types.";
610 }
611
612 typedef uint24 {
613 type uint32 {
614 range "0..16777215";
615 }
616 description
617 "24-bit unsigned integer.";
618 }
619
620 /*** Collection of types related to MPLS/GMPLS ***/
621
622 typedef generalized-label {
623 type binary;
624 description
625 "Generalized Label. Nodes sending and receiving the
626 Generalized Label are aware of the link-specific
627 label context and type.";
628 reference
629 "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS)
630 Signaling Functional Description. Section 3.2.";
631 }
632
633 typedef mpls-label-special-purpose {
634 type identityref {
635 base mpls-label-special-purpose-value;
636 }
637 description
638 "This type represents the special-purpose MPLS label values.";
639 reference
640 "RFC 3032: MPLS Label Stack Encoding.
641 RFC 7274: Allocating and Retiring Special-Purpose MPLS
642 Labels.";
643 }
644
645 typedef mpls-label-general-use {
646 type uint32 {
647 range "16..1048575";
648 }
649 description
650 "The 20-bit label value in an MPLS label stack as specified
651 in RFC 3032. This label value does not include the
652 encodings of Traffic Class and TTL (Time to Live).
653 The label range specified by this type is for general use,
654 with special-purpose MPLS label values excluded.";
655 reference
656 "RFC 3032: MPLS Label Stack Encoding.";
657 }
658
659 typedef mpls-label {
660 type union {
661 type mpls-label-special-purpose;
662 type mpls-label-general-use;
663 }
664 description
665 "The 20-bit label value in an MPLS label stack as specified
666 in RFC 3032. This label value does not include the
667 encodings of Traffic Class and TTL.";
668 reference
669 "RFC 3032: MPLS Label Stack Encoding.";
670 }
671
672 /*** Groupings **/
673
674 grouping mpls-label-stack {
675 description
676 "This grouping specifies an MPLS label stack. The label
677 stack is encoded as a list of label stack entries. The
678 list key is an identifier that indicates the relative
679 ordering of each entry, with the lowest-value identifier
680 corresponding to the top of the label stack.";
681 container mpls-label-stack {
682 description
683 "Container for a list of MPLS label stack entries.";
684 list entry {
685 key "id";
686 description
687 "List of MPLS label stack entries.";
688 leaf id {
689 type uint8;
690 description
691 "Identifies the entry in a sequence of MPLS label
692 stack entries. An entry with a smaller identifier
693 value precedes an entry with a larger identifier
694 value in the label stack. The value of this ID has
695 no semantic meaning other than relative ordering
696 and referencing the entry.";
697 }
698 leaf label {
699 type rt-types:mpls-label;
700 description
701 "Label value.";
702 }
703
704 leaf ttl {
705 type uint8;
706 description
707 "Time to Live (TTL).";
708 reference
709 "RFC 3032: MPLS Label Stack Encoding.";
710 }
711 leaf traffic-class {
712 type uint8 {
713 range "0..7";
714 }
715 description
716 "Traffic Class (TC).";
717 reference
718 "RFC 5462: Multiprotocol Label Switching (MPLS) Label
719 Stack Entry: 'EXP' Field Renamed to 'Traffic Class'
720 Field.";
721 }
722 }
723 }
724 }
725
726 grouping vpn-route-targets {
727 description
728 "A grouping that specifies Route Target import-export rules
729 used in BGP-enabled VPNs.";
730 reference
731 "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).
732 RFC 4664: Framework for Layer 2 Virtual Private Networks
733 (L2VPNs).";
734 list vpn-target {
735 key "route-target";
736 description
737 "List of Route Targets.";
738 leaf route-target {
739 type rt-types:route-target;
740 description
741 "Route Target value.";
742 }
743 leaf route-target-type {
744 type rt-types:route-target-type;
745 mandatory true;
746 description
747 "Import/export type of the Route Target.";
748 }
749 }
750 }
751 }