aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/restconfapi-yang/src/main/yang/sotn/ietf-te-types@2018-07-01.yang
blob: 7a50210e0cac8691a45a146c59816bc0e771a155 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
module ietf-te-types {

  namespace "urn:ietf:params:xml:ns:yang:ietf-te-types";

  /* Replace with IANA when assigned */
  prefix "te-types";

  import ietf-inet-types {
    prefix inet;
  }

  import ietf-yang-types {
    prefix "yang";
  }

  import ietf-routing-types {
    prefix "rt-types";
  }

  organization
    "IETF Traffic Engineering Architecture and Signaling (TEAS)
     Working Group";

  contact
    "WG Web:   <http://tools.ietf.org/wg/teas/>
     WG List:  <mailto:teas@ietf.org>
     WG Chair: Lou Berger
               <mailto:lberger@labn.net>
     WG Chair: Vishnu Pavan Beeram
               <mailto:vbeeram@juniper.net>
     Editor:   Tarek Saad
               <mailto:tsaad@cisco.com>
     Editor:   Rakesh Gandhi
               <mailto:rgandhi@cisco.com>
     Editor:   Vishnu Pavan Beeram
               <mailto:vbeeram@juniper.net>
     Editor:   Himanshu Shah
               <mailto:hshah@ciena.com>
     Editor:   Xufeng Liu
               <mailto:xufeng.liu@ericsson.com>
     Editor:   Igor Bryskin
               <mailto:Igor.Bryskin@huawei.com>";

  description
    "This module contains a collection of generally
    useful TE specific YANG data type defintions.";

  revision "2018-07-01" {
    description "Latest revision of TE types";
    reference "RFC3209";
  }

  /*
   * Identities
   */
  identity association-type {
    description "Base identity for tunnel association";
    reference "RFC6780, RFC4872, RFC4873";
  }
  identity association-type-recovery {
    base association-type;
    description
      "Association Type Recovery used to association LSPs of
       same tunnel for recovery";
    reference "RFC4872";
  }
  identity association-type-resource-sharing {
    base association-type;
    description
      "Association Type Resource Sharing used to enable resource
       sharing during make-before-break.";
    reference "RFC4873";
  }
  identity association-type-double-sided-bidir {
    base association-type;
    description
      "Association Type Double Sided bidirectional used to associate
       two LSPs of two tunnels that are independently configured on
       either endpoint";
    reference "RFC7551";
  }
  identity association-type-single-sided-bidir {
    base association-type;
    description
      "Association Type Single Sided bidirectional used to associate
       two LSPs of two tunnels, where a tunnel is configured on one
       side/endpoint, and the other tunnel is dynamically created on
       the other endpoint";
    reference "RFC7551";
  }

  identity objective-function-type {
    description "Base objective function type";
    reference "RFC4657";
  }
  identity of-minimize-cost-path {
    base objective-function-type;
    description
        "Mimimuze cost of path objective function";
  }
  identity of-minimize-load-path {
    base objective-function-type;
    description
        "Minimize the load on path(s) objective
         function";
  }
  identity of-maximize-residual-bandwidth {
    base objective-function-type;
    description
        "Maximize the residual bandwidth objective
         function";
  }
  identity of-minimize-agg-bandwidth-consumption {
    base objective-function-type;
    description
        "minimize the aggregate bandwidth consumption
         objective function";
  }
  identity of-minimize-load-most-loaded-link {
    base objective-function-type;
    description
        "Minimize the load on the most loaded link
         objective function";
  }
  identity of-minimize-cost-path-set {
    base objective-function-type;
    description
        "Minimize the cost on a path set objective
         function";
  }

  identity path-computation-method {
    description
     "base identity for supported path computation
      mechanisms";
  }

  identity path-locally-computed {
    base path-computation-method;
    description
      "indicates a constrained-path LSP in which the
      path is computed by the local LER";
  }

  identity path-externally-queried {
    base path-computation-method;
    description
     "Constrained-path LSP in which the path is
      obtained by querying an external source, such as a PCE server.
      In the case that an LSP is defined to be externally queried, it
      may also have associated explicit definitions (provided
      to the external source to aid computation); and the path that is
      returned by the external source is not required to provide a
      wholly resolved path back to the originating system - that is to
      say, some local computation may also be required";
  }

  identity path-explicitly-defined {
    base path-computation-method;
    description
     "constrained-path LSP in which the path is
      explicitly specified as a collection of strict or/and loose
      hops";
  }
  /**
   * Typedefs
   */

  typedef te-bandwidth {
    type string {
      pattern
        '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|'
      + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|'
      + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+'
      + '(,(0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|'
      + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|'
      + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+))*';
    }
    description
      "This is the generic bandwidth type that is a string containing
       a list of numbers separated by commas, with each of these
       number can be non-negative decimal, hex integer, or hex float:
       (dec | hex | float)[*(','(dec | hex | float))]
       For packet switching type, a float number is used, such as
       0x1p10.
       For OTN switching type, a list of integers can be used, such
       as '0,2,3,1', indicating 2 odu0's and 1 odu3.
       For DWDM, a list of pairs of slot number and width can be
       used, such as '0, 2, 3, 3', indicating a frequency slot 0 with
       slot width 2 and a frequency slot 3 with slot width 3.";
  } // te-bandwidth

  typedef te-ds-class {
    type uint8 {
      range "0..7";
    }
    description
      "The Differentiatied Class-Type of traffic.";
    reference "RFC4124: section-4.3.1";
  }

  typedef te-link-direction {
    type enumeration {
      enum INCOMING {
        description
          "explicit route represents an incoming link on a node";
      }
      enum OUTGOING {
        description
          "explicit route represents an outgoing link on a node";
      }
    }
    description
     "enumerated type for specifying direction of link on a node";
  }

  typedef te-label-direction {
    type enumeration {
      enum FORWARD {
        description
          "Label allocated for the forward LSP direction";
      }
      enum REVERSE {
        description
          "Label allocated for the reverse LSP direction";
      }
    }
    description
     "enumerated type for specifying the forward or reverse
     label";
  }

  typedef te-hop-type {
    type enumeration {
      enum LOOSE {
        description
          "loose hop in an explicit path";
      }
      enum STRICT {
        description
          "strict hop in an explicit path";
      }
    }
    description
     "enumerated type for specifying loose or strict
      paths";
    reference "RFC3209: section-4.3.2";
  }

  identity LSP_METRIC_TYPE {
    description
      "Base identity for types of LSP metric specification";
  }

  identity LSP_METRIC_RELATIVE {
    base LSP_METRIC_TYPE;
    description
      "The metric specified for the LSPs to which this identity refers
      is specified as a relative value to the IGP metric cost to the
      LSP's tail-end.";
  }

  identity LSP_METRIC_ABSOLUTE {
    base LSP_METRIC_TYPE;
    description
      "The metric specified for the LSPs to which this identity refers
      is specified as an absolute value";
  }

  identity LSP_METRIC_INHERITED {
    base LSP_METRIC_TYPE;
    description
      "The metric for for the LSPs to which this identity refers is
      not specified explicitly - but rather inherited from the IGP
      cost directly";
  }

  identity tunnel-type {
    description
      "Base identity from which specific tunnel types are
      derived.";
  }

  identity tunnel-p2p {
    base tunnel-type;
    description
      "TE point-to-point tunnel type.";
  }

  identity tunnel-p2mp {
    base tunnel-type;
    description
      "TE point-to-multipoint tunnel type.";
    reference "RFC4875";
  }

  identity tunnel-action-type {
    description
      "Base identity from which specific tunnel action types
       are derived.";
  }

  identity tunnel-action-resetup {
    base tunnel-action-type;
    description
      "TE tunnel action resetup. Tears the
      tunnel's current LSP (if any) and
      attempts to re-establish a new LSP";
  }

  identity tunnel-action-reoptimize {
    base tunnel-action-type;
    description
      "TE tunnel action reoptimize.
       Reoptimizes placement of the tunnel LSP(s)";
  }

  identity tunnel-action-switchpath {
    base tunnel-action-type;
    description
      "TE tunnel action reoptimize
       Switches the tunnel's LSP to use the specified path";
  }

  identity te-action-result {
    description
      "Base identity from which specific TE action results
       are derived.";
  }

  identity te-action-success {
    base te-action-result;
    description "TE action successul.";
  }

  identity te-action-fail {
    base te-action-result;
    description "TE action failed.";
  }

  identity tunnel-action-inprogress {
    base te-action-result;
    description "TE action inprogress.";
  }

  identity tunnel-admin-state-type {
    description
      "Base identity for TE tunnel admin states";
  }

  identity tunnel-admin-state-up {
    base tunnel-admin-state-type;
    description "Tunnel administratively state up";
  }

  identity tunnel-admin-state-down {
    base tunnel-admin-state-type;
    description "Tunnel administratively state down";
  }

  identity tunnel-state-type {
    description
      "Base identity for TE tunnel states";
  }

  identity tunnel-state-up {
    base tunnel-state-type;
    description "Tunnel state up";
  }

  identity tunnel-state-down {
    base tunnel-state-type;
    description "Tunnel state down";
  }

  identity lsp-state-type {
    description
      "Base identity for TE LSP states";
  }

  identity lsp-path-computing {
    base lsp-state-type;
    description
      "State path compute in progress";
  }

  identity lsp-path-computation-ok {
    base lsp-state-type;
    description
      "State path compute successful";
  }

  identity lsp-path-computatione-failed {
    base lsp-state-type;
    description
      "State path compute failed";
  }

  identity lsp-state-setting-up {
    base lsp-state-type;
    description
      "State setting up";
  }

  identity lsp-state-setup-ok {
    base lsp-state-type;
    description
      "State setup successful";
  }

  identity lsp-state-setup-failed {
    base lsp-state-type;
    description
      "State setup failed";
  }

  identity lsp-state-up {
    base lsp-state-type;
    description "State up";
  }

  identity lsp-state-tearing-down {
    base lsp-state-type;
    description
      "State tearing down";
  }

  identity lsp-state-down {
    base lsp-state-type;
    description "State down";
  }

  identity path-invalidation-action-type {
    description
      "Base identity for TE path invalidation action types";
  }

  identity path-invalidation-action-drop-type {
    base path-invalidation-action-type;
    description
      "TE path invalidation action drop";
  }

  identity path-invalidation-action-drop-tear {
    base path-invalidation-action-type;
    description
      "TE path invalidation action tear";
  }

  identity lsp-restoration-type {
    description
      "Base identity from which LSP restoration types are
       derived.";
  }

  identity lsp-restoration-restore-any {
    base lsp-restoration-type;
    description
      "Restores when any of the LSPs is affected by a failure";
  }

  identity lsp-restoration-restore-all {
    base lsp-restoration-type;
    description
      "Restores when all the tunnel LSPs are affected by failure";
  }

  identity restoration-scheme-type {
    description
      "Base identity for LSP restoration schemes";
    reference "RFC4872";
  }

  identity restoration-scheme-preconfigured {
    base restoration-scheme-type;
    description
      "Restoration LSP is preconfigured prior to the failure";
  }

  identity restoration-scheme-precomputed {
    base restoration-scheme-type;
    description
      "Restoration LSP is precomputed prior to the failure";
  }

  identity restoration-scheme-presignaled {
    base restoration-scheme-type;
    description
      "Restoration LSP is presignaledd prior to the failure";
  }

  identity lsp-protection-type {
    description
      "Base identity from which LSP protection types are
      derived.";
  }

  identity lsp-protection-unprotected {
    base lsp-protection-type;
    description
      "LSP protection 'Unprotected'";
    reference "RFC4872";
  }

  identity lsp-protection-reroute-extra {
    base lsp-protection-type;
    description
      "LSP protection '(Full) Rerouting'";
    reference "RFC4872";
  }

  identity lsp-protection-reroute {
    base lsp-protection-type;
    description
      "LSP protection 'Rerouting without Extra-Traffic'";
    reference "RFC4872";
  }

  identity lsp-protection-1-for-n {
    base lsp-protection-type;
    description
      "LSP protection '1:N Protection with Extra-Traffic'";
    reference "RFC4872";
  }

  identity lsp-protection-unidir-1-to-1 {
    base lsp-protection-type;
    description
      "LSP protection '1+1 Unidirectional Protection'";
    reference "RFC4872";
  }

  identity lsp-protection-bidir-1-to-1 {
    base lsp-protection-type;
    description
      "LSP protection '1+1 Bidirectional Protection'";
    reference "RFC4872";
  }

  identity lsp-protection-extra-traffic {
    base lsp-protection-type;
    description
      "LSP protection 'Extra-Traffic'";
    reference
      "ITU-T G.808, RFC 4427.";
  }

  identity lsp-protection-state {
    description
      "Base identity of protection states for reporting
       purposes.";
  }

  identity normal {
    base lsp-protection-state;
    description "Normal state.";
  }

  identity signal-fail-of-protection {
    base lsp-protection-state;
    description
        "There is a SF condition on the protection transport
        entity which has higher priority than the FS command.";
    reference
        "ITU-T G.873.1, G.8031, G.8131";
  }

  identity lockout-of-protection {
    base lsp-protection-state;
    description
        "A Loss of Protection (LoP) command is active.";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity forced-switch {
    base lsp-protection-state;
    description
        "A forced switch (FS) command is active.";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity signal-fail {
    base lsp-protection-state;
    description
        "There is a SF condition on either the working
        or the protection path.";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity signal-degrade {
    base lsp-protection-state;
    description
        "There is an SD condition on either the working or the
         protection path.";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity manual-switch {
    base lsp-protection-state;
    description
        "A manual switch (MS) command is active.";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity wait-to-restore {
    base lsp-protection-state;
    description
        "A wait time to restore (WTR) is running.";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity do-not-revert {
    base lsp-protection-state;
    description
        "A DNR condition is active because of a non-revertive
         behavior.";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity failure-of-protocol {
    base lsp-protection-state;
    description
        "The protection is not working because of a failure of
         protocol condition.";
    reference
        "ITU-T G.873.1, G.8031, G.8131";
  }

  identity protection-external-commands {
    description
      "Protection external commands for trouble shooting
      purposes.";
  }

  identity action-freeze {
    base protection-external-commands;
    description
      "A temporary configuration action initiated by an operator
       command to prevent any switch action to be taken and as such
       freezes the current state.";
    reference
      "ITU-T G.808, RFC 4427";
  }

  identity clear-freeze {
    base protection-external-commands;
    description
      "An action that clears the active freeze state.";
    reference
      "ITU-T G.808, RFC 4427";
  }

  identity action-lockout-of-normal {
    base protection-external-commands;
    description
      "A temporary configuration action initiated by an operator
       command to ensure that the normal traffic is not allowed
       to use the protection transport entity.";
    reference
      "ITU-T G.808, RFC 4427";
  }

  identity clear-lockout-of-normal {
    base protection-external-commands;
    description
      "An action that clears the active lockout of normal state.";
    reference
      "ITU-T G.808, RFC 4427";
  }

  identity action-lockout-of-protection {
    base protection-external-commands;
    description
      "A temporary configuration action initiated by an operator
       command to ensure that the protection transport entity is
       temporarily not available to transport a traffic signal
       (either normal or extra traffic).";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity action-forced-switch {
    base protection-external-commands;
    description
        "A switch action initiated by an operator command to swith
         the extra traffic signal, the normal traffic signal, or the
         null signal to the protection transport entity, unless an
         equal or higher priority switch command is in effect.";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity action-manual-switch {
    base protection-external-commands;
    description
        "A switch action initiated by an operator command to swith
         the extra traffic signal, the normal traffic signal #i, or
         the null signal to the protection transport entity, unless
         a fault condition exists on other transport entities or an
         equal or higher priority switch command is in effect.";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity action-exercise {
    base protection-external-commands;
    description
        "An action to start testing if the APS communication is
         operating correctly. It is lower priority than any other
         state or command.";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity clear {
    base protection-external-commands;
    description
        "An action that clears the active near-end lockout of
         protection, forced switch, manual switch, WTR state,
         or exercise command.";
    reference
        "ITU-T G.808, RFC 4427";
  }

  identity switching-capabilities {
    description
      "Base identity for interface switching capabilities";
    reference "RFC3471";
  }

  identity switching-psc1 {
    base switching-capabilities;
    description
      "Packet-Switch Capable-1 (PSC-1)";
    reference "RFC3471";
  }

  identity switching-evpl {
    base switching-capabilities;
    description
      "Ethernet Virtual Private Line (EVPL)";
  }

  identity switching-l2sc {
    base switching-capabilities;
    description
      "Layer-2 Switch Capable (L2SC)";
    reference "RFC3471";
  }

  identity switching-tdm {
    base switching-capabilities;
    description
      "Time-Division-Multiplex Capable (TDM)";
    reference "RFC3471";
  }

  identity switching-otn {
    base switching-capabilities;
    description
      "OTN-TDM capable";
  }

  identity switching-dcsc {
    base switching-capabilities;
    description
      "Data Channel Switching Capable (DCSC)";
  }

  identity switching-lsc {
    base switching-capabilities;
    description
      "Lambda-Switch Capable (LSC)";
    reference "RFC3471";
  }

  identity switching-fsc {
    base switching-capabilities;
    description
      "Fiber-Switch Capable (FSC)";
    reference "RFC3471";
  }

  identity lsp-encoding-types {
    description
      "Base identity for encoding types";
    reference "RFC3471";
  }

  identity lsp-encoding-packet {
    base lsp-encoding-types;
    description
      "Packet LSP encoding";
    reference "RFC3471";
  }

  identity lsp-encoding-ethernet {
    base lsp-encoding-types;
    description
      "Ethernet LSP encoding";
    reference "RFC3471";
  }

  identity lsp-encoding-pdh {
    base lsp-encoding-types;
    description
      "ANSI/ETSI LSP encoding";
    reference "RFC3471";
  }

  identity lsp-encoding-sdh {
    base lsp-encoding-types;
    description
      "SDH ITU-T G.707 / SONET ANSI T1.105 LSP encoding";
    reference "RFC3471";
  }

  identity lsp-encoding-digital-wrapper {
    base lsp-encoding-types;
    description
      "Digital Wrapper LSP encoding";
    reference "RFC3471";
  }

  identity lsp-encoding-lambda {
    base lsp-encoding-types;
    description
      "Lambda (photonic) LSP encoding";
    reference "RFC3471";
  }

  identity lsp-encoding-fiber {
    base lsp-encoding-types;
    description
      "Fiber LSP encoding";
    reference "RFC3471";
  }

  identity lsp-encoding-fiber-channel {
    base lsp-encoding-types;
    description
      "FiberChannel LSP encoding";
    reference "RFC3471";
  }

  identity lsp-encoding-oduk {
    base lsp-encoding-types;
    description
      "G.709 ODUk (Digital Path)LSP encoding";
  }

  identity lsp-encoding-optical-channel {
    base lsp-encoding-types;
    description
      "Line (e.g., 8B/10B) LSP encoding";
  }

  identity lsp-encoding-line {
    base lsp-encoding-types;
    description
      "Line (e.g., 8B/10B) LSP encoding";
  }

  identity path-signaling-type {
    description
      "base identity from which specific LSPs path
       setup types are derived";
  }

  identity path-setup-static {
    base path-signaling-type;
    description
      "Static LSP provisioning path setup";
  }

  identity path-setup-rsvp {
    base path-signaling-type;
    description
      "RSVP-TE signaling path setup";
    reference "RFC3209";
  }

  identity path-setup-sr {
    base path-signaling-type;
    description
      "Segment-routing path setup";
  }

  identity path-scope-type {
    description
      "base identity from which specific path
       scope types are derived";
  }

  identity path-scope-segment {
    base path-scope-type;
    description
      "Path scope segment";
  }

  identity path-scope-end-to-end {
    base path-scope-type;
    description
      "Path scope end to end";
  }

  /* TE basic features */
  feature p2mp-te {
    description
      "Indicates support for P2MP-TE";
    reference "RFC4875";
  }

  feature frr-te {
    description
      "Indicates support for TE FastReroute (FRR)";
    reference "RFC4090";
  }

  feature extended-admin-groups {
    description
      "Indicates support for TE link extended admin
      groups.";
    reference "RFC7308";
  }

  feature named-path-affinities {
    description
      "Indicates support for named path affinities";
  }

  feature named-extended-admin-groups {
    description
      "Indicates support for named extended admin groups";
  }

  feature named-srlg-groups {
    description
      "Indicates support for named SRLG groups";
  }

  feature named-path-constraints {
    description
      "Indicates support for named path constraints";
  }

  feature path-optimization-metric {
    description
      "Indicates support for path optimization metric";
  }

  feature path-optimization-objective-function {
    description
      "Indicates support for path optimization objective function";
  }

  identity route-usage-type {
    description
      "Base identity for route usage";
  }

  identity route-include-ero {
    base route-usage-type;
    description
      "Include ERO from route";
  }

  identity route-exclude-ero {
    base route-usage-type;
    description
      "Exclude ERO from route";
  }

  identity route-exclude-srlg {
    base route-usage-type;
    description
      "Exclude SRLG from route";
  }

  identity path-metric-type {
    description
      "Base identity for path metric type";
  }

  identity path-metric-te {
    base path-metric-type;
    description
      "TE path metric";
    reference "RFC3785";
  }

  identity path-metric-igp {
    base path-metric-type;
    description
      "IGP path metric";
    reference "RFC3785";
  }

  identity path-metric-hop {
    base path-metric-type;
    description
      "Hop path metric";
  }

  identity path-metric-delay-average {
    base path-metric-type;
    description
      "Unidirectional average link delay";
    reference "RFC7471";
  }

  identity path-metric-residual-bandwidth {
    base path-metric-type;
    description
      "Unidirectional Residual Bandwidth, which is defined to be
       Maximum Bandwidth [RFC3630] minus the bandwidth currently
       allocated to  LSPs.";
    reference "RFC7471";
  }
  identity path-metric-optimize-includes {
    base path-metric-type;
    description
      "A metric that optimizes the number of included resources
       specified in a set";
  }

  identity path-metric-optimize-excludes {
    base path-metric-type;
    description
      "A metric that optimizes the number of excluded resources
       specified in a set";
  }

  identity path-tiebreaker-type {
    description
      "Base identity for path tie-breaker type";
  }

  identity path-tiebreaker-minfill {
    base path-tiebreaker-type;
    description
      "Min-Fill LSP path placement";
  }

  identity path-tiebreaker-maxfill {
    base path-tiebreaker-type;
    description
      "Max-Fill LSP path placement";
  }

  identity path-tiebreaker-randoom {
    base path-tiebreaker-type;
    description
      "Random LSP path placement";
  }

  identity bidir-provisioning-mode {
    description
      "Base identity for bidirectional provisioning
      mode.";
    reference "RFC7551";
  }

  identity bidir-provisioning-single-sided {
    base bidir-provisioning-mode;
    description
      "Single-sided bidirectional provioning mode";
    reference "RFC7551";
  }

  identity bidir-provisioning-double-sided {
    base bidir-provisioning-mode;
    description
      "Double-sided bidirectional provioning mode";
    reference "RFC7551";
  }

  identity bidir-association-type {
    description
      "Base identity for bidirectional association type";
    reference "RFC7551";
  }

  identity bidir-assoc-corouted {
    base bidir-association-type;
    description
      "Co-routed bidirectional association type";
    reference "RFC7551";
  }

  identity bidir-assoc-non-corouted {
    base bidir-association-type;
    description
      "Non co-routed bidirectional association type";
    reference "RFC7551";
  }

  identity resource-affinities-type {
    description
      "Base identity for resource affinities";
    reference "RFC2702";
  }

  identity resource-aff-include-all {
    base resource-affinities-type;
    description
      "The set of attribute filters associated with a
      tunnel all of which must be present for a link
      to be acceptable";
    reference "RFC2702 and RFC3209";
  }

  identity resource-aff-include-any {
    base resource-affinities-type;
    description
      "The set of attribute filters associated with a
      tunnel any of which must be present for a link
      to be acceptable";
    reference "RFC2702 and RFC3209";
  }

  identity resource-aff-exclude-any {
    base resource-affinities-type;
    description
      "The set of attribute filters associated with a
      tunnel any of which renders a link unacceptable";
    reference "RFC2702 and RFC3209";
  }

  typedef optimization-goal {
    type enumeration {
      enum minimize {
        description "Pick lowest path metric goal";
      }
      enum maximize {
        description "Pick highest path metric goal";
      }
      enum randomize {
        description
          "Pick a path at random from list of
           equally favorable ones";
      }
    }
    description "TE optimization goal";
  }

  identity te-optimization-criterion {
    description
      "Base identity for TE optimization criterion.";
    reference
      "RFC3272: Overview and Principles of Internet Traffic
       Engineering.";
  }

  identity not-optimized {
    base te-optimization-criterion;
    description "Optimization is not applied.";
  }

  identity cost {
    base te-optimization-criterion;
    description "Optimized on cost.";
  }
  identity delay {
    base te-optimization-criterion;
    description "Optimized on delay.";
  }

  /*
   * Typedefs
   */

  typedef percentage {
    type uint8 {
      range "0..100";
    }
    description
      "Integer indicating a percentage value";
  }

  typedef performance-metric-normality {
    type enumeration {
      enum "unknown" {
        value 0;
        description
          "Unknown.";
      }
      enum "normal" {
        value 1;
        description
          "Normal.";
      }
      enum "abnormal" {
        value 2;
        description
          "Abnormal. The anomalous bit is set.";
      }
    }
    description
      "Indicates whether a performance metric is normal, abnormal, or
       unknown.";
    reference
      "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
       RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
       RFC7823: Performance-Based Path Selection for Explicitly
       Routed Label Switched Paths (LSPs) Using TE Metric
       Extensions";
  }

  typedef te-admin-status {
    type enumeration {
      enum up {
        description
          "Enabled.";
      }
      enum down {
        description
          "Disabled.";
      }
      enum testing {
        description
          "In some test mode.";
      }
      enum preparing-maintenance {
        description
          "Resource is disabled in the control plane to prepare for
           graceful shutdown for maintenance purposes.";
        reference
          "RFC5817: Graceful Shutdown in MPLS and Generalized MPLS
           Traffic Engineering Networks";
      }
      enum maintenance {
        description
          "Resource is disabled in the data plane for maintenance
           purposes.";
      }
    }
    description
      "Defines a type representing the administrative status of
       a TE resource.";
  }

  typedef te-global-id {
    type uint32;
    description
      "An identifier to uniquely identify an operator, which can be
       either a provider or a client.
       The definition of this type is taken from RFC6370 and RFC5003.
       This attribute type is used solely to provide a globally
       unique context for TE topologies.";
  }

  typedef te-link-access-type {
    type enumeration {
      enum point-to-point {
        description
          "The link is point-to-point.";
      }
      enum multi-access {
        description
          "The link is multi-access, including broacast and NBMA.";
      }
    }
    description
      "Defines a type representing the access type of a TE link.";
    reference
      "RFC3630: Traffic Engineering (TE) Extensions to OSPF
       Version 2.";
  }

  typedef te-node-id {
    type yang:dotted-quad;
    description
      "An identifier for a node in a topology.
       The identifier is represented as 32-bit unsigned integer in
       the dotted-quad notation.
       This attribute is mapped to Router ID in
       RFC3630, RFC5329, RFC5305, and RFC6119.";
  }

  typedef te-oper-status {
    type enumeration {
      enum up {
        description
        "Operational up.";
      }
      enum down {
        description
        "Operational down.";
      }
      enum testing {
        description
        "In some test mode.";
      }
      enum unknown {
        description
        "Status cannot be determined for some reason.";
      }
      enum preparing-maintenance {
        description
          "Resource is disabled in the control plane to prepare for
           graceful shutdown for maintenance purposes.";
        reference
          "RFC5817: Graceful Shutdown in MPLS and Generalized MPLS
           Traffic Engineering Networks";
      }
      enum maintenance {
        description
          "Resource is disabled in the data plane for maintenance
           purposes.";
      }
    }
    description
      "Defines a type representing the operational status of
       a TE resource.";
  }

  typedef te-path-disjointness {
    type bits {
      bit node {
        position 0;
        description "Node disjoint.";
      }
      bit link {
        position 1;
        description "Link disjoint.";
      }
      bit srlg {
        position 2;
        description "SRLG (Shared Risk Link Group) disjoint.";
      }
    }
    description
      "Type of the resource disjointness for a TE tunnel path.";
    reference
      "RFC4872: RSVP-TE Extensions in Support of End-to-End
       Generalized Multi-Protocol Label Switching (GMPLS)
       Recovery";
  } // te-path-disjointness

  typedef te-recovery-status {
    type enumeration {
      enum normal {
        description
          "Both the recovery and working spans are fully
           allocated and active, data traffic is being
           transported over (or selected from) the working
           span, and no trigger events are reported.";
      }
      enum recovery-started {
        description
          "The recovery action has been started, but not completed.";
      }
      enum recovery-succeeded {
        description
          "The recovery action has succeeded. The working span has
           reported a failure/degrade condition and the user traffic
           is being transported (or selected) on the recovery span.";
      }
      enum recovery-failed {
        description
          "The recovery action has failed.";
      }
      enum reversion-started {
        description
          "The reversion has started.";
      }
      enum reversion-failed {
        description
          "The reversion has failed.";
      }
      enum recovery-unavailable {
        description
          "The recovery is unavailable -- either as a result of an
           operator Lockout command or a failure condition detected
           on the recovery span.";
      }
      enum recovery-admin {
        description
          "The operator has issued a command switching the user
           traffic to the recovery span.";
      }
      enum wait-to-restore {
        description
          "The recovery domain is recovering from a failuer/degrade
           condition on the working span that is being controlled by
           the Wait-to-Restore (WTR) timer.";
      }
    }
    description
      "Defines the status of a recovery action.";
    reference
      "RFC4427: Recovery (Protection and Restoration) Terminology
       for Generalized Multi-Protocol Label Switching (GMPLS).
       RFC6378: MPLS Transport Profile (MPLS-TP) Linear Protection";
  }

  typedef te-template-name {
    type string {
      pattern '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*';
    }
    description
      "A type for the name of a TE node template or TE link
       template.";
  }

  typedef te-topology-event-type {
    type enumeration {
      enum "add" {
        value 0;
        description
          "A TE node or te-link has been added.";
      }
      enum "remove" {
        value 1;
        description
          "A TE node or te-link has been removed.";
      }
      enum "update" {
        value 2;
        description
          "A TE node or te-link has been updated.";
      }
    }
    description "TE  Event type for notifications";
  } // te-topology-event-type

  typedef te-topology-id {
    type string {
      pattern
        '([a-zA-Z0-9\-_.]+:)*'
      + '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*';
    }
    description
      "An identifier for a topology.
       It is optional to have one or more prefixes at the begining,
       separated by colons. The prefixes can be the network-types,
       defined in ietf-network.yang, to help user to understand the
       topology better before further inquiry.";
  }

  typedef te-tp-id {
    type union {
      type uint32;          // Unnumbered
      type inet:ip-address; // IPv4 or IPv6 address
    }
    description
      "An identifier for a TE link endpoint on a node.
       This attribute is mapped to local or remote link identifier in
       RFC3630 and RFC5305.";
  }
  typedef admin-group {
    type binary {
      length 4;
    }
    description
      "Administrative group/Resource class/Color.";
    reference "RFC3630 and RFC5305";
  }

  typedef extended-admin-group {
    type binary;
    description
      "Extended administrative group/Resource class/Color.";
    reference "RFC7308";
  }

  typedef admin-groups {
    type union {
      type admin-group;
      type extended-admin-group;
    }
    description "TE administrative group derived type";
  }

  typedef srlg {
    type uint32;
    description "SRLG type";
    reference "RFC4203 and RFC5307";
  }

  identity path-computation-srlg-type {
    description
      "Base identity for SRLG path computation";
  }

  identity srlg-ignore {
    base path-computation-srlg-type;
    description
      "Ignores SRLGs in path computation";
  }

  identity srlg-strict {
    base path-computation-srlg-type;
    description
      "Include strict SRLG check in path computation";
  }

  identity srlg-preferred {
    base path-computation-srlg-type;
    description
      "Include preferred SRLG check in path computation";
  }

  identity srlg-weighted {
    base path-computation-srlg-type;
    description
      "Include weighted SRLG check in path computation";
  }

  typedef te-metric {
    type uint32;
    description
      "TE link metric";
    reference "RFC3785";
  }

  /**
   * TE bandwidth groupings
   **/
  identity otn-rate-type {
    description
      "Base type to identify OTN bit rates of various information
       structures.";
    reference "RFC7139";
  }
  identity odu0 {
    base otn-rate-type;
    description
        "ODU0 bit rate.";
  }
  identity odu1 {
    base otn-rate-type;
    description
        "ODU1 bit rate.";
  }
  identity odu2 {
    base otn-rate-type;
    description
        "ODU2 bit rate.";
  }
  identity odu3 {
    base otn-rate-type;
    description
        "ODU3 bit rate.";
  }
  identity odu4 {
    base otn-rate-type;
    description
        "ODU4 bit rate.";
  }
  identity odu2e {
    base otn-rate-type;
    description
        "ODU2e bit rate.";
  }
  identity oduc {
    base otn-rate-type;
    description
        "ODUCn bit rate.";
  }
  identity oduflex {
    base otn-rate-type;
    description
        "ODUflex bit rate.";
  }

  identity wdm-spectrum-type {
    description
      "Base type to identify WDM spectrum type.";
  }
  identity cwdm {
    base wdm-spectrum-type;
    description "CWDM.";
    reference "RFC6205";
  }
  identity dwdm {
    base wdm-spectrum-type;
    description "DWDM.";
    reference "RFC6205";
  }
  identity flexible-grid {
    base wdm-spectrum-type;
    description "Flexible grid.";
    reference "RFC6205";
  }

  grouping te-bandwidth {
    description
      "This grouping defines the generic TE bandwidth.
       For some known data plane technologies, specific modeling
       structures are specified. The string encoded te-bandwidth
       type is used for un-specified technologies.
       The modeling structure can be augmented later for other
       technologies.";
    container te-bandwidth {
      description
        "Container that specifies TE bandwidth.";
      choice technology {
        default generic;
        description
          "Data plane technology type.";
        case generic {
          leaf generic {
            type te-bandwidth;
            description
              "Bandwidth specified in a generic format.";
          }
        }
      }
    }
  }

  /**
   * TE label groupings
   **/
  grouping te-label {
    description
      "This grouping defines the generic TE label.
       The modeling structure can be augmented for each technology.
       For un-specified technologies, rt-types:generalized-label
       is used.";
    container te-label {
      description
        "Container that specifies TE label.";
      choice technology {
        default generic;
        description
          "Data plane technology type.";
        case generic {
          leaf generic {
            type rt-types:generalized-label;
            description
              "TE label specified in a generic format.";
          }
        }
      }
      leaf direction {
        type te-label-direction;
        description "Label direction";
      }
    }
  }
  /**
   * TE performance metric groupings
   **/
  grouping performance-metric-container {
    description
      "A container containing performance metric attributes.";
    container performance-metric {
      description
        "Link performance information in real time.";
      reference
        "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
         RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
         RFC7823: Performance-Based Path Selection for Explicitly
         Routed Label Switched Paths (LSPs) Using TE Metric
         Extensions";
      container measurement {
        description
          "Measured performance metric values. Static configuration
           and manual overrides of these measurements are also
           allowed.";
        uses performance-metric-attributes;
      }
      container normality
      {
        description
          "Performance metric normality values.";
        uses performance-metric-normality-attributes;
      }
      uses performance-metric-throttle-container;
    }
  } // performance-metric-container

  grouping te-topology-identifier {
    description
      "Augmentation for TE topology.";
    container te-topology-identifier {
      description "TE topology identifier container";
      leaf provider-id {
        type te-types:te-global-id;
        description
          "An identifier to uniquely identify a provider.";
      }
      leaf client-id {
        type te-types:te-global-id;
        description
          "An identifier to uniquely identify a client.";
      }
      leaf topology-id {
        type te-types:te-topology-id;
        description
          "It is presumed that a datastore will contain many
           topologies. To distinguish between topologies it is
           vital to have UNIQUE topology identifiers.";
      }
    }
  }

  grouping performance-metric-attributes {
    description
      "Link performance information in real time.";
    reference
      "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
       RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
       RFC7823: Performance-Based Path Selection for Explicitly
       Routed Label Switched Paths (LSPs) Using TE Metric
       Extensions";
    leaf unidirectional-delay {
      type uint32 {
        range 0..16777215;
      }
      description "Delay or latency in micro seconds.";
    }
    leaf unidirectional-min-delay {
      type uint32 {
        range 0..16777215;
      }
      description "Minimum delay or latency in micro seconds.";
    }
    leaf unidirectional-max-delay {
      type uint32 {
        range 0..16777215;
      }
      description "Maximum delay or latency in micro seconds.";
    }
    leaf unidirectional-delay-variation {
      type uint32 {
        range 0..16777215;
      }
      description "Delay variation in micro seconds.";
    }
    leaf unidirectional-packet-loss {
      type decimal64 {
        fraction-digits 6;
        range "0 .. 50.331642";
      }
      description
        "Packet loss as a percentage of the total traffic sent
         over a configurable interval. The finest precision is
         0.000003%.";
    }
    leaf unidirectional-residual-bandwidth {
      type rt-types:bandwidth-ieee-float32;
      description
        "Residual bandwidth that subtracts tunnel
         reservations from Maximum Bandwidth (or link capacity)
         [RFC3630] and provides an aggregated remainder across QoS
         classes.";
    }
    leaf unidirectional-available-bandwidth {
      type rt-types:bandwidth-ieee-float32;
      description
        "Available bandwidth that is defined to be residual
         bandwidth minus the measured bandwidth used for the
         actual forwarding of non-RSVP-TE LSP packets.  For a
         bundled link, available bandwidth is defined to be the
         sum of the component link available bandwidths.";
    }
    leaf unidirectional-utilized-bandwidth {
      type rt-types:bandwidth-ieee-float32;
      description
        "Bandwidth utilization that represents the actual
         utilization of the link (i.e. as measured in the router).
         For a bundled link, bandwidth utilization is defined to
         be the sum of the component link bandwidth
         utilizations.";
    }
  } // performance-metric-attributes

  grouping performance-metric-normality-attributes {
    description
      "Link performance metric normality attributes.";
    reference
      "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
       RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
       RFC7823: Performance-Based Path Selection for Explicitly
       Routed Label Switched Paths (LSPs) Using TE Metric
       Extensions";
    leaf unidirectional-delay {
      type te-types:performance-metric-normality;
      description "Delay normality.";
    }
    leaf unidirectional-min-delay {
      type te-types:performance-metric-normality;
      description "Minimum delay or latency normality.";
    }
    leaf unidirectional-max-delay {
      type te-types:performance-metric-normality;
      description "Maximum delay or latency normality.";
    }
    leaf unidirectional-delay-variation {
      type te-types:performance-metric-normality;
      description "Delay variation normality.";
    }
    leaf unidirectional-packet-loss {
      type te-types:performance-metric-normality;
      description "Packet loss normality.";
    }
    leaf unidirectional-residual-bandwidth {
      type te-types:performance-metric-normality;
      description "Residual bandwidth normality.";
    }
    leaf unidirectional-available-bandwidth {
      type te-types:performance-metric-normality;
      description "Available bandwidth normality.";
    }
    leaf unidirectional-utilized-bandwidth {
      type te-types:performance-metric-normality;
      description "Bandwidth utilization normality.";
    }
  } // performance-metric-normality-attributes

  grouping performance-metric-throttle-container {
    description
      "A container controlling performance metric throttle.";
    container throttle {
      must "suppression-interval >= measure-interval" {
        error-message
          "suppression-interval cannot be less then
           measure-interval.";
        description
          "Constraint on suppression-interval and
           measure-interval.";
      }
      description
        "Link performance information in real time.";
      reference
        "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
         RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
         RFC7823: Performance-Based Path Selection for Explicitly
         Routed Label Switched Paths (LSPs) Using TE Metric
         Extensions";
      leaf unidirectional-delay-offset {
        type uint32 {
          range 0..16777215;
        }
        description
          "Offset value to be added to the measured delay value.";
      }
      leaf measure-interval {
        type uint32;
        default 30;
        description
          "Interval in seconds to measure the extended metric
           values.";
      }
      leaf advertisement-interval {
        type uint32;
        description
          "Interval in seconds to advertise the extended metric
           values.";
      }
      leaf suppression-interval {
        type uint32 {
          range "1 .. max";
        }
        default 120;
        description
          "Interval in seconds to suppress advertising the extended
           metric values.";
      }
      container threshold-out {
        uses performance-metric-attributes;
        description
          "If the measured parameter falls outside an upper bound
           for all but the min delay metric (or lower bound for
           min-delay metric only) and the advertised value is not
           already outside that bound, anomalous announcement will be
           triggered.";
      }
      container threshold-in {
        uses performance-metric-attributes;
        description
          "If the measured parameter falls inside an upper bound
           for all but the min delay metric (or lower bound for
           min-delay metric only) and the advertised value is not
           already inside that bound, normal (anomalous-flag cleared)
           announcement will be triggered.";
      }
      container threshold-accelerated-advertisement {
        description
          "When the difference between the last advertised value and
           current measured value exceed this threshold, anomalous
           announcement will be triggered.";
        uses performance-metric-attributes;
      }
    }
  } // performance-metric-throttle-container

  /**
   * TE tunnel generic groupings
   **/

  /* Tunnel path selection parameters */
  grouping explicit-route-hop {
    description
      "The explicit route subobject grouping";
    leaf index {
      type uint32;
      description "ERO subobject index";
    }
    choice type {
      description
        "The explicit route subobject type";
      case num-unnum-hop {
        container num-unnum-hop {
          leaf node-id {
            type te-types:te-node-id;
            description
              "The identifier of a node in the TE topology.";
          }
          leaf link-tp-id {
            type te-types:te-tp-id;
              description
                "TE link termination point identifier. The combination
                 of TE link ID and the TE node ID is used to identify an
                 unnumbered TE link.";
          }
          leaf hop-type {
            type te-hop-type;
            description "strict or loose hop";
          }
          leaf direction {
            type te-link-direction;
            description "Unnumbered Link ERO direction";
          }
          description
            "Numbered and Unnumbered link/node explicit route
             subobject";
          reference
            "RFC3209: section 4.3 for EXPLICIT_ROUTE in RSVP-TE
             RFC3477: Signalling Unnumbered Links in RSVP-TE";
        }
      }
      case as-number {
        container as-number-hop {
          leaf as-number {
            type binary {
              length 16;
            }
            description "AS number";
          }
          leaf hop-type {
            type te-hop-type;
              description
                "strict or loose hop";
          }
          description
            "Autonomous System explicit route subobject";
        }
      }
      case label {
        container label-hop {
          description "Label hop type";
          uses te-label;
        }
        description
          "The Label ERO subobject";
      }
    }
  }

  grouping record-route-subobject_state {
    description
      "The record route subobject grouping";
    leaf index {
      type uint32;
      description "RRO subobject index";
    }
    choice type {
      description
        "The record route subobject type";
      case numbered {
        leaf address {
          type te-types:te-tp-id;
          description
            "Numbered link TE termination point address.";
        }
        leaf ip-flags {
          type binary {
            length 8;
          }
          description
            "RRO IP address sub-object flags";
          reference "RFC3209";
        }
      }
      case unnumbered {
        leaf node-id {
          type te-types:te-node-id;
          description
            "The identifier of a node in the TE topology.";
        }
        leaf link-tp-id {
          type te-types:te-tp-id;
            description
              "TE link termination point identifier, used
               together with te-node-id to identify the
               link termination point";
        }
        description
          "Unnumbered link record route subobject";
        reference
          "RFC3477: Signalling Unnumbered Links in
           RSVP-TE";
      }
      case label {
        container label-hop {
          description "Label hop type";
          uses te-label;
          leaf label-flags {
            type binary {
              length 8;
            }
            description
              "Label sub-object flags";
            reference "RFC3209";
          }
        }
        description
          "The Label RRO subobject";
      }
    }
  }

  grouping label-restriction-info {
    description "Label set item info";
    leaf restriction {
      type enumeration {
        enum inclusive {
          description "The label or label range is inclusive.";
        }
        enum exclusive {
          description "The label or label range is exclusive.";
        }
      }
      description
        "Whether the list item is inclusive or exclusive.";
    }
    leaf index {
      type uint32;
      description
        "Then index of the label restriction list entry.";
    }
    container label-start {
      description
        "This is the starting label if a label range is specified.
         This is the label value if a single label is specified,
         in which case, attribute 'label-end' is not set.";
      uses te-label;
    }
    container label-end {
      description
        "The ending label if a label range is specified;
         This attribute is not set, If a single label is
         specified.";
      uses te-label;
    }
    leaf range-bitmap {
      type binary;
      description
        "When there are gaps between label-start and label-end,
         this attribute is used to specified the possitions
         of the used labels.";
    }
  }

  grouping label-set-info {
    description
      "Grouping for List of label restrictions specifying what labels
       may or may not be used on a link connectivity.";
    container label-restrictions {
      description
        "The label restrictions container";
      list label-restriction {
        key "index";
        description
          "The absence of label-set implies that all labels are
           acceptable; otherwise only restricted labels are
           available.";
        reference
          "RFC7579: General Network Element Constraint Encoding
           for GMPLS-Controlled Networks";
        uses label-restriction-info;
      }
    }
  }

  /*** End of TE tunnel groupings ***/
  grouping optimizations_config {
    description "Optimization metrics configuration grouping";
    leaf metric-type {
      type identityref {
        base te-types:path-metric-type;
      }
      description "TE path metric type";
    }
    leaf weight {
      type uint8;
      description "TE path metric normalization weight";
    }
    container explicit-route-exclude-objects {
      when "../metric-type = " +
           "'te-types:path-metric-optimize-excludes'";
      description
        "Container for the exclude route object list";
      uses path-route-exclude-objects;
    }
    container explicit-route-include-objects {
      when "../metric-type = " +
           "'te-types:path-metric-optimize-includes'";
      description
        "Container for the include route object list";
      uses path-route-include-objects;
    }
  }

  grouping common-constraints_config {
    description
      "Common constraints grouping that can be set on
       a constraint set or directly on the tunnel";

    uses te-types:te-bandwidth {
      description
        "A requested bandwidth to use for path computation";
    }

    leaf setup-priority {
      type uint8 {
        range "0..7";
      }
      description
        "TE LSP requested setup priority";
      reference "RFC3209";
    }
    leaf hold-priority {
      type uint8 {
        range "0..7";
      }
      description
        "TE LSP requested hold priority";
      reference "RFC3209";
    }
    leaf signaling-type {
      type identityref {
        base te-types:path-signaling-type;
      }
      description "TE tunnel path signaling type";
    }
  }

  grouping tunnel-constraints_config {
    description
      "Tunnel constraints grouping that can be set on
       a constraint set or directly on the tunnel";
    uses te-types:te-topology-identifier;
    uses te-types:common-constraints_config;
  }

  grouping path-metrics-bounds_config {
    description "TE path metric bounds grouping";
    leaf metric-type {
      type identityref {
        base te-types:path-metric-type;
      }
      description "TE path metric type";
    }
    leaf upper-bound {
      type uint64;
      description "Upper bound on end-to-end TE path metric";
    }
  }

  grouping path-objective-function_config {
    description "Optimization metrics configuration grouping";
    leaf objective-function-type {
      type identityref {
        base te-types:objective-function-type;
      }
      description
        "Objective function entry";
    }
  }

  /**
   * TE interface generic groupings
   **/
  grouping path-route-objects {
    description
      "List of EROs to be included or excluded when performing
       the path computation.";
    container explicit-route-objects {
      description
        "Container for the exclude route object list";
      list route-object-exclude-always {
        key index;
        description
          "List of explicit route objects to always exclude
           from path computation";
        uses te-types:explicit-route-hop;
      }
      list route-object-include-exclude {
        key index;
        description
          "List of explicit route objects to include or
           exclude in path computation";
        leaf explicit-route-usage {
          type identityref {
            base te-types:route-usage-type;
          }
          description "Explicit-route usage.";
        }
        uses te-types:explicit-route-hop {
          augment "type" {
            case srlg {
              container srlg {
                description "SRLG container";
                leaf srlg {
                  type uint32;
                  description "SRLG value";
                }
              }
              description "An SRLG value to be included or excluded";
            }
            description
              "Augmentation to generic explicit route for SRLG
               exclusion";
          }
        }
      }
    }
  }

  grouping path-route-include-objects {
    description
      "List of EROs to be included when performing
       the path computation.";
    list route-object-include-object {
      key index;
      description
        "List of explicit route objects to be included
         in path computation";
      uses te-types:explicit-route-hop;
    }
  }

  grouping path-route-exclude-objects {
    description
      "List of EROs to be included when performing
       the path computation.";
    list route-object-exclude-object {
      key index;
      description
        "List of explicit route objects to be excluded
         in path computation";
      uses te-types:explicit-route-hop {
        augment "type" {
          case srlg {
            container srlg {
              description "SRLG container";
              leaf srlg {
                type uint32;
                description "SRLG value";
              }
            }
            description "An SRLG value to be included or excluded";
          }
          description
            "Augmentation to generic explicit route for SRLG exclusion";
        }
      }
    }
  }

  grouping generic-path-metric-bounds {
    description "TE path metric bounds grouping";
    container path-metric-bounds {
      description "TE path metric bounds container";
      list path-metric-bound {
        key metric-type;
        description "List of TE path metric bounds";
        uses path-metrics-bounds_config;
      }
    }
  }

  grouping generic-path-optimization {
    description "TE generic path optimization grouping";

    container optimizations {
      description
        "The objective function container that includes
         attributes to impose when computing a TE path";

      choice algorithm {
        description "Optimizations algorithm.";
        case metric {
          if-feature path-optimization-metric;
          /* Optimize by metric */
          list optimization-metric {
            key "metric-type";
            description "TE path metric type";
            uses optimizations_config;
          }
          /* Tiebreakers */
          container tiebreakers {
            description
              "The list of tiebreaker criterion to apply
               on an equally favored set of paths to pick best";
            list tiebreaker {
              key "tiebreaker-type";
              description
                "The list of tiebreaker criterion to apply
                 on an equally favored set of paths to pick best";
              leaf tiebreaker-type {
                type identityref {
                  base te-types:path-metric-type;
                }
                description "The objective function";
              }
            }
          }
        }
        case objective-function {
          if-feature path-optimization-objective-function;
          /* Objective functions */
          container objective-function {
            description
              "The objective function container that includes
               attributes to impose when computing a TE path";
            uses path-objective-function_config;
          }
        }
      }
    }
  }

  grouping generic-path-affinities {
    description
      "Path affinities grouping";
    container path-affinities {
      description
        "Path affinities container";
      list constraint {
        key "usage";
        description
          "List of named affinity constraints";
        leaf usage {
          type identityref {
            base resource-affinities-type;
          }
          description "Affinities usage";
        }
        leaf value {
          type admin-groups;
          description "Affinity value";
        }
      }
    }
  }

  grouping generic-path-srlgs {
    description
      "Path SRLG grouping";
    container path-srlgs {
      description
        "Path SRLG properties container";
      leaf usage {
        type identityref {
          base te-types:route-exclude-srlg;
        }
        description "SRLG usage";
      }
      leaf-list values {
        type srlg;
        description "SRLG value";
      }
    }
  }

  grouping generic-path-disjointness {
    description "Path disjointness grouping";
    leaf disjointness {
      type te-types:te-path-disjointness;
      description
        "The type of resource disjointness.
         Under primary path, disjointness level applies to
         all secondary LSPs. Under secondary, disjointness
         level overrides the one under primary";
    }
  }

  grouping common-path-constraints-attributes {
    description
      "Common path constraints configuration grouping";
    uses common-constraints_config;
    uses generic-path-metric-bounds;
    uses generic-path-affinities;
    uses generic-path-srlgs;
  }

  grouping generic-path-constraints {
    description
      "Global named path constraints configuration
      grouping";
    container path-constraints {
      description "TE named path constraints container";
      uses common-path-constraints-attributes;
      uses generic-path-disjointness;
    }
  }

  grouping generic-path-properties {
    description "TE generic path properties grouping";
    container path-properties {
      config false;
      description "The TE path properties";
      list path-metric {
        key metric-type;
        description "TE path metric type";
        leaf metric-type {
          type identityref {
            base te-types:path-metric-type;
          }
          description "TE path metric type";
        }
        leaf accumulative-value {
          type uint64;
          description "TE path metric accumulative value";
        }
      }
      uses generic-path-affinities;
      uses generic-path-srlgs;
      container path-route-objects {
        description
          "Container for the list of route objects either returned by
           the computation engine or actually used by an LSP";
        list path-route-object {
          key index;
          description
            "List of route objects either returned by the computation
             engine or actually used by an LSP";
          uses explicit-route-hop;
        }
      }
    }
  }
}