1 <?xml version="1.0" encoding="UTF-8"?>
2 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3 xmlns:yin="urn:ietf:params:xml:schema:yang:yin:1"
4 targetNamespace="urn:ietf:params:xml:ns:yang:ietf-inet-types"
5 xmlns="urn:ietf:params:xml:ns:yang:ietf-inet-types"
6 elementFormDefault="qualified"
7 attributeFormDefault="unqualified"
10 xmlns:inet="urn:ietf:params:xml:ns:yang:ietf-inet-types">
14 This schema was generated from the YANG module ietf-inet-types
17 The schema describes an instance document consisting
18 of the entire configuration data store, operational
19 data, rpc operations, and notifications.
20 This schema can thus NOT be used as-is to
21 validate NETCONF PDUs.
27 This module contains a collection of generally useful derived
28 YANG data types for Internet addresses and related things.
30 Copyright (c) 2010 IETF Trust and the persons identified as
31 authors of the code. All rights reserved.
33 Redistribution and use in source and binary forms, with or without
34 modification, is permitted pursuant to, and subject to the license
35 terms contained in, the Simplified BSD License set forth in Section
36 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents
37 (http://trustee.ietf.org/license-info).
39 This version of this YANG module is part of RFC 6021; see
40 the RFC itself for full legal notices.
44 <!-- YANG typedefs -->
45 <xs:simpleType name="ip-version">
48 This value represents the version of the IP protocol.
50 In the value set and its semantics, this type is equivalent
51 to the InetVersion textual convention of the SMIv2.
55 <xs:restriction base="xs:string">
56 <xs:enumeration value="unknown"/>
57 <xs:enumeration value="ipv4"/>
58 <xs:enumeration value="ipv6"/>
61 <xs:simpleType name="dscp">
64 The dscp type represents a Differentiated Services Code-Point
65 that may be used for marking packets in a traffic stream.
67 In the value set and its semantics, this type is equivalent
68 to the Dscp textual convention of the SMIv2.
72 <xs:restriction base="xs:unsignedByte">
73 <xs:minInclusive value="0"/>
74 <xs:maxInclusive value="63"/>
77 <xs:simpleType name="ipv6-flow-label">
80 The flow-label type represents flow identifier or Flow Label
81 in an IPv6 packet header that may be used to discriminate
84 In the value set and its semantics, this type is equivalent
85 to the IPv6FlowLabel textual convention of the SMIv2.
89 <xs:restriction base="xs:unsignedInt">
90 <xs:minInclusive value="0"/>
91 <xs:maxInclusive value="1048575"/>
94 <xs:simpleType name="port-number">
97 The port-number type represents a 16-bit port number of an
98 Internet transport layer protocol such as UDP, TCP, DCCP, or
99 SCTP. Port numbers are assigned by IANA. A current list of
100 all assignments is available from <http://www.iana.org/>.
102 Note that the port number value zero is reserved by IANA. In
103 situations where the value zero does not make sense, it can
104 be excluded by subtyping the port-number type.
106 In the value set and its semantics, this type is equivalent
107 to the InetPortNumber textual convention of the SMIv2.
111 <xs:restriction base="xs:unsignedShort">
112 <xs:minInclusive value="0"/>
113 <xs:maxInclusive value="65535"/>
116 <xs:simpleType name="as-number">
119 The as-number type represents autonomous system numbers
120 which identify an Autonomous System (AS). An AS is a set
121 of routers under a single technical administration, using
122 an interior gateway protocol and common metrics to route
123 packets within the AS, and using an exterior gateway
124 protocol to route packets to other ASs'. IANA maintains
125 the AS number space and has delegated large parts to the
128 Autonomous system numbers were originally limited to 16
129 bits. BGP extensions have enlarged the autonomous system
130 number space to 32 bits. This type therefore uses an uint32
131 base type without a range restriction in order to support
132 a larger autonomous system number space.
134 In the value set and its semantics, this type is equivalent
135 to the InetAutonomousSystemNumber textual convention of
140 <xs:restriction base="xs:unsignedInt">
143 <xs:simpleType name="ip-address">
146 The ip-address type represents an IP address and is IP
147 version neutral. The format of the textual representations
148 implies the IP version.
154 <xs:restriction base="ipv4-address">
158 <xs:restriction base="ipv6-address">
163 <xs:simpleType name="ipv4-address">
166 The ipv4-address type represents an IPv4 address in
167 dotted-quad notation. The IPv4 address may include a zone
168 index, separated by a % sign.
170 The zone index is used to disambiguate identical address
171 values. For link-local addresses, the zone index will
172 typically be the interface index number or the name of an
173 interface. If the zone index is not present, the default
174 zone of the device will be used.
176 The canonical format for the zone index is the numerical
181 <xs:restriction base="xs:string">
182 <xs: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}]+)?"/>
185 <xs:simpleType name="ipv6-address">
188 The ipv6-address type represents an IPv6 address in full,
189 mixed, shortened, and shortened-mixed notation. The IPv6
190 address may include a zone index, separated by a % sign.
192 The zone index is used to disambiguate identical address
193 values. For link-local addresses, the zone index will
194 typically be the interface index number or the name of an
195 interface. If the zone index is not present, the default
196 zone of the device will be used.
198 The canonical format of IPv6 addresses uses the compressed
199 format described in RFC 4291, Section 2.2, item 2 with the
200 following additional rules: the :: substitution must be
201 applied to the longest sequence of all-zero 16-bit chunks
202 in an IPv6 address. If there is a tie, the first sequence
203 of all-zero 16-bit chunks is replaced by ::. Single
204 all-zero 16-bit chunks are not compressed. The canonical
205 format uses lowercase characters and leading zeros are
206 not allowed. The canonical format for the zone index is
207 the numerical format as described in RFC 4007, Section
212 <xs:restriction base="xs:string">
213 <xs: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}]+)?)|((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(%.+)?)"/>
216 <xs:simpleType name="ip-prefix">
219 The ip-prefix type represents an IP prefix and is IP
220 version neutral. The format of the textual representations
221 implies the IP version.
227 <xs:restriction base="ipv4-prefix">
231 <xs:restriction base="ipv6-prefix">
236 <xs:simpleType name="ipv4-prefix">
239 The ipv4-prefix type represents an IPv4 address prefix.
240 The prefix length is given by the number following the
241 slash character and must be less than or equal to 32.
243 A prefix length value of n corresponds to an IP address
244 mask that has n contiguous 1-bits from the most
245 significant bit (MSB) and all other bits set to 0.
247 The canonical format of an IPv4 prefix has all bits of
248 the IPv4 address set to zero that are not part of the
253 <xs:restriction base="xs:string">
254 <xs: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]))"/>
257 <xs:simpleType name="ipv6-prefix">
260 The ipv6-prefix type represents an IPv6 address prefix.
261 The prefix length is given by the number following the
262 slash character and must be less than or equal 128.
264 A prefix length value of n corresponds to an IP address
265 mask that has n contiguous 1-bits from the most
266 significant bit (MSB) and all other bits set to 0.
268 The IPv6 address should have all bits that do not belong
269 to the prefix set to zero.
271 The canonical format of an IPv6 prefix has all bits of
272 the IPv6 address set to zero that are not part of the
273 IPv6 prefix. Furthermore, IPv6 address is represented
274 in the compressed format described in RFC 4291, Section
275 2.2, item 2 with the following additional rules: the ::
276 substitution must be applied to the longest sequence of
277 all-zero 16-bit chunks in an IPv6 address. If there is
278 a tie, the first sequence of all-zero 16-bit chunks is
279 replaced by ::. Single all-zero 16-bit chunks are not
280 compressed. The canonical format uses lowercase
281 characters and leading zeros are not allowed.
285 <xs:restriction base="xs:string">
286 <xs: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]))))|((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(/.+))"/>
289 <xs:simpleType name="domain-name">
292 The domain-name type represents a DNS domain name. The
293 name SHOULD be fully qualified whenever possible.
295 Internet domain names are only loosely specified. Section
296 3.5 of RFC 1034 recommends a syntax (modified in Section
297 2.1 of RFC 1123). The pattern above is intended to allow
298 for current practice in domain name use, and some possible
299 future expansion. It is designed to hold various types of
300 domain names, including names used for A or AAAA records
301 (host names) and other records, such as SRV records. Note
302 that Internet host names have a stricter syntax (described
303 in RFC 952) than the DNS recommendations in RFCs 1034 and
304 1123, and that systems that want to store host names in
305 schema nodes using the domain-name type are recommended to
306 adhere to this stricter standard to ensure interoperability.
308 The encoding of DNS names in the DNS protocol is limited
309 to 255 characters. Since the encoding consists of labels
310 prefixed by a length bytes and there is a trailing NULL
311 byte, only 253 characters can appear in the textual dotted
314 The description clause of schema nodes using the domain-name
315 type MUST describe when and how these names are resolved to
316 IP addresses. Note that the resolution of a domain-name value
317 may require to query multiple DNS records (e.g., A for IPv4
318 and AAAA for IPv6). The order of the resolution process and
319 which DNS record takes precedence can either be defined
320 explicitely or it may depend on the configuration of the
323 Domain-name values use the US-ASCII encoding. Their canonical
324 format uses lowercase US-ASCII characters. Internationalized
325 domain names MUST be encoded in punycode as described in RFC
330 <xs:restriction base="t0">
331 <xs:minLength value="1"/>
332 <xs:maxLength value="253"/>
335 <xs:simpleType name="host">
338 The host type represents either an IP address or a DNS
345 <xs:restriction base="ip-address">
349 <xs:restriction base="domain-name">
354 <xs:simpleType name="uri">
357 The uri type represents a Uniform Resource Identifier
358 (URI) as defined by STD 66.
360 Objects using the uri type MUST be in US-ASCII encoding,
361 and MUST be normalized as described by RFC 3986 Sections
362 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary
363 percent-encoding is removed, and all case-insensitive
364 characters are set to lowercase except for hexadecimal
365 digits, which are normalized to uppercase as described in
368 The purpose of this normalization is to help provide
369 unique URIs. Note that this normalization is not
370 sufficient to provide uniqueness. Two URIs that are
371 textually distinct after this normalization may still be
374 Objects using the uri type may restrict the schemes that
375 they permit. For example, 'data:' and 'urn:' schemes
376 might not be appropriate.
378 A zero-length URI is not a valid URI. This can be used to
379 express 'URI absent' where required.
381 In the value set and its semantics, this type is equivalent
382 to the Uri SMIv2 textual convention defined in RFC 5017.
386 <xs:restriction base="xs:string">
391 <!-- locally generated simpleType helpers -->
393 <xs:simpleType name="t0">
394 <xs:restriction base="xs:string">
395 <xs: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]\.?)|\."/>