YANGTOOLS-706: Split out yang-parser-rfc7950
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / resources / semantic-statement-parser / yin / modules / ietf-inet-types.yin
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <module name="ietf-inet-types"\r
3         xmlns="urn:ietf:params:xml:ns:yang:yin:1"\r
4         xmlns:inet="urn:ietf:params:xml:ns:yang:ietf-inet-types">\r
5   <namespace uri="urn:ietf:params:xml:ns:yang:ietf-inet-types"/>\r
6   <prefix value="inet"/>\r
7   <organization>\r
8     <text>IETF NETMOD (NETCONF Data Modeling Language) Working Group</text>\r
9   </organization>\r
10   <contact>\r
11     <text>WG Web:   &lt;http://tools.ietf.org/wg/netmod/&gt;\r
12 WG List:  &lt;mailto:netmod@ietf.org&gt;\r
13 \r
14 WG Chair: David Partain\r
15           &lt;mailto:david.partain@ericsson.com&gt;\r
16 \r
17 WG Chair: David Kessens\r
18           &lt;mailto:david.kessens@nsn.com&gt;\r
19 \r
20 Editor:   Juergen Schoenwaelder\r
21           &lt;mailto:j.schoenwaelder@jacobs-university.de&gt;</text>\r
22   </contact>\r
23   <description>\r
24     <text>This module contains a collection of generally useful derived\r
25 YANG data types for Internet addresses and related things.\r
26 \r
27 Copyright (c) 2010 IETF Trust and the persons identified as\r
28 authors of the code.  All rights reserved.\r
29 \r
30 \r
31 \r
32 Redistribution and use in source and binary forms, with or without\r
33 modification, is permitted pursuant to, and subject to the license\r
34 terms contained in, the Simplified BSD License set forth in Section\r
35 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents\r
36 (http://trustee.ietf.org/license-info).\r
37 \r
38 This version of this YANG module is part of RFC 6021; see\r
39 the RFC itself for full legal notices.</text>\r
40   </description>\r
41   <revision date="2010-09-24">\r
42     <description>\r
43       <text>Initial revision.</text>\r
44     </description>\r
45     <reference>\r
46       <text>RFC 6021: Common YANG Data Types</text>\r
47     </reference>\r
48   </revision>\r
49   <typedef name="ip-version">\r
50     <type name="enumeration">\r
51       <enum name="unknown">\r
52         <value value="0"/>\r
53         <description>\r
54           <text>An unknown or unspecified version of the Internet protocol.</text>\r
55         </description>\r
56       </enum>\r
57       <enum name="ipv4">\r
58         <value value="1"/>\r
59         <description>\r
60           <text>The IPv4 protocol as defined in RFC 791.</text>\r
61         </description>\r
62       </enum>\r
63       <enum name="ipv6">\r
64         <value value="2"/>\r
65         <description>\r
66           <text>The IPv6 protocol as defined in RFC 2460.</text>\r
67         </description>\r
68       </enum>\r
69     </type>\r
70     <description>\r
71       <text>This value represents the version of the IP protocol.\r
72 \r
73 In the value set and its semantics, this type is equivalent\r
74 to the InetVersion textual convention of the SMIv2.</text>\r
75     </description>\r
76     <reference>\r
77       <text>RFC  791: Internet Protocol\r
78 RFC 2460: Internet Protocol, Version 6 (IPv6) Specification\r
79 RFC 4001: Textual Conventions for Internet Network Addresses</text>\r
80     </reference>\r
81   </typedef>\r
82   <typedef name="dscp">\r
83     <type name="uint8">\r
84       <range value="0..63"/>\r
85     </type>\r
86     <description>\r
87       <text>The dscp type represents a Differentiated Services Code-Point\r
88 that may be used for marking packets in a traffic stream.\r
89 \r
90 In the value set and its semantics, this type is equivalent\r
91 to the Dscp textual convention of the SMIv2.</text>\r
92     </description>\r
93     <reference>\r
94       <text>RFC 3289: Management Information Base for the Differentiated\r
95           Services Architecture\r
96 RFC 2474: Definition of the Differentiated Services Field\r
97           (DS Field) in the IPv4 and IPv6 Headers\r
98 RFC 2780: IANA Allocation Guidelines For Values In\r
99           the Internet Protocol and Related Headers</text>\r
100     </reference>\r
101   </typedef>\r
102   <typedef name="ipv6-flow-label">\r
103     <type name="uint32">\r
104       <range value="0..1048575"/>\r
105     </type>\r
106     <description>\r
107       <text>The flow-label type represents flow identifier or Flow Label\r
108 in an IPv6 packet header that may be used to discriminate\r
109 traffic flows.\r
110 \r
111 In the value set and its semantics, this type is equivalent\r
112 to the IPv6FlowLabel textual convention of the SMIv2.</text>\r
113     </description>\r
114     <reference>\r
115       <text>RFC 3595: Textual Conventions for IPv6 Flow Label\r
116 RFC 2460: Internet Protocol, Version 6 (IPv6) Specification</text>\r
117     </reference>\r
118   </typedef>\r
119   <typedef name="port-number">\r
120     <type name="uint16">\r
121       <range value="0..65535"/>\r
122     </type>\r
123     <description>\r
124       <text>The port-number type represents a 16-bit port number of an\r
125 Internet transport layer protocol such as UDP, TCP, DCCP, or\r
126 SCTP.  Port numbers are assigned by IANA.  A current list of\r
127 all assignments is available from &lt;http://www.iana.org/&gt;.\r
128 \r
129 Note that the port number value zero is reserved by IANA.  In\r
130 situations where the value zero does not make sense, it can\r
131 be excluded by subtyping the port-number type.\r
132 \r
133 In the value set and its semantics, this type is equivalent\r
134 to the InetPortNumber textual convention of the SMIv2.</text>\r
135     </description>\r
136     <reference>\r
137       <text>RFC  768: User Datagram Protocol\r
138 RFC  793: Transmission Control Protocol\r
139 RFC 4960: Stream Control Transmission Protocol\r
140 RFC 4340: Datagram Congestion Control Protocol (DCCP)\r
141 RFC 4001: Textual Conventions for Internet Network Addresses</text>\r
142     </reference>\r
143   </typedef>\r
144   <typedef name="as-number">\r
145     <type name="uint32"/>\r
146     <description>\r
147       <text>The as-number type represents autonomous system numbers\r
148 which identify an Autonomous System (AS).  An AS is a set\r
149 of routers under a single technical administration, using\r
150 an interior gateway protocol and common metrics to route\r
151 packets within the AS, and using an exterior gateway\r
152 protocol to route packets to other ASs'.  IANA maintains\r
153 the AS number space and has delegated large parts to the\r
154 regional registries.\r
155 \r
156 Autonomous system numbers were originally limited to 16\r
157 bits.  BGP extensions have enlarged the autonomous system\r
158 number space to 32 bits.  This type therefore uses an uint32\r
159 base type without a range restriction in order to support\r
160 a larger autonomous system number space.\r
161 \r
162 In the value set and its semantics, this type is equivalent\r
163 to the InetAutonomousSystemNumber textual convention of\r
164 the SMIv2.</text>\r
165     </description>\r
166     <reference>\r
167       <text>RFC 1930: Guidelines for creation, selection, and registration\r
168           of an Autonomous System (AS)\r
169 RFC 4271: A Border Gateway Protocol 4 (BGP-4)\r
170 RFC 4893: BGP Support for Four-octet AS Number Space\r
171 RFC 4001: Textual Conventions for Internet Network Addresses</text>\r
172     </reference>\r
173   </typedef>\r
174   <typedef name="ip-address">\r
175     <type name="union">\r
176       <type name="inet:ipv4-address"/>\r
177       <type name="inet:ipv6-address"/>\r
178     </type>\r
179     <description>\r
180       <text>The ip-address type represents an IP address and is IP\r
181 version neutral.  The format of the textual representations\r
182 implies the IP version.</text>\r
183     </description>\r
184   </typedef>\r
185   <typedef name="ipv4-address">\r
186     <type name="string">\r
187       <pattern value="(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?"/>\r
188     </type>\r
189     <description>\r
190       <text>The ipv4-address type represents an IPv4 address in\r
191 dotted-quad notation.  The IPv4 address may include a zone\r
192 index, separated by a % sign.\r
193 \r
194 The zone index is used to disambiguate identical address\r
195 values.  For link-local addresses, the zone index will\r
196 typically be the interface index number or the name of an\r
197 interface.  If the zone index is not present, the default\r
198 zone of the device will be used.\r
199 \r
200 The canonical format for the zone index is the numerical\r
201 format</text>\r
202     </description>\r
203   </typedef>\r
204   <typedef name="ipv6-address">\r
205     <type name="string">\r
206       <pattern value="((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\p{N}\p{L}]+)?"/>\r
207       <pattern value="(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(%.+)?"/>\r
208     </type>\r
209     <description>\r
210       <text>The ipv6-address type represents an IPv6 address in full,\r
211 mixed, shortened, and shortened-mixed notation.  The IPv6\r
212 address may include a zone index, separated by a % sign.\r
213 \r
214 \r
215 \r
216 \r
217 \r
218 The zone index is used to disambiguate identical address\r
219 values.  For link-local addresses, the zone index will\r
220 typically be the interface index number or the name of an\r
221 interface.  If the zone index is not present, the default\r
222 zone of the device will be used.\r
223 \r
224 The canonical format of IPv6 addresses uses the compressed\r
225 format described in RFC 4291, Section 2.2, item 2 with the\r
226 following additional rules: the :: substitution must be\r
227 applied to the longest sequence of all-zero 16-bit chunks\r
228 in an IPv6 address.  If there is a tie, the first sequence\r
229 of all-zero 16-bit chunks is replaced by ::.  Single\r
230 all-zero 16-bit chunks are not compressed.  The canonical\r
231 format uses lowercase characters and leading zeros are\r
232 not allowed.  The canonical format for the zone index is\r
233 the numerical format as described in RFC 4007, Section\r
234 11.2.</text>\r
235     </description>\r
236     <reference>\r
237       <text>RFC 4291: IP Version 6 Addressing Architecture\r
238 RFC 4007: IPv6 Scoped Address Architecture\r
239 RFC 5952: A Recommendation for IPv6 Address Text Representation</text>\r
240     </reference>\r
241   </typedef>\r
242   <typedef name="ip-prefix">\r
243     <type name="union">\r
244       <type name="inet:ipv4-prefix"/>\r
245       <type name="inet:ipv6-prefix"/>\r
246     </type>\r
247     <description>\r
248       <text>The ip-prefix type represents an IP prefix and is IP\r
249 version neutral.  The format of the textual representations\r
250 implies the IP version.</text>\r
251     </description>\r
252   </typedef>\r
253   <typedef name="ipv4-prefix">\r
254     <type name="string">\r
255       <pattern value="(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))"/>\r
256     </type>\r
257     <description>\r
258       <text>The ipv4-prefix type represents an IPv4 address prefix.\r
259 The prefix length is given by the number following the\r
260 slash character and must be less than or equal to 32.\r
261 \r
262 \r
263 \r
264 A prefix length value of n corresponds to an IP address\r
265 mask that has n contiguous 1-bits from the most\r
266 significant bit (MSB) and all other bits set to 0.\r
267 \r
268 The canonical format of an IPv4 prefix has all bits of\r
269 the IPv4 address set to zero that are not part of the\r
270 IPv4 prefix.</text>\r
271     </description>\r
272   </typedef>\r
273   <typedef name="ipv6-prefix">\r
274     <type name="string">\r
275       <pattern value="((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))"/>\r
276       <pattern value="(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(/.+)"/>\r
277     </type>\r
278     <description>\r
279       <text>The ipv6-prefix type represents an IPv6 address prefix.\r
280 The prefix length is given by the number following the\r
281 slash character and must be less than or equal 128.\r
282 \r
283 A prefix length value of n corresponds to an IP address\r
284 mask that has n contiguous 1-bits from the most\r
285 significant bit (MSB) and all other bits set to 0.\r
286 \r
287 The IPv6 address should have all bits that do not belong\r
288 to the prefix set to zero.\r
289 \r
290 The canonical format of an IPv6 prefix has all bits of\r
291 the IPv6 address set to zero that are not part of the\r
292 IPv6 prefix.  Furthermore, IPv6 address is represented\r
293 in the compressed format described in RFC 4291, Section\r
294 2.2, item 2 with the following additional rules: the ::\r
295 substitution must be applied to the longest sequence of\r
296 all-zero 16-bit chunks in an IPv6 address.  If there is\r
297 a tie, the first sequence of all-zero 16-bit chunks is\r
298 replaced by ::.  Single all-zero 16-bit chunks are not\r
299 compressed.  The canonical format uses lowercase\r
300 characters and leading zeros are not allowed.</text>\r
301     </description>\r
302     <reference>\r
303       <text>RFC 4291: IP Version 6 Addressing Architecture</text>\r
304     </reference>\r
305   </typedef>\r
306   <typedef name="domain-name">\r
307     <type name="string">\r
308       <pattern value="((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)|\."/>\r
309       <length value="1..253"/>\r
310     </type>\r
311     <description>\r
312       <text>The domain-name type represents a DNS domain name.  The\r
313 name SHOULD be fully qualified whenever possible.\r
314 \r
315 Internet domain names are only loosely specified.  Section\r
316 3.5 of RFC 1034 recommends a syntax (modified in Section\r
317 2.1 of RFC 1123).  The pattern above is intended to allow\r
318 for current practice in domain name use, and some possible\r
319 future expansion.  It is designed to hold various types of\r
320 domain names, including names used for A or AAAA records\r
321 (host names) and other records, such as SRV records.  Note\r
322 that Internet host names have a stricter syntax (described\r
323 in RFC 952) than the DNS recommendations in RFCs 1034 and\r
324 1123, and that systems that want to store host names in\r
325 schema nodes using the domain-name type are recommended to\r
326 adhere to this stricter standard to ensure interoperability.\r
327 \r
328 The encoding of DNS names in the DNS protocol is limited\r
329 to 255 characters.  Since the encoding consists of labels\r
330 prefixed by a length bytes and there is a trailing NULL\r
331 byte, only 253 characters can appear in the textual dotted\r
332 notation.\r
333 \r
334 The description clause of schema nodes using the domain-name\r
335 type MUST describe when and how these names are resolved to\r
336 IP addresses.  Note that the resolution of a domain-name value\r
337 may require to query multiple DNS records (e.g., A for IPv4\r
338 and AAAA for IPv6).  The order of the resolution process and\r
339 which DNS record takes precedence can either be defined\r
340 explicitely or it may depend on the configuration of the\r
341 resolver.\r
342 \r
343 Domain-name values use the US-ASCII encoding.  Their canonical\r
344 format uses lowercase US-ASCII characters.  Internationalized\r
345 domain names MUST be encoded in punycode as described in RFC\r
346 3492</text>\r
347     </description>\r
348     <reference>\r
349       <text>RFC  952: DoD Internet Host Table Specification\r
350 RFC 1034: Domain Names - Concepts and Facilities\r
351 RFC 1123: Requirements for Internet Hosts -- Application\r
352           and Support\r
353 RFC 2782: A DNS RR for specifying the location of services\r
354           (DNS SRV)\r
355 RFC 3492: Punycode: A Bootstring encoding of Unicode for\r
356           Internationalized Domain Names in Applications\r
357           (IDNA)\r
358 RFC 5891: Internationalizing Domain Names in Applications\r
359           (IDNA): Protocol</text>\r
360     </reference>\r
361   </typedef>\r
362   <typedef name="host">\r
363     <type name="union">\r
364       <type name="inet:ip-address"/>\r
365       <type name="inet:domain-name"/>\r
366     </type>\r
367     <description>\r
368       <text>The host type represents either an IP address or a DNS\r
369 domain name.</text>\r
370     </description>\r
371   </typedef>\r
372   <typedef name="uri">\r
373     <type name="string"/>\r
374     <description>\r
375       <text>The uri type represents a Uniform Resource Identifier\r
376 (URI) as defined by STD 66.\r
377 \r
378 Objects using the uri type MUST be in US-ASCII encoding,\r
379 and MUST be normalized as described by RFC 3986 Sections\r
380 6.2.1, 6.2.2.1, and 6.2.2.2.  All unnecessary\r
381 percent-encoding is removed, and all case-insensitive\r
382 characters are set to lowercase except for hexadecimal\r
383 digits, which are normalized to uppercase as described in\r
384 Section 6.2.2.1.\r
385 \r
386 The purpose of this normalization is to help provide\r
387 unique URIs.  Note that this normalization is not\r
388 sufficient to provide uniqueness.  Two URIs that are\r
389 textually distinct after this normalization may still be\r
390 equivalent.\r
391 \r
392 Objects using the uri type may restrict the schemes that\r
393 they permit.  For example, 'data:' and 'urn:' schemes\r
394 might not be appropriate.\r
395 \r
396 A zero-length URI is not a valid URI.  This can be used to\r
397 express 'URI absent' where required.\r
398 \r
399 In the value set and its semantics, this type is equivalent\r
400 to the Uri SMIv2 textual convention defined in RFC 5017.</text>\r
401     </description>\r
402     <reference>\r
403       <text>RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\r
404 RFC 3305: Report from the Joint W3C/IETF URI Planning Interest\r
405           Group: Uniform Resource Identifiers (URIs), URLs,\r
406           and Uniform Resource Names (URNs): Clarifications\r
407           and Recommendations\r
408 RFC 5017: MIB Textual Conventions for Uniform Resource\r
409           Identifiers (URIs)</text>\r
410     </reference>\r
411   </typedef>\r
412 </module>\r