From aa4fb1282046ecd565798f1e3b9c4ba3586592f1 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 17 May 2018 22:11:16 +0200 Subject: [PATCH] Remove RFC6021 models This patch removes old versions of ietf-{inet,yang}-types, which are not used in OpenDaylight proper. Also models are documented where they come from and their content is harmonized with https://github.com/YangModels/yang/ to make them text-equal. JIRA: MDSAL-338 Change-Id: I8b9f5bac484bdf52bc7abe8f72f5817e111e069d Signed-off-by: Robert Varga --- model/artifacts/pom.xml | 127 +-- model/features/odl-mdsal-models/pom.xml | 25 - .../main/yang/iana-if-type@2014-05-08.yang | 24 - .../main/yang/ietf-inet-types@2013-07-15.yang | 1 + model/ietf/ietf-inet-types/pom.xml | 56 -- .../inet/types/rev100924/HostBuilder.java | 69 -- .../inet/types/rev100924/IetfInetUtil.java | 73 -- .../types/rev100924/IpAddressBuilder.java | 45 - .../inet/types/rev100924/IpPrefixBuilder.java | 42 - .../src/main/yang/ietf-inet-types.yang | 418 -------- .../inet/types/rev100924/HostBuilderTest.java | 38 - ...s.yang => ietf-interfaces@2014-05-08.yang} | 30 - model/ietf/ietf-ip-2014-06-16/pom.xml | 2 +- .../src/main/yang/ietf-ip.yang | 742 -------------- .../src/main/yang/ietf-ip@2014-06-16.yang | 701 +++++++++++++ model/ietf/ietf-network/pom.xml | 22 +- .../main/yang/ietf-yang-types@2013-07-15.yang | 937 +++++++++--------- model/ietf/ietf-yang-types/pom.xml | 48 - .../yang/types/rev100924/IetfYangUtil.java | 28 - .../src/main/yang/ietf-yang-types.yang | 396 -------- model/ietf/pom.xml | 33 +- 21 files changed, 1250 insertions(+), 2607 deletions(-) delete mode 100644 model/ietf/ietf-inet-types/pom.xml delete mode 100644 model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/HostBuilder.java delete mode 100644 model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IetfInetUtil.java delete mode 100644 model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IpAddressBuilder.java delete mode 100644 model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IpPrefixBuilder.java delete mode 100644 model/ietf/ietf-inet-types/src/main/yang/ietf-inet-types.yang delete mode 100644 model/ietf/ietf-inet-types/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/HostBuilderTest.java rename model/ietf/ietf-interfaces/src/main/yang/{ietf-interfaces.yang => ietf-interfaces@2014-05-08.yang} (99%) delete mode 100644 model/ietf/ietf-ip-2014-06-16/src/main/yang/ietf-ip.yang create mode 100644 model/ietf/ietf-ip-2014-06-16/src/main/yang/ietf-ip@2014-06-16.yang delete mode 100644 model/ietf/ietf-yang-types/pom.xml delete mode 100644 model/ietf/ietf-yang-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev100924/IetfYangUtil.java delete mode 100644 model/ietf/ietf-yang-types/src/main/yang/ietf-yang-types.yang diff --git a/model/artifacts/pom.xml b/model/artifacts/pom.xml index fbe6128feb..46072d2924 100644 --- a/model/artifacts/pom.xml +++ b/model/artifacts/pom.xml @@ -32,44 +32,78 @@ org.opendaylight.mdsal.model - iana-afn-safi - 2013.07.04.13.0-SNAPSHOT + opendaylight-l2-types + 2013.08.27.13.0-SNAPSHOT org.opendaylight.mdsal.model - iana-if-type-2014-05-08 - 2014.05.08.13.0-SNAPSHOT + general-entity + 0.13.0-SNAPSHOT + + + org.opendaylight.mdsal.model - ietf-inet-types - 2010.09.24.13.0-SNAPSHOT + ietf-inet-types-2013-07-15 + 1.5.0-SNAPSHOT org.opendaylight.mdsal.model - ietf-yang-types - 2010.09.24.13.0-SNAPSHOT + ietf-yang-types-20130715 + 2013.07.15.13.0-SNAPSHOT org.opendaylight.mdsal.model - ietf-yang-types-20130715 - 2013.07.15.13.0-SNAPSHOT + ietf-type-util + 2.1.0-SNAPSHOT + + + org.opendaylight.mdsal.model ietf-interfaces 2014.05.08.13.0-SNAPSHOT + + + + org.opendaylight.mdsal.model + iana-if-type-2014-05-08 + 2014.05.08.13.0-SNAPSHOT + + + + org.opendaylight.mdsal.model ietf-ip-2014-06-16 2014.06.16.13.0-SNAPSHOT + + + + org.opendaylight.mdsal.model + rfc7895 + 1.0.0-SNAPSHOT + + + + org.opendaylight.mdsal.model ietf-restconf 2013.10.19.13.0-SNAPSHOT + + + org.opendaylight.mdsal.model ietf-ted @@ -102,24 +136,37 @@ org.opendaylight.mdsal.model - opendaylight-l2-types - 2013.08.27.13.0-SNAPSHOT + ietf-network-2015-06-08 + 1.5.0-SNAPSHOT org.opendaylight.mdsal.model - ietf-network-2015-06-08 - 1.5.0-SNAPSHOT + ietf-lisp-address-types-2015-11-05 + 1.2.0-SNAPSHOT + + + org.opendaylight.mdsal.model - ietf-inet-types-2013-07-15 - 1.5.0-SNAPSHOT + ietf-packet-fields + 0.11.0-SNAPSHOT org.opendaylight.mdsal.model - ietf-lisp-address-types-2015-11-05 - 1.2.0-SNAPSHOT + ietf-access-control-list + 0.11.0-SNAPSHOT + + + + + org.opendaylight.mdsal.model + iana-afn-safi + 2013.07.04.13.0-SNAPSHOT + + org.opendaylight.mdsal.model features-mdsal-model @@ -134,50 +181,6 @@ features xml - - org.opendaylight.mdsal.model - general-entity - 0.13.0-SNAPSHOT - - - org.opendaylight.mdsal.model - ietf-type-util - 2.1.0-SNAPSHOT - - - org.opendaylight.mdsal.model - ietf-packet-fields - 0.11.0-SNAPSHOT - - - org.opendaylight.mdsal.model - ietf-access-control-list - 0.11.0-SNAPSHOT - - - - org.opendaylight.mdsal.model - rfc7895 - 1.0.0-SNAPSHOT - - - - - ${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/ - - - - opendaylight-site - ${nexus.site.url}/${project.artifactId}/ - - - diff --git a/model/features/odl-mdsal-models/pom.xml b/model/features/odl-mdsal-models/pom.xml index 0fb9989243..db73cac666 100644 --- a/model/features/odl-mdsal-models/pom.xml +++ b/model/features/odl-mdsal-models/pom.xml @@ -57,18 +57,10 @@ ${project.groupId} iana-if-type-2014-05-08 - - ${project.groupId} - ietf-inet-types - ${project.groupId} ietf-interfaces - - ${project.groupId} - ietf-yang-types - ${project.groupId} ietf-yang-types-20130715 @@ -138,21 +130,4 @@ rfc7895 - - - ${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/ - - - - opendaylight-site - ${nexus.site.url}/${project.artifactId}/ - - - diff --git a/model/iana/iana-if-type-2014-05-08/src/main/yang/iana-if-type@2014-05-08.yang b/model/iana/iana-if-type-2014-05-08/src/main/yang/iana-if-type@2014-05-08.yang index 5dd8219500..81b217563d 100644 --- a/model/iana/iana-if-type-2014-05-08/src/main/yang/iana-if-type@2014-05-08.yang +++ b/model/iana/iana-if-type-2014-05-08/src/main/yang/iana-if-type@2014-05-08.yang @@ -59,11 +59,6 @@ module iana-if-type { defined in the 'ifType definitions' registry."; } - - - - - identity other { base iana-interface-type; } @@ -159,7 +154,6 @@ module iana-if-type { DS1, J1, E1, DS2, and E2 Interface Types"; } - identity basicISDN { base iana-interface-type; description @@ -254,8 +248,6 @@ module iana-if-type { "ARCnet Plus."; } - - identity atm { base iana-interface-type; description @@ -350,8 +342,6 @@ module iana-if-type { "Fibre Channel."; } - - identity hippiInterface { base iana-interface-type; description @@ -398,8 +388,6 @@ module iana-if-type { in the Packet Mode"; } - - identity v11 { base iana-interface-type; description @@ -687,7 +675,6 @@ module iana-if-type { base iana-interface-type; status deprecated; - description "Obsoleted via RFC 3635. ethernetCsmacd(6) should be used instead."; @@ -974,8 +961,6 @@ module iana-if-type { "Packet over SONET/SDH Interface."; } - - identity dvbAsiIn { base iana-interface-type; description @@ -1022,8 +1007,6 @@ module iana-if-type { "Cisco proprietary Maclayer."; } - - identity propDocsWirelessDownstream { base iana-interface-type; description @@ -1118,8 +1101,6 @@ module iana-if-type { "Voice Over Cable Interface."; } - - identity infiniband { base iana-interface-type; description @@ -1166,8 +1147,6 @@ module iana-if-type { "FSAN 155Mb Symetrical PON interface."; } - - identity pon622 { base iana-interface-type; description @@ -1262,8 +1241,6 @@ module iana-if-type { "Resilient Packet Ring Interface Type."; } - - identity qam { base iana-interface-type; description @@ -1455,7 +1432,6 @@ module iana-if-type { "DOCSIS CATV Upstream RF Port."; } - identity cableDownstreamRfPort { base iana-interface-type; description diff --git a/model/ietf/ietf-inet-types-2013-07-15/src/main/yang/ietf-inet-types@2013-07-15.yang b/model/ietf/ietf-inet-types-2013-07-15/src/main/yang/ietf-inet-types@2013-07-15.yang index 5c6f139a27..eacefb6363 100644 --- a/model/ietf/ietf-inet-types-2013-07-15/src/main/yang/ietf-inet-types@2013-07-15.yang +++ b/model/ietf/ietf-inet-types-2013-07-15/src/main/yang/ietf-inet-types@2013-07-15.yang @@ -328,6 +328,7 @@ module ietf-inet-types { + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + '(/.+)'; } + description "The ipv6-prefix type represents an IPv6 address prefix. The prefix length is given by the number following the diff --git a/model/ietf/ietf-inet-types/pom.xml b/model/ietf/ietf-inet-types/pom.xml deleted file mode 100644 index 74409dcdbe..0000000000 --- a/model/ietf/ietf-inet-types/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - org.opendaylight.mdsal - binding-parent - 0.13.0-SNAPSHOT - ../../../binding/binding-parent - - - 4.0.0 - org.opendaylight.mdsal.model - ietf-inet-types - 2010.09.24.13.0-SNAPSHOT - ${project.artifactId} - ${project.artifactId} - bundle - - - - org.opendaylight.mdsal.model - ietf-type-util - - - junit - junit - test - - - - - - ${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/ - - - - opendaylight-site - ${nexus.site.url}/${project.artifactId}/ - - - - diff --git a/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/HostBuilder.java b/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/HostBuilder.java deleted file mode 100644 index 96f32fcba2..0000000000 --- a/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/HostBuilder.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924; - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - **/ -public final class HostBuilder { - private static final Pattern IPV4_PATTERN = Pattern.compile("(([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}]+)?"); - private static final Pattern IPV6_PATTERN1 = Pattern.compile("((:|[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}]+)?"); - private static final Pattern IPV6_PATTERN2 = Pattern.compile("(([^:]+:){6}(([^:]+:[^:]+)|(.*\\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(%.+)?"); - private static final Pattern DOMAIN_PATTERN = Pattern.compile("((([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]\\.?)|\\."); - - private HostBuilder() { - - } - - public static Host getDefaultInstance(final String defaultValue) { - final Matcher ipv4Matcher = IPV4_PATTERN.matcher(defaultValue); - final Matcher ipv6Matcher1 = IPV6_PATTERN1.matcher(defaultValue); - final Matcher ipv6Matcher2 = IPV6_PATTERN2.matcher(defaultValue); - final Matcher domainMatcher = DOMAIN_PATTERN.matcher(defaultValue); - - List matchers = new ArrayList<>(3); - if (ipv6Matcher1.matches() || ipv6Matcher2.matches()) { - matchers.add(Ipv6Address.class.getSimpleName()); - } - - // Ipv4 and Domain Name patterns are not exclusive - // Address 127.0.0.1 matches both patterns - // This way Ipv4 address is preferred to domain name - if (ipv4Matcher.matches()) { - matchers.add(Ipv4Address.class.getSimpleName()); - } else if (domainMatcher.matches()) { - matchers.add(DomainName.class.getSimpleName()); - } - - if (matchers.size() > 1) { - throw new IllegalArgumentException("Cannot create Host from " + defaultValue + ". Value is ambigious for " - + matchers); - } - - if (ipv4Matcher.matches()) { - Ipv4Address ipv4 = new Ipv4Address(defaultValue); - IpAddress ipAddress = new IpAddress(ipv4); - return new Host(ipAddress); - } - if (ipv6Matcher1.matches() || ipv6Matcher2.matches()) { - Ipv6Address ipv6 = new Ipv6Address(defaultValue); - IpAddress ipAddress = new IpAddress(ipv6); - return new Host(ipAddress); - } - if (domainMatcher.matches()) { - DomainName domainName = new DomainName(defaultValue); - return new Host(domainName); - } - throw new IllegalArgumentException("Cannot create Host from " + defaultValue); - } - -} diff --git a/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IetfInetUtil.java b/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IetfInetUtil.java deleted file mode 100644 index 1549b6e0f9..0000000000 --- a/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IetfInetUtil.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2016 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924; - -import com.google.common.annotations.Beta; -import org.opendaylight.mdsal.model.ietf.util.AbstractIetfInetUtil; - -/** - * A set of utility methods to efficiently instantiate various ietf-inet-types DTOs. - */ -@Beta -public final class IetfInetUtil extends AbstractIetfInetUtil { - public static final IetfInetUtil INSTANCE = new IetfInetUtil(); - - private IetfInetUtil() { - super(Ipv4Address.class, Ipv4Prefix.class, Ipv6Address.class, Ipv6Prefix.class); - } - - @Override - protected IpAddress ipv4Address(final Ipv4Address addr) { - return new IpAddress(addr); - } - - @Override - protected IpAddress ipv6Address(final Ipv6Address addr) { - return new IpAddress(addr); - } - - @Override - protected IpPrefix ipv4Prefix(Ipv4Prefix addr) { - return new IpPrefix(addr); - } - - @Override - protected IpPrefix ipv6Prefix(Ipv6Prefix addr) { - return new IpPrefix(addr); - } - - @Override - protected String ipv4AddressString(final Ipv4Address addr) { - return addr.getValue(); - } - - @Override - protected String ipv6AddressString(final Ipv6Address addr) { - return addr.getValue(); - } - - @Override - protected String ipv4PrefixString(final Ipv4Prefix prefix) { - return prefix.getValue(); - } - - @Override - protected String ipv6PrefixString(final Ipv6Prefix prefix) { - return prefix.getValue(); - } - - @Override - protected Ipv4Address maybeIpv4Address(final IpAddress addr) { - return addr.getIpv4Address(); - } - - @Override - protected Ipv6Address maybeIpv6Address(final IpAddress addr) { - return addr.getIpv6Address(); - } -} diff --git a/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IpAddressBuilder.java b/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IpAddressBuilder.java deleted file mode 100644 index 26bfa2d981..0000000000 --- a/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IpAddressBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - **/ -public final class IpAddressBuilder { - private static final Pattern IPV4_PATTERN = - Pattern.compile("(([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}]+)?"); - private static final Pattern IPV6_PATTERN1 = - Pattern.compile("((:|[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}]+)?"); - private static final Pattern IPV6_PATTERN2 = - Pattern.compile("(([^:]+:){6}(([^:]+:[^:]+)|(.*\\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(%.+)?"); - - private IpAddressBuilder() { - - } - - public static IpAddress getDefaultInstance(final String defaultValue) { - final Matcher ipv4Matcher = IPV4_PATTERN.matcher(defaultValue); - - if (ipv4Matcher.matches()) { - if (IPV6_PATTERN1.matcher(defaultValue).matches() && IPV6_PATTERN2.matcher(defaultValue).matches()) { - throw new IllegalArgumentException( - String.format("Cannot create IpAddress from \"%s\", matches both %s and %s", - defaultValue, Ipv4Address.class.getSimpleName(), Ipv6Address.class.getSimpleName())); - - } - return new IpAddress(new Ipv4Address(defaultValue)); - } else if (IPV6_PATTERN1.matcher(defaultValue).matches() && IPV6_PATTERN2.matcher(defaultValue).matches()) { - return new IpAddress(new Ipv6Address(defaultValue)); - } else { - throw new IllegalArgumentException("Cannot create IpAddress from " + defaultValue); - } - } - -} diff --git a/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IpPrefixBuilder.java b/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IpPrefixBuilder.java deleted file mode 100644 index 4d151165f1..0000000000 --- a/model/ietf/ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/IpPrefixBuilder.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - **/ -public final class IpPrefixBuilder { - private static final Pattern IPV4_PATTERN = Pattern.compile("(([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]))"); - private static final Pattern IPV6_PATTERN1 = Pattern.compile("((:|[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])))"); - private static final Pattern IPV6_PATTERN2 = Pattern.compile("(([^:]+:){6}(([^:]+:[^:]+)|(.*\\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(/.+)"); - - private IpPrefixBuilder() { - - } - - public static IpPrefix getDefaultInstance(final String defaultValue) { - final Matcher ipv4Matcher = IPV4_PATTERN.matcher(defaultValue); - - if (ipv4Matcher.matches()) { - if (IPV6_PATTERN1.matcher(defaultValue).matches() && IPV6_PATTERN2.matcher(defaultValue).matches()) { - throw new IllegalArgumentException( - String.format("Cannot create IpPrefix from \"%s\", matches both %s and %s", - defaultValue, Ipv4Address.class.getSimpleName(), Ipv6Address.class.getSimpleName())); - - } - return new IpPrefix(new Ipv4Prefix(defaultValue)); - } else if (IPV6_PATTERN1.matcher(defaultValue).matches() && IPV6_PATTERN2.matcher(defaultValue).matches()) { - return new IpPrefix(new Ipv6Prefix(defaultValue)); - } else { - throw new IllegalArgumentException("Cannot create IpPrefix from " + defaultValue); - } - } - -} diff --git a/model/ietf/ietf-inet-types/src/main/yang/ietf-inet-types.yang b/model/ietf/ietf-inet-types/src/main/yang/ietf-inet-types.yang deleted file mode 100644 index de20febbb7..0000000000 --- a/model/ietf/ietf-inet-types/src/main/yang/ietf-inet-types.yang +++ /dev/null @@ -1,418 +0,0 @@ - module ietf-inet-types { - - namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; - prefix "inet"; - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: David Partain - - - WG Chair: David Kessens - - - Editor: Juergen Schoenwaelder - "; - - description - "This module contains a collection of generally useful derived - YANG data types for Internet addresses and related things. - - Copyright (c) 2010 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, is permitted pursuant to, and subject to the license - terms contained in, the Simplified BSD License set forth in Section - 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 6021; see - the RFC itself for full legal notices."; - - revision 2010-09-24 { - description - "Initial revision."; - reference - "RFC 6021: Common YANG Data Types"; - } - - /*** collection of protocol field related types ***/ - - typedef ip-version { - type enumeration { - enum unknown { - value "0"; - description - "An unknown or unspecified version of the Internet protocol."; - } - enum ipv4 { - value "1"; - description - "The IPv4 protocol as defined in RFC 791."; - } - enum ipv6 { - value "2"; - description - "The IPv6 protocol as defined in RFC 2460."; - } - } - description - "This value represents the version of the IP protocol. - - In the value set and its semantics, this type is equivalent - to the InetVersion textual convention of the SMIv2."; - reference - "RFC 791: Internet Protocol - RFC 2460: Internet Protocol, Version 6 (IPv6) Specification - RFC 4001: Textual Conventions for Internet Network Addresses"; - } - - typedef dscp { - type uint8 { - range "0..63"; - } - description - "The dscp type represents a Differentiated Services Code-Point - that may be used for marking packets in a traffic stream. - - In the value set and its semantics, this type is equivalent - to the Dscp textual convention of the SMIv2."; - reference - "RFC 3289: Management Information Base for the Differentiated - Services Architecture - RFC 2474: Definition of the Differentiated Services Field - (DS Field) in the IPv4 and IPv6 Headers - RFC 2780: IANA Allocation Guidelines For Values In - the Internet Protocol and Related Headers"; - } - - typedef ipv6-flow-label { - type uint32 { - range "0..1048575"; - } - description - "The flow-label type represents flow identifier or Flow Label - in an IPv6 packet header that may be used to discriminate - traffic flows. - - In the value set and its semantics, this type is equivalent - to the IPv6FlowLabel textual convention of the SMIv2."; - reference - "RFC 3595: Textual Conventions for IPv6 Flow Label - RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; - } - - typedef port-number { - type uint16 { - range "0..65535"; - } - description - "The port-number type represents a 16-bit port number of an - Internet transport layer protocol such as UDP, TCP, DCCP, or - SCTP. Port numbers are assigned by IANA. A current list of - all assignments is available from . - - Note that the port number value zero is reserved by IANA. In - situations where the value zero does not make sense, it can - be excluded by subtyping the port-number type. - - In the value set and its semantics, this type is equivalent - to the InetPortNumber textual convention of the SMIv2."; - reference - "RFC 768: User Datagram Protocol - RFC 793: Transmission Control Protocol - RFC 4960: Stream Control Transmission Protocol - RFC 4340: Datagram Congestion Control Protocol (DCCP) - RFC 4001: Textual Conventions for Internet Network Addresses"; - } - - /*** collection of autonomous system related types ***/ - - typedef as-number { - type uint32; - description - "The as-number type represents autonomous system numbers - which identify an Autonomous System (AS). An AS is a set - of routers under a single technical administration, using - an interior gateway protocol and common metrics to route - packets within the AS, and using an exterior gateway - protocol to route packets to other ASs'. IANA maintains - the AS number space and has delegated large parts to the - regional registries. - - Autonomous system numbers were originally limited to 16 - bits. BGP extensions have enlarged the autonomous system - number space to 32 bits. This type therefore uses an uint32 - base type without a range restriction in order to support - a larger autonomous system number space. - - In the value set and its semantics, this type is equivalent - to the InetAutonomousSystemNumber textual convention of - the SMIv2."; - reference - "RFC 1930: Guidelines for creation, selection, and registration - of an Autonomous System (AS) - RFC 4271: A Border Gateway Protocol 4 (BGP-4) - RFC 4893: BGP Support for Four-octet AS Number Space - RFC 4001: Textual Conventions for Internet Network Addresses"; - } - - /*** collection of IP address and hostname related types ***/ - - typedef ip-address { - type union { - type inet:ipv4-address; - type inet:ipv6-address; - } - description - "The ip-address type represents an IP address and is IP - version neutral. The format of the textual representations - implies the IP version."; - } - - typedef ipv4-address { - type string { - 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}]+)?'; - } - description - "The ipv4-address type represents an IPv4 address in - dotted-quad notation. The IPv4 address may include a zone - index, separated by a % sign. - - The zone index is used to disambiguate identical address - values. For link-local addresses, the zone index will - typically be the interface index number or the name of an - interface. If the zone index is not present, the default - zone of the device will be used. - - The canonical format for the zone index is the numerical - format"; - } - - typedef ipv6-address { - type string { - 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}]+)?'; - pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' - + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' - + '(%.+)?'; - } - description - "The ipv6-address type represents an IPv6 address in full, - mixed, shortened, and shortened-mixed notation. The IPv6 - address may include a zone index, separated by a % sign. - - The zone index is used to disambiguate identical address - values. For link-local addresses, the zone index will - typically be the interface index number or the name of an - interface. If the zone index is not present, the default - zone of the device will be used. - - The canonical format of IPv6 addresses uses the compressed - format described in RFC 4291, Section 2.2, item 2 with the - following additional rules: the :: substitution must be - applied to the longest sequence of all-zero 16-bit chunks - in an IPv6 address. If there is a tie, the first sequence - of all-zero 16-bit chunks is replaced by ::. Single - all-zero 16-bit chunks are not compressed. The canonical - format uses lowercase characters and leading zeros are - not allowed. The canonical format for the zone index is - the numerical format as described in RFC 4007, Section - 11.2."; - reference - "RFC 4291: IP Version 6 Addressing Architecture - RFC 4007: IPv6 Scoped Address Architecture - RFC 5952: A Recommendation for IPv6 Address Text Representation"; - } - - typedef ip-prefix { - type union { - type inet:ipv4-prefix; - type inet:ipv6-prefix; - } - description - "The ip-prefix type represents an IP prefix and is IP - version neutral. The format of the textual representations - implies the IP version."; - } - - typedef ipv4-prefix { - type string { - 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]))'; - } - description - "The ipv4-prefix type represents an IPv4 address prefix. - The prefix length is given by the number following the - slash character and must be less than or equal to 32. - - A prefix length value of n corresponds to an IP address - mask that has n contiguous 1-bits from the most - significant bit (MSB) and all other bits set to 0. - - The canonical format of an IPv4 prefix has all bits of - the IPv4 address set to zero that are not part of the - IPv4 prefix."; - } - - typedef ipv6-prefix { - type string { - 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])))'; - pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' - + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' - + '(/.+)'; - } - description - "The ipv6-prefix type represents an IPv6 address prefix. - The prefix length is given by the number following the - slash character and must be less than or equal 128. - - A prefix length value of n corresponds to an IP address - mask that has n contiguous 1-bits from the most - significant bit (MSB) and all other bits set to 0. - - The IPv6 address should have all bits that do not belong - to the prefix set to zero. - - The canonical format of an IPv6 prefix has all bits of - the IPv6 address set to zero that are not part of the - IPv6 prefix. Furthermore, IPv6 address is represented - in the compressed format described in RFC 4291, Section - 2.2, item 2 with the following additional rules: the :: - substitution must be applied to the longest sequence of - all-zero 16-bit chunks in an IPv6 address. If there is - a tie, the first sequence of all-zero 16-bit chunks is - replaced by ::. Single all-zero 16-bit chunks are not - compressed. The canonical format uses lowercase - characters and leading zeros are not allowed."; - reference - "RFC 4291: IP Version 6 Addressing Architecture"; - } - - /*** collection of domain name and URI types ***/ - - typedef domain-name { - type string { - 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]\.?)' - + '|\.'; - length "1..253"; - } - description - "The domain-name type represents a DNS domain name. The - name SHOULD be fully qualified whenever possible. - - Internet domain names are only loosely specified. Section - 3.5 of RFC 1034 recommends a syntax (modified in Section - 2.1 of RFC 1123). The pattern above is intended to allow - for current practice in domain name use, and some possible - future expansion. It is designed to hold various types of - domain names, including names used for A or AAAA records - (host names) and other records, such as SRV records. Note - that Internet host names have a stricter syntax (described - in RFC 952) than the DNS recommendations in RFCs 1034 and - 1123, and that systems that want to store host names in - schema nodes using the domain-name type are recommended to - adhere to this stricter standard to ensure interoperability. - - The encoding of DNS names in the DNS protocol is limited - to 255 characters. Since the encoding consists of labels - prefixed by a length bytes and there is a trailing NULL - byte, only 253 characters can appear in the textual dotted - notation. - - The description clause of schema nodes using the domain-name - type MUST describe when and how these names are resolved to - IP addresses. Note that the resolution of a domain-name value - may require to query multiple DNS records (e.g., A for IPv4 - and AAAA for IPv6). The order of the resolution process and - which DNS record takes precedence can either be defined - explicitely or it may depend on the configuration of the - resolver. - - Domain-name values use the US-ASCII encoding. Their canonical - format uses lowercase US-ASCII characters. Internationalized - domain names MUST be encoded in punycode as described in RFC - 3492"; - reference - "RFC 952: DoD Internet Host Table Specification - RFC 1034: Domain Names - Concepts and Facilities - RFC 1123: Requirements for Internet Hosts -- Application - and Support - RFC 2782: A DNS RR for specifying the location of services - (DNS SRV) - RFC 3492: Punycode: A Bootstring encoding of Unicode for - Internationalized Domain Names in Applications - (IDNA) - RFC 5891: Internationalizing Domain Names in Applications - (IDNA): Protocol"; - } - - typedef host { - type union { - type inet:ip-address; - type inet:domain-name; - } - description - "The host type represents either an IP address or a DNS - domain name."; - } - - typedef uri { - type string; - description - "The uri type represents a Uniform Resource Identifier - (URI) as defined by STD 66. - - Objects using the uri type MUST be in US-ASCII encoding, - and MUST be normalized as described by RFC 3986 Sections - 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary - percent-encoding is removed, and all case-insensitive - characters are set to lowercase except for hexadecimal - digits, which are normalized to uppercase as described in - Section 6.2.2.1. - - The purpose of this normalization is to help provide - unique URIs. Note that this normalization is not - sufficient to provide uniqueness. Two URIs that are - textually distinct after this normalization may still be - equivalent. - - Objects using the uri type may restrict the schemes that - they permit. For example, 'data:' and 'urn:' schemes - might not be appropriate. - - A zero-length URI is not a valid URI. This can be used to - express 'URI absent' where required. - - In the value set and its semantics, this type is equivalent - to the Uri SMIv2 textual convention defined in RFC 5017."; - reference - "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax - RFC 3305: Report from the Joint W3C/IETF URI Planning Interest - Group: Uniform Resource Identifiers (URIs), URLs, - and Uniform Resource Names (URNs): Clarifications - and Recommendations - RFC 5017: MIB Textual Conventions for Uniform Resource - Identifiers (URIs)"; - } - - } diff --git a/model/ietf/ietf-inet-types/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/HostBuilderTest.java b/model/ietf/ietf-inet-types/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/HostBuilderTest.java deleted file mode 100644 index e9d7d0b8cf..0000000000 --- a/model/ietf/ietf-inet-types/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev100924/HostBuilderTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class HostBuilderTest { - - @Test - public void testGetDefaultInstanceIpv4() throws Exception { - final Host host = HostBuilder.getDefaultInstance("127.0.0.1"); - assertEquals(new Host(new IpAddress(new Ipv4Address("127.0.0.1"))), host); - } - - @Test - public void testGetDefaultInstanceIpv6() throws Exception { - testIpv6("1234:5678:9abc:def1:2345:6789:abcd:ef12"); - } - - private static void testIpv6(final String ivp6string) { - final Host host = HostBuilder.getDefaultInstance(ivp6string); - assertEquals(new Host(new IpAddress(new Ipv6Address(ivp6string))), host); - } - - @Test - public void testGetDefaultInstanceDomain() throws Exception { - final Host host = HostBuilder.getDefaultInstance("localhost"); - assertEquals(new Host(new DomainName("localhost")), host); - } -} \ No newline at end of file diff --git a/model/ietf/ietf-interfaces/src/main/yang/ietf-interfaces.yang b/model/ietf/ietf-interfaces/src/main/yang/ietf-interfaces@2014-05-08.yang similarity index 99% rename from model/ietf/ietf-interfaces/src/main/yang/ietf-interfaces.yang rename to model/ietf/ietf-interfaces/src/main/yang/ietf-interfaces@2014-05-08.yang index 3689c8920d..710e7e62bb 100644 --- a/model/ietf/ietf-interfaces/src/main/yang/ietf-interfaces.yang +++ b/model/ietf/ietf-interfaces/src/main/yang/ietf-interfaces@2014-05-08.yang @@ -5,7 +5,6 @@ module ietf-interfaces { import ietf-yang-types { prefix yang; - revision-date "2013-07-15"; } organization @@ -231,8 +230,6 @@ module ietf-interfaces { IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry has been initialized, as described in RFC 2863. - - Changes in this leaf in the 'running' datastore are reflected in ifAdminStatus, but if ifAdminStatus is changed over SNMP, this leaf is not affected."; @@ -277,10 +274,6 @@ module ietf-interfaces { list interface { key "name"; - - - - description "The list of interfaces on the device. @@ -327,8 +320,6 @@ module ietf-interfaces { "Not ready to pass packets and not in some test mode."; } - - enum testing { value 3; description @@ -424,7 +415,6 @@ module ietf-interfaces { contains a Media Access Control (MAC) address. The interface's media-specific modules must define the bit - and byte ordering and the format of the value of this object. For interfaces that do not have such an address (e.g., a serial line), this node is not present."; @@ -465,14 +455,6 @@ module ietf-interfaces { ifSpeed, ifHighSpeed"; } - - - - - - - - container statistics { description "A collection of interface-related statistics objects."; @@ -518,9 +500,6 @@ module ietf-interfaces { "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts"; } - - - leaf in-broadcast-pkts { type yang:counter64; description @@ -568,7 +547,6 @@ module ietf-interfaces { other times as indicated by the value of 'discontinuity-time'."; - reference "RFC 2863: The Interfaces Group MIB - ifInDiscards"; } @@ -613,10 +591,6 @@ module ietf-interfaces { "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos"; } - - - - leaf out-octets { type yang:counter64; description @@ -664,7 +638,6 @@ module ietf-interfaces { ifHCOutBroadcastPkts"; } - leaf out-multicast-pkts { type yang:counter64; description @@ -710,9 +683,6 @@ module ietf-interfaces { number of outbound transmission units that could not be transmitted because of errors. - - - Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of diff --git a/model/ietf/ietf-ip-2014-06-16/pom.xml b/model/ietf/ietf-ip-2014-06-16/pom.xml index 723399aa8c..0790e0cda2 100644 --- a/model/ietf/ietf-ip-2014-06-16/pom.xml +++ b/model/ietf/ietf-ip-2014-06-16/pom.xml @@ -36,7 +36,7 @@ org.opendaylight.mdsal.model - ietf-yang-types + ietf-yang-types-20130715 diff --git a/model/ietf/ietf-ip-2014-06-16/src/main/yang/ietf-ip.yang b/model/ietf/ietf-ip-2014-06-16/src/main/yang/ietf-ip.yang deleted file mode 100644 index f6c59edea2..0000000000 --- a/model/ietf/ietf-ip-2014-06-16/src/main/yang/ietf-ip.yang +++ /dev/null @@ -1,742 +0,0 @@ -module ietf-ip { - - yang-version 1; - - namespace - "urn:ietf:params:xml:ns:yang:ietf-ip"; - - prefix ip; - - import ietf-interfaces { - prefix if; - } - import ietf-inet-types { - prefix inet; - } - import ietf-yang-types { - prefix yang; - } - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Thomas Nadeau - - - WG Chair: Juergen Schoenwaelder - - - Editor: Martin Bjorklund - "; - - description - "This module contains a collection of YANG definitions for - configuring IP implementations. - - Copyright (c) 2014 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD License - set forth in Section 4.c of the IETF Trust's Legal Provisions - Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 7277; see - the RFC itself for full legal notices."; - - revision "2014-06-16" { - description "Initial revision."; - reference - "RFC 7277: A YANG Data Model for IP Management"; - - } - - - feature ipv4-non-contiguous-netmasks { - description - "Indicates support for configuring non-contiguous - subnet masks."; - } - - feature ipv6-privacy-autoconf { - description - "Indicates support for Privacy Extensions for Stateless Address - Autoconfiguration in IPv6."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6"; - - } - - typedef ip-address-origin { - type enumeration { - enum "other" { - value 0; - description - "None of the following."; - } - enum "static" { - value 1; - description - "Indicates that the address has been statically - configured - for example, using NETCONF or a Command Line - Interface."; - } - enum "dhcp" { - value 2; - description - "Indicates an address that has been assigned to this - system by a DHCP server."; - } - enum "link-layer" { - value 3; - description - "Indicates an address created by IPv6 stateless - autoconfiguration that embeds a link-layer address in its - interface identifier."; - } - enum "random" { - value 4; - description - "Indicates an address chosen by the system at - - random, e.g., an IPv4 address within 169.254/16, an - RFC 4941 temporary address, or an RFC 7217 semantically - opaque address."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6 - RFC 7217: A Method for Generating Semantically Opaque - Interface Identifiers with IPv6 Stateless - Address Autoconfiguration (SLAAC)"; - - } - } - description - "The origin of an address."; - } - - typedef neighbor-origin { - type enumeration { - enum "other" { - value 0; - description - "None of the following."; - } - enum "static" { - value 1; - description - "Indicates that the mapping has been statically - configured - for example, using NETCONF or a Command Line - Interface."; - } - enum "dynamic" { - value 2; - description - "Indicates that the mapping has been dynamically resolved - using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery - protocol."; - } - } - description - "The origin of a neighbor entry."; - } - - augment /if:interfaces/if:interface { - description - "Parameters for configuring IP on interfaces. - - If an interface is not capable of running IP, the server - must not allow the client to configure these parameters."; - container ipv4 { - presence - "Enables IPv4 unless the 'enabled' leaf - (which defaults to 'true') is set to 'false'"; - description - "Parameters for the IPv4 address family."; - leaf enabled { - type boolean; - default 'true'; - description - "Controls whether IPv4 is enabled or disabled on this - interface. When IPv4 is enabled, this interface is - connected to an IPv4 stack, and the interface can send - and receive IPv4 packets."; - } - - leaf forwarding { - type boolean; - default 'false'; - description - "Controls IPv4 packet forwarding of datagrams received by, - but not addressed to, this interface. IPv4 routers - forward datagrams. IPv4 hosts do not (except those - source-routed via the host)."; - } - - leaf mtu { - type uint16 { - range "68..max"; - } - units "octets"; - description - "The size, in octets, of the largest IPv4 packet that the - interface will send and receive. - - The server may restrict the allowed values for this leaf, - depending on the interface's type. - - If this leaf is not configured, the operationally used MTU - depends on the interface's type."; - reference - "RFC 791: Internet Protocol"; - - } - - list address { - key "ip"; - description - "The list of configured IPv4 addresses on the interface."; - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address on the interface."; - } - - choice subnet { - mandatory true; - description - "The subnet can be specified as a prefix-length, or, - if the server supports non-contiguous netmasks, as - a netmask."; - leaf prefix-length { - type uint8 { - range "0..32"; - } - description - "The length of the subnet prefix."; - } - leaf netmask { - if-feature ipv4-non-contiguous-netmasks; - type yang:dotted-quad; - description - "The subnet specified as a netmask."; - } - } // choice subnet - } // list address - - list neighbor { - key "ip"; - description - "A list of mappings from IPv4 addresses to - link-layer addresses. - - Entries in this list are used as static entries in the - ARP Cache."; - reference - "RFC 826: An Ethernet Address Resolution Protocol"; - - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address of the neighbor node."; - } - - leaf link-layer-address { - type yang:phys-address; - mandatory true; - description - "The link-layer address of the neighbor node."; - } - } // list neighbor - } // container ipv4 - - container ipv6 { - presence - "Enables IPv6 unless the 'enabled' leaf - (which defaults to 'true') is set to 'false'"; - description - "Parameters for the IPv6 address family."; - leaf enabled { - type boolean; - default 'true'; - description - "Controls whether IPv6 is enabled or disabled on this - interface. When IPv6 is enabled, this interface is - connected to an IPv6 stack, and the interface can send - and receive IPv6 packets."; - } - - leaf forwarding { - type boolean; - default 'false'; - description - "Controls IPv6 packet forwarding of datagrams received by, - but not addressed to, this interface. IPv6 routers - forward datagrams. IPv6 hosts do not (except those - source-routed via the host)."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - Section 6.2.1, IsRouter"; - - } - - leaf mtu { - type uint32 { - range "1280..max"; - } - units "octets"; - description - "The size, in octets, of the largest IPv6 packet that the - interface will send and receive. - - The server may restrict the allowed values for this leaf, - depending on the interface's type. - - If this leaf is not configured, the operationally used MTU - depends on the interface's type."; - reference - "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification - Section 5"; - - } - - list address { - key "ip"; - description - "The list of configured IPv6 addresses on the interface."; - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address on the interface."; - } - - leaf prefix-length { - type uint8 { - range "0..128"; - } - mandatory true; - description - "The length of the subnet prefix."; - } - } // list address - - list neighbor { - key "ip"; - description - "A list of mappings from IPv6 addresses to - link-layer addresses. - - Entries in this list are used as static entries in the - Neighbor Cache."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; - - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address of the neighbor node."; - } - - leaf link-layer-address { - type yang:phys-address; - mandatory true; - description - "The link-layer address of the neighbor node."; - } - } // list neighbor - - leaf dup-addr-detect-transmits { - type uint32; - default '1'; - description - "The number of consecutive Neighbor Solicitation messages - sent while performing Duplicate Address Detection on a - tentative address. A value of zero indicates that - Duplicate Address Detection is not performed on - tentative addresses. A value of one indicates a single - transmission with no follow-up retransmissions."; - reference - "RFC 4862: IPv6 Stateless Address Autoconfiguration"; - - } - - container autoconf { - description - "Parameters to control the autoconfiguration of IPv6 - addresses, as described in RFC 4862."; - reference - "RFC 4862: IPv6 Stateless Address Autoconfiguration"; - - leaf create-global-addresses { - type boolean; - default 'true'; - description - "If enabled, the host creates global addresses as - described in RFC 4862."; - reference - "RFC 4862: IPv6 Stateless Address Autoconfiguration - Section 5.5"; - - } - - leaf create-temporary-addresses { - if-feature ipv6-privacy-autoconf; - type boolean; - default 'false'; - description - "If enabled, the host creates temporary addresses as - described in RFC 4941."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6"; - - } - - leaf temporary-valid-lifetime { - if-feature ipv6-privacy-autoconf; - type uint32; - units "seconds"; - default '604800'; - description - "The time period during which the temporary address - is valid."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6 - - TEMP_VALID_LIFETIME"; - - } - - leaf temporary-preferred-lifetime { - if-feature ipv6-privacy-autoconf; - type uint32; - units "seconds"; - default '86400'; - description - "The time period during which the temporary address is - preferred."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6 - - TEMP_PREFERRED_LIFETIME"; - - } - } // container autoconf - } // container ipv6 - } - - augment /if:interfaces-state/if:interface { - description - "Data nodes for the operational state of IP on interfaces."; - container ipv4 { - presence - "Present if IPv4 is enabled on this interface"; - config false; - description - "Interface-specific parameters for the IPv4 address family."; - leaf forwarding { - type boolean; - description - "Indicates whether IPv4 packet forwarding is enabled or - disabled on this interface."; - } - - leaf mtu { - type uint16 { - range "68..max"; - } - units "octets"; - description - "The size, in octets, of the largest IPv4 packet that the - interface will send and receive."; - reference - "RFC 791: Internet Protocol"; - - } - - list address { - key "ip"; - description - "The list of IPv4 addresses on the interface."; - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address on the interface."; - } - - choice subnet { - description - "The subnet can be specified as a prefix-length, or, - if the server supports non-contiguous netmasks, as - a netmask."; - leaf prefix-length { - type uint8 { - range "0..32"; - } - description - "The length of the subnet prefix."; - } - leaf netmask { - if-feature ipv4-non-contiguous-netmasks; - type yang:dotted-quad; - description - "The subnet specified as a netmask."; - } - } // choice subnet - - leaf origin { - type ip-address-origin; - description - "The origin of this address."; - } - } // list address - - list neighbor { - key "ip"; - description - "A list of mappings from IPv4 addresses to - link-layer addresses. - - This list represents the ARP Cache."; - reference - "RFC 826: An Ethernet Address Resolution Protocol"; - - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address of the neighbor node."; - } - - leaf link-layer-address { - type yang:phys-address; - description - "The link-layer address of the neighbor node."; - } - - leaf origin { - type neighbor-origin; - description - "The origin of this neighbor entry."; - } - } // list neighbor - } // container ipv4 - - container ipv6 { - presence - "Present if IPv6 is enabled on this interface"; - config false; - description - "Parameters for the IPv6 address family."; - leaf forwarding { - type boolean; - default 'false'; - description - "Indicates whether IPv6 packet forwarding is enabled or - disabled on this interface."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - Section 6.2.1, IsRouter"; - - } - - leaf mtu { - type uint32 { - range "1280..max"; - } - units "octets"; - description - "The size, in octets, of the largest IPv6 packet that the - interface will send and receive."; - reference - "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification - Section 5"; - - } - - list address { - key "ip"; - description - "The list of IPv6 addresses on the interface."; - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address on the interface."; - } - - leaf prefix-length { - type uint8 { - range "0..128"; - } - mandatory true; - description - "The length of the subnet prefix."; - } - - leaf origin { - type ip-address-origin; - description - "The origin of this address."; - } - - leaf status { - type enumeration { - enum "preferred" { - value 0; - description - "This is a valid address that can appear as the - destination or source address of a packet."; - } - enum "deprecated" { - value 1; - description - "This is a valid but deprecated address that should - no longer be used as a source address in new - communications, but packets addressed to such an - address are processed as expected."; - } - enum "invalid" { - value 2; - description - "This isn't a valid address, and it shouldn't appear - as the destination or source address of a packet."; - } - enum "inaccessible" { - value 3; - description - "The address is not accessible because the interface - to which this address is assigned is not - operational."; - } - enum "unknown" { - value 4; - description - "The status cannot be determined for some reason."; - } - enum "tentative" { - value 5; - description - "The uniqueness of the address on the link is being - verified. Addresses in this state should not be - used for general communication and should only be - used to determine the uniqueness of the address."; - } - enum "duplicate" { - value 6; - description - "The address has been determined to be non-unique on - the link and so must not be used."; - } - enum "optimistic" { - value 7; - description - "The address is available for use, subject to - restrictions, while its uniqueness on a link is - being verified."; - } - } - description - "The status of an address. Most of the states correspond - to states from the IPv6 Stateless Address - Autoconfiguration protocol."; - reference - "RFC 4293: Management Information Base for the - Internet Protocol (IP) - - IpAddressStatusTC - RFC 4862: IPv6 Stateless Address Autoconfiguration"; - - } - } // list address - - list neighbor { - key "ip"; - description - "A list of mappings from IPv6 addresses to - link-layer addresses. - - This list represents the Neighbor Cache."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; - - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address of the neighbor node."; - } - - leaf link-layer-address { - type yang:phys-address; - description - "The link-layer address of the neighbor node."; - } - - leaf origin { - type neighbor-origin; - description - "The origin of this neighbor entry."; - } - - leaf is-router { - type empty; - description - "Indicates that the neighbor node acts as a router."; - } - - leaf state { - type enumeration { - enum "incomplete" { - value 0; - description - "Address resolution is in progress, and the link-layer - address of the neighbor has not yet been - determined."; - } - enum "reachable" { - value 1; - description - "Roughly speaking, the neighbor is known to have been - reachable recently (within tens of seconds ago)."; - } - enum "stale" { - value 2; - description - "The neighbor is no longer known to be reachable, but - until traffic is sent to the neighbor no attempt - should be made to verify its reachability."; - } - enum "delay" { - value 3; - description - "The neighbor is no longer known to be reachable, and - traffic has recently been sent to the neighbor. - Rather than probe the neighbor immediately, however, - delay sending probes for a short while in order to - give upper-layer protocols a chance to provide - reachability confirmation."; - } - enum "probe" { - value 4; - description - "The neighbor is no longer known to be reachable, and - unicast Neighbor Solicitation probes are being sent - to verify reachability."; - } - } - description - "The Neighbor Unreachability Detection state of this - entry."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - Section 7.3.2"; - - } - } // list neighbor - } // container ipv6 - } -} // module ietf-ip diff --git a/model/ietf/ietf-ip-2014-06-16/src/main/yang/ietf-ip@2014-06-16.yang b/model/ietf/ietf-ip-2014-06-16/src/main/yang/ietf-ip@2014-06-16.yang new file mode 100644 index 0000000000..51276a5cd0 --- /dev/null +++ b/model/ietf/ietf-ip-2014-06-16/src/main/yang/ietf-ip@2014-06-16.yang @@ -0,0 +1,701 @@ +module ietf-ip { + + namespace "urn:ietf:params:xml:ns:yang:ietf-ip"; + prefix ip; + + import ietf-interfaces { + prefix if; + } + import ietf-inet-types { + prefix inet; + } + import ietf-yang-types { + prefix yang; + } + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: + WG List: + + WG Chair: Thomas Nadeau + + + WG Chair: Juergen Schoenwaelder + + + Editor: Martin Bjorklund + "; + + description + "This module contains a collection of YANG definitions for + configuring IP implementations. + + Copyright (c) 2014 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 7277; see + the RFC itself for full legal notices."; + + revision 2014-06-16 { + description + "Initial revision."; + reference + "RFC 7277: A YANG Data Model for IP Management"; + } + + /* + + * Features + */ + + feature ipv4-non-contiguous-netmasks { + description + "Indicates support for configuring non-contiguous + subnet masks."; + } + + feature ipv6-privacy-autoconf { + description + "Indicates support for Privacy Extensions for Stateless Address + Autoconfiguration in IPv6."; + reference + "RFC 4941: Privacy Extensions for Stateless Address + Autoconfiguration in IPv6"; + } + + /* + * Typedefs + */ + + typedef ip-address-origin { + type enumeration { + enum other { + description + "None of the following."; + } + enum static { + description + "Indicates that the address has been statically + configured - for example, using NETCONF or a Command Line + Interface."; + } + enum dhcp { + description + "Indicates an address that has been assigned to this + system by a DHCP server."; + } + enum link-layer { + description + "Indicates an address created by IPv6 stateless + autoconfiguration that embeds a link-layer address in its + interface identifier."; + } + enum random { + description + "Indicates an address chosen by the system at + + random, e.g., an IPv4 address within 169.254/16, an + RFC 4941 temporary address, or an RFC 7217 semantically + opaque address."; + reference + "RFC 4941: Privacy Extensions for Stateless Address + Autoconfiguration in IPv6 + RFC 7217: A Method for Generating Semantically Opaque + Interface Identifiers with IPv6 Stateless + Address Autoconfiguration (SLAAC)"; + } + } + description + "The origin of an address."; + } + + typedef neighbor-origin { + type enumeration { + enum other { + description + "None of the following."; + } + enum static { + description + "Indicates that the mapping has been statically + configured - for example, using NETCONF or a Command Line + Interface."; + } + enum dynamic { + description + "Indicates that the mapping has been dynamically resolved + using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery + protocol."; + } + } + description + "The origin of a neighbor entry."; + } + + /* + * Configuration data nodes + */ + + augment "/if:interfaces/if:interface" { + description + "Parameters for configuring IP on interfaces. + + If an interface is not capable of running IP, the server + must not allow the client to configure these parameters."; + + container ipv4 { + presence + "Enables IPv4 unless the 'enabled' leaf + (which defaults to 'true') is set to 'false'"; + description + "Parameters for the IPv4 address family."; + + leaf enabled { + type boolean; + default true; + description + "Controls whether IPv4 is enabled or disabled on this + interface. When IPv4 is enabled, this interface is + connected to an IPv4 stack, and the interface can send + and receive IPv4 packets."; + } + leaf forwarding { + type boolean; + default false; + description + "Controls IPv4 packet forwarding of datagrams received by, + but not addressed to, this interface. IPv4 routers + forward datagrams. IPv4 hosts do not (except those + source-routed via the host)."; + } + leaf mtu { + type uint16 { + range "68..max"; + } + units octets; + description + "The size, in octets, of the largest IPv4 packet that the + interface will send and receive. + + The server may restrict the allowed values for this leaf, + depending on the interface's type. + + If this leaf is not configured, the operationally used MTU + depends on the interface's type."; + reference + "RFC 791: Internet Protocol"; + } + list address { + key "ip"; + description + "The list of configured IPv4 addresses on the interface."; + + leaf ip { + type inet:ipv4-address-no-zone; + description + "The IPv4 address on the interface."; + } + + choice subnet { + mandatory true; + description + "The subnet can be specified as a prefix-length, or, + if the server supports non-contiguous netmasks, as + a netmask."; + leaf prefix-length { + type uint8 { + range "0..32"; + } + description + "The length of the subnet prefix."; + } + leaf netmask { + if-feature ipv4-non-contiguous-netmasks; + type yang:dotted-quad; + description + "The subnet specified as a netmask."; + } + } + } + list neighbor { + key "ip"; + description + "A list of mappings from IPv4 addresses to + link-layer addresses. + + Entries in this list are used as static entries in the + ARP Cache."; + reference + "RFC 826: An Ethernet Address Resolution Protocol"; + + leaf ip { + type inet:ipv4-address-no-zone; + description + "The IPv4 address of the neighbor node."; + } + leaf link-layer-address { + type yang:phys-address; + mandatory true; + description + "The link-layer address of the neighbor node."; + } + } + + } + + container ipv6 { + presence + "Enables IPv6 unless the 'enabled' leaf + (which defaults to 'true') is set to 'false'"; + description + "Parameters for the IPv6 address family."; + + leaf enabled { + type boolean; + default true; + description + "Controls whether IPv6 is enabled or disabled on this + interface. When IPv6 is enabled, this interface is + connected to an IPv6 stack, and the interface can send + and receive IPv6 packets."; + } + leaf forwarding { + type boolean; + default false; + description + "Controls IPv6 packet forwarding of datagrams received by, + but not addressed to, this interface. IPv6 routers + forward datagrams. IPv6 hosts do not (except those + source-routed via the host)."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) + Section 6.2.1, IsRouter"; + } + leaf mtu { + type uint32 { + range "1280..max"; + } + units octets; + description + "The size, in octets, of the largest IPv6 packet that the + interface will send and receive. + + The server may restrict the allowed values for this leaf, + depending on the interface's type. + + If this leaf is not configured, the operationally used MTU + depends on the interface's type."; + reference + "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + Section 5"; + } + + list address { + key "ip"; + description + "The list of configured IPv6 addresses on the interface."; + + leaf ip { + type inet:ipv6-address-no-zone; + description + "The IPv6 address on the interface."; + } + leaf prefix-length { + type uint8 { + range "0..128"; + } + mandatory true; + description + "The length of the subnet prefix."; + } + } + list neighbor { + key "ip"; + description + "A list of mappings from IPv6 addresses to + link-layer addresses. + + Entries in this list are used as static entries in the + Neighbor Cache."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; + + leaf ip { + type inet:ipv6-address-no-zone; + description + "The IPv6 address of the neighbor node."; + } + leaf link-layer-address { + type yang:phys-address; + mandatory true; + description + "The link-layer address of the neighbor node."; + } + } + + leaf dup-addr-detect-transmits { + type uint32; + default 1; + description + "The number of consecutive Neighbor Solicitation messages + sent while performing Duplicate Address Detection on a + tentative address. A value of zero indicates that + Duplicate Address Detection is not performed on + tentative addresses. A value of one indicates a single + transmission with no follow-up retransmissions."; + reference + "RFC 4862: IPv6 Stateless Address Autoconfiguration"; + } + container autoconf { + description + "Parameters to control the autoconfiguration of IPv6 + addresses, as described in RFC 4862."; + reference + "RFC 4862: IPv6 Stateless Address Autoconfiguration"; + + leaf create-global-addresses { + type boolean; + default true; + description + "If enabled, the host creates global addresses as + described in RFC 4862."; + reference + "RFC 4862: IPv6 Stateless Address Autoconfiguration + Section 5.5"; + } + leaf create-temporary-addresses { + if-feature ipv6-privacy-autoconf; + type boolean; + default false; + description + "If enabled, the host creates temporary addresses as + described in RFC 4941."; + reference + "RFC 4941: Privacy Extensions for Stateless Address + Autoconfiguration in IPv6"; + } + + leaf temporary-valid-lifetime { + if-feature ipv6-privacy-autoconf; + type uint32; + units "seconds"; + default 604800; + description + "The time period during which the temporary address + is valid."; + reference + "RFC 4941: Privacy Extensions for Stateless Address + Autoconfiguration in IPv6 + - TEMP_VALID_LIFETIME"; + } + leaf temporary-preferred-lifetime { + if-feature ipv6-privacy-autoconf; + type uint32; + units "seconds"; + default 86400; + description + "The time period during which the temporary address is + preferred."; + reference + "RFC 4941: Privacy Extensions for Stateless Address + Autoconfiguration in IPv6 + - TEMP_PREFERRED_LIFETIME"; + } + } + } + } + + /* + * Operational state data nodes + */ + + augment "/if:interfaces-state/if:interface" { + description + "Data nodes for the operational state of IP on interfaces."; + + container ipv4 { + presence "Present if IPv4 is enabled on this interface"; + config false; + description + "Interface-specific parameters for the IPv4 address family."; + + leaf forwarding { + type boolean; + description + "Indicates whether IPv4 packet forwarding is enabled or + disabled on this interface."; + } + leaf mtu { + type uint16 { + range "68..max"; + } + units octets; + description + "The size, in octets, of the largest IPv4 packet that the + interface will send and receive."; + reference + "RFC 791: Internet Protocol"; + } + list address { + key "ip"; + description + "The list of IPv4 addresses on the interface."; + + leaf ip { + type inet:ipv4-address-no-zone; + description + "The IPv4 address on the interface."; + } + choice subnet { + description + "The subnet can be specified as a prefix-length, or, + if the server supports non-contiguous netmasks, as + a netmask."; + leaf prefix-length { + type uint8 { + range "0..32"; + } + description + "The length of the subnet prefix."; + } + leaf netmask { + if-feature ipv4-non-contiguous-netmasks; + type yang:dotted-quad; + description + "The subnet specified as a netmask."; + } + } + + leaf origin { + type ip-address-origin; + description + "The origin of this address."; + } + } + list neighbor { + key "ip"; + description + "A list of mappings from IPv4 addresses to + link-layer addresses. + + This list represents the ARP Cache."; + reference + "RFC 826: An Ethernet Address Resolution Protocol"; + + leaf ip { + type inet:ipv4-address-no-zone; + description + "The IPv4 address of the neighbor node."; + } + leaf link-layer-address { + type yang:phys-address; + description + "The link-layer address of the neighbor node."; + } + leaf origin { + type neighbor-origin; + description + "The origin of this neighbor entry."; + } + } + + } + + container ipv6 { + presence "Present if IPv6 is enabled on this interface"; + config false; + description + "Parameters for the IPv6 address family."; + + leaf forwarding { + type boolean; + default false; + description + "Indicates whether IPv6 packet forwarding is enabled or + disabled on this interface."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) + Section 6.2.1, IsRouter"; + } + leaf mtu { + type uint32 { + range "1280..max"; + } + units octets; + description + "The size, in octets, of the largest IPv6 packet that the + interface will send and receive."; + reference + "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + Section 5"; + } + list address { + key "ip"; + description + "The list of IPv6 addresses on the interface."; + + leaf ip { + type inet:ipv6-address-no-zone; + description + "The IPv6 address on the interface."; + } + leaf prefix-length { + type uint8 { + range "0..128"; + } + mandatory true; + description + "The length of the subnet prefix."; + } + leaf origin { + type ip-address-origin; + description + "The origin of this address."; + } + + leaf status { + type enumeration { + enum preferred { + description + "This is a valid address that can appear as the + destination or source address of a packet."; + } + enum deprecated { + description + "This is a valid but deprecated address that should + no longer be used as a source address in new + communications, but packets addressed to such an + address are processed as expected."; + } + enum invalid { + description + "This isn't a valid address, and it shouldn't appear + as the destination or source address of a packet."; + } + enum inaccessible { + description + "The address is not accessible because the interface + to which this address is assigned is not + operational."; + } + enum unknown { + description + "The status cannot be determined for some reason."; + } + enum tentative { + description + "The uniqueness of the address on the link is being + verified. Addresses in this state should not be + used for general communication and should only be + used to determine the uniqueness of the address."; + } + enum duplicate { + description + "The address has been determined to be non-unique on + the link and so must not be used."; + } + + enum optimistic { + description + "The address is available for use, subject to + restrictions, while its uniqueness on a link is + being verified."; + } + } + description + "The status of an address. Most of the states correspond + to states from the IPv6 Stateless Address + Autoconfiguration protocol."; + reference + "RFC 4293: Management Information Base for the + Internet Protocol (IP) + - IpAddressStatusTC + RFC 4862: IPv6 Stateless Address Autoconfiguration"; + } + } + list neighbor { + key "ip"; + description + "A list of mappings from IPv6 addresses to + link-layer addresses. + + This list represents the Neighbor Cache."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; + + leaf ip { + type inet:ipv6-address-no-zone; + description + "The IPv6 address of the neighbor node."; + } + leaf link-layer-address { + type yang:phys-address; + description + "The link-layer address of the neighbor node."; + } + leaf origin { + type neighbor-origin; + description + "The origin of this neighbor entry."; + } + leaf is-router { + type empty; + description + "Indicates that the neighbor node acts as a router."; + } + leaf state { + type enumeration { + enum incomplete { + description + "Address resolution is in progress, and the link-layer + address of the neighbor has not yet been + determined."; + } + enum reachable { + description + "Roughly speaking, the neighbor is known to have been + reachable recently (within tens of seconds ago)."; + } + enum stale { + description + "The neighbor is no longer known to be reachable, but + until traffic is sent to the neighbor no attempt + should be made to verify its reachability."; + } + enum delay { + description + "The neighbor is no longer known to be reachable, and + traffic has recently been sent to the neighbor. + Rather than probe the neighbor immediately, however, + delay sending probes for a short while in order to + give upper-layer protocols a chance to provide + reachability confirmation."; + } + enum probe { + description + "The neighbor is no longer known to be reachable, and + unicast Neighbor Solicitation probes are being sent + to verify reachability."; + } + } + description + "The Neighbor Unreachability Detection state of this + entry."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) + Section 7.3.2"; + } + } + } + } +} diff --git a/model/ietf/ietf-network/pom.xml b/model/ietf/ietf-network/pom.xml index 59f93c9160..fc6c4ccfc6 100644 --- a/model/ietf/ietf-network/pom.xml +++ b/model/ietf/ietf-network/pom.xml @@ -39,29 +39,11 @@ org.opendaylight.mdsal.model - ietf-inet-types + ietf-inet-types-2013-07-15 org.opendaylight.mdsal.model - ietf-yang-types + ietf-yang-types-20130715 - - - - ${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/ - - - - opendaylight-site - ${nexus.site.url}/${project.artifactId}/ - - - diff --git a/model/ietf/ietf-yang-types-20130715/src/main/yang/ietf-yang-types@2013-07-15.yang b/model/ietf/ietf-yang-types-20130715/src/main/yang/ietf-yang-types@2013-07-15.yang index bdff18cc4b..ee58fa3ab0 100644 --- a/model/ietf/ietf-yang-types-20130715/src/main/yang/ietf-yang-types@2013-07-15.yang +++ b/model/ietf/ietf-yang-types-20130715/src/main/yang/ietf-yang-types@2013-07-15.yang @@ -1,467 +1,474 @@ module ietf-yang-types { - namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; - prefix "yang"; - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - WG Chair: David Kessens - - - WG Chair: Juergen Schoenwaelder - - - Editor: Juergen Schoenwaelder - "; - - description - "This module contains a collection of generally useful derived - YANG data types. - - Copyright (c) 2013 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD License - set forth in Section 4.c of the IETF Trust's Legal Provisions - Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 6991; see - the RFC itself for full legal notices."; - - revision 2013-07-15 { - description - "This revision adds the following new data types: - - yang-identifier - - hex-string - - uuid - - dotted-quad"; - reference - "RFC 6991: Common YANG Data Types"; - } - - revision 2010-09-24 { - description - "Initial revision."; - reference - "RFC 6021: Common YANG Data Types"; - } - - /*** collection of counter and gauge types ***/ - - typedef counter32 { - type uint32; - description - "The counter32 type represents a non-negative integer - that monotonically increases until it reaches a - maximum value of 2^32-1 (4294967295 decimal), when it - wraps around and starts increasing again from zero. - - Counters have no defined 'initial' value, and thus, a - single value of a counter has (in general) no information - content. Discontinuities in the monotonically increasing - value normally occur at re-initialization of the - management system, and at other times as specified in the - description of a schema node using this type. If such - other times can occur, for example, the creation of - a schema node of type counter32 at times other than - re-initialization, then a corresponding schema node - should be defined, with an appropriate type, to indicate - the last discontinuity. - - The counter32 type should not be used for configuration - schema nodes. A default statement SHOULD NOT be used in - combination with the type counter32. - - In the value set and its semantics, this type is equivalent - to the Counter32 type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 - (SMIv2)"; - } - - typedef zero-based-counter32 { - type yang:counter32; - default "0"; - description - "The zero-based-counter32 type represents a counter32 - that has the defined 'initial' value zero. - - A schema node of this type will be set to zero (0) on creation - and will thereafter increase monotonically until it reaches - a maximum value of 2^32-1 (4294967295 decimal), when it - wraps around and starts increasing again from zero. - - Provided that an application discovers a new schema node - of this type within the minimum time to wrap, it can use the - 'initial' value as a delta. It is important for a management - station to be aware of this minimum time and the actual time - between polls, and to discard data if the actual time is too - long or there is no defined minimum time. - In the value set and its semantics, this type is equivalent - to the ZeroBasedCounter32 textual convention of the SMIv2."; - reference - "RFC 4502: Remote Network Monitoring Management Information - Base Version 2"; - } - - typedef counter64 { - type uint64; - description - "The counter64 type represents a non-negative integer - that monotonically increases until it reaches a - maximum value of 2^64-1 (18446744073709551615 decimal), - when it wraps around and starts increasing again from zero. - - Counters have no defined 'initial' value, and thus, a - single value of a counter has (in general) no information - content. Discontinuities in the monotonically increasing - value normally occur at re-initialization of the - management system, and at other times as specified in the - description of a schema node using this type. If such - other times can occur, for example, the creation of - a schema node of type counter64 at times other than - re-initialization, then a corresponding schema node - should be defined, with an appropriate type, to indicate - the last discontinuity. - - The counter64 type should not be used for configuration - schema nodes. A default statement SHOULD NOT be used in - combination with the type counter64. - - In the value set and its semantics, this type is equivalent - to the Counter64 type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 - (SMIv2)"; - } - - typedef zero-based-counter64 { - type yang:counter64; - default "0"; - description - "The zero-based-counter64 type represents a counter64 that - has the defined 'initial' value zero. - A schema node of this type will be set to zero (0) on creation - and will thereafter increase monotonically until it reaches - a maximum value of 2^64-1 (18446744073709551615 decimal), - when it wraps around and starts increasing again from zero. - - Provided that an application discovers a new schema node - of this type within the minimum time to wrap, it can use the - 'initial' value as a delta. It is important for a management - station to be aware of this minimum time and the actual time - between polls, and to discard data if the actual time is too - long or there is no defined minimum time. - - In the value set and its semantics, this type is equivalent - to the ZeroBasedCounter64 textual convention of the SMIv2."; - reference - "RFC 2856: Textual Conventions for Additional High Capacity - Data Types"; - } - - typedef gauge32 { - type uint32; - description - "The gauge32 type represents a non-negative integer, which - may increase or decrease, but shall never exceed a maximum - value, nor fall below a minimum value. The maximum value - cannot be greater than 2^32-1 (4294967295 decimal), and - the minimum value cannot be smaller than 0. The value of - a gauge32 has its maximum value whenever the information - being modeled is greater than or equal to its maximum - value, and has its minimum value whenever the information - being modeled is smaller than or equal to its minimum value. - If the information being modeled subsequently decreases - below (increases above) the maximum (minimum) value, the - gauge32 also decreases (increases). - - In the value set and its semantics, this type is equivalent - to the Gauge32 type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 - (SMIv2)"; - } - - typedef gauge64 { - type uint64; - description - "The gauge64 type represents a non-negative integer, which - may increase or decrease, but shall never exceed a maximum - value, nor fall below a minimum value. The maximum value - cannot be greater than 2^64-1 (18446744073709551615), and - the minimum value cannot be smaller than 0. The value of - a gauge64 has its maximum value whenever the information - being modeled is greater than or equal to its maximum - value, and has its minimum value whenever the information - being modeled is smaller than or equal to its minimum value. - If the information being modeled subsequently decreases - below (increases above) the maximum (minimum) value, the - gauge64 also decreases (increases). - - In the value set and its semantics, this type is equivalent - to the CounterBasedGauge64 SMIv2 textual convention defined - in RFC 2856"; - reference - "RFC 2856: Textual Conventions for Additional High Capacity - Data Types"; - } - - /*** collection of identifier-related types ***/ - - typedef object-identifier { - type string { - pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' - + '(\.(0|([1-9]\d*)))*'; - } - description - "The object-identifier type represents administratively - assigned names in a registration-hierarchical-name tree. - - Values of this type are denoted as a sequence of numerical - non-negative sub-identifier values. Each sub-identifier - value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers - are separated by single dots and without any intermediate - whitespace. - - The ASN.1 standard restricts the value space of the first - sub-identifier to 0, 1, or 2. Furthermore, the value space - of the second sub-identifier is restricted to the range - 0 to 39 if the first sub-identifier is 0 or 1. Finally, - the ASN.1 standard requires that an object identifier - has always at least two sub-identifiers. The pattern - captures these restrictions. - - Although the number of sub-identifiers is not limited, - module designers should realize that there may be - implementations that stick with the SMIv2 limit of 128 - sub-identifiers. - This type is a superset of the SMIv2 OBJECT IDENTIFIER type - since it is not restricted to 128 sub-identifiers. Hence, - this type SHOULD NOT be used to represent the SMIv2 OBJECT - IDENTIFIER type; the object-identifier-128 type SHOULD be - used instead."; - reference - "ISO9834-1: Information technology -- Open Systems - Interconnection -- Procedures for the operation of OSI - Registration Authorities: General procedures and top - arcs of the ASN.1 Object Identifier tree"; - } - - typedef object-identifier-128 { - type object-identifier { - pattern '\d*(\.\d*){1,127}'; - } - description - "This type represents object-identifiers restricted to 128 - sub-identifiers. - - In the value set and its semantics, this type is equivalent - to the OBJECT IDENTIFIER type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 - (SMIv2)"; - } - - typedef yang-identifier { - type string { - length "1..max"; - pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; - pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; - } - description - "A YANG identifier string as defined by the 'identifier' - rule in Section 12 of RFC 6020. An identifier must - start with an alphabetic character or an underscore - followed by an arbitrary sequence of alphabetic or - numeric characters, underscores, hyphens, or dots. - - A YANG identifier MUST NOT start with any possible - combination of the lowercase or uppercase character - sequence 'xml'."; - reference - "RFC 6020: YANG - A Data Modeling Language for the Network - Configuration Protocol (NETCONF)"; - } - /*** collection of types related to date and time***/ - - typedef date-and-time { - type string { - pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' - + '(Z|[\+\-]\d{2}:\d{2})'; - } - description - "The date-and-time type is a profile of the ISO 8601 - standard for representation of dates and times using the - Gregorian calendar. The profile is defined by the - date-time production in Section 5.6 of RFC 3339. - - The date-and-time type is compatible with the dateTime XML - schema type with the following notable exceptions: - - (a) The date-and-time type does not allow negative years. - - (b) The date-and-time time-offset -00:00 indicates an unknown - time zone (see RFC 3339) while -00:00 and +00:00 and Z - all represent the same time zone in dateTime. - - (c) The canonical format (see below) of data-and-time values - differs from the canonical format used by the dateTime XML - schema type, which requires all times to be in UTC using - the time-offset 'Z'. - - This type is not equivalent to the DateAndTime textual - convention of the SMIv2 since RFC 3339 uses a different - separator between full-date and full-time and provides - higher resolution of time-secfrac. - - The canonical format for date-and-time values with a known time - zone uses a numeric time zone offset that is calculated using - the device's configured known offset to UTC time. A change of - the device's offset to UTC time will cause date-and-time values - to change accordingly. Such changes might happen periodically - in case a server follows automatically daylight saving time - (DST) time zone offset changes. The canonical format for - date-and-time values with an unknown time zone (usually - referring to the notion of local time) uses the time-offset - -00:00."; - reference - "RFC 3339: Date and Time on the Internet: Timestamps - RFC 2579: Textual Conventions for SMIv2 - XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; - } - typedef timeticks { - type uint32; - description - "The timeticks type represents a non-negative integer that - represents the time, modulo 2^32 (4294967296 decimal), in - hundredths of a second between two epochs. When a schema - node is defined that uses this type, the description of - the schema node identifies both of the reference epochs. - - In the value set and its semantics, this type is equivalent - to the TimeTicks type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 - (SMIv2)"; - } - - typedef timestamp { - type yang:timeticks; - description - "The timestamp type represents the value of an associated - timeticks schema node at which a specific occurrence - happened. The specific occurrence must be defined in the - description of any schema node defined using this type. When - the specific occurrence occurred prior to the last time the - associated timeticks attribute was zero, then the timestamp - value is zero. Note that this requires all timestamp values - to be reset to zero when the value of the associated timeticks - attribute reaches 497+ days and wraps around to zero. - - The associated timeticks schema node must be specified - in the description of any schema node using this type. - - In the value set and its semantics, this type is equivalent - to the TimeStamp textual convention of the SMIv2."; - reference - "RFC 2579: Textual Conventions for SMIv2"; - } - - /*** collection of generic address types ***/ - - typedef phys-address { - type string { - pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; - } - description - "Represents media- or physical-level addresses represented - as a sequence octets, each octet represented by two hexadecimal - numbers. Octets are separated by colons. The canonical - representation uses lowercase characters. - - In the value set and its semantics, this type is equivalent - to the PhysAddress textual convention of the SMIv2."; - reference - "RFC 2579: Textual Conventions for SMIv2"; - } - - typedef mac-address { - type string { - pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; - } - description - "The mac-address type represents an IEEE 802 MAC address. - The canonical representation uses lowercase characters. - - In the value set and its semantics, this type is equivalent - to the MacAddress textual convention of the SMIv2."; - reference - "IEEE 802: IEEE Standard for Local and Metropolitan Area - Networks: Overview and Architecture - RFC 2579: Textual Conventions for SMIv2"; - } - - /*** collection of XML-specific types ***/ - - typedef xpath1.0 { - type string; - description - "This type represents an XPATH 1.0 expression. - - When a schema node is defined that uses this type, the - description of the schema node MUST specify the XPath - context in which the XPath expression is evaluated."; - reference - "XPATH: XML Path Language (XPath) Version 1.0"; - } - - /*** collection of string types ***/ - - typedef hex-string { - type string { - pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; - } - description - "A hexadecimal string with octets represented as hex digits - separated by colons. The canonical representation uses - lowercase characters."; - } - - typedef uuid { - type string { - pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' - + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'; - } - description - "A Universally Unique IDentifier in the string representation - defined in RFC 4122. The canonical representation uses - lowercase characters. - - The following is an example of a UUID in string representation: - f81d4fae-7dec-11d0-a765-00a0c91e6bf6 - "; - reference - "RFC 4122: A Universally Unique IDentifier (UUID) URN - Namespace"; - } - - typedef dotted-quad { - type string { - 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])'; - } - description - "An unsigned 32-bit number expressed in the dotted-quad - notation, i.e., four octets written as decimal numbers - and separated with the '.' (full stop) character."; - } - } \ No newline at end of file + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: + WG List: + + WG Chair: David Kessens + + + WG Chair: Juergen Schoenwaelder + + + Editor: Juergen Schoenwaelder + "; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6991; see + the RFC itself for full legal notices."; + + revision 2013-07-15 { + description + "This revision adds the following new data types: + - yang-identifier + - hex-string + - uuid + - dotted-quad"; + reference + "RFC 6991: Common YANG Data Types"; + } + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier-related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifiers. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type; the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of types related to date and time***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z + all represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using + the time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually + referring to the notion of local time) uses the time-offset + -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence + happened. The specific occurrence must be defined in the + description of any schema node defined using this type. When + the specific occurrence occurred prior to the last time the + associated timeticks attribute was zero, then the timestamp + value is zero. Note that this requires all timestamp values + to be reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML-specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + /*** collection of string types ***/ + + typedef hex-string { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "A hexadecimal string with octets represented as hex digits + separated by colons. The canonical representation uses + lowercase characters."; + } + + typedef uuid { + type string { + pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'; + } + description + "A Universally Unique IDentifier in the string representation + defined in RFC 4122. The canonical representation uses + lowercase characters. + + The following is an example of a UUID in string representation: + f81d4fae-7dec-11d0-a765-00a0c91e6bf6 + "; + reference + "RFC 4122: A Universally Unique IDentifier (UUID) URN + Namespace"; + } + + typedef dotted-quad { + type string { + 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])'; + } + description + "An unsigned 32-bit number expressed in the dotted-quad + notation, i.e., four octets written as decimal numbers + and separated with the '.' (full stop) character."; + } +} diff --git a/model/ietf/ietf-yang-types/pom.xml b/model/ietf/ietf-yang-types/pom.xml deleted file mode 100644 index 1df1231f34..0000000000 --- a/model/ietf/ietf-yang-types/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - org.opendaylight.mdsal - binding-parent - 0.13.0-SNAPSHOT - ../../../binding/binding-parent - - - 4.0.0 - org.opendaylight.mdsal.model - ietf-yang-types - 2010.09.24.13.0-SNAPSHOT - ${project.artifactId} - ${project.artifactId} - bundle - - - - org.opendaylight.mdsal.model - ietf-type-util - - - - - ${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/ - - - opendaylight-site - ${nexus.site.url}/${project.artifactId}/ - - - diff --git a/model/ietf/ietf-yang-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev100924/IetfYangUtil.java b/model/ietf/ietf-yang-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev100924/IetfYangUtil.java deleted file mode 100644 index f9f21a7c52..0000000000 --- a/model/ietf/ietf-yang-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/yang/types/rev100924/IetfYangUtil.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2016 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924; - -import com.google.common.annotations.Beta; -import org.opendaylight.mdsal.model.ietf.util.AbstractIetfYangUtil; - -/** - * Utility methods for working with types defined in ietf-yang-types. - */ -@Beta -public final class IetfYangUtil extends AbstractIetfYangUtil { - public static final IetfYangUtil INSTANCE = new IetfYangUtil(); - - private IetfYangUtil() { - super(MacAddress.class); - } - - @Override - protected String getValue(final MacAddress macAddress) { - return macAddress.getValue(); - } -} diff --git a/model/ietf/ietf-yang-types/src/main/yang/ietf-yang-types.yang b/model/ietf/ietf-yang-types/src/main/yang/ietf-yang-types.yang deleted file mode 100644 index 51d9f8b887..0000000000 --- a/model/ietf/ietf-yang-types/src/main/yang/ietf-yang-types.yang +++ /dev/null @@ -1,396 +0,0 @@ - module ietf-yang-types { - - namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; - prefix "yang"; - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: David Partain - - - WG Chair: David Kessens - - - Editor: Juergen Schoenwaelder - "; - - description - "This module contains a collection of generally useful derived - YANG data types. - - Copyright (c) 2010 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, is permitted pursuant to, and subject to the license - terms contained in, the Simplified BSD License set forth in Section - 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 6021; see - the RFC itself for full legal notices."; - - revision 2010-09-24 { - description - "Initial revision."; - reference - "RFC 6021: Common YANG Data Types"; - } - - /*** collection of counter and gauge types ***/ - - typedef counter32 { - type uint32; - description - "The counter32 type represents a non-negative integer - that monotonically increases until it reaches a - maximum value of 2^32-1 (4294967295 decimal), when it - wraps around and starts increasing again from zero. - - Counters have no defined 'initial' value, and thus, a - single value of a counter has (in general) no information - content. Discontinuities in the monotonically increasing - value normally occur at re-initialization of the - management system, and at other times as specified in the - description of a schema node using this type. If such - other times can occur, for example, the creation of - a schema node of type counter32 at times other than - re-initialization, then a corresponding schema node - should be defined, with an appropriate type, to indicate - the last discontinuity. - - The counter32 type should not be used for configuration - schema nodes. A default statement SHOULD NOT be used in - combination with the type counter32. - - In the value set and its semantics, this type is equivalent - to the Counter32 type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; - } - - typedef zero-based-counter32 { - type yang:counter32; - default "0"; - description - "The zero-based-counter32 type represents a counter32 - that has the defined 'initial' value zero. - - A schema node of this type will be set to zero (0) on creation - and will thereafter increase monotonically until it reaches - a maximum value of 2^32-1 (4294967295 decimal), when it - wraps around and starts increasing again from zero. - - Provided that an application discovers a new schema node - of this type within the minimum time to wrap, it can use the - 'initial' value as a delta. It is important for a management - station to be aware of this minimum time and the actual time - between polls, and to discard data if the actual time is too - long or there is no defined minimum time. - - In the value set and its semantics, this type is equivalent - to the ZeroBasedCounter32 textual convention of the SMIv2."; - reference - "RFC 4502: Remote Network Monitoring Management Information - Base Version 2"; - } - - typedef counter64 { - type uint64; - description - "The counter64 type represents a non-negative integer - that monotonically increases until it reaches a - maximum value of 2^64-1 (18446744073709551615 decimal), - when it wraps around and starts increasing again from zero. - - Counters have no defined 'initial' value, and thus, a - single value of a counter has (in general) no information - content. Discontinuities in the monotonically increasing - value normally occur at re-initialization of the - management system, and at other times as specified in the - description of a schema node using this type. If such - other times can occur, for example, the creation of - a schema node of type counter64 at times other than - re-initialization, then a corresponding schema node - should be defined, with an appropriate type, to indicate - the last discontinuity. - - The counter64 type should not be used for configuration - schema nodes. A default statement SHOULD NOT be used in - combination with the type counter64. - - In the value set and its semantics, this type is equivalent - to the Counter64 type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; - } - - typedef zero-based-counter64 { - type yang:counter64; - default "0"; - description - "The zero-based-counter64 type represents a counter64 that - has the defined 'initial' value zero. - - A schema node of this type will be set to zero (0) on creation - and will thereafter increase monotonically until it reaches - a maximum value of 2^64-1 (18446744073709551615 decimal), - when it wraps around and starts increasing again from zero. - - Provided that an application discovers a new schema node - of this type within the minimum time to wrap, it can use the - 'initial' value as a delta. It is important for a management - station to be aware of this minimum time and the actual time - between polls, and to discard data if the actual time is too - long or there is no defined minimum time. - - In the value set and its semantics, this type is equivalent - to the ZeroBasedCounter64 textual convention of the SMIv2."; - reference - "RFC 2856: Textual Conventions for Additional High Capacity - Data Types"; - } - - typedef gauge32 { - type uint32; - description - "The gauge32 type represents a non-negative integer, which - may increase or decrease, but shall never exceed a maximum - value, nor fall below a minimum value. The maximum value - cannot be greater than 2^32-1 (4294967295 decimal), and - the minimum value cannot be smaller than 0. The value of - a gauge32 has its maximum value whenever the information - being modeled is greater than or equal to its maximum - value, and has its minimum value whenever the information - being modeled is smaller than or equal to its minimum value. - If the information being modeled subsequently decreases - below (increases above) the maximum (minimum) value, the - gauge32 also decreases (increases). - - In the value set and its semantics, this type is equivalent - to the Gauge32 type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; - } - - typedef gauge64 { - type uint64; - description - "The gauge64 type represents a non-negative integer, which - may increase or decrease, but shall never exceed a maximum - value, nor fall below a minimum value. The maximum value - cannot be greater than 2^64-1 (18446744073709551615), and - the minimum value cannot be smaller than 0. The value of - a gauge64 has its maximum value whenever the information - being modeled is greater than or equal to its maximum - value, and has its minimum value whenever the information - being modeled is smaller than or equal to its minimum value. - If the information being modeled subsequently decreases - below (increases above) the maximum (minimum) value, the - gauge64 also decreases (increases). - - In the value set and its semantics, this type is equivalent - to the CounterBasedGauge64 SMIv2 textual convention defined - in RFC 2856"; - reference - "RFC 2856: Textual Conventions for Additional High Capacity - Data Types"; - } - - /*** collection of identifier related types ***/ - - typedef object-identifier { - type string { - pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' - + '(\.(0|([1-9]\d*)))*'; - } - description - "The object-identifier type represents administratively - assigned names in a registration-hierarchical-name tree. - - Values of this type are denoted as a sequence of numerical - non-negative sub-identifier values. Each sub-identifier - value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers - are separated by single dots and without any intermediate - whitespace. - - The ASN.1 standard restricts the value space of the first - sub-identifier to 0, 1, or 2. Furthermore, the value space - of the second sub-identifier is restricted to the range - 0 to 39 if the first sub-identifier is 0 or 1. Finally, - the ASN.1 standard requires that an object identifier - has always at least two sub-identifier. The pattern - captures these restrictions. - - Although the number of sub-identifiers is not limited, - module designers should realize that there may be - implementations that stick with the SMIv2 limit of 128 - sub-identifiers. - - This type is a superset of the SMIv2 OBJECT IDENTIFIER type - since it is not restricted to 128 sub-identifiers. Hence, - this type SHOULD NOT be used to represent the SMIv2 OBJECT - IDENTIFIER type, the object-identifier-128 type SHOULD be - used instead."; - reference - "ISO9834-1: Information technology -- Open Systems - Interconnection -- Procedures for the operation of OSI - Registration Authorities: General procedures and top - arcs of the ASN.1 Object Identifier tree"; - } - - - - - typedef object-identifier-128 { - type object-identifier { - pattern '\d*(\.\d*){1,127}'; - } - description - "This type represents object-identifiers restricted to 128 - sub-identifiers. - - In the value set and its semantics, this type is equivalent - to the OBJECT IDENTIFIER type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; - } - - /*** collection of date and time related types ***/ - - typedef date-and-time { - type string { - pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' - + '(Z|[\+\-]\d{2}:\d{2})'; - } - description - "The date-and-time type is a profile of the ISO 8601 - standard for representation of dates and times using the - Gregorian calendar. The profile is defined by the - date-time production in Section 5.6 of RFC 3339. - - The date-and-time type is compatible with the dateTime XML - schema type with the following notable exceptions: - - (a) The date-and-time type does not allow negative years. - - (b) The date-and-time time-offset -00:00 indicates an unknown - time zone (see RFC 3339) while -00:00 and +00:00 and Z all - represent the same time zone in dateTime. - - (c) The canonical format (see below) of data-and-time values - differs from the canonical format used by the dateTime XML - schema type, which requires all times to be in UTC using the - time-offset 'Z'. - - This type is not equivalent to the DateAndTime textual - convention of the SMIv2 since RFC 3339 uses a different - separator between full-date and full-time and provides - higher resolution of time-secfrac. - - The canonical format for date-and-time values with a known time - zone uses a numeric time zone offset that is calculated using - the device's configured known offset to UTC time. A change of - the device's offset to UTC time will cause date-and-time values - to change accordingly. Such changes might happen periodically - in case a server follows automatically daylight saving time - (DST) time zone offset changes. The canonical format for - date-and-time values with an unknown time zone (usually referring - to the notion of local time) uses the time-offset -00:00."; - reference - "RFC 3339: Date and Time on the Internet: Timestamps - RFC 2579: Textual Conventions for SMIv2 - XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; - } - - typedef timeticks { - type uint32; - description - "The timeticks type represents a non-negative integer that - represents the time, modulo 2^32 (4294967296 decimal), in - hundredths of a second between two epochs. When a schema - node is defined that uses this type, the description of - the schema node identifies both of the reference epochs. - - In the value set and its semantics, this type is equivalent - to the TimeTicks type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; - } - - typedef timestamp { - type yang:timeticks; - description - "The timestamp type represents the value of an associated - timeticks schema node at which a specific occurrence happened. - The specific occurrence must be defined in the description - of any schema node defined using this type. When the specific - occurrence occurred prior to the last time the associated - timeticks attribute was zero, then the timestamp value is - zero. Note that this requires all timestamp values to be - reset to zero when the value of the associated timeticks - attribute reaches 497+ days and wraps around to zero. - - The associated timeticks schema node must be specified - in the description of any schema node using this type. - - In the value set and its semantics, this type is equivalent - to the TimeStamp textual convention of the SMIv2."; - reference - "RFC 2579: Textual Conventions for SMIv2"; - } - - /*** collection of generic address types ***/ - - typedef phys-address { - type string { - pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; - } - description - "Represents media- or physical-level addresses represented - as a sequence octets, each octet represented by two hexadecimal - numbers. Octets are separated by colons. The canonical - representation uses lowercase characters. - - In the value set and its semantics, this type is equivalent - to the PhysAddress textual convention of the SMIv2."; - reference - "RFC 2579: Textual Conventions for SMIv2"; - } - - typedef mac-address { - type string { - pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; - } - description - "The mac-address type represents an IEEE 802 MAC address. - The canonical representation uses lowercase characters. - - In the value set and its semantics, this type is equivalent - to the MacAddress textual convention of the SMIv2."; - reference - "IEEE 802: IEEE Standard for Local and Metropolitan Area - Networks: Overview and Architecture - RFC 2579: Textual Conventions for SMIv2"; - } - - /*** collection of XML specific types ***/ - - typedef xpath1.0 { - type string; - description - "This type represents an XPATH 1.0 expression. - - When a schema node is defined that uses this type, the - description of the schema node MUST specify the XPath - context in which the XPath expression is evaluated."; - reference - "XPATH: XML Path Language (XPath) Version 1.0"; - } - - } diff --git a/model/ietf/pom.xml b/model/ietf/pom.xml index 59fe6f8270..8f4469cd1e 100644 --- a/model/ietf/pom.xml +++ b/model/ietf/pom.xml @@ -25,10 +25,15 @@ ${project.artifactId} - ietf-inet-types - ietf-interfaces - ietf-yang-types + + ietf-inet-types-2013-07-15 ietf-yang-types-20130715 + ietf-type-util + + + rfc7895 + + ietf-interfaces ietf-network ietf-packet-fields ietf-access-control-list @@ -42,29 +47,7 @@ ietf-topology-ospf ietf-restconf - ietf-inet-types-2013-07-15 - ietf-type-util ietf-ip-2014-06-16 - - - rfc7895 - - - ${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/ - - - - opendaylight-site - ${nexus.site.url}/${project.artifactId}/ - - - -- 2.36.6