use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4PrefixBuilder in project lispflowmapping by opendaylight.
the class SourceDestKeyHelperTest method getSrcTest_sourceDestKey.
/**
* Tests {@link SourceDestKeyHelper#getSrc} method with SourceDestKey address type.
*/
@Test
public void getSrcTest_sourceDestKey() {
final Eid expectedResult = new EidBuilder().setAddress(new Ipv4PrefixBuilder().setIpv4Prefix(IPV4_PREFIX_SOURCE).build()).setVirtualNetworkId(INSTANCE_ID).setAddressType(Ipv4PrefixAfi.class).build();
assertEquals(expectedResult, SourceDestKeyHelper.getSrc(EID_SOURCE_DEST_KEY));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4PrefixBuilder in project lispflowmapping by opendaylight.
the class LispAddressUtil method toEid.
public static Eid toEid(Ipv4Prefix prefix, InstanceIdType vni) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv4PrefixAfi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress((Address) new Ipv4PrefixBuilder().setIpv4Prefix(prefix).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4PrefixBuilder in project lispflowmapping by opendaylight.
the class LispAddressUtil method asIpv4PrefixEid.
public static Eid asIpv4PrefixEid(Eid eid, Inet4Address address, short mask) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv4PrefixAfi.class);
builder.setVirtualNetworkId(eid.getVirtualNetworkId());
builder.setAddress(new Ipv4PrefixBuilder().setIpv4Prefix(IetfInetUtil.INSTANCE.ipv4PrefixFor(address, mask)).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4PrefixBuilder in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method registerAndQuery__SegmentLCAF.
public void registerAndQuery__SegmentLCAF() throws SocketTimeoutException {
cleanUP();
String ipString = "10.20.255.30";
int instanceId = 6;
EidBuilder eb = new EidBuilder();
eb.setAddressType(Ipv4PrefixAfi.class);
eb.setVirtualNetworkId(new InstanceIdType((long) instanceId));
eb.setAddress(new Ipv4PrefixBuilder().setIpv4Prefix(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix(ipString)).build());
MapReply reply = registerAddressAndQuery(eb.build());
Eid receivedAddress = reply.getMappingRecordItem().get(0).getMappingRecord().getEid();
assertEquals(Ipv4PrefixAfi.class, receivedAddress.getAddressType());
assertEquals(ipString, ((Ipv4Prefix) receivedAddress.getAddress()).getIpv4Prefix().getValue());
assertEquals(instanceId, receivedAddress.getVirtualNetworkId().getValue().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4PrefixBuilder in project lispflowmapping by opendaylight.
the class SourceDestKeyHelperTest method getDstTest_sourceDestKey.
/**
* Tests {@link SourceDestKeyHelper#getDst} method with SourceDestKey address type.
*/
@Test
public void getDstTest_sourceDestKey() {
final Eid expectedResult = new EidBuilder().setAddress(new Ipv4PrefixBuilder().setIpv4Prefix(IPV4_PREFIX_DEST).build()).setVirtualNetworkId(INSTANCE_ID).setAddressType(Ipv4PrefixAfi.class).build();
assertEquals(expectedResult, SourceDestKeyHelper.getDst(EID_SOURCE_DEST_KEY));
}
Aggregations