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