1 update yang_resource set
2 checksum = '417a7b14944f6236ad0e2b1ef956158c050cff9b74e3561ca80af32d11be240b',
3 content = 'module ietf-inet-types {
5 namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types";
9 "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
12 "WG Web: <http://tools.ietf.org/wg/netmod/>
13 WG List: <mailto:netmod@ietf.org>
15 WG Chair: David Kessens
16 <mailto:david.kessens@nsn.com>
18 WG Chair: Juergen Schoenwaelder
19 <mailto:j.schoenwaelder@jacobs-university.de>
21 Editor: Juergen Schoenwaelder
22 <mailto:j.schoenwaelder@jacobs-university.de>";
25 "This module contains a collection of generally useful derived
26 YANG data types for Internet addresses and related things.
28 Copyright (c) 2013 IETF Trust and the persons identified as
29 authors of the code. All rights reserved.
31 Redistribution and use in source and binary forms, with or
32 without modification, is permitted pursuant to, and subject
33 to the license terms contained in, the Simplified BSD License
34 set forth in Section 4.c of the IETF Trust''''s Legal Provisions
35 Relating to IETF Documents
36 (http://trustee.ietf.org/license-info).
38 This version of this YANG module is part of RFC 6991; see
39 the RFC itself for full legal notices.";
43 "This revision adds the following new data types:
45 - ipv4-address-no-zone
46 - ipv6-address-no-zone";
48 "RFC 6991: Common YANG Data Types";
55 "RFC 6021: Common YANG Data Types";
58 /*** collection of types related to protocol fields ***/
65 "An unknown or unspecified version of the Internet
71 "The IPv4 protocol as defined in RFC 791.";
76 "The IPv6 protocol as defined in RFC 2460.";
80 "This value represents the version of the IP protocol.
82 In the value set and its semantics, this type is equivalent
83 to the InetVersion textual convention of the SMIv2.";
85 "RFC 791: Internet Protocol
86 RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
87 RFC 4001: Textual Conventions for Internet Network Addresses";
95 "The dscp type represents a Differentiated Services Code Point
96 that may be used for marking packets in a traffic stream.
97 In the value set and its semantics, this type is equivalent
98 to the Dscp textual convention of the SMIv2.";
100 "RFC 3289: Management Information Base for the Differentiated
101 Services Architecture
102 RFC 2474: Definition of the Differentiated Services Field
103 (DS Field) in the IPv4 and IPv6 Headers
104 RFC 2780: IANA Allocation Guidelines For Values In
105 the Internet Protocol and Related Headers";
108 typedef ipv6-flow-label {
113 "The ipv6-flow-label type represents the flow identifier or Flow
114 Label in an IPv6 packet header that may be used to
115 discriminate traffic flows.
117 In the value set and its semantics, this type is equivalent
118 to the IPv6FlowLabel textual convention of the SMIv2.";
120 "RFC 3595: Textual Conventions for IPv6 Flow Label
121 RFC 2460: Internet Protocol, Version 6 (IPv6) Specification";
124 typedef port-number {
129 "The port-number type represents a 16-bit port number of an
130 Internet transport-layer protocol such as UDP, TCP, DCCP, or
131 SCTP. Port numbers are assigned by IANA. A current list of
132 all assignments is available from <http://www.iana.org/>.
134 Note that the port number value zero is reserved by IANA. In
135 situations where the value zero does not make sense, it can
136 be excluded by subtyping the port-number type.
137 In the value set and its semantics, this type is equivalent
138 to the InetPortNumber textual convention of the SMIv2.";
140 "RFC 768: User Datagram Protocol
141 RFC 793: Transmission Control Protocol
142 RFC 4960: Stream Control Transmission Protocol
143 RFC 4340: Datagram Congestion Control Protocol (DCCP)
144 RFC 4001: Textual Conventions for Internet Network Addresses";
147 /*** collection of types related to autonomous systems ***/
152 "The as-number type represents autonomous system numbers
153 which identify an Autonomous System (AS). An AS is a set
154 of routers under a single technical administration, using
155 an interior gateway protocol and common metrics to route
156 packets within the AS, and using an exterior gateway
157 protocol to route packets to other ASes. IANA maintains
158 the AS number space and has delegated large parts to the
161 Autonomous system numbers were originally limited to 16
162 bits. BGP extensions have enlarged the autonomous system
163 number space to 32 bits. This type therefore uses an uint32
164 base type without a range restriction in order to support
165 a larger autonomous system number space.
167 In the value set and its semantics, this type is equivalent
168 to the InetAutonomousSystemNumber textual convention of
171 "RFC 1930: Guidelines for creation, selection, and registration
172 of an Autonomous System (AS)
173 RFC 4271: A Border Gateway Protocol 4 (BGP-4)
174 RFC 4001: Textual Conventions for Internet Network Addresses
175 RFC 6793: BGP Support for Four-Octet Autonomous System (AS)
179 /*** collection of types related to IP addresses and hostnames ***/
183 type inet:ipv4-address;
184 type inet:ipv6-address;
187 "The ip-address type represents an IP address and is IP
188 version neutral. The format of the textual representation
189 implies the IP version. This type supports scoped addresses
190 by allowing zone identifiers in the address format.";
192 "RFC 4007: IPv6 Scoped Address Architecture";
195 typedef ipv4-address {
198 ''''(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]).){3}''''
199 + ''''([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])''''
200 + ''''(%[p{N}p{L}]+)?'''';
203 "The ipv4-address type represents an IPv4 address in
204 dotted-quad notation. The IPv4 address may include a zone
205 index, separated by a % sign.
207 The zone index is used to disambiguate identical address
208 values. For link-local addresses, the zone index will
209 typically be the interface index number or the name of an
210 interface. If the zone index is not present, the default
211 zone of the device will be used.
213 The canonical format for the zone index is the numerical
217 typedef ipv6-address {
219 pattern ''''((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}''''
220 + ''''((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|''''
221 + ''''(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9]).){3}''''
222 + ''''(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))''''
223 + ''''(%[p{N}p{L}]+)?'''';
224 pattern ''''(([^:]+:){6}(([^:]+:[^:]+)|(.*..*)))|''''
225 + ''''((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)''''
229 "The ipv6-address type represents an IPv6 address in full,
230 mixed, shortened, and shortened-mixed notation. The IPv6
231 address may include a zone index, separated by a % sign.
233 The zone index is used to disambiguate identical address
234 values. For link-local addresses, the zone index will
235 typically be the interface index number or the name of an
236 interface. If the zone index is not present, the default
237 zone of the device will be used.
239 The canonical format of IPv6 addresses uses the textual
240 representation defined in Section 4 of RFC 5952. The
241 canonical format for the zone index is the numerical
242 format as described in Section 11.2 of RFC 4007.";
244 "RFC 4291: IP Version 6 Addressing Architecture
245 RFC 4007: IPv6 Scoped Address Architecture
246 RFC 5952: A Recommendation for IPv6 Address Text
250 typedef ip-address-no-zone {
252 type inet:ipv4-address-no-zone;
253 type inet:ipv6-address-no-zone;
256 "The ip-address-no-zone type represents an IP address and is
257 IP version neutral. The format of the textual representation
258 implies the IP version. This type does not support scoped
259 addresses since it does not allow zone identifiers in the
262 "RFC 4007: IPv6 Scoped Address Architecture";
265 typedef ipv4-address-no-zone {
266 type inet:ipv4-address {
267 pattern ''''[0-9.]*'''';
270 "An IPv4 address without a zone index. This type, derived from
271 ipv4-address, may be used in situations where the zone is
272 known from the context and hence no zone index is needed.";
275 typedef ipv6-address-no-zone {
276 type inet:ipv6-address {
277 pattern ''''[0-9a-fA-F:.]*'''';
280 "An IPv6 address without a zone index. This type, derived from
281 ipv6-address, may be used in situations where the zone is
282 known from the context and hence no zone index is needed.";
284 "RFC 4291: IP Version 6 Addressing Architecture
285 RFC 4007: IPv6 Scoped Address Architecture
286 RFC 5952: A Recommendation for IPv6 Address Text
292 type inet:ipv4-prefix;
293 type inet:ipv6-prefix;
296 "The ip-prefix type represents an IP prefix and is IP
297 version neutral. The format of the textual representations
298 implies the IP version.";
301 typedef ipv4-prefix {
304 ''''(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]).){3}''''
305 + ''''([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])''''
306 + ''''/(([0-9])|([1-2][0-9])|(3[0-2]))'''';
309 "The ipv4-prefix type represents an IPv4 address prefix.
310 The prefix length is given by the number following the
311 slash character and must be less than or equal to 32.
313 A prefix length value of n corresponds to an IP address
314 mask that has n contiguous 1-bits from the most
315 significant bit (MSB) and all other bits set to 0.
317 The canonical format of an IPv4 prefix has all bits of
318 the IPv4 address set to zero that are not part of the
322 typedef ipv6-prefix {
324 pattern ''''((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}''''
325 + ''''((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|''''
326 + ''''(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9]).){3}''''
327 + ''''(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))''''
328 + ''''(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'''';
329 pattern ''''(([^:]+:){6}(([^:]+:[^:]+)|(.*..*)))|''''
330 + ''''((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)''''
334 "The ipv6-prefix type represents an IPv6 address prefix.
335 The prefix length is given by the number following the
336 slash character and must be less than or equal to 128.
338 A prefix length value of n corresponds to an IP address
339 mask that has n contiguous 1-bits from the most
340 significant bit (MSB) and all other bits set to 0.
342 The IPv6 address should have all bits that do not belong
343 to the prefix set to zero.
345 The canonical format of an IPv6 prefix has all bits of
346 the IPv6 address set to zero that are not part of the
347 IPv6 prefix. Furthermore, the IPv6 address is represented
348 as defined in Section 4 of RFC 5952.";
350 "RFC 5952: A Recommendation for IPv6 Address Text
354 /*** collection of domain name and URI types ***/
356 typedef domain-name {
360 ''''((([a-zA-Z0-9_]([a-zA-Z0-9-_]){0,61})?[a-zA-Z0-9].)*''''
361 + ''''([a-zA-Z0-9_]([a-zA-Z0-9-_]){0,61})?[a-zA-Z0-9].?)''''
365 "The domain-name type represents a DNS domain name. The
366 name SHOULD be fully qualified whenever possible.
368 Internet domain names are only loosely specified. Section
369 3.5 of RFC 1034 recommends a syntax (modified in Section
370 2.1 of RFC 1123). The pattern above is intended to allow
371 for current practice in domain name use, and some possible
372 future expansion. It is designed to hold various types of
373 domain names, including names used for A or AAAA records
374 (host names) and other records, such as SRV records. Note
375 that Internet host names have a stricter syntax (described
376 in RFC 952) than the DNS recommendations in RFCs 1034 and
377 1123, and that systems that want to store host names in
378 schema nodes using the domain-name type are recommended to
379 adhere to this stricter standard to ensure interoperability.
381 The encoding of DNS names in the DNS protocol is limited
382 to 255 characters. Since the encoding consists of labels
383 prefixed by a length bytes and there is a trailing NULL
384 byte, only 253 characters can appear in the textual dotted
387 The description clause of schema nodes using the domain-name
388 type MUST describe when and how these names are resolved to
389 IP addresses. Note that the resolution of a domain-name value
390 may require to query multiple DNS records (e.g., A for IPv4
391 and AAAA for IPv6). The order of the resolution process and
392 which DNS record takes precedence can either be defined
393 explicitly or may depend on the configuration of the
396 Domain-name values use the US-ASCII encoding. Their canonical
397 format uses lowercase US-ASCII characters. Internationalized
398 domain names MUST be A-labels as per RFC 5890.";
400 "RFC 952: DoD Internet Host Table Specification
401 RFC 1034: Domain Names - Concepts and Facilities
402 RFC 1123: Requirements for Internet Hosts -- Application
404 RFC 2782: A DNS RR for specifying the location of services
406 RFC 5890: Internationalized Domain Names in Applications
407 (IDNA): Definitions and Document Framework";
412 type inet:ip-address;
413 type inet:domain-name;
416 "The host type represents either an IP address or a DNS
423 "The uri type represents a Uniform Resource Identifier
424 (URI) as defined by STD 66.
426 Objects using the uri type MUST be in US-ASCII encoding,
427 and MUST be normalized as described by RFC 3986 Sections
428 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary
429 percent-encoding is removed, and all case-insensitive
430 characters are set to lowercase except for hexadecimal
431 digits, which are normalized to uppercase as described in
434 The purpose of this normalization is to help provide
435 unique URIs. Note that this normalization is not
436 sufficient to provide uniqueness. Two URIs that are
437 textually distinct after this normalization may still be
440 Objects using the uri type may restrict the schemes that
441 they permit. For example, ''''data:'''' and ''''urn:'''' schemes
442 might not be appropriate.
444 A zero-length URI is not a valid URI. This can be used to
445 express ''''URI absent'''' where required.
447 In the value set and its semantics, this type is equivalent
448 to the Uri SMIv2 textual convention defined in RFC 5017.";
450 "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
451 RFC 3305: Report from the Joint W3C/IETF URI Planning Interest
452 Group: Uniform Resource Identifiers (URIs), URLs,
453 and Uniform Resource Names (URNs): Clarifications
455 RFC 5017: MIB Textual Conventions for Uniform Resource
460 where name = 'ietf-inet-types.yang'
461 and checksum = '64e7b04e6126acc3f598f68677aa487502c6e0682d2732c817669becdfb099ba';