gnpy-api 0.0.0__py3-none-any.whl

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