</dependency>
</dependencies>
</dependencyManagement>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
<packaging>jar</packaging>
<name>Build Tools</name>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.8.1</version>
<configuration>
<doclet>org.jboss.apiviz.APIviz</doclet>
<docletArtifact>
</plugins>
</reporting>
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
<distributionManagement>
<!-- Note: We want the nexus proxy property here because want to enable
devs to upload this artifact using mvn deploy to other maven repositories. -->
<url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
</snapshotRepository>
<!-- Site deployment -->
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
</distributionManagement>
</project>
<artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=2 tabstop=2: -->
+<!--
+ Copyright (c) 2015 The Linux Foundation 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
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.opendaylight.lispflowmapping</groupId>
+ <artifactId>deploy-site</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <stream>latest</stream>
+ <nexus.site.url>dav:https://nexus.opendaylight.org/content/sites/site/${project.groupId}/${stream}/</nexus.site.url>
+ </properties>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav-jackrabbit</artifactId>
+ <version>2.9</version>
+ </extension>
+ </extensions>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.4</version>
+ <configuration>
+ <inputDirectory>${project.build.directory}/staged-site</inputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}</url>
+ </site>
+ </distributionManagement>
+</project>
</plugin>
</plugins>
</build>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
<type>xml</type>
</dependency>
</dependencies>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
</plugins>
</pluginManagement>
</build>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
@Override
public Option getLoggingOption() {
Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
- logConfiguration(MappingServiceIntegrationTest.class),
+ "log4j.logger.org.opendaylight.lispflowmapping",
LogLevel.DEBUG.name());
option = composite(option, super.getLoggingOption());
return option;
<artifactId>ietf-inet-types</artifactId>
</dependency>
</dependencies>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
package org.opendaylight.lispflowmapping.interfaces.mappingservice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
/**
}
}
- typedef site-id {
- description "64 bit site identifier";
- type binary {
- length "8";
- }
- }
-
typedef vni-uri {
description "VNI as a string lookup key in a URI";
type inet:uri;
type inet:uri;
}
+ typedef xtr-id-uri {
+ description "xTR-ID as a string lookup key in a URI";
+ type inet:uri;
+ }
+
typedef mapping-change {
description "Type of mapping update";
type enumeration {
description "A classifier for endpoint-id elements which allows direct access to a particular element in the data tree.";
}
+ identity xtrid-context {
+ description "A classifier for xtr-id elements which allows direct access to a particular element in the data tree.";
+ }
+
grouping mapping-authkey-container {
container mapping-authkey {
leaf key-string {
}
leaf-list site-id {
description "Site ID";
- type site-id;
+ type lisp-proto:site-id;
}
uses lisp-proto:mapping-record-container;
+ list xtr-id {
+ description "A list of xTR-IDs with their associated mappings";
+ config false;
+ key "xtr-id-uri";
+ ext:context-instance "xtrid-context";
+ leaf xtr-id-uri {
+ type xtr-id-uri;
+ }
+ uses lisp-proto:mapping-record-container;
+ }
}
list authentication-key {
description "A list of authentication keys for EID prefixes within the same Virtual Network Identifier";
</plugin>
</plugins>
</build>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
import org.opendaylight.lispflowmapping.implementation.util.RPCInputConvertorUtil;
import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
import org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddKeyInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveKeysInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.RemoveMappingsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateKeyInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateKeysInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingInput;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ServicePath;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.explicit.locator.path.explicit.locator.path.Hop;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecord;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecordBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecordBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.list.EidItem;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.list.EidItemBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingChanged;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.OdlMappingserviceListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.opendaylight.lispflowmapping.implementation.mapcache;
import java.util.AbstractMap.SimpleImmutableEntry;
-import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import org.opendaylight.lispflowmapping.interfaces.mapcache.IMapCache;
import org.opendaylight.lispflowmapping.lisp.util.MaskUtil;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
return table;
}
- public static Object deserializeBytes(byte[] data) {
- return ByteBuffer.wrap(data);
- }
-
- private void removeExpiredXtrIdTableEntries(ILispDAO xtrIdDao, List<byte[]> expiredMappings) {
- for (byte[] xtrId : expiredMappings) {
- xtrIdDao.removeSpecific(deserializeBytes(xtrId), SubKeys.RECORD);
+ private void removeExpiredXtrIdTableEntries(ILispDAO xtrIdDao, List<XtrId> expiredMappings) {
+ for (XtrId xtrId : expiredMappings) {
+ xtrIdDao.removeSpecific(xtrId, SubKeys.RECORD);
}
}
ILispDAO xtrIdDao = null;
if (!shouldOverwrite) {
xtrIdDao = getOrInstantiateXtrIdTable(eid, table);
- xtrIdDao.put(deserializeBytes(record.getXtrId()), new MappingEntry<>(SubKeys.RECORD, value));
+ xtrIdDao.put(record.getXtrId(), new MappingEntry<>(SubKeys.RECORD, value));
}
if (ConfigIni.getInstance().mappingMergeIsSet()) {
- List<byte[]> expiredMappings = new ArrayList<byte[]>();
+ List<XtrId> expiredMappings = new ArrayList<XtrId>();
Set<IpAddress> sourceRlocs = new HashSet<IpAddress>();
MappingRecord mergedEntry = MappingMergeUtil.mergeXtrIdMappings(getXtrIdMappingList(xtrIdDao),
expiredMappings, sourceRlocs);
import org.opendaylight.lispflowmapping.implementation.util.InstanceIdentifierUtil;
import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingDatabase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifier;
*/
public class DataStoreBackEnd implements TransactionChainListener {
protected static final Logger LOG = LoggerFactory.getLogger(DataStoreBackEnd.class);
+ private static final InstanceIdentifier<MappingDatabase> DATABASE_ROOT =
+ InstanceIdentifier.create(MappingDatabase.class);
private BindingTransactionChain txChain;
public DataStoreBackEnd(DataBroker broker) {
InstanceIdentifier<Mapping> path = InstanceIdentifierUtil
.createMappingIid(mapping.getMappingRecord().getEid(), mapping.getOrigin());
- writePutTransaction(path, mapping, LogicalDatastoreType.CONFIGURATION,
+ writePutTransaction(path, mapping, getDestinationDatastore(mapping),
"Adding mapping to config datastrore failed");
}
InstanceIdentifier<Mapping> path = InstanceIdentifierUtil
.createMappingIid(mapping.getMappingRecord().getEid(), mapping.getOrigin());
- deleteTransaction(path, LogicalDatastoreType.CONFIGURATION, "Deleting mapping from config datastrore failed");
+ deleteTransaction(path, getDestinationDatastore(mapping), "Deleting mapping from config datastrore failed");
}
public void removeAllMappings() {
LOG.debug("MD-SAL: Removing all mappings");
- InstanceIdentifier<MappingDatabase> path = InstanceIdentifier.create(MappingDatabase.class);
- deleteTransaction(path, LogicalDatastoreType.CONFIGURATION,
+ removeAllConfigurationMappings();
+ removeAllOperationalMappings();
+ }
+
+ public void removeAllConfigurationMappings() {
+ deleteTransaction(DATABASE_ROOT, LogicalDatastoreType.CONFIGURATION,
"Removing of all mappings in config datastore failed");
}
+ public void removeAllOperationalMappings() {
+ deleteTransaction(DATABASE_ROOT, LogicalDatastoreType.OPERATIONAL,
+ "Removing of all mappings in operational datastore failed");
+ }
+
public void updateAuthenticationKey(AuthenticationKey authenticationKey) {
LOG.debug("MD-SAL: Updating authentication key for {} with '{}'",
LispAddressStringifier.getString(authenticationKey.getEid()),
}
public List<Mapping> getAllMappings() {
+ List<Mapping> mappings = getAllMappings(LogicalDatastoreType.CONFIGURATION);
+ mappings.addAll(getAllMappings(LogicalDatastoreType.OPERATIONAL));
+ return mappings;
+ }
+
+ public List<Mapping> getAllMappings(LogicalDatastoreType logicalDataStore) {
LOG.debug("MD-SAL: Get all mappings from datastore");
List<Mapping> mappings = new ArrayList<Mapping>();
- InstanceIdentifier<MappingDatabase> path = InstanceIdentifier.create(MappingDatabase.class);
- MappingDatabase mdb = readTransaction(path, LogicalDatastoreType.CONFIGURATION);
+ MappingDatabase mdb = readTransaction(DATABASE_ROOT, logicalDataStore);
if (mdb != null) {
for (VirtualNetworkIdentifier id : mdb.getVirtualNetworkIdentifier()) {
public List<AuthenticationKey> getAllAuthenticationKeys() {
LOG.debug("MD-SAL: Get all authentication keys from datastore");
List<AuthenticationKey> authKeys = new ArrayList<AuthenticationKey>();
- InstanceIdentifier<MappingDatabase> path = InstanceIdentifier.create(MappingDatabase.class);
- MappingDatabase mdb = readTransaction(path, LogicalDatastoreType.CONFIGURATION);
+ MappingDatabase mdb = readTransaction(DATABASE_ROOT, LogicalDatastoreType.CONFIGURATION);
if (mdb != null) {
for (VirtualNetworkIdentifier id : mdb.getVirtualNetworkIdentifier()) {
return authKeys;
}
+ private static LogicalDatastoreType getDestinationDatastore(Mapping mapping) {
+ return mapping.getOrigin().equals(MappingOrigin.Southbound) ? LogicalDatastoreType.OPERATIONAL
+ : LogicalDatastoreType.CONFIGURATION;
+ }
+
private <U extends org.opendaylight.yangtools.yang.binding.DataObject> void writePutTransaction(
InstanceIdentifier<U> addIID, U data, LogicalDatastoreType logicalDatastoreType, String errMsg) {
WriteTransaction writeTx = txChain.newWriteOnlyTransaction();
import java.util.List;
import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping;
package org.opendaylight.lispflowmapping.implementation.util;
import com.google.common.base.Splitter;
+
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+
import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.AddMapping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapregisternotification.MapRegister;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddressBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.EidUri;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddressBuilder;
import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
import org.opendaylight.lispflowmapping.lisp.util.MaskUtil;
import org.opendaylight.lispflowmapping.lisp.util.SourceDestKeyHelper;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecord;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecordBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
}
public static MappingRecord mergeMappings(MappingRecord currentMergedMapping, MappingRecord newMapping,
- byte[] xtrId, Date regdate) {
+ XtrId xtrId, Date regdate) {
if (currentMergedMapping == null) {
return newMapping;
}
return mrb.build();
}
- public static MappingRecord mergeXtrIdMappings(List<Object> records, List<byte[]> expiredMappings,
+ public static MappingRecord mergeXtrIdMappings(List<Object> records, List<XtrId> expiredMappings,
Set<IpAddress> sourceRlocs) {
MappingRecordBuilder mrb = null;
- byte[] xtrId = {};
+ XtrId xtrId = null;
Long timestamp = Long.MAX_VALUE;
for (int i = 0; i < records.size(); i++) {
<scope>test</scope>
</dependency>
</dependencies>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
<version>1.4</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
</plugins>
</pluginManagement>
</build>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
import org.opendaylight.lispflowmapping.lisp.util.NumberUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapNotify;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MessageType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapnotifymessage.MapNotifyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecordBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.list.MappingRecordItem;
}
if (mapNotify.isXtrSiteIdPresent() != null && mapNotify.isXtrSiteIdPresent()) {
- replyBuffer.put(mapNotify.getXtrId());
- replyBuffer.put(mapNotify.getSiteId());
+ replyBuffer.put(mapNotify.getXtrId().getValue());
+ replyBuffer.put(mapNotify.getSiteId().getValue());
}
replyBuffer.clear();
return replyBuffer;
for (int i = 0; i < recordCount; i++) {
mrbs.add(MappingRecordSerializer.getInstance().deserializeToBuilder(notifyBuffer));
}
- byte[] xtrId = new byte[MapRegisterSerializer.Length.XTRID_SIZE];
- notifyBuffer.get(xtrId);
- byte[] siteId = new byte[MapRegisterSerializer.Length.SITEID_SIZE];
- notifyBuffer.get(siteId);
+ byte[] xtrIdBuf = new byte[MapRegisterSerializer.Length.XTRID_SIZE];
+ notifyBuffer.get(xtrIdBuf);
+ XtrId xtrId = new XtrId(xtrIdBuf);
+ byte[] siteIdBuf = new byte[MapRegisterSerializer.Length.SITEID_SIZE];
+ notifyBuffer.get(siteIdBuf);
+ SiteId siteId = new SiteId(siteIdBuf);
builder.setXtrId(xtrId);
builder.setSiteId(siteId);
for (MappingRecordBuilder mrb : mrbs) {
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MessageType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecordBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.list.MappingRecordItem;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.list.MappingRecordItemBuilder;
}
if (mapRegister.isXtrSiteIdPresent() != null && mapRegister.isXtrSiteIdPresent()) {
- registerBuffer.put(mapRegister.getXtrId());
- registerBuffer.put(mapRegister.getSiteId());
+ registerBuffer.put(mapRegister.getXtrId().getValue());
+ registerBuffer.put(mapRegister.getSiteId().getValue());
}
registerBuffer.clear();
return registerBuffer;
for (int i = 0; i < recordCount; i++) {
mrbs.add(MappingRecordSerializer.getInstance().deserializeToBuilder(registerBuffer));
}
- byte[] xtrId = new byte[Length.XTRID_SIZE];
- registerBuffer.get(xtrId);
- byte[] siteId = new byte[Length.SITEID_SIZE];
- registerBuffer.get(siteId);
+ byte[] xtrIdBuf = new byte[Length.XTRID_SIZE];
+ registerBuffer.get(xtrIdBuf);
+ XtrId xtrId = new XtrId(xtrIdBuf);
+ byte[] siteIdBuf = new byte[Length.SITEID_SIZE];
+ registerBuffer.get(siteIdBuf);
+ SiteId siteId = new SiteId(siteIdBuf);
builder.setXtrId(xtrId);
builder.setSiteId(siteId);
for (MappingRecordBuilder mrb : mrbs) {
public static Eid toIpPrefixEid(IpAddress addr, int vni) {
// If you touch this, be sure that sfclisp compiles!
int mask = addressTypeFromIpAddress(addr) == Ipv4Afi.class ? 32 : 128;
- IpPrefix prefix = asIpPrefix(addr.getValue().toString(), mask);
+ IpPrefix prefix = asIpPrefix(String.valueOf(addr.getValue()), mask);
// XXX getMapping rcp fails if VNI set to 0
return toEidNoVni(prefix);
}
}
return 0;
} else if (a instanceof Inet6Address && b instanceof Inet6Address) {
- byte[] aBytes = ((Inet4Address) a).getAddress();
- byte[] bBytes = ((Inet4Address) b).getAddress();
+ byte[] aBytes = ((Inet6Address) a).getAddress();
+ byte[] bBytes = ((Inet6Address) b).getAddress();
for (i = 0; i < 16; i++) {
if (aBytes[i] < bBytes[i]) {
return -1;
in network byte order.";
}
+ typedef xtr-id {
+ type binary {
+ length "16";
+ }
+ description
+ "128 bit xTR identifier.";
+ }
+
+ typedef site-id {
+ type binary {
+ length "8";
+ }
+ description
+ "64 bit site identifier.";
+ }
+
typedef ipv6-address-binary {
type binary {
length "16";
grouping mapping-record-metadata {
leaf xtr-id {
- type binary {
- length "16";
- }
+ type xtr-id;
description
"128 bit xTR identifier.";
}
leaf site-id {
- type binary {
- length "8";
- }
+ type site-id;
description
"64 bit site identifier.";
}
grouping xtrSiteId {
leaf xtrId {
- type binary {
- length "16";
- }
+ type xtr-id;
}
leaf siteId {
- type binary {
- length "8";
- }
+ type site-id;
}
}
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
+import java.util.Arrays;
+import java.util.List;
+import org.junit.Ignore;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.AsNumberAfi;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.DistinguishedNameAfi;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.DistinguishedNameType;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.ExplicitLocatorPathLcaf;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv4Afi;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv4PrefixAfi;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv6Afi;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv6PrefixAfi;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.KeyValueAddressLcaf;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddressFamily;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.MacAfi;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.NoAddressAfi;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.ServicePathIdType;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.ServicePathLcaf;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SourceDestKeyLcaf;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.DistinguishedName;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ExplicitLocatorPath;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Builder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.KeyValueAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Mac;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.MacBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.NoAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.explicit.locator.path.explicit.locator.path.Hop;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.service.path.ServicePath;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.source.dest.key.SourceDestKey;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.source.dest.key.SourceDestKeyBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecord;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
public class LispAddressUtilTest {
private static final char[] DUMMY_CHARACTER_ARRAY_TEST = new char[]{'a', 'b', 'c', 'd'};
- private static final String MAC_ADDRESS_TEST = "aa:bb:cc:dd:ee:ff";
- private static final String IPV4_ADDRESS_PREFIX_TEST = "192.168.1.2/30";
- private static final String IPV6_ADDRESS_PREFIX_TEST = "102:304:506:708:90a:b0c:d0e:f11/30";
private static final Long NUMBER_TEST = 5L;
- private static final byte[] IPV4_ADDRESS_BYTES_TEST = new byte[]{(byte) 192, (byte) 168, 1, 1};
- private static final String IPV4_ADDRESS_TEST = "192.168.1.1";
- private static final Ipv4Address IPV4_ADDRESS_OBJECT_TEST = new Ipv4Address(IPV4_ADDRESS_TEST);
- private static final IpAddress IP_ADDRESS_OBJECT_GENERAL_TEST = new IpAddress(IPV4_ADDRESS_OBJECT_TEST);
- private static final SimpleAddress SIMPLE_ADDRESS_TEST = new SimpleAddress(IP_ADDRESS_OBJECT_GENERAL_TEST);
+ private static final String MAC_ADDRESS_VALUE_TEST = "aa:bb:cc:dd:ee:ff";
+ private static final MacAddress MAC_ADDRESS_TEST = new MacAddress("aa:bb:cc:dd:ee:ff");
- private static final byte[] IPV6_ADDRESS_BYTES_TEST = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ private static final byte[] IPV4_ADDRESS_BYTES_A_TEST = new byte[]{(byte) 192, (byte) 168, 1, 1};
+ private static final byte[] IPV4_ADDRESS_BYTES_B_TEST = new byte[]{(byte) 192, (byte) 168, 1, 2};
+
+ private static final short MASK_OK_TEST = 30;
+ private static final short MASK_OK_DEFAULT_IPV4_TEST = 32;
+ private static final short MASK_OK_DEFAULT_IPV6_TEST = 128;
+
+ private static final String IPV4_ADDRESS_VALUE_TEST = "192.168.1.1";
+ private static final String IPV4_ADDRESS_PREFIX_VALUE_TEST = IPV4_ADDRESS_VALUE_TEST + "/" + MASK_OK_TEST;
+ private static final Ipv4Address IPV4_ADDRESS_TEST = new Ipv4Address(IPV4_ADDRESS_VALUE_TEST);
+ private static final IpAddress IP_ADDRESS_OBJECT_WITH_IPV4_TEST = new IpAddress(IPV4_ADDRESS_TEST);
+ private static final Ipv4Prefix IPV4_ADDRESS_PREFIX_TEST = new Ipv4Prefix(IPV4_ADDRESS_PREFIX_VALUE_TEST);
+ private static final IpPrefix IP_ADDRESS_PREFIX_WITH_IPV4_TEST = new IpPrefix(IPV4_ADDRESS_PREFIX_TEST);
+
+
+ private static final byte[] IPV6_ADDRESS_BYTES_A_TEST = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16};
- private static final Ipv6Address IPV6_ADDRESS_OBJECT_TEST = new Ipv6Address("102:304:506:708:90a:b0c:d0e:f10");
+ private static final byte[] IPV6_ADDRESS_BYTES_B_TEST = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 17};
+ private static final String IPV6_ADDRESS_VALUE_TEST = "102:304:506:708:90a:b0c:d0e:f10";
+ private static final String IPV6_ADDRESS_PREFIX_VALUE_TEST = IPV6_ADDRESS_VALUE_TEST + "/" + MASK_OK_TEST;
+ private static final Ipv6Prefix IPV6_ADDRESS_PREFIX_TEST = new Ipv6Prefix(IPV6_ADDRESS_PREFIX_VALUE_TEST);
+ private static final Ipv6Address IPV6_ADDRESS_TEST = new Ipv6Address(IPV6_ADDRESS_VALUE_TEST);
+ private static final IpPrefix IP_ADDRESS_PREFIX_WITH_IPV6_TEST = new IpPrefix(IPV6_ADDRESS_PREFIX_TEST);
+ private static final IpAddress IP_ADDRESS_OBJECT_WITH_IPV6_TEST = new IpAddress(IPV6_ADDRESS_TEST);
- private static final String IPV6_ADDRESS_TEST = "102:304:506:708:90a:b0c:d0e:f10";
- private static final Short DUMMY_SERVICE_INDEX = 45;
+ private static final Short SERVICE_INDEX_TEST = 45;
private static final Long DUMMY_SERVICE_PATH_ID_TYPE = 46L;
- private static final String DISTINGUISHED_NAME_TYPE_TEST = "dummy distinguished name type";
+ private static final String DISTINGUISHED_NAME_TYPE_VALUE_TEST = "dummy distinguished name type";
+ private static final String DISTINGUISHED_NAME_TYPE_VALUE_WITH_MAC_TEST = MAC_ADDRESS_VALUE_TEST;
+ private static final DistinguishedNameType DISTINGUISHED_NAME_TYPE_TEST = new DistinguishedNameType
+ (DISTINGUISHED_NAME_TYPE_VALUE_TEST);
+
private static final Long AS_NUMBER_TEST = 100L;
+ private static final Long INSTANCE_ID_TYPE_VALUE_TEST = 121L;
+ private static final Short INSTANCE_ID_TYPE_VALUE_SHORT_TEST = 122;
+ private static final InstanceIdType INSTANCE_ID_TYPE_TEST = new InstanceIdType(INSTANCE_ID_TYPE_VALUE_TEST);
+ private static final String INCORRECT_IP_ADDRESS_TEST = "incorrect ip address";
+ private static final SimpleAddress SIMPLE_ADDRESS_A_TEST = new SimpleAddress(IP_ADDRESS_OBJECT_WITH_IPV4_TEST);
+ private static final SimpleAddress SIMPLE_ADDRESS_B_TEST = new SimpleAddress(MAC_ADDRESS_TEST);
+ private static final String SIMPLE_ADDRESS_DISTINGUISHED_VALUE_TEST = DISTINGUISHED_NAME_TYPE_VALUE_TEST;
+ private static final SimpleAddress SIMPLE_ADDRESS_DISTINGUISHED_TEST = new SimpleAddress(new DistinguishedNameType
+ (SIMPLE_ADDRESS_DISTINGUISHED_VALUE_TEST));
+ private static final SimpleAddress SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV4_TEST = new SimpleAddress
+ (IP_ADDRESS_PREFIX_WITH_IPV4_TEST);
+ private static final SimpleAddress SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV6_TEST = new SimpleAddress
+ (IP_ADDRESS_PREFIX_WITH_IPV6_TEST);
+ private static final Long SERVICE_PATH_ID_TEST = 2121L;
/**
* Tests {@link LispAddressUtil#addressTypeFromSimpleAddress} and {@link
@Test
public void addressFromSimpleAddressTest_asAnyIpAddress() {
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromSimpleAddress
- (SIMPLE_ADDRESS_TEST);
+ (SIMPLE_ADDRESS_A_TEST);
assertEquals(Ipv4Afi.class, addressClass);
- final Address address = LispAddressUtil.addressFromSimpleAddress(SIMPLE_ADDRESS_TEST);
+ final Address address = LispAddressUtil.addressFromSimpleAddress(SIMPLE_ADDRESS_A_TEST);
assertTrue(address instanceof Ipv4);
}
*/
@Test
public void addressFromSimpleAddressTest_asIpPrefix() {
- final SimpleAddress simpleAddress = new SimpleAddress(new IpPrefix(new Ipv4Prefix(IPV4_ADDRESS_PREFIX_TEST)));
+ final SimpleAddress simpleAddress = new SimpleAddress(new IpPrefix(new Ipv4Prefix(IPV4_ADDRESS_PREFIX_VALUE_TEST)));
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromSimpleAddress
(simpleAddress);
assertEquals(Ipv4PrefixAfi.class, addressClass);
*/
@Test
public void addressFromSimpleAddressTest_asMacAddress() {
- final SimpleAddress simpleAddress = new SimpleAddress(new MacAddress(MAC_ADDRESS_TEST));
+ final SimpleAddress simpleAddress = new SimpleAddress(new MacAddress(MAC_ADDRESS_VALUE_TEST));
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromSimpleAddress
(simpleAddress);
assertEquals(MacAfi.class, addressClass);
*/
@Test
public void addressFromInet_ipv4() throws UnknownHostException {
- final InetAddress ipv4InetAddress = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_TEST);
+ final InetAddress ipv4InetAddress = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_A_TEST);
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromInet(ipv4InetAddress);
assertEquals(Ipv4Afi.class, addressClass);
final Address address = LispAddressUtil.addressFromInet(ipv4InetAddress);
assertTrue(address instanceof Ipv4);
- assertEquals(IPV4_ADDRESS_TEST, ((Ipv4) address).getIpv4().getValue());
+ assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) address).getIpv4().getValue());
}
/**
*/
@Test
public void addressFromInet_ipv6() throws UnknownHostException {
- final InetAddress ipv6InetAddress = Inet6Address.getByAddress(IPV6_ADDRESS_BYTES_TEST);
+ final InetAddress ipv6InetAddress = Inet6Address.getByAddress(IPV6_ADDRESS_BYTES_A_TEST);
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromInet(ipv6InetAddress);
assertEquals(Ipv6Afi.class, addressClass);
final Address address = LispAddressUtil.addressFromInet(ipv6InetAddress);
assertTrue(address instanceof Ipv6);
- assertEquals(IPV6_ADDRESS_TEST, ((Ipv6) address).getIpv6().getValue());
+ assertEquals(IPV6_ADDRESS_VALUE_TEST, ((Ipv6) address).getIpv6().getValue());
}
/**
*/
@Test
public void addressFromIpAddress_ipv4() {
- final IpAddress ipv4Address = new IpAddress(IPV4_ADDRESS_OBJECT_TEST);
+ final IpAddress ipv4Address = new IpAddress(IPV4_ADDRESS_TEST);
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromIpAddress(ipv4Address);
assertEquals(Ipv4Afi.class, addressClass);
final Address address = LispAddressUtil.addressFromIpAddress(ipv4Address);
assertTrue(address instanceof Ipv4);
- assertEquals(IPV4_ADDRESS_TEST, ((Ipv4) address).getIpv4().getValue());
+ assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) address).getIpv4().getValue());
}
/**
*/
@Test
public void addressFromIpAddress_ipv6() {
- final IpAddress ipv6Address = new IpAddress(new Ipv6Address(IPV6_ADDRESS_TEST));
+ final IpAddress ipv6Address = new IpAddress(new Ipv6Address(IPV6_ADDRESS_VALUE_TEST));
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromIpAddress(ipv6Address);
assertEquals(Ipv6Afi.class, addressClass);
final Address address = LispAddressUtil.addressFromIpAddress(ipv6Address);
assertTrue(address instanceof Ipv6);
- assertEquals(IPV6_ADDRESS_TEST, ((Ipv6) address).getIpv6().getValue());
+ assertEquals(IPV6_ADDRESS_VALUE_TEST, ((Ipv6) address).getIpv6().getValue());
}
/**
*/
@Test
public void addressFromIpPrefix_ipv4() {
- IpPrefix ipv4Prefix = new IpPrefix(new Ipv4Prefix(IPV4_ADDRESS_PREFIX_TEST));
+ IpPrefix ipv4Prefix = new IpPrefix(new Ipv4Prefix(IPV4_ADDRESS_PREFIX_VALUE_TEST));
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromIpPrefix(ipv4Prefix);
assertEquals(Ipv4PrefixAfi.class, addressClass);
final Address address = LispAddressUtil.addressFromIpPrefix(ipv4Prefix);
assertTrue(address instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.
types.rev151105.lisp.address.address.Ipv4Prefix);
- assertEquals(IPV4_ADDRESS_PREFIX_TEST, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.
+ assertEquals(IPV4_ADDRESS_PREFIX_VALUE_TEST, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.
address.types.rev151105.lisp.address.address.Ipv4Prefix) address).getIpv4Prefix().getValue());
}
*/
@Test
public void addressFromIpPrefix_ipv6() {
- IpPrefix ipv6Address = new IpPrefix(new Ipv6Prefix(IPV6_ADDRESS_PREFIX_TEST));
+ IpPrefix ipv6Address = new IpPrefix(new Ipv6Prefix(IPV6_ADDRESS_PREFIX_VALUE_TEST));
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromIpPrefix(ipv6Address);
assertEquals(Ipv6PrefixAfi.class, addressClass);
final Address address = LispAddressUtil.addressFromIpPrefix(ipv6Address);
assertTrue(address instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address
.types.rev151105.lisp.address.address.Ipv6Prefix);
- assertEquals(IPV6_ADDRESS_PREFIX_TEST,
+ assertEquals(IPV6_ADDRESS_PREFIX_VALUE_TEST,
((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp
.address.address.Ipv6Prefix) address).getIpv6Prefix().getValue());
}
*/
@Test
public void addressFromMacAddress_mac() {
- final Address address = LispAddressUtil.addressFromMacAddress(new MacAddress(MAC_ADDRESS_TEST));
+ final Address address = LispAddressUtil.addressFromMacAddress(new MacAddress(MAC_ADDRESS_VALUE_TEST));
assertTrue(address instanceof Mac);
- assertEquals(MAC_ADDRESS_TEST, ((Mac) address).getMac().getValue());
+ assertEquals(MAC_ADDRESS_VALUE_TEST, ((Mac) address).getMac().getValue());
}
/**
.address.service.path.ServicePathBuilder servicePathBuilder = new org.opendaylight.yang.gen.v1.urn.ietf
.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address
.address.service.path.ServicePathBuilder();
- servicePathBuilder.setServiceIndex(DUMMY_SERVICE_INDEX);
+ servicePathBuilder.setServiceIndex(SERVICE_INDEX_TEST);
servicePathBuilder.setServicePathId(new ServicePathIdType(DUMMY_SERVICE_PATH_ID_TYPE));
ServicePath expectedAddress = servicePathBuilder.build();
assertTrue(testedAddress instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address
.types.rev151105.lisp.address.address.ServicePath);
assertEquals(expectedAddress, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address
- .types.rev151105.lisp.address.address.ServicePath)testedAddress).getServicePath());
+ .types.rev151105.lisp.address.address.ServicePath) testedAddress).getServicePath());
}
/**
*/
@Test
public void addressFromDistinguishedNameTest_withDistinguishedName() {
- final DistinguishedNameType distinguishedNameType = new DistinguishedNameType(DISTINGUISHED_NAME_TYPE_TEST);
+ final DistinguishedNameType distinguishedNameType = new DistinguishedNameType(DISTINGUISHED_NAME_TYPE_VALUE_TEST);
final Address testedAddress = LispAddressUtil.addressFromDistinguishedName(distinguishedNameType);
assertTrue(testedAddress instanceof DistinguishedName);
- assertEquals(distinguishedNameType, ((DistinguishedName)testedAddress).getDistinguishedName());
+ assertEquals(distinguishedNameType, ((DistinguishedName) testedAddress).getDistinguishedName());
}
/**
assertTrue(testedAddress instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp
.address.types.rev151105.lisp.address.address.AsNumber);
assertEquals(expectedAddress, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp
- .address.types.rev151105.lisp.address.address.AsNumber)testedAddress).getAsNumber());
+ .address.types.rev151105.lisp.address.address.AsNumber) testedAddress).getAsNumber());
}
/**
*/
@Test
public void toRloc() throws UnknownHostException {
- InetAddress ipv4AddressInet = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_TEST);
+ InetAddress ipv4AddressInet = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_A_TEST);
final Rloc rlocFromInetAddress = LispAddressUtil.toRloc(ipv4AddressInet);
assertEquals(Ipv4Afi.class, rlocFromInetAddress.getAddressType());
- assertEquals(IPV4_ADDRESS_TEST, ((Ipv4)rlocFromInetAddress.getAddress()).getIpv4().getValue());
+ assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4)rlocFromInetAddress.getAddress()).getIpv4().getValue());
- final Rloc rlocFromIpv4Address = LispAddressUtil.toRloc(IPV4_ADDRESS_OBJECT_TEST);
+ final Rloc rlocFromIpv4Address = LispAddressUtil.toRloc(IPV4_ADDRESS_TEST);
assertEquals(Ipv4Afi.class, rlocFromIpv4Address.getAddressType());
- assertEquals(IPV4_ADDRESS_TEST, ((Ipv4)rlocFromIpv4Address.getAddress()).getIpv4().getValue());
+ assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) rlocFromIpv4Address.getAddress()).getIpv4().getValue());
+
- final Rloc rlocFromIpv6Address = LispAddressUtil.toRloc(IPV6_ADDRESS_OBJECT_TEST);
+ final Rloc rlocFromIpv6Address = LispAddressUtil.toRloc(IPV6_ADDRESS_TEST);
assertEquals(Ipv6Afi.class, rlocFromIpv6Address.getAddressType());
- assertEquals(IPV6_ADDRESS_TEST, ((Ipv6)rlocFromIpv6Address.getAddress()).getIpv6().getValue());
+ assertEquals(IPV6_ADDRESS_VALUE_TEST, ((Ipv6) rlocFromIpv6Address.getAddress()).getIpv6().getValue());
- final Rloc rlocFromSimpleAddress = LispAddressUtil.toRloc(SIMPLE_ADDRESS_TEST);
+ final Rloc rlocFromSimpleAddress = LispAddressUtil.toRloc(SIMPLE_ADDRESS_A_TEST);
assertEquals(Ipv4Afi.class, rlocFromSimpleAddress.getAddressType());
- assertEquals(IPV4_ADDRESS_TEST, ((Ipv4)rlocFromSimpleAddress.getAddress()).getIpv4().getValue());
+ assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) rlocFromSimpleAddress.getAddress()).getIpv4().getValue());
+ }
+
+ /**
+ * Test {@link LispAddressUtil#asIpv4Rloc(String)} method with ipv4 or ipv6.
+ * Test {@link LispAddressUtil#asIpv6Rloc(String)} method with ipv4 or ipv6.
+ */
+ @Test
+ public void asIpvRloc() {
+ final Rloc rlocFromIpV4 = LispAddressUtil.asIpv4Rloc(IPV4_ADDRESS_VALUE_TEST);
+ assertEquals(Ipv4Afi.class, rlocFromIpV4.getAddressType());
+ assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) rlocFromIpV4.getAddress()).getIpv4().getValue());
+
+ final Rloc rlocFromIpV6 = LispAddressUtil.asIpv6Rloc(IPV6_ADDRESS_VALUE_TEST);
+ assertEquals(Ipv6Afi.class, rlocFromIpV6.getAddressType());
+ assertEquals(IPV6_ADDRESS_VALUE_TEST, ((Ipv6) rlocFromIpV6.getAddress()).getIpv6().getValue());
+ }
+
+ /**
+ * Test
+ * - {@link LispAddressUtil#toEid(Ipv6Address, InstanceIdType)}
+ * - {@link LispAddressUtil#asIpv6PrefixEid(String)}
+ * - {@link LispAddressUtil#asIpv6PrefixEid(Eid, Inet6Address, short)}
+ * - {@link LispAddressUtil#asIpv6PrefixEid(Ipv6Address, InstanceIdType)}
+ * methods.
+ */
+ @Test
+ public void toEid_ipv6Prefix() throws UnknownHostException {
+ Eid eidFromIpv6Prefix = LispAddressUtil.toEid(IPV6_ADDRESS_PREFIX_TEST, INSTANCE_ID_TYPE_TEST);
+ verifyToEidWithIpv6Prefix(eidFromIpv6Prefix, true, MASK_OK_TEST, Ipv6PrefixAfi.class);
+
+ eidFromIpv6Prefix = LispAddressUtil.asIpv6PrefixEid(IPV6_ADDRESS_PREFIX_VALUE_TEST);
+ verifyToEidWithIpv6Prefix(eidFromIpv6Prefix, false, MASK_OK_TEST, Ipv6PrefixAfi.class);
+
+ eidFromIpv6Prefix = LispAddressUtil.asIpv6PrefixEid(IPV6_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
+ verifyToEidWithIpv6Prefix(eidFromIpv6Prefix, true, MASK_OK_DEFAULT_IPV6_TEST, Ipv6PrefixAfi.class);
+
+ }
+
+ /**
+ * Test
+ * - {@link LispAddressUtil#toEid(MacAddress, InstanceIdType)}
+ * - {@link LispAddressUtil#asMacEid(String)}
+ * - {@link LispAddressUtil#asMacEid(String, long)}
+ * methods.
+ */
+ @Test
+ public void toEid_mac() {
+ Eid eidFromMac = LispAddressUtil.toEid(MAC_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
+ verifyToEidWithMacAddress(eidFromMac, true);
+
+ eidFromMac = LispAddressUtil.asMacEid(MAC_ADDRESS_VALUE_TEST);
+ verifyToEidWithMacAddress(eidFromMac, false);
+
+ eidFromMac = LispAddressUtil.asMacEid(MAC_ADDRESS_VALUE_TEST, INSTANCE_ID_TYPE_VALUE_TEST);
+ verifyToEidWithMacAddress(eidFromMac, true);
+ }
+
+ /**
+ * Test
+ * - {@link LispAddressUtil#toEid(Ipv6Address, InstanceIdType)}
+ * - {@link LispAddressUtil#asIpv6Eid(String)}
+ * - {@link LispAddressUtil#asIpv6Eid(String, long)}
+ * methods.
+ */
+ @Test
+ public void toEid_ipv6() {
+ Eid eidFromIpv6 = LispAddressUtil.toEid(IPV6_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
+ verifyToEidWithIpv6(eidFromIpv6, true);
+
+ eidFromIpv6 = LispAddressUtil.asIpv6Eid(IPV6_ADDRESS_VALUE_TEST);
+ verifyToEidWithIpv6(eidFromIpv6, false);
+
+ eidFromIpv6 = LispAddressUtil.asIpv6Eid(IPV6_ADDRESS_VALUE_TEST, INSTANCE_ID_TYPE_VALUE_TEST);
+ verifyToEidWithIpv6(eidFromIpv6, true);
+ }
+
+ /**
+ * Test
+ * - {@link LispAddressUtil#toEid(Ipv4Prefix, InstanceIdType)}
+ * - {@link LispAddressUtil#asIpv4PrefixEid(String)}
+ * - {@link LispAddressUtil#asIpv4PrefixEid(Eid, Inet4Address, short)}
+ * - {@link LispAddressUtil#asIpv4PrefixEid(Ipv4Address, InstanceIdType)} }
+ * methods.
+ */
+ @Test
+ public void toEid_ipv4Prefix() throws UnknownHostException {
+ Eid eidFromIpv4Prefix = LispAddressUtil.toEid(IPV4_ADDRESS_PREFIX_TEST, INSTANCE_ID_TYPE_TEST);
+ verifyToEidWithIpv4Prefix(eidFromIpv4Prefix, true, MASK_OK_TEST, Ipv4PrefixAfi.class);
+
+ eidFromIpv4Prefix = LispAddressUtil.asIpv4PrefixEid(IPV4_ADDRESS_PREFIX_VALUE_TEST);
+ verifyToEidWithIpv4Prefix(eidFromIpv4Prefix, false, MASK_OK_TEST, Ipv4PrefixAfi.class);
+
+ eidFromIpv4Prefix = LispAddressUtil.asIpv4PrefixEid(IPV4_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
+ }
+
+ public Eid provideDummyMacEid() {
+ final EidBuilder eidBuilder = new EidBuilder();
+ eidBuilder.setAddressType(MacAfi.class);
+ eidBuilder.setVirtualNetworkId(INSTANCE_ID_TYPE_TEST);
+ return eidBuilder.build();
+ }
+
+ /**
+ * Test
+ * - {@link LispAddressUtil#toEid(Ipv4Address, InstanceIdType)}
+ * - {@link LispAddressUtil#asIpv4Eid(String)}
+ * - {@link LispAddressUtil#asIpv4Eid(String, long)}
+ * methods.
+ */
+ @Test
+ public void toEid_ipv4() {
+ Eid eidFromIpv4 = LispAddressUtil.toEid(IPV4_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
+ verifyToEidWithIpv4(eidFromIpv4, true);
+
+ eidFromIpv4 = LispAddressUtil.asIpv4Eid(IPV4_ADDRESS_VALUE_TEST);
+ verifyToEidWithIpv4(eidFromIpv4, false);
+
+ eidFromIpv4 = LispAddressUtil.asIpv4Eid(IPV4_ADDRESS_VALUE_TEST, INSTANCE_ID_TYPE_VALUE_TEST);
+ verifyToEidWithIpv4(eidFromIpv4, true);
}
+
+ /**
+ * Test
+ * - {@link LispAddressUtil#toEid(IpPrefix, InstanceIdType)}
+ * method.
+ */
+ @Test
+ public void toEid_ipPrefix() {
+ final Eid eidFromIpPrefix = LispAddressUtil.toEid(IP_ADDRESS_PREFIX_WITH_IPV4_TEST, INSTANCE_ID_TYPE_TEST);
+ verifyToEidWithIpv4Prefix(eidFromIpPrefix, true, MASK_OK_TEST, Ipv4PrefixAfi.class);
+ }
+
+ /**
+ * Test
+ * - {@link LispAddressUtil#toEid(DistinguishedNameType, InstanceIdType)}
+ * - {@link LispAddressUtil#asDistinguishedNameEid(String)}
+ * - {@link LispAddressUtil#asDistinguishedNameEid(String, long)}
+ * methods with various input.
+ */
+ @Test
+ public void toEid_distinguishedName() {
+ Eid eidFromDistinguishedName = LispAddressUtil.toEid(DISTINGUISHED_NAME_TYPE_TEST, INSTANCE_ID_TYPE_TEST);
+ verifyToEidWithDistinguishedName(eidFromDistinguishedName, true);
+
+ eidFromDistinguishedName = LispAddressUtil.asDistinguishedNameEid(DISTINGUISHED_NAME_TYPE_VALUE_TEST);
+ verifyToEidWithDistinguishedName(eidFromDistinguishedName, false);
+
+ eidFromDistinguishedName = LispAddressUtil.asDistinguishedNameEid
+ (DISTINGUISHED_NAME_TYPE_VALUE_WITH_MAC_TEST, INSTANCE_ID_TYPE_VALUE_TEST);
+ verifyToEidWithMacAddress(eidFromDistinguishedName, true);
+ }
+
+ private void verifyToEidWithIpv6Prefix(final Eid eidFromIpv6Prefix, final boolean isVniChecked, short
+ expectedMask, final Class<? extends org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp
+ .address.types.rev151105.LispAddressFamily> addressType) {
+ assertEquals(addressType, eidFromIpv6Prefix.getAddressType());
+ if (isVniChecked) {
+ assertEquals(INSTANCE_ID_TYPE_TEST, eidFromIpv6Prefix.getVirtualNetworkId());
+ }
+ assertEquals(IPV6_ADDRESS_VALUE_TEST + "/" + expectedMask, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml
+ .ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix) eidFromIpv6Prefix
+ .getAddress()).getIpv6Prefix().getValue());
+ }
+
+ private void verifyToEidWithIpv4(final Eid eidFromIpv4, final boolean isVniChecked) {
+ assertEquals(Ipv4Afi.class, eidFromIpv4.getAddressType());
+ if (isVniChecked) {
+ assertEquals(INSTANCE_ID_TYPE_TEST, eidFromIpv4.getVirtualNetworkId());
+ }
+ assertEquals(IPV4_ADDRESS_VALUE_TEST, ((Ipv4) eidFromIpv4.getAddress()).getIpv4().getValue());
+ }
+
+ private void verifyToEidWithIpv6(final Eid eidFromIpv6, final boolean isVniChecked) {
+ assertEquals(Ipv6Afi.class, eidFromIpv6.getAddressType());
+ if (isVniChecked) {
+ assertEquals(INSTANCE_ID_TYPE_TEST, eidFromIpv6.getVirtualNetworkId());
+ }
+ assertEquals(IPV6_ADDRESS_VALUE_TEST, ((Ipv6) eidFromIpv6.getAddress()).getIpv6().getValue());
+ }
+
+ private void verifyToEidWithIpv4Prefix(final Eid eidFromIpv4Prefix, final boolean isVniChecked, short
+ expectedMask, Class<? extends org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address
+ .types.rev151105.LispAddressFamily> addressType) {
+ assertEquals(addressType, eidFromIpv4Prefix.getAddressType());
+ if (isVniChecked) {
+ assertEquals(INSTANCE_ID_TYPE_TEST, eidFromIpv4Prefix.getVirtualNetworkId());
+ }
+ assertEquals(IPV4_ADDRESS_VALUE_TEST + "/" + expectedMask, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns
+ .yang.ietf
+ .lisp.address.types.rev151105.lisp.address.address.Ipv4Prefix) eidFromIpv4Prefix.getAddress())
+ .getIpv4Prefix().getValue());
+ }
+
+ private void verifyToEidWithDistinguishedName(final Eid eidFromDistinguishedName, final boolean isVniChecked) {
+ assertEquals(DistinguishedNameAfi.class, eidFromDistinguishedName.getAddressType());
+ if (isVniChecked) {
+ assertEquals(INSTANCE_ID_TYPE_TEST, eidFromDistinguishedName.getVirtualNetworkId());
+ }
+ assertEquals(DISTINGUISHED_NAME_TYPE_TEST, ((DistinguishedName) eidFromDistinguishedName.getAddress())
+ .getDistinguishedName());
+ }
+
+ private void verifyToEidWithMacAddress(final Eid eidFromMac, final boolean isVniChecked) {
+ assertEquals(MacAfi.class, eidFromMac.getAddressType());
+ if (isVniChecked) {
+ assertEquals(INSTANCE_ID_TYPE_TEST, eidFromMac.getVirtualNetworkId());
+ }
+ assertEquals(MAC_ADDRESS_VALUE_TEST, ((Mac) eidFromMac.getAddress()).getMac().getValue());
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asIpPrefix(String, int)} with ipv4 address and correct mask
+ */
+ @Test
+ public void asIpPrefix_ipv4() {
+ final IpPrefix ipPrefix = LispAddressUtil.asIpPrefix(IPV4_ADDRESS_VALUE_TEST, MASK_OK_TEST);
+ assertNotNull(ipPrefix);
+ final Ipv4Prefix ipv4Prefix = ipPrefix.getIpv4Prefix();
+ assertNotNull(ipv4Prefix);
+ assertEquals(IPV4_ADDRESS_PREFIX_TEST, ipv4Prefix);
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asIpPrefix(String, int)} with ipv6 address and correct mask
+ */
+ @Test
+ public void asIpPrefix_ipv6() {
+ final IpPrefix ipPrefix = LispAddressUtil.asIpPrefix(IPV6_ADDRESS_VALUE_TEST, MASK_OK_TEST);
+ assertNotNull(ipPrefix);
+ final Ipv6Prefix ipv6Prefix = ipPrefix.getIpv6Prefix();
+ assertNotNull(ipv6Prefix);
+ assertEquals(IPV6_ADDRESS_PREFIX_TEST, ipv6Prefix);
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asIpPrefix(String, int)} with incorrect ip address and correct mask
+ */
+ @Test
+ public void asIpPrefix_other() {
+ final IpPrefix ipPrefix = LispAddressUtil.asIpPrefix(INCORRECT_IP_ADDRESS_TEST, MASK_OK_TEST);
+ assertNull(ipPrefix);
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#ipVersionFromString(String)} with ipv4
+ */
+ @Test
+ public void ipVersionFromString_ipv4() {
+ final int addressType = LispAddressUtil.ipVersionFromString(IPV4_ADDRESS_VALUE_TEST);
+ assertEquals(4, addressType);
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#ipVersionFromString(String)} with ipv6
+ */
+ @Test
+ public void ipVersionFromString_ipv6() {
+ final int addressType = LispAddressUtil.ipVersionFromString(IPV6_ADDRESS_VALUE_TEST);
+ assertEquals(6, addressType);
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#ipVersionFromString(String)} with incorrect ip address format
+ */
+ @Test
+ public void ipVersionFromString_other() {
+ final int addressType = LispAddressUtil.ipVersionFromString(INCORRECT_IP_ADDRESS_TEST);
+ assertEquals(0, addressType);
+
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asKeyValueAddressEid(SimpleAddress, SimpleAddress)} method.
+ */
+ @Test
+ public void asKeyValueAddressEid() {
+ final Eid eid = LispAddressUtil.asKeyValueAddressEid(SIMPLE_ADDRESS_A_TEST, SIMPLE_ADDRESS_B_TEST);
+ verifyKeyValueAddress(eid, SIMPLE_ADDRESS_A_TEST);
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asKeyValueAddressRloc(SimpleAddress, SimpleAddress)} method.
+ */
+ @Test
+ public void asKeyValueAddressRloc() {
+ final Rloc rloc = LispAddressUtil.asKeyValueAddressRloc(SIMPLE_ADDRESS_A_TEST, SIMPLE_ADDRESS_B_TEST);
+ verifyKeyValueAddress(rloc, SIMPLE_ADDRESS_A_TEST);
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asKeyValueAddress(String, SimpleAddress)} method.
+ */
+ @Test
+ public void asKeyValueAddress() {
+ final Rloc rloc = LispAddressUtil.asKeyValueAddress(SIMPLE_ADDRESS_DISTINGUISHED_VALUE_TEST, SIMPLE_ADDRESS_B_TEST);
+ verifyKeyValueAddress(rloc, SIMPLE_ADDRESS_DISTINGUISHED_TEST);
+ }
+
+ private void verifyKeyValueAddress(final LispAddress lispAddress, final SimpleAddress keyValue) {
+ assertEquals(KeyValueAddressLcaf.class, lispAddress.getAddressType());
+ assertNull(lispAddress.getVirtualNetworkId());
+ final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address
+ .address.key.value.address.KeyValueAddress keyValueAddress = ((KeyValueAddress) lispAddress.getAddress()).
+ getKeyValueAddress();
+ assertNotNull(keyValueAddress);
+ assertEquals(keyValue, keyValueAddress.getKey());
+ assertEquals(SIMPLE_ADDRESS_B_TEST, keyValueAddress.getValue());
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asSrcDst(String, String, int, int)} method.
+ */
+ @Test
+ public void asSrcDst() {
+ final SourceDestKey sourceDestKey = LispAddressUtil.asSrcDst(IPV4_ADDRESS_VALUE_TEST,
+ IPV6_ADDRESS_VALUE_TEST, MASK_OK_TEST, MASK_OK_TEST);
+ assertNotNull(sourceDestKey);
+ assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV4_TEST, sourceDestKey.getSource());
+ assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV6_TEST, sourceDestKey.getDest());
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asSrcDstEid(String, String, int, int, int)} method.
+ */
+ @Test
+ public void asSrcDstEid_addressesAsString() {
+ final Eid srcDstEid = LispAddressUtil.asSrcDstEid(IPV4_ADDRESS_VALUE_TEST,
+ IPV6_ADDRESS_VALUE_TEST, MASK_OK_TEST, MASK_OK_TEST, INSTANCE_ID_TYPE_VALUE_SHORT_TEST);
+ assertNotNull(srcDstEid);
+ assertEquals(SourceDestKeyLcaf.class, srcDstEid.getAddressType());
+ final SourceDestKey sourceDestKey = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns
+ .yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey) srcDstEid.getAddress())
+ .getSourceDestKey();
+ assertNotNull(sourceDestKey);
+ assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV4_TEST, sourceDestKey.getSource());
+ assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV6_TEST, sourceDestKey.getDest());
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asSrcDstEid(SourceDestKey, InstanceIdType)} method.
+ */
+ @Test
+ public void asSrcDstEid_addressesAsSrcDstKey() {
+ final SourceDestKey expectedSourceDestKey = new SourceDestKeyBuilder().setSource
+ (SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV4_TEST).setDest(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV6_TEST).build();
+ final Eid srcDstEid = LispAddressUtil.asSrcDstEid(expectedSourceDestKey, INSTANCE_ID_TYPE_TEST);
+ assertNotNull(srcDstEid);
+ assertEquals(SourceDestKeyLcaf.class, srcDstEid.getAddressType());
+ final SourceDestKey testedSourceDestKey = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns
+ .yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey) srcDstEid.getAddress())
+ .getSourceDestKey();
+ assertNotNull(testedSourceDestKey);
+ assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV4_TEST, testedSourceDestKey.getSource());
+ assertEquals(SIMPLE_ADDRESS_WITH_IP_PREFIX_IPV6_TEST, testedSourceDestKey.getDest());
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asSrcDstEid(SourceDestKey, InstanceIdType)} method.
+ */
+ @Test
+ public void asTeLcafRloc() {
+ final List<IpAddress> ipAddresses = Arrays.asList(IP_ADDRESS_OBJECT_WITH_IPV4_TEST, IP_ADDRESS_OBJECT_WITH_IPV6_TEST);
+ final Rloc rloc = LispAddressUtil.asTeLcafRloc(ipAddresses);
+ assertNotNull(rloc);
+ assertEquals(ExplicitLocatorPathLcaf.class, rloc.getAddressType());
+ final List<Hop> hops = ((ExplicitLocatorPath) rloc.getAddress()).getExplicitLocatorPath().getHop();
+ assertEquals(hops.size(), ipAddresses.size());
+
+ for(IpAddress ipAddress : ipAddresses) {
+ assertTrue("Ip address "+ipAddress+"should be part of hops list.",isIpAddressInHops(ipAddress, hops));
+ }
+
+ for(Hop hop : hops) {
+ final Hop.LrsBits lrsBits = hop.getLrsBits();
+ assertFalse(lrsBits.isLookup());
+ assertFalse(lrsBits.isRlocProbe());
+ assertFalse(lrsBits.isStrict());
+
+ final IpAddress ipAddressFromHop = hop.getAddress().getIpAddress();
+ assertNotNull(ipAddressFromHop);
+ }
+ }
+
+ private boolean isIpAddressInHops(final IpAddress ipAddress, final List<Hop> hops) {
+ for (Hop hop : hops) {
+ if (hop.getAddress().getIpAddress().equals(ipAddress)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asLocatorRecords(List)} method.
+ */
+ @Test
+ public void asLocatorRecords() {
+ final List<Rloc> expectedRlocs = Arrays.asList(LispAddressUtil.toRloc(IPV4_ADDRESS_TEST), LispAddressUtil.toRloc
+ (IPV6_ADDRESS_TEST));
+ final List<LocatorRecord> locatorRecords = LispAddressUtil.asLocatorRecords(expectedRlocs);
+
+ assertEquals(expectedRlocs.size(), locatorRecords.size());
+
+ for (Rloc rloc : expectedRlocs) {
+ assertTrue("Rloc " + rloc + " should be part of " +
+ "locator records list list", isRlocInLocatorRecords(locatorRecords, rloc));
+ }
+
+ for (LocatorRecord locatorRecord : locatorRecords) {
+ assertFalse(locatorRecord.isLocalLocator());
+ assertFalse(locatorRecord.isRlocProbed());
+ assertTrue(locatorRecord.isRouted());
+ assertTrue(1 == locatorRecord.getWeight());
+ assertTrue(1 == locatorRecord.getPriority());
+ assertTrue(1 == locatorRecord.getMulticastWeight());
+ assertTrue(1 == locatorRecord.getMulticastPriority());
+ assertEquals("SFC_LISP", locatorRecord.getLocatorId());
+ }
+ }
+
+ private boolean isRlocInLocatorRecords(final List<LocatorRecord> locatorRecords, final Rloc rloc) {
+ for (LocatorRecord locatorRecord : locatorRecords) {
+ if (locatorRecord.getRloc().equals(rloc)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#getNoAddressEid()} method.
+ */
+ @Test
+ public void getNoAddressEid() {
+ final Eid noAddressEid = LispAddressUtil.getNoAddressEid();
+ assertEquals(NoAddressAfi.class, noAddressEid.getAddressType());
+ assertNull(noAddressEid.getVirtualNetworkId());
+ assertTrue(((NoAddress) noAddressEid.getAddress()).isNoAddress());
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#ipAddressToInet(Address)} method with ipv4 value.
+ */
+ @Test
+ public void ipAddressToInet_ipv4() {
+ final Ipv4 expectedIpv4 = new Ipv4Builder().setIpv4(IPV4_ADDRESS_TEST).build();
+ final InetAddress testedAddress = LispAddressUtil.ipAddressToInet(expectedIpv4);
+ assertEquals(IPV4_ADDRESS_TEST.getValue(), testedAddress.getHostAddress());
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#ipAddressToInet(Address)} method with ipv6 value.
+ */
+ @Test
+ public void ipAddressToInet_ipv6() {
+ final Ipv6 expectedIpv6 = new Ipv6Builder().setIpv6(IPV6_ADDRESS_TEST).build();
+ final InetAddress testedAddress = LispAddressUtil.ipAddressToInet(expectedIpv6);
+ assertEquals(IPV6_ADDRESS_TEST.getValue(), testedAddress.getHostAddress());
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#ipAddressToInet(Address)} method with mac value.
+ */
+ @Test
+ public void ipAddressToInet_other() {
+ final InetAddress testedAddress = LispAddressUtil.ipAddressToInet(new MacBuilder().build());
+ assertNull(testedAddress);
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#compareInetAddresses(InetAddress, InetAddress)} with all possible combination
+ * of input parameters to reach 100 % coverage.
+ */
+ @Test
+ public void compareInetAddresses() throws UnknownHostException {
+ final InetAddress inetIpv4A = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_A_TEST);
+ final InetAddress inetIpv6A = Inet6Address.getByAddress(IPV6_ADDRESS_BYTES_A_TEST);
+ final InetAddress inetIpv4B = Inet4Address.getByAddress(IPV4_ADDRESS_BYTES_B_TEST);
+ final InetAddress inetIpv6B = Inet6Address.getByAddress(IPV6_ADDRESS_BYTES_B_TEST);
+
+ int comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv4A, inetIpv6A);
+ assertEquals(-1, comparisonResult);
+
+ comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv6A, inetIpv4A);
+ assertEquals(1, comparisonResult);
+
+ comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv4A, inetIpv4B);
+ assertEquals(-1, comparisonResult);
+
+ comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv4B, inetIpv4A);
+ assertEquals(1, comparisonResult);
+
+ comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv4B, inetIpv4B);
+ assertEquals(0, comparisonResult);
+
+ // remove this ignore once https://git.opendaylight.org/gerrit/#/c/35682/1 will be merged */
+/*
+ comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv6A, inetIpv6B);
+ assertEquals(-1, comparisonResult);
+
+ comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv6B, inetIpv6A);
+ assertEquals(1, comparisonResult);
+
+ comparisonResult = LispAddressUtil.compareInetAddresses(inetIpv6B, inetIpv6B);
+ assertEquals(0, comparisonResult);
+*/
+
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asServicePathEid(long, long, short)} method.
+ */
+ @Test
+ public void asServicePathEid() {
+ final Eid eid = LispAddressUtil.asServicePathEid(INSTANCE_ID_TYPE_VALUE_TEST, SERVICE_PATH_ID_TEST,
+ SERVICE_INDEX_TEST);
+
+ assertNotNull(eid);
+ assertEquals(ServicePathLcaf.class, eid.getAddressType());
+ assertEquals(INSTANCE_ID_TYPE_TEST, eid.getVirtualNetworkId());
+ ServicePath servicePath = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.
+ address.types.rev151105.lisp.address.address.ServicePath) eid.getAddress()).getServicePath();
+ assertNotNull(servicePath);
+ assertEquals(SERVICE_INDEX_TEST, servicePath.getServiceIndex());
+ assertEquals(SERVICE_PATH_ID_TEST, servicePath.getServicePathId().getValue());
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#toIpPrefixEid(IpAddress, int)} method.
+ */
+ @Ignore /* remove when https://git.opendaylight.org/gerrit/#/c/35681/2 will be merged */
+ @Test
+ public void toIpPrefixEid() throws UnknownHostException {
+ final Eid eid = LispAddressUtil.toIpPrefixEid(IP_ADDRESS_OBJECT_WITH_IPV4_TEST, INSTANCE_ID_TYPE_VALUE_SHORT_TEST);
+ verifyEidContainsIpPrefix(eid, MASK_OK_DEFAULT_IPV4_TEST);
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#toEidNoVni(IpPrefix)} method.
+ */
+ @Test
+ public void toEidNoVni() {
+ final Eid eid = LispAddressUtil.toEidNoVni(IP_ADDRESS_PREFIX_WITH_IPV4_TEST);
+ verifyEidContainsIpPrefix(eid, MASK_OK_TEST);
+ }
+
+ public void verifyEidContainsIpPrefix(final Eid eid, final short mask) {
+ final Ipv4Prefix expectedPrefix = new Ipv4Prefix(IPV4_ADDRESS_VALUE_TEST + "/" + mask);
+ assertNotNull(eid);
+ assertTrue(eid.getAddress() instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp
+ .address.types.rev151105.lisp.address.address.Ipv4Prefix);
+ final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address
+ .address.Ipv4Prefix address = (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp
+ .address.types.rev151105.lisp.address.address.Ipv4Prefix) eid.getAddress();
+ assertEquals(expectedPrefix, address.getIpv4Prefix());
+ }
+
+ /**
+ * Tests {@link LispAddressUtil#asEid(SimpleAddress, InstanceIdType)} method.
+ */
+ @Test
+ public void asEid() {
+ final Eid eid = LispAddressUtil.asEid(SIMPLE_ADDRESS_A_TEST, INSTANCE_ID_TYPE_TEST);
+ assertNotNull(eid);
+ assertEquals(Ipv4Afi.class, eid.getAddressType());
+ final Ipv4 address = (Ipv4) eid.getAddress();
+ assertEquals(SIMPLE_ADDRESS_A_TEST.getIpAddress().getIpv4Address(), address.getIpv4());
+ assertEquals(INSTANCE_ID_TYPE_TEST, eid.getVirtualNetworkId());
+ }
+
}
import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecord;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
mrBuilder.setWantMapNotify(true);
mrBuilder.setProxyMapReply(true);
mrBuilder.setXtrSiteIdPresent(true);
- byte[] authenticationData = new byte[] { (byte) 0x16, (byte) 0x98, (byte) 0x96, (byte) 0xeb, (byte) 0x88, (byte) 0x2d, (byte) 0x4d,
- (byte) 0x22, (byte) 0xe5, (byte) 0x8f, (byte) 0xe6, (byte) 0x89, (byte) 0x64, (byte) 0xb9, (byte) 0x17, (byte) 0xa4, (byte) 0xba,
- (byte) 0x4e, (byte) 0x8c, (byte) 0x41 };
+ byte[] authenticationData = new byte[] { (byte) 0x16, (byte) 0x98, (byte) 0x96, (byte) 0xeb, (byte) 0x88,
+ (byte) 0x2d, (byte) 0x4d, (byte) 0x22, (byte) 0xe5, (byte) 0x8f, (byte) 0xe6, (byte) 0x89, (byte) 0x64,
+ (byte) 0xb9, (byte) 0x17, (byte) 0xa4, (byte) 0xba, (byte) 0x4e, (byte) 0x8c, (byte) 0x41 };
mrBuilder.setAuthenticationData(authenticationData);
- byte[] xtrId = new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
- (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01 };
+ XtrId xtrId = new XtrId(new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x01 });
mrBuilder.setXtrId(xtrId);
- byte[] siteId = new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01 };
+ SiteId siteId = new SiteId(new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x01 });
mrBuilder.setSiteId(siteId);
ByteBuffer bb = MapRegisterSerializer.getInstance().serialize(mrBuilder.build());
byte[] actualXtrId = new byte[Length.XTRID_SIZE];
bb.get(actualXtrId);
- ArrayAssert.assertEquals(xtrId, actualXtrId);
+ ArrayAssert.assertEquals(xtrId.getValue(), actualXtrId);
byte[] actualSiteId = new byte[Length.SITEID_SIZE];
bb.get(actualSiteId);
- ArrayAssert.assertEquals(siteId, actualSiteId);
+ ArrayAssert.assertEquals(siteId.getValue(), actualSiteId);
assertEquals(bb.position(), bb.capacity());
}
mrBuilder.setKeyId((short) 0x0001);
mrBuilder.setWantMapNotify(true);
mrBuilder.setProxyMapReply(true);
- byte[] authenticationData = new byte[] { (byte) 0x16, (byte) 0x98, (byte) 0x96, (byte) 0xeb, (byte) 0x88, (byte) 0x2d, (byte) 0x4d,
- (byte) 0x22, (byte) 0xe5, (byte) 0x8f, (byte) 0xe6, (byte) 0x89, (byte) 0x64, (byte) 0xb9, (byte) 0x17, (byte) 0xa4, (byte) 0xba,
- (byte) 0x4e, (byte) 0x8c, (byte) 0x41 };
+ byte[] authenticationData = new byte[] { (byte) 0x16, (byte) 0x98, (byte) 0x96, (byte) 0xeb, (byte) 0x88,
+ (byte) 0x2d, (byte) 0x4d, (byte) 0x22, (byte) 0xe5, (byte) 0x8f, (byte) 0xe6, (byte) 0x89, (byte) 0x64,
+ (byte) 0xb9, (byte) 0x17, (byte) 0xa4, (byte) 0xba, (byte) 0x4e, (byte) 0x8c, (byte) 0x41 };
mrBuilder.setAuthenticationData(authenticationData);
MapRegister mapRegister = mrBuilder.build();
ArrayAssert.assertEquals(
MapRegisterSerializer.getInstance().serialize(mapRegister).array(),
MapRegisterSerializer.getInstance()
- .serialize(MapRegisterSerializer.getInstance().deserialize(MapRegisterSerializer.getInstance().serialize(mapRegister), null))
- .array());
+ .serialize(MapRegisterSerializer.getInstance().deserialize(MapRegisterSerializer.getInstance()
+ .serialize(mapRegister), null)).array());
}
@Test
assertEquals(1, mr.getMappingRecordItem().size());
assertEquals(0xFFBB000000000000L, mr.getNonce().longValue());
assertEquals(0x0001, mr.getKeyId().shortValue());
- byte[] expectedAuthenticationData = { (byte) 0x2c, (byte) 0x61, (byte) 0xb9, (byte) 0xc9, (byte) 0x9a, (byte) 0x20, (byte) 0xba, (byte) 0xd8, //
- (byte) 0xf5, (byte) 0x40, (byte) 0xd3, (byte) 0x55, (byte) 0x6f, (byte) 0x5f, (byte) 0x6e, (byte) 0x5a, //
- (byte) 0xb2, (byte) 0x0a, (byte) 0xbf, (byte) 0xb5 };
+ byte[] expectedAuthenticationData = { (byte) 0x2c, (byte) 0x61, (byte) 0xb9, (byte) 0xc9, (byte) 0x9a,
+ (byte) 0x20, (byte) 0xba, (byte) 0xd8, (byte) 0xf5, (byte) 0x40, (byte) 0xd3, (byte) 0x55, (byte) 0x6f,
+ (byte) 0x5f, (byte) 0x6e, (byte) 0x5a, (byte) 0xb2, (byte) 0x0a, (byte) 0xbf, (byte) 0xb5 };
ArrayAssert.assertEquals(expectedAuthenticationData, mr.getAuthenticationData());
}
assertEquals(1, mr.getMappingRecordItem().size());
assertEquals(0xFFBB000000000000L, mr.getNonce().longValue());
assertEquals(0x0002, mr.getKeyId().shortValue());
- byte[] expectedAuthenticationData = { (byte) 0x70, (byte) 0x30, (byte) 0xd4, (byte) 0xc6, (byte) 0x10, (byte) 0x44, (byte) 0x0d, (byte) 0x83,
- (byte) 0xbe, (byte) 0x4d, (byte) 0xbf, (byte) 0xfd, (byte) 0xa9, (byte) 0x8c, (byte) 0x57, (byte) 0x6d, (byte) 0x68, (byte) 0xa5,
- (byte) 0xbf, (byte) 0x32, (byte) 0x11, (byte) 0xc9, (byte) 0x7b, (byte) 0x58, (byte) 0xc4, (byte) 0xb9, (byte) 0x9f, (byte) 0x06,
- (byte) 0x11, (byte) 0x23, (byte) 0xb9, (byte) 0x38 };
+ byte[] expectedAuthenticationData = { (byte) 0x70, (byte) 0x30, (byte) 0xd4, (byte) 0xc6, (byte) 0x10,
+ (byte) 0x44, (byte) 0x0d, (byte) 0x83, (byte) 0xbe, (byte) 0x4d, (byte) 0xbf, (byte) 0xfd, (byte) 0xa9,
+ (byte) 0x8c, (byte) 0x57, (byte) 0x6d, (byte) 0x68, (byte) 0xa5, (byte) 0xbf, (byte) 0x32, (byte) 0x11,
+ (byte) 0xc9, (byte) 0x7b, (byte) 0x58, (byte) 0xc4, (byte) 0xb9, (byte) 0x9f, (byte) 0x06, (byte) 0x11,
+ (byte) 0x23, (byte) 0xb9, (byte) 0x38 };
ArrayAssert.assertEquals(expectedAuthenticationData, mr.getAuthenticationData());
}
}
</plugin>
</plugins>
</build>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
</plugin>
</plugins>
</build>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
</plugins>
</pluginManagement>
</build>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
</plugin>
</plugins>
</build>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
<artifactId>junit-addons</artifactId>
</dependency>
</dependencies>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
</plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <!--
+ This profile is to ensure we only build javadocs reports
+ when we plan to deploy Maven site for our project.
+ -->
+ <id>maven-site</id>
+ <activation>
+ <file>
+ <exists>${user.dir}/deploy-site.xml</exists>
+ </file>
+ </activation>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>aggregate</id>
+ <goals>
+ <goal>aggregate</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/</url>
+ </site>
+ </distributionManagement>
+
</project>
--- /dev/null
+/* Javadoc style sheet */
+/*
+Overall document style
+*/
+body {
+ background-color:#ffffff;
+ color:#353833;
+ font-family:Arial, Helvetica, sans-serif;
+ font-size:76%;
+ margin:0;
+}
+a:link, a:visited {
+ text-decoration:none;
+ color:#4c6b87;
+}
+a:hover, a:focus {
+ text-decoration:none;
+ color:#bb7a2a;
+}
+a:active {
+ text-decoration:none;
+ color:#4c6b87;
+}
+a[name] {
+ color:#353833;
+}
+a[name]:hover {
+ text-decoration:none;
+ color:#353833;
+}
+pre {
+ font-size:1.3em;
+}
+h1 {
+ font-size:1.8em;
+}
+h2 {
+ font-size:1.5em;
+}
+h3 {
+ font-size:1.4em;
+}
+h4 {
+ font-size:1.3em;
+}
+h5 {
+ font-size:1.2em;
+}
+h6 {
+ font-size:1.1em;
+}
+ul {
+ list-style-type:disc;
+}
+code, tt {
+ font-size:1.2em;
+}
+dt code {
+ font-size:1.2em;
+}
+table tr td dt code {
+ font-size:1.2em;
+ vertical-align:top;
+}
+sup {
+ font-size:.6em;
+}
+/*
+Document title and Copyright styles
+*/
+.clear {
+ clear:both;
+ height:0px;
+ overflow:hidden;
+}
+.aboutLanguage {
+ float:right;
+ padding:0px 21px;
+ font-size:.8em;
+ z-index:200;
+ margin-top:-7px;
+}
+.legalCopy {
+ margin-left:.5em;
+}
+.bar a, .bar a:link, .bar a:visited, .bar a:active {
+ color:#FFFFFF;
+ text-decoration:none;
+}
+.bar a:hover, .bar a:focus {
+ color:#bb7a2a;
+}
+.tab {
+ background-color:#0066FF;
+ background-image:url(resources/titlebar.gif);
+ background-position:left top;
+ background-repeat:no-repeat;
+ color:#ffffff;
+ padding:8px;
+ width:5em;
+ font-weight:bold;
+}
+/*
+Navigation bar styles
+*/
+.bar {
+ background-image:url(resources/background.gif);
+ background-repeat:repeat-x;
+ color:#FFFFFF;
+ padding:.8em .5em .4em .8em;
+ height:auto;/*height:1.8em;*/
+ font-size:1em;
+ margin:0;
+}
+.topNav {
+ background-image:url(resources/background.gif);
+ background-repeat:repeat-x;
+ color:#FFFFFF;
+ float:left;
+ padding:0;
+ width:100%;
+ clear:right;
+ height:2.8em;
+ padding-top:10px;
+ overflow:hidden;
+}
+.bottomNav {
+ margin-top:10px;
+ background-image:url(resources/background.gif);
+ background-repeat:repeat-x;
+ color:#FFFFFF;
+ float:left;
+ padding:0;
+ width:100%;
+ clear:right;
+ height:2.8em;
+ padding-top:10px;
+ overflow:hidden;
+}
+.subNav {
+ background-color:#dee3e9;
+ border-bottom:1px solid #9eadc0;
+ float:left;
+ width:100%;
+ overflow:hidden;
+}
+.subNav div {
+ clear:left;
+ float:left;
+ padding:0 0 5px 6px;
+}
+ul.navList, ul.subNavList {
+ float:left;
+ margin:0 25px 0 0;
+ padding:0;
+}
+ul.navList li{
+ list-style:none;
+ float:left;
+ padding:3px 6px;
+}
+ul.subNavList li{
+ list-style:none;
+ float:left;
+ font-size:90%;
+}
+.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
+ color:#FFFFFF;
+ text-decoration:none;
+}
+.topNav a:hover, .bottomNav a:hover {
+ text-decoration:none;
+ color:#bb7a2a;
+}
+.navBarCell1Rev {
+ background-image:url(resources/tab.gif);
+ background-color:#a88834;
+ color:#FFFFFF;
+ margin: auto 5px;
+ border:1px solid #c9aa44;
+}
+/*
+Page header and footer styles
+*/
+.header, .footer {
+ clear:both;
+ margin:0 20px;
+ padding:5px 0 0 0;
+}
+.indexHeader {
+ margin:10px;
+ position:relative;
+}
+.indexHeader h1 {
+ font-size:1.3em;
+}
+.title {
+ color:#2c4557;
+ margin:10px 0;
+}
+.subTitle {
+ margin:5px 0 0 0;
+}
+.header ul {
+ margin:0 0 25px 0;
+ padding:0;
+}
+.footer ul {
+ margin:20px 0 5px 0;
+}
+.header ul li, .footer ul li {
+ list-style:none;
+ font-size:1.2em;
+}
+/*
+Heading styles
+*/
+div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
+ background-color:#dee3e9;
+ border-top:1px solid #9eadc0;
+ border-bottom:1px solid #9eadc0;
+ margin:0 0 6px -8px;
+ padding:2px 5px;
+}
+ul.blockList ul.blockList ul.blockList li.blockList h3 {
+ background-color:#dee3e9;
+ border-top:1px solid #9eadc0;
+ border-bottom:1px solid #9eadc0;
+ margin:0 0 6px -8px;
+ padding:2px 5px;
+}
+ul.blockList ul.blockList li.blockList h3 {
+ padding:0;
+ margin:15px 0;
+}
+ul.blockList li.blockList h2 {
+ padding:0px 0 20px 0;
+}
+/*
+Page layout container styles
+*/
+.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
+ clear:both;
+ padding:10px 20px;
+ position:relative;
+}
+.indexContainer {
+ margin:10px;
+ position:relative;
+ font-size:1.0em;
+}
+.indexContainer h2 {
+ font-size:1.1em;
+ padding:0 0 3px 0;
+}
+.indexContainer ul {
+ margin:0;
+ padding:0;
+}
+.indexContainer ul li {
+ list-style:none;
+}
+.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
+ font-size:1.1em;
+ font-weight:bold;
+ margin:10px 0 0 0;
+ color:#4E4E4E;
+}
+.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
+ margin:10px 0 10px 20px;
+}
+.serializedFormContainer dl.nameValue dt {
+ margin-left:1px;
+ font-size:1.1em;
+ display:inline;
+ font-weight:bold;
+}
+.serializedFormContainer dl.nameValue dd {
+ margin:0 0 0 1px;
+ font-size:1.1em;
+ display:inline;
+}
+/*
+List styles
+*/
+ul.horizontal li {
+ display:inline;
+ font-size:0.9em;
+}
+ul.inheritance {
+ margin:0;
+ padding:0;
+}
+ul.inheritance li {
+ display:inline;
+ list-style:none;
+}
+ul.inheritance li ul.inheritance {
+ margin-left:15px;
+ padding-left:15px;
+ padding-top:1px;
+}
+ul.blockList, ul.blockListLast {
+ margin:10px 0 10px 0;
+ padding:0;
+}
+ul.blockList li.blockList, ul.blockListLast li.blockList {
+ list-style:none;
+ margin-bottom:25px;
+}
+ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
+ padding:0px 20px 5px 10px;
+ border:1px solid #9eadc0;
+ background-color:#f9f9f9;
+}
+ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
+ padding:0 0 5px 8px;
+ background-color:#ffffff;
+ border:1px solid #9eadc0;
+ border-top:none;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
+ margin-left:0;
+ padding-left:0;
+ padding-bottom:15px;
+ border:none;
+ border-bottom:1px solid #9eadc0;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
+ list-style:none;
+ border-bottom:none;
+ padding-bottom:0;
+}
+table tr td dl, table tr td dl dt, table tr td dl dd {
+ margin-top:0;
+ margin-bottom:1px;
+}
+/*
+Table styles
+*/
+.contentContainer table, .classUseContainer table, .constantValuesContainer table {
+ border-bottom:1px solid #9eadc0;
+ width:100%;
+}
+.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {
+ width:100%;
+}
+.contentContainer .description table, .contentContainer .details table {
+ border-bottom:none;
+}
+.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{
+ vertical-align:top;
+ padding-right:20px;
+}
+.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,
+.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,
+.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,
+.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {
+ padding-right:3px;
+}
+.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
+ position:relative;
+ text-align:left;
+ background-repeat:no-repeat;
+ color:#FFFFFF;
+ font-weight:bold;
+ clear:none;
+ overflow:hidden;
+ padding:0px;
+ margin:0px;
+}
+caption a:link, caption a:hover, caption a:active, caption a:visited {
+ color:#FFFFFF;
+}
+.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
+ white-space:nowrap;
+ padding-top:8px;
+ padding-left:8px;
+ display:block;
+ float:left;
+ background-image:url(resources/titlebar.gif);
+ height:18px;
+}
+.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
+ width:10px;
+ background-image:url(resources/titlebar_end.gif);
+ background-repeat:no-repeat;
+ background-position:top right;
+ position:relative;
+ float:left;
+}
+ul.blockList ul.blockList li.blockList table {
+ margin:0 0 12px 0px;
+ width:100%;
+}
+.tableSubHeadingColor {
+ background-color: #EEEEFF;
+}
+.altColor {
+ background-color:#eeeeef;
+}
+.rowColor {
+ background-color:#ffffff;
+}
+.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
+ text-align:left;
+ padding:3px 3px 3px 7px;
+}
+th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
+ background:#dee3e9;
+ border-top:1px solid #9eadc0;
+ border-bottom:1px solid #9eadc0;
+ text-align:left;
+ padding:3px 3px 3px 7px;
+}
+td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
+ font-weight:bold;
+}
+td.colFirst, th.colFirst {
+ border-left:1px solid #9eadc0;
+ white-space:nowrap;
+}
+td.colLast, th.colLast {
+ border-right:1px solid #9eadc0;
+}
+td.colOne, th.colOne {
+ border-right:1px solid #9eadc0;
+ border-left:1px solid #9eadc0;
+}
+table.overviewSummary {
+ padding:0px;
+ margin-left:0px;
+}
+table.overviewSummary td.colFirst, table.overviewSummary th.colFirst,
+table.overviewSummary td.colOne, table.overviewSummary th.colOne {
+ width:25%;
+ vertical-align:middle;
+}
+table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
+ width:25%;
+ vertical-align:middle;
+}
+/*
+Content styles
+*/
+.description pre {
+ margin-top:0;
+}
+.deprecatedContent {
+ margin:0;
+ padding:10px 0;
+}
+.docSummary {
+ padding:0;
+}
+/*
+Formatting effect styles
+*/
+.sourceLineNo {
+ color:green;
+ padding:0 30px 0 0;
+}
+h1.hidden {
+ visibility:hidden;
+ overflow:hidden;
+ font-size:.9em;
+}
+.block {
+ display:block;
+ margin:3px 0 0 0;
+}
+.strong {
+ font-weight:bold;
+}
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="lispflowmapping">
+ <body>
+ <menu name="Overview">
+ <item name="Javadocs" href="apidocs/index.html" />
+ </menu>
+ </body>
+</project>
+
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
<artifactId>lispflowmapping-ui-module</artifactId>
<packaging>jar</packaging>
<name>LISP Flow Mapping UI - Module</name>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>
<module>module</module>
<module>bundle</module>
</modules>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
+
</project>