YANGTOOLS-706: Split out yang-parser-rfc7950
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / resources / semantic-statement-parser / two-revisions / ted@2013-07-12.yang
1 module ted {
2   yang-version 1;
3   namespace "urn:TBD:params:xml:ns:yang:network:ted";
4   // replace with IANA namespace when assigned
5   prefix ted;
6
7   import ietf-inet-types {
8     prefix inet;
9   }
10
11   organization "TBD";
12   contact
13     "TBD";
14   description
15     "Helper module to hold TED attributes for OSPF/ISIS";
16
17   revision 2013-07-12 {
18     description
19       "Initial revision";
20   }
21
22   typedef switching-capabilities {
23     description
24       "Switching Capabilities of an interface.";
25     reference
26       "RFC 5307: IS-IS Extensions in Support of Generalized
27        Multi-Protocol Label Switching (GMPLS)";
28     type enumeration {
29       enum "PSC-1" {
30         description
31           "Packet-Switch Capable-1 (PSC-1)";
32         value 1;
33       }
34       enum "PSC-2" {
35         description
36           "Packet-Switch Capable-2 (PSC-2)";
37         value 2;
38       }
39       enum "PSC-3" {
40         description
41           "Packet-Switch Capable-3 (PSC-3)";
42         value 3;
43       }
44       enum "PSC-4" {
45         description
46           "Packet-Switch Capable-4 (PSC-4)";
47         value 4;
48       }
49       enum "L2SC" {
50         description
51           "Layer-2 Switch Capable (L2SC)";
52         value 51;
53       }
54       enum "TDM" {
55         description
56           "Time-Division-Multiplex Capable (TDM)";
57         value 100;
58       }
59       enum "LSC" {
60         description
61           "Lambda-Switch Capable (LSC)";
62         value 150;
63       }
64       enum "FSC" {
65         description
66           "Fiber-Switch Capable (FSC)";
67         value 200;
68       }
69     }
70   }
71
72   typedef pcc-capabilities {
73     description
74       "Path Computation Capabilities.";
75     reference
76       "RFC 5088, draft-ietf-pce-disco-protoc-isis-07.txt
77        OSPF/ISIS Protocol Extensions for Path Computation Element (PCE) Discovery.";
78     type bits {
79       bit path-computation-with-gmpls-link-constraints {
80         position 0;
81       }
82       bit bidirectional-path-computation {
83         position 1;
84       }
85       bit diverse-path-computation {
86         position 2;
87       }
88       bit load-balanced-path-computation {
89         position 3;
90       }
91       bit synchronized-path-computation {
92         position 4;
93       }
94       bit support-for-multiple-objective-functions {
95         position 5;
96       }
97       bit support-for-additive-path-constraints {
98         position 6;
99       }
100       bit support-for-request-prioritization {
101         position 7;
102       }
103       bit support-for-multiple-requests-per-message {
104         position 8;
105       }
106     }
107   }
108
109
110 grouping srlg-attributes {
111     description
112       "Shared Risk Link Group Attributes";
113     reference
114       "RFC 5307, RFC 4203: ISIS / OSPF Extensions in Support of
115        Generalized Multi-Protocol Label Switching (GMPLS)";
116     list interface-switching-capabilities {
117       description
118         "List of interface capabilities for this interface";
119       key "switching-capability";
120       leaf switching-capability {
121         description
122           "Switching Capability for this interface";
123         type ted:switching-capabilities;
124       }
125       leaf encoding {
126         description
127           "Encoding supported by this interface";
128         type uint8;
129       }
130       list max-lsp-bandwidth {
131         description
132           "Maximum LSP Bandwidth at priorities 0-7";
133         max-elements "8";
134         key "priority";
135         leaf priority {
136           type uint8 {
137             range "0..7";
138           }
139         }
140         leaf bandwidth {
141           description
142             "Max LSP Bandwidth for this level";
143           type decimal64 {
144             fraction-digits 2;
145           }
146         }
147       }
148       container packet-switch-capable {
149         when "../switching-capability = PSC-1 or ../switching-capability = PSC-2 or ../switching-capability = PSC-3 or ../switching-capability = PSC-4";
150         description
151           "Interface has packet-switching capabilities";
152         leaf minimum-lsp-bandwidth {
153           description
154             "Minimum LSP Bandwidth. Units in bytes per second";
155           type decimal64 {
156             fraction-digits 2;
157           }
158         }
159         leaf interface-mtu {
160           description
161             "Interface MTU";
162           type uint16;
163         }
164       }
165       container time-division-multiplex-capable {
166         when "../switching-capability = TDM";
167         description
168           "Interface has time-division multiplex capabilities";
169         leaf minimum-lsp-bandwidth {
170           description
171             "Minimum LSP Bandwidth. Units in bytes per second";
172           type decimal64 {
173             fraction-digits 2;
174           }
175         }
176         leaf indication {
177           description
178             "Indication whether the interface supports Standard or Arbitrary SONET/SDH";
179           type uint16;
180         }
181       }
182     }
183     list srlg-values {
184       description
185         "List of Shared Risk Link Group this interface belongs to.";
186       key "srlg-value";
187       leaf srlg-value {
188         description
189           "Shared Risk Link Group value";
190         type uint32;
191       }
192     }
193     leaf link-protection-type {
194       description
195         "Link Protection Type desired for this link";
196       type uint16;
197     }
198   }
199
200   grouping ted-node-attributes {
201     description
202       "Identifier to uniquely identify a node in TED";
203     reference "RFC 5305, RFC 6119: IPv6 Traffic Engineering in IS-IS/OSPF";
204     leaf te-router-id-ipv4 {
205       description
206         "Globally unique IPv4 Traffic Engineering Router ID.";
207       type inet:ipv4-address;
208     }
209     leaf te-router-id-ipv6 {
210       description
211         "Globally unique IPv6 Traffic Engineering Router ID";
212       type inet:ipv6-address;
213     }
214     list ipv4-local-address {
215       description
216         "List of IPv4 Local Address(OSPF). RFC 5786";
217       key "ipv4-prefix";
218       leaf ipv4-prefix {
219         description
220           "Local IPv4 address for the node";
221         type inet:ipv4-prefix;
222       }
223     }
224     list ipv6-local-address {
225       description
226         "List of IPv6 Local Address.";
227       reference
228         "RFC 5786: Advertising a Router's Local Addresses
229          in OSPF Traffic Engineering (TE) Extensions";
230       key "ipv6-prefix";
231       leaf ipv6-prefix {
232         description
233           "Local IPv6 address for the node";
234         type inet:ipv6-prefix;
235       }
236       leaf prefix-option {
237         description
238           "IPv6 prefix option.";
239         type uint8;
240       }
241     }
242     leaf pcc-capabilities {
243       description
244         "OSPF/ISIS PCC capabilities";
245       type pcc-capabilities;
246     }
247   }
248
249   grouping ted-link-attributes {
250     description
251       "TED Attributes associated with the link.";
252     reference "RFC 3630, RFC 3784: IS-IS / OSPF Traffic Engineering (TE)";
253     leaf color {
254       description
255         "Administrative group or color of the link";
256       type uint32;
257     }
258     leaf max-link-bandwidth {
259       description
260         "Maximum bandwidth that can be see on this link in this direction. Units in bytes per second";
261       type decimal64 {
262         fraction-digits 2;
263       }
264     }
265     leaf max-resv-link-bandwidth {
266       description
267         "Maximum amount of bandwidth that can be reserved in this direction in this link. Units in bytes per second";
268       type decimal64 {
269         fraction-digits 2;
270       }
271     }
272     list unreserved-bandwidth {
273       description
274         "Unreserved bandwidth for 0-7 priority levels. Units in bytes per second";
275       max-elements "8";
276       key "priority";
277       leaf priority {
278         type uint8 {
279           range "0..7";
280         }
281       }
282       leaf bandwidth {
283         description
284           "Unreserved bandwidth for this level";
285         type decimal64 {
286           fraction-digits 2;
287         }
288       }
289     }
290     leaf te-default-metric {
291       description
292         "Traffic Engineering Metric";
293       type uint32;
294     }
295     container srlg {
296       description
297         "Shared Risk Link Group Attributes";
298       uses srlg-attributes;
299     }
300   }
301 }