use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method testNonProxyOtherPort.
public void testNonProxyOtherPort() throws SocketTimeoutException, SocketException {
cleanUP();
String rloc = "127.0.0.3";
int port = 4350;
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(ApplicationDataLcaf.class);
rb.setVirtualNetworkId(null);
rb.setAddress(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ApplicationDataBuilder().setApplicationData(new ApplicationDataBuilder().setAddress(new SimpleAddress(new IpAddress(new Ipv4Address(rloc)))).setLocalPortLow(new PortNumber(port)).build()).build());
Rloc adLcaf = rb.build();
LOG.info("testNonProxyOtherPort:" + LispAddressStringifier.getString(adLcaf));
sendProxyMapRequest(rloc, port, adLcaf);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method registerSBMapping.
private void registerSBMapping(long iid, String prefix, String locator) {
LOG.debug("Registering Southbound mapping in VNI {} for prefix {}, locator {}" + " via simulated Map-Register a.k.a. handleMapRegister()", iid, prefix, locator);
Eid eid = LispAddressUtil.asIpv4PrefixBinaryEid(iid, prefix);
Rloc rloc = LispAddressUtil.asIpv4Rloc(locator);
MapRegister mr = MappingServiceIntegrationTestUtil.getDefaultMapRegisterBuilder(eid, rloc).build();
lms.handleMapRegister(mr);
sleepForMilliseconds(100);
MappingServiceIntegrationTestUtil.printMapCacheState(mapService);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method testSimpleNonProxy.
public void testSimpleNonProxy() throws SocketTimeoutException, SocketException {
cleanUP();
String rloc = "127.0.0.3";
int port = LispMessage.PORT_NUM;
Rloc ipRloc = LispAddressUtil.asIpv4Rloc(rloc);
sendProxyMapRequest(rloc, port, ipRloc);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method newSubscriber.
private static Subscriber newSubscriber(Eid srcEid, String srcRlocIp) {
final int timeout = 5;
final Rloc srcRloc = LispAddressUtil.asIpv4Rloc(srcRlocIp);
return new Subscriber(srcRloc, srcEid, timeout);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTestUtil method getDefaultMappingRecordBuilder.
/**
* Create a default MappingRecordBuilder object.
*
* @param eid EID for the mapping record, if null, a default will be added
* @param rlocs RLOCs for the mapping record, if null, no locator record will be added
* @return the MappingRecordBuilder object
*/
static MappingRecordBuilder getDefaultMappingRecordBuilder(Eid eid, List<Rloc> rlocs) {
if (eid == null) {
eid = DEFAULT_IPV4_EID_PREFIX;
LOG.warn("getDefaultMappingRecordBuilder(): null EID received, using the default {}", DEFAULT_IPV4_EID_STRING);
}
MappingRecordBuilder mrb = new MappingRecordBuilder().setEid(eid).setAction(MappingRecord.Action.NoAction).setAuthoritative(false).setLocatorRecord(new ArrayList<>()).setMapVersion((short) 0).setRecordTtl(60).setSiteId(DEFAULT_SITE_ID).setXtrId(DEFAULT_XTR_ID).setTimestamp(System.currentTimeMillis());
// We want to allow for empty locator records, so we only add one if rloc is not null
if (rlocs != null) {
for (Rloc rloc : rlocs) {
mrb.getLocatorRecord().add(getDefaultLocatorBuilder(rloc).build());
}
}
return mrb;
}
Aggregations