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