import org.opendaylight.lispflowmapping.implementation.dao.MappingServiceNoMaskKey;
import org.opendaylight.lispflowmapping.implementation.lisp.MapResolver;
import org.opendaylight.lispflowmapping.implementation.lisp.MapServer;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
import org.opendaylight.lispflowmapping.interfaces.dao.ILispTypeConverter;
import org.opendaylight.lispflowmapping.interfaces.dao.IQueryAll;
import org.apache.tomcat.util.buf.HexUtils;
import org.opendaylight.lispflowmapping.implementation.serializer.address.LispAddressSerializer;
import org.opendaylight.lispflowmapping.implementation.util.ByteUtil;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.implementation.util.NumberUtil;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
import org.apache.commons.lang3.BooleanUtils;
import org.opendaylight.lispflowmapping.implementation.serializer.address.LispAddressSerializer;
import org.opendaylight.lispflowmapping.implementation.util.ByteUtil;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.implementation.util.NumberUtil;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainerBuilder;
import java.nio.ByteBuffer;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
import org.opendaylight.lispflowmapping.implementation.util.ByteUtil;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.implementation.util.NumberUtil;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
import java.util.ArrayList;
import java.util.List;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafListAddress;
import java.nio.ByteBuffer;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafSegmentAddress;
import java.nio.ByteBuffer;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafSourceDestAddress;
import java.util.List;
import org.apache.commons.lang3.BooleanUtils;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
import org.opendaylight.lispflowmapping.implementation.serializer.address.factory.LispAFIAddressSerializerFactory;
import org.opendaylight.lispflowmapping.implementation.util.ByteUtil;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafTrafficEngineeringAddress;
-package org.opendaylight.lispflowmapping.implementation.serializer;
+package org.opendaylight.lispflowmapping.implementation.util;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispIpv4Address;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispIpv6Address;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.Address;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.lispflowmapping.implementation.dao.InMemoryDAO;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.interfaces.dao.IRowVisitor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.lispflowmapping.tools.junit.MockCommandInterpreter;
import org.junit.Ignore;
import org.junit.Test;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
import org.opendaylight.lispflowmapping.implementation.serializer.MapRegisterSerializer;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRegister;
import org.junit.Before;
import org.junit.Test;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.interfaces.dao.ILispTypeConverter;
import org.opendaylight.lispflowmapping.interfaces.dao.MappingEntry;
import org.opendaylight.lispflowmapping.interfaces.dao.MappingServiceRLOC;
import org.junit.Test;
import org.opendaylight.lispflowmapping.implementation.LispMappingService;
import org.opendaylight.lispflowmapping.implementation.dao.MappingServiceKeyUtil;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
import org.opendaylight.lispflowmapping.interfaces.dao.IMappingServiceKey;
import org.opendaylight.lispflowmapping.interfaces.dao.MappingServiceRLOC;
import org.junit.Test;
import org.opendaylight.lispflowmapping.implementation.LispMappingService;
import org.opendaylight.lispflowmapping.implementation.dao.MappingServiceKeyUtil;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
import org.opendaylight.lispflowmapping.implementation.serializer.MapRegisterSerializer;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
import org.opendaylight.lispflowmapping.interfaces.dao.IMappingServiceKey;
import org.opendaylight.lispflowmapping.interfaces.dao.MappingEntry;
import org.junit.Test;
import org.opendaylight.lispflowmapping.implementation.lisp.exception.LispSerializationException;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapNotify;
import org.junit.Test;
import org.opendaylight.lispflowmapping.implementation.lisp.exception.LispSerializationException;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
import org.junit.Ignore;
import org.junit.Test;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapReply;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
import org.junit.Test;
import org.opendaylight.lispflowmapping.implementation.util.ByteUtil;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRequest;
import org.junit.Test;
import org.opendaylight.lispflowmapping.implementation.lisp.exception.LispSerializationException;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
import org.opendaylight.lispflowmapping.implementation.util.ByteUtil;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv6;
import org.junit.Test;
import org.opendaylight.lispflowmapping.implementation.lisp.exception.LispSerializationException;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
import org.junit.Test;
import org.opendaylight.lispflowmapping.implementation.lisp.exception.LispSerializationException;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
import org.junit.Test;
import org.opendaylight.lispflowmapping.implementation.lisp.exception.LispSerializationException;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
import org.junit.Test;
import org.opendaylight.lispflowmapping.implementation.lisp.exception.LispSerializationException;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
import org.codehaus.jettison.json.JSONTokener;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.lispflowmapping.implementation.dao.ClusterDAOService;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
import org.opendaylight.lispflowmapping.implementation.serializer.LispMessage;
import org.opendaylight.lispflowmapping.implementation.serializer.MapNotifySerializer;
import org.opendaylight.lispflowmapping.implementation.serializer.MapRegisterSerializer;
import org.opendaylight.lispflowmapping.implementation.serializer.MapReplySerializer;
import org.opendaylight.lispflowmapping.implementation.serializer.MapRequestSerializer;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping;
import org.opendaylight.lispflowmapping.type.sbplugin.IConfigLispPlugin;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafApplicationDataBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafListBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafSegmentBuilder;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafSourceDest;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafSourceDestBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafTrafficEngineeringBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Mac;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.MacBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.NoBuilder;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.PrimitiveAddress;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecord;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecordBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.mapregisternotification.MapRegisterBuilder;
}
+ @Test
+ public void northboundRetrieveSourceDestKey() throws Exception {
+
+ org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4 address1 = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4) LispAFIConvertor
+ .toPrimitive(LispAFIConvertor.asIPAfiAddress("10.0.0.1"));
+ org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4 address2 = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4) LispAFIConvertor
+ .toPrimitive(LispAFIConvertor.asIPAfiAddress("10.0.0.2"));
+ int mask1 = 32;
+ int mask2 = 32;
+ LcafSourceDest sourceDestAddress = new LcafSourceDestBuilder().setAfi(AddressFamilyNumberEnum.LCAF.getIanaCode())
+ .setLcafType((short) LispCanonicalAddressFormatEnum.SOURCE_DEST.getLispCode())
+ .setSrcAddress(new SrcAddressBuilder().setPrimitiveAddress(address1).build()).setSrcMaskLength((short) mask1)
+ .setDstAddress(new DstAddressBuilder().setPrimitiveAddress(address2).build()).setDstMaskLength((short) mask2).build();
+ String pass = "asdf";
+
+ lms.addAuthenticationKey(LispAFIConvertor.toContainer(sourceDestAddress), mask1, pass);
+
+ // URL url = createGetKeyIPv4URL(address1, mask1);
+ URL url = createGetKeySourceDestURL(address1.getAfi(), ((LispIpv4Address) sourceDestAddress.getSrcAddress().getPrimitiveAddress())
+ .getIpv4Address().getValue(), sourceDestAddress.getSrcMaskLength(), ((LispIpv4Address) sourceDestAddress.getDstAddress()
+ .getPrimitiveAddress()).getIpv4Address().getValue(), sourceDestAddress.getDstMaskLength());
+ String reply = callURL("GET", null, "application/json", null, url);
+ JSONTokener jt = new JSONTokener(reply);
+ JSONObject json = new JSONObject(jt);
+
+ // test that the password matches what was we expected.
+ assertEquals(pass, json.get("key"));
+
+ }
+
@Test
public void northboundRetrieveKey() throws Exception {
@Test
public void northboundRetrieveMapping() throws Exception {
-
- String pass = "";
LispIpv4Address eid = LispAFIConvertor.asIPAfiAddress("10.0.0.1");
int mask = 32;
LispIpv4Address rloc = LispAFIConvertor.asIPAfiAddress("20.0.0.2");
}
+ @Test
+ public void northboundRetrieveSourceDestMapping() throws Exception {
+
+ org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4 address1 = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4) LispAFIConvertor
+ .toPrimitive(LispAFIConvertor.asIPAfiAddress("10.0.0.1"));
+ org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4 address2 = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4) LispAFIConvertor
+ .toPrimitive(LispAFIConvertor.asIPAfiAddress("10.0.0.2"));
+ int mask1 = 32;
+ int mask2 = 32;
+ LcafSourceDest sourceDestAddress = new LcafSourceDestBuilder().setAfi(AddressFamilyNumberEnum.LCAF.getIanaCode())
+ .setLcafType((short) LispCanonicalAddressFormatEnum.SOURCE_DEST.getLispCode())
+ .setSrcAddress(new SrcAddressBuilder().setPrimitiveAddress(address1).build()).setSrcMaskLength((short) mask1)
+ .setDstAddress(new DstAddressBuilder().setPrimitiveAddress(address2).build()).setDstMaskLength((short) mask2).build();
+ LispIpv4Address rloc = LispAFIConvertor.asIPAfiAddress("20.0.0.2");
+
+ // Insert mapping in the database
+ MapRegisterBuilder mapRegister = new MapRegisterBuilder();
+ EidToLocatorRecordBuilder etlr = new EidToLocatorRecordBuilder();
+ etlr.setLispAddressContainer(LispAFIConvertor.toContainer(sourceDestAddress));
+ etlr.setMaskLength((short) mask1);
+ etlr.setRecordTtl(254);
+ etlr.setAuthoritative(false);
+ etlr.setAction(Action.NoAction);
+ LocatorRecordBuilder record = new LocatorRecordBuilder();
+ record.setLispAddressContainer(LispAFIConvertor.toContainer(rloc));
+ record.setRouted(true);
+ etlr.setLocatorRecord(new ArrayList<LocatorRecord>());
+ etlr.getLocatorRecord().add(record.build());
+ mapRegister.setEidToLocatorRecord(new ArrayList<EidToLocatorRecord>());
+ mapRegister.getEidToLocatorRecord().add(etlr.build());
+ lms.handleMapRegister(mapRegister.build());
+
+ // Get mapping using NB interface. No IID used
+ URL url = createGetMappingSourceDestURL(address1.getAfi(), address1.getIpv4Address().getValue(), mask1, address2.getIpv4Address().getValue(),
+ mask2);
+ String reply = callURL("GET", null, "application/json", null, url);
+ JSONTokener jt = new JSONTokener(reply);
+ JSONObject json = new JSONObject(jt);
+
+ // With just one locator, locators is not a JSONArray
+ String rlocRetrieved = json.getJSONObject("locators").getJSONObject("locatorGeneric").getString("ipAddress");
+
+ assertEquals(rloc.getIpv4Address().getValue(), rlocRetrieved);
+
+ }
+
private URL createGetKeyIPv4URL(LispIpv4Address address, int mask) throws MalformedURLException {
String restUrl = String.format("http://localhost:8080/lispflowmapping/default/%s/%d/%s/%d", "key", address.getAfi().shortValue(), address
.getIpv4Address().getValue(), mask);
return url;
}
+ private URL createGetKeySourceDestURL(int afi, String srcAddress, int srcMask, String dstAddress, int dstMask) throws MalformedURLException {
+ String restUrl = String.format("http://localhost:8080/lispflowmapping/default/%s/%d/%s/%d/%s/%d", "key", afi, srcAddress, srcMask,
+ dstAddress, dstMask);
+ URL url = new URL(restUrl);
+ return url;
+ }
+
+ private URL createGetMappingSourceDestURL(int afi, String srcAddress, int srcMask, String dstAddress, int dstMask) throws MalformedURLException {
+ String restUrl = String.format("http://localhost:8080/lispflowmapping/default/%s/%d/%s/%d/%s/%d", "mapping", afi, srcAddress, srcMask,
+ dstAddress, dstMask);
+ URL url = new URL(restUrl);
+ return url;
+ }
+
private URL createGetMappingIPv4URL(int iid, LispIpv4Address address, int mask) throws MalformedURLException {
String restUrl = String.format("http://localhost:8080/lispflowmapping/default/%s/%d/%d/%s/%d", "mapping", iid, address.getAfi().shortValue(),
address.getIpv4Address().getValue(), mask);
org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest,
org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequestnotification,
org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.mapregisternotification,
+ org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafsourcedestaddress,
+ org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress,
+ org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress,
+ org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924,
org.opendaylight.lispflowmapping.type,
org.opendaylight.lispflowmapping.type.lisp,
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapNotify;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapReply;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainer;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.slf4j.Logger;
return legacyRecord;
}
- // /**
- // * Retrieve a mapping from the LISP mapping system, using
- // Source-Destination
- // * LCAF as EID
- // *
- // * @param containerName
- // * name of the container context from which the mapping is going
- // * to be retrieved
- // * @param iid
- // * Instance-ID of the addresses (0 if none)
- // *
- // * @param afi
- // * Address Family of the addresses (IPv4, IPv6 or MAC)
- // *
- // * @param srcAdd
- // * Source address of type defined by afi
- // *
- // * @param srcML
- // * Network mask length of the source address
- // *
- // * @param dstAdd
- // * Destination address of type defined by afi
- // *
- // * @param dstML
- // * Network mask length of the destination address
- // *
- // * @return EidToLocatorRecord as a JSON object
- // *
- // * <pre>
- // * Example:
- // *
- // * Request URL:
- // *
- // http://localhost:8080/lispflowmapping/default/mapping/0/1/10.0.0.1/32/20.0.0.2/32
- // *
- // * </pre>
- // */
- //
- // @Path("/{containerName}/mapping/{iid}/{afi}/{srcAdd}/{srcML}/{dstAdd}/{dstML}")
- // @GET
- // @Produces(MediaType.APPLICATION_JSON)
- // @StatusCodes({ @ResponseCode(code = 401, condition =
- // "User not authorized to perform this operation"),
- // @ResponseCode(code = 404, condition =
- // "The containerName passed was not found"),
- // @ResponseCode(code = 503, condition = "Service unavailable") })
- // public EidToLocatorRecord getMapping(@PathParam("containerName") String
- // containerName, @PathParam("iid") int iid, @PathParam("afi") int afi,
- // @PathParam("srcAdd") String srcAdd, @PathParam("srcML") int srcML,
- // @PathParam("dstAdd") String dstAdd, @PathParam("dstML") int dstML) {
- //
- // handleContainerDoesNotExist(containerName);
- //
- // authorizationCheck(containerName, Privilege.READ);
- //
- // LispAddressGeneric srcGeneric = new LispAddressGeneric(afi, srcAdd);
- // LispAddressGeneric dstGeneric = new LispAddressGeneric(afi, dstAdd);
- //
- // if (iid != 0) {
- // srcGeneric = new
- // LispAddressGeneric(AddressFamilyNumberEnum.LCAF.getIanaCode(),
- // srcGeneric);
- // srcGeneric.setLcafType(LispCanonicalAddressFormatEnum.SEGMENT.getLispCode());
- // srcGeneric.setInstanceId(iid);
- //
- // dstGeneric = new
- // LispAddressGeneric(AddressFamilyNumberEnum.LCAF.getIanaCode(),
- // dstGeneric);
- // dstGeneric.setLcafType(LispCanonicalAddressFormatEnum.SEGMENT.getLispCode());
- // dstGeneric.setInstanceId(iid);
- // }
- //
- // LispAddressGeneric eidGeneric = new
- // LispAddressGeneric(AddressFamilyNumberEnum.LCAF.getIanaCode());
- //
- // eidGeneric.setLcafType(LispCanonicalAddressFormatEnum.SOURCE_DEST.getLispCode());
- // eidGeneric.setSrcAddress(srcGeneric);
- // eidGeneric.setSrcMaskLength((byte) srcML);
- // eidGeneric.setDstAddress(dstGeneric);
- // eidGeneric.setDstMaskLength((byte) dstML);
- //
- // int mask = 0; //Not used here
- //
- // EidToLocatorRecord record = lookupEID(containerName, mask,
- // LispAddressConvertorNB.convertToLispAddress(eidGeneric));
- //
- // LispAddressConvertorNB.convertRecordToGenericAddress(record);
- //
- // return record;
- // }
+ /**
+ * Retrieve a mapping from the LISP mapping system, using Source-Destination
+ * LCAF as EID
+ *
+ * @param containerName
+ * name of the container context from which the mapping is going
+ * to be retrieved
+ * @param iid
+ * Instance-ID of the addresses (0 if none)
+ *
+ * @param afi
+ * Address Family of the addresses (IPv4, IPv6 or MAC)
+ *
+ * @param srcAdd
+ * Source address of type defined by afi
+ *
+ * @param srcML
+ * Network mask length of the source address
+ *
+ * @param dstAdd
+ * Destination address of type defined by afi
+ *
+ * @param dstML
+ * Network mask length of the destination address
+ *
+ * @return EidToLocatorRecord as a JSON object
+ *
+ * <pre>
+ * Example:
+ *
+ * Request URL:
+ *
+ * http://localhost:8080/lispflowmapping/default/mapping/0/1/10.0.0.1/32/20.0.0.2/32
+ *
+ * </pre>
+ */
+
+ @Path("/{containerName}/mapping/{afi}/{srcAdd}/{srcML}/{dstAdd}/{dstML}")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @StatusCodes({ @ResponseCode(code = 401, condition = "User not authorized to perform this operation"),
+ @ResponseCode(code = 404, condition = "The containerName passed was not found"),
+ @ResponseCode(code = 503, condition = "Service unavailable") })
+ public org.opendaylight.lispflowmapping.type.lisp.EidToLocatorRecord getMapping(@PathParam("containerName") String containerName,
+ @PathParam("afi") int afi, @PathParam("srcAdd") String srcAdd, @PathParam("srcML") int srcML, @PathParam("dstAdd") String dstAdd,
+ @PathParam("dstML") int dstML) {
+
+ handleContainerDoesNotExist(containerName);
+
+ authorizationCheck(containerName, Privilege.READ);
+
+ LispAddressGeneric srcGeneric = new LispAddressGeneric(afi, srcAdd);
+ LispAddressGeneric dstGeneric = new LispAddressGeneric(afi, dstAdd);
+
+ LispAddressGeneric eidGeneric = new LispAddressGeneric(AddressFamilyNumberEnum.LCAF.getIanaCode());
+
+ eidGeneric.setLcafType(LispCanonicalAddressFormatEnum.SOURCE_DEST.getLispCode());
+ eidGeneric.setSrcAddress(srcGeneric);
+ eidGeneric.setSrcMaskLength((byte) srcML);
+ eidGeneric.setDstAddress(dstGeneric);
+ eidGeneric.setDstMaskLength((byte) dstML);
+
+ int mask = 0; // Not used here
+
+ EidToLocatorRecord record = lookupEID(containerName, mask, LispAddressConvertorNB.convertToLispAddress(eidGeneric));
+
+ org.opendaylight.lispflowmapping.type.lisp.EidToLocatorRecord legacyRecord = YangTransformerNB.reTransformEidToLocatorRecord(record);
+ LispAddressConvertorNB.convertRecordToGenericAddress(legacyRecord);
+
+ return legacyRecord;
+ }
/**
* Set the authentication key for an EID prefix
return authKeyNB;
}
- // /**
- // * Retrieve a key used to register a Source-Destination LCAF EID prefix
- // *
- // * @param containerName
- // * name of the container context from which the key is going to
- // * be retrieved
- // *
- // * @param afi
- // * Address Family of the addresses (IPv4, IPv6 or MAC)
- // *
- // * @param srcAdd
- // * Source address of type defined by afi
- // *
- // * @param srcML
- // * Network mask length of the source address
- // *
- // * @param dstAdd
- // * Destination address of type defined by afi
- // *
- // * @param dstML
- // * Network mask length of the destination address
- // *
- // * @return AuthKeyNB as a JSON object
- // *
- // * <pre>
- // * Example:
- // *
- // * Request URL:
- // *
- // http://localhost:8080/lispflowmapping/default/key/1/10.0.0.1/32/20.0.0.2/32
- // *
- // * </pre>
- // */
- //
- // @Path("/{containerName}/key/{afi}/{srcAdd}/{srcML}/{dstAdd}/{dstML}")
- // @GET
- // @Produces(MediaType.APPLICATION_JSON)
- // @StatusCodes({ @ResponseCode(code = 401, condition =
- // "User not authorized to perform this operation"),
- // @ResponseCode(code = 404, condition =
- // "The containerName passed was not found"),
- // @ResponseCode(code = 503, condition = "Service unavailable") })
- // public AuthKeyNB getAuthKey(@PathParam("containerName") String
- // containerName, @PathParam("afi") int afi, @PathParam("srcAdd") String
- // srcAdd,
- // @PathParam("srcML") int srcML, @PathParam("dstAdd") String dstAdd,
- // @PathParam("dstML") int dstML) {
- //
- // handleContainerDoesNotExist(containerName);
- //
- // authorizationCheck(containerName, Privilege.READ);
- //
- // LispAddressGeneric srcGeneric = new LispAddressGeneric(afi, srcAdd);
- // LispAddressGeneric dstGeneric = new LispAddressGeneric(afi, dstAdd);
- //
- // LispAddressGeneric lispAddressGeneric = new
- // LispAddressGeneric(AddressFamilyNumberEnum.LCAF.getIanaCode());
- //
- // lispAddressGeneric.setLcafType(LispCanonicalAddressFormatEnum.SOURCE_DEST.getLispCode());
- // lispAddressGeneric.setSrcAddress(srcGeneric);
- // lispAddressGeneric.setSrcMaskLength((byte) srcML);
- // lispAddressGeneric.setDstAddress(dstGeneric);
- // lispAddressGeneric.setDstMaskLength((byte) dstML);
- //
- // LispAddress lispAddress =
- // LispAddressConvertorNB.convertToLispAddress(lispAddressGeneric);
- //
- // INorthboundService nbService = (INorthboundService)
- // ServiceHelper.getInstance(INorthboundService.class, containerName, this);
- //
- // int mask = 0; //Not used here
- //
- // String key =
- // nbService.getMappingService().getAuthenticationKey(lispAddress, mask);
- //
- // if (key == null) {
- // return null;
- // }
- //
- // AuthKeyNB authKeyNB = new AuthKeyNB();
- //
- // authKeyNB.setKey(key);
- // authKeyNB.setAddress(lispAddressGeneric);
- // authKeyNB.setMaskLength(mask);
- //
- // return authKeyNB;
- // }
+ /**
+ * Retrieve a key used to register a Source-Destination LCAF EID prefix
+ *
+ * @param containerName
+ * name of the container context from which the key is going to
+ * be retrieved
+ *
+ * @param afi
+ * Address Family of the addresses (IPv4, IPv6 or MAC)
+ *
+ * @param srcAdd
+ * Source address of type defined by afi
+ *
+ * @param srcML
+ * Network mask length of the source address
+ *
+ * @param dstAdd
+ * Destination address of type defined by afi
+ *
+ * @param dstML
+ * Network mask length of the destination address
+ *
+ * @return AuthKeyNB as a JSON object
+ *
+ * <pre>
+ * Example:
+ *
+ * Request URL:
+ *
+ * http://localhost:8080/lispflowmapping/default/key/1/10.0.0.1/32/20.0.0.2/32
+ *
+ * </pre>
+ */
+
+ @Path("/{containerName}/key/{afi}/{srcAdd}/{srcML}/{dstAdd}/{dstML}")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @StatusCodes({ @ResponseCode(code = 401, condition = "User not authorized to perform this operation"),
+ @ResponseCode(code = 404, condition = "The containerName passed was not found"),
+ @ResponseCode(code = 503, condition = "Service unavailable") })
+ public AuthKeyNB getAuthKey(@PathParam("containerName") String containerName, @PathParam("afi") int afi, @PathParam("srcAdd") String srcAdd,
+ @PathParam("srcML") int srcML, @PathParam("dstAdd") String dstAdd, @PathParam("dstML") int dstML) {
+
+ handleContainerDoesNotExist(containerName);
+
+ authorizationCheck(containerName, Privilege.READ);
+
+ LispAddressGeneric srcGeneric = new LispAddressGeneric(afi, srcAdd);
+ LispAddressGeneric dstGeneric = new LispAddressGeneric(afi, dstAdd);
+
+ LispAddressGeneric lispAddressGeneric = new LispAddressGeneric(AddressFamilyNumberEnum.LCAF.getIanaCode());
+
+ lispAddressGeneric.setLcafType(LispCanonicalAddressFormatEnum.SOURCE_DEST.getLispCode());
+ lispAddressGeneric.setSrcAddress(srcGeneric);
+ lispAddressGeneric.setSrcMaskLength((byte) srcML);
+ lispAddressGeneric.setDstAddress(dstGeneric);
+ lispAddressGeneric.setDstMaskLength((byte) dstML);
+
+ LispAddress lispAddress = LispAddressConvertorNB.convertToLispAddress(lispAddressGeneric);
+
+ ILispmappingNorthbound nbService = (ILispmappingNorthbound) ServiceHelper.getInstance(ILispmappingNorthbound.class, containerName, this);
+
+ int mask = 0; // Not used here
+
+ LispAddressContainer yangAddress = YangTransformerNB.transformLispAddress(lispAddress);
+
+ String key = nbService.getMappingService().getAuthenticationKey(yangAddress, mask);
+
+ if (key == null) {
+ return null;
+ }
+
+ AuthKeyNB authKeyNB = new AuthKeyNB();
+
+ authKeyNB.setKey(key);
+ authKeyNB.setAddress(lispAddressGeneric);
+ authKeyNB.setMaskLength(mask);
+
+ return authKeyNB;
+ }
/**
* Delete the key used to register an EID prefix
import java.util.Iterator;
import java.util.List;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LcafSourceDestAddress;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispAFIAddress;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispLcafAddress;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRegister;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.MapRequest;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidrecords.EidRecordBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecord.Action;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.eidtolocatorrecords.EidToLocatorRecordBuilder;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafsourcedestaddress.DstAddressBuilder;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lcafsourcedestaddress.SrcAddressBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainer;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.LispAddressContainerBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.Address;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.AS;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.ASBuilder;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.DistinguishedName;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv4;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv4Builder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv6;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv6Builder;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafSegment;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafSourceDest;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.LcafSourceDestBuilder;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Mac;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.NoBuilder;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.PrimitiveAddress;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.DistinguishedNameBuilder;
+import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.MacBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecord;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.locatorrecords.LocatorRecordBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.mapregisternotification.MapRegisterBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequest.SourceEidBuilder;
import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.maprequestnotification.MapRequestBuilder;
import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
+import org.opendaylight.lispflowmapping.type.LispCanonicalAddressFormatEnum;
import org.opendaylight.lispflowmapping.type.lisp.EidRecord;
import org.opendaylight.lispflowmapping.type.lisp.MapReplyAction;
import org.opendaylight.lispflowmapping.type.lisp.address.LispASAddress;
import org.opendaylight.lispflowmapping.type.lisp.address.LispAddress;
import org.opendaylight.lispflowmapping.type.lisp.address.LispIpv4Address;
import org.opendaylight.lispflowmapping.type.lisp.address.LispIpv6Address;
+import org.opendaylight.lispflowmapping.type.lisp.address.LispLCAFAddress;
+import org.opendaylight.lispflowmapping.type.lisp.address.LispSourceDestLCAFAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
import org.slf4j.Logger;
lispAFIAddress = new Ipv6Builder().setIpv6Address(ipv6Address).setAfi(ianaCode).build();
break;
case LCAF:
+ LispLCAFAddress lcafAddress = (LispLCAFAddress) lispAddress;
+ switch (lcafAddress.getType()) {
+ case SOURCE_DEST:
+ LispSourceDestLCAFAddress sourceDest = (LispSourceDestLCAFAddress) lcafAddress;
+ LcafSourceDestBuilder SourceDestBuider = new LcafSourceDestBuilder();
+ SourceDestBuider
+ .setAfi(AddressFamilyNumberEnum.LCAF.getIanaCode())
+ .setLcafType((short) LispCanonicalAddressFormatEnum.SOURCE_DEST.getLispCode())
+ .setSrcMaskLength((short) sourceDest.getSrcMaskLength())
+ .setDstMaskLength((short) sourceDest.getDstMaskLength())
+ .setSrcAddress(
+ new SrcAddressBuilder().setPrimitiveAddress(
+ toPrimitive((LispAFIAddress) transformLispAddress(sourceDest.getSrcAddress()).getAddress())).build())
+ .setDstAddress(
+ new DstAddressBuilder().setPrimitiveAddress(
+ toPrimitive((LispAFIAddress) transformLispAddress(sourceDest.getDstAddress()).getAddress())).build());
+ lispAFIAddress = SourceDestBuider.build();
+ break;
+
+ default:
+ break;
+ }
break;
case MAC:
break;
org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispIpv6Address lispIpv6Address = (org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.LispIpv6Address) address;
legacyAddres = new LispIpv6Address(lispIpv6Address.getIpv6Address().getValue());
break;
+ case 16387:
+ LispLcafAddress lcafAddress = (LispLcafAddress) address;
+ short lcafType = lcafAddress.getLcafType();
+ switch (lcafType) {
+ case 12:
+ LcafSourceDest yangSourceDest = (LcafSourceDest) lcafAddress;
+ LispSourceDestLCAFAddress sourceDest = new LispSourceDestLCAFAddress((byte) 0);
+ sourceDest.setSrcAddress(transformToLispAddress(toContainer(toNonPrimitive(yangSourceDest.getSrcAddress().getPrimitiveAddress()))));
+ sourceDest.setDstAddress(transformToLispAddress(toContainer(toNonPrimitive(yangSourceDest.getDstAddress().getPrimitiveAddress()))));
+ sourceDest.setSrcMaskLength(yangSourceDest.getSrcMaskLength().byteValue());
+ sourceDest.setDstMaskLength(yangSourceDest.getDstMaskLength().byteValue());
+ legacyAddres = sourceDest;
+ break;
+
+ default:
+ break;
+ }
default:
break;
}
+ public static PrimitiveAddress toPrimitive(LispAFIAddress address) {
+ if (address instanceof Ipv4) {
+ return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4Builder()
+ .setIpv4Address(((Ipv4) address).getIpv4Address()).setAfi(address.getAfi()).build();
+ }
+ if (address instanceof Ipv6) {
+ return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv6Builder()
+ .setIpv6Address(((Ipv6) address).getIpv6Address()).setAfi(address.getAfi()).build();
+ }
+ if (address instanceof Mac) {
+ return new MacBuilder().setAfi(address.getAfi()).setMacAddress(((Mac) address).getMacAddress()).build();
+ }
+ if (address instanceof DistinguishedName) {
+ return new DistinguishedNameBuilder().setAfi(address.getAfi()).setDistinguishedName(((DistinguishedName) address).getDistinguishedName())
+ .build();
+ }
+ return null;
+ }
+
+ public static LispAFIAddress toNonPrimitive(PrimitiveAddress address) {
+ if (address instanceof org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4) {
+ return new Ipv4Builder()
+ .setIpv4Address(
+ ((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv4) address)
+ .getIpv4Address()).setAfi(((LispAFIAddress) address).getAfi()).build();
+ }
+ if (address instanceof org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv6) {
+ return new Ipv6Builder()
+ .setIpv6Address(
+ ((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Ipv6) address)
+ .getIpv6Address()).setAfi(((LispAFIAddress) address).getAfi()).build();
+ }
+ if (address instanceof org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Mac) {
+ return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.MacBuilder()
+ .setAfi(((LispAFIAddress) address).getAfi())
+ .setMacAddress(
+ ((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.Mac) address).getMacAddress())
+ .build();
+ }
+ if (address instanceof org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.DistinguishedName) {
+ return new org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.DistinguishedNameBuilder()
+ .setAfi(((LispAFIAddress) address).getAfi())
+ .setDistinguishedName(
+ ((org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispsimpleaddress.primitiveaddress.DistinguishedName) address)
+ .getDistinguishedName()).build();
+ }
+ return null;
+ }
+
}
import org.junit.Ignore;
import org.junit.Test;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.lispflowmapping.implementation.serializer.LispAFIConvertor;
import org.opendaylight.lispflowmapping.implementation.serializer.LispMessage;
import org.opendaylight.lispflowmapping.implementation.serializer.LispMessageEnum;
import org.opendaylight.lispflowmapping.implementation.serializer.MapNotifySerializer;
import org.opendaylight.lispflowmapping.implementation.serializer.MapReplySerializer;
import org.opendaylight.lispflowmapping.implementation.util.ByteUtil;
+import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
import org.opendaylight.lispflowmapping.implementation.util.MapNotifyBuilderHelper;
import org.opendaylight.lispflowmapping.southbound.lisp.exception.LispMalformedPacketException;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
leaf dstMaskLength {
type uint8;
}
- leaf reserved {
- type int16;
- }
}
grouping LcafApplicationDataAddress {