use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.inet.binary.types.rev160303.Ipv4AddressBinary in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getTransportAddressFromRlocTest_withIpv4AddressBinary.
/**
* Tests {@link LispNotificationHelper#getTransportAddressFromRloc} method with Ipv4AddressBinary type address.
*/
@Test
public void getTransportAddressFromRlocTest_withIpv4AddressBinary() {
final TransportAddress result = new TransportAddressBuilder().setIpAddress(new IpAddressBinary(ADDRESS_IPV4_BINARY)).setPort(new PortNumber(LispMessage.PORT_NUM)).build();
assertEquals(result, LispNotificationHelper.getTransportAddressFromRloc(RLOC_IPV4_BINARY));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.inet.binary.types.rev160303.Ipv4AddressBinary in project lispflowmapping by opendaylight.
the class LispAddressUtil method asIpv4PrefixBinaryEid.
public static Eid asIpv4PrefixBinaryEid(InstanceIdType vni, byte[] address, short mask) {
Preconditions.checkArgument(address.length == 4, "asIpv4PrefixBinaryEid called with incorrect length byte array ({})", address.length);
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv4PrefixBinaryAfi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress(new Ipv4PrefixBinaryBuilder().setIpv4AddressBinary(new Ipv4AddressBinary(address)).setIpv4MaskLength(mask).build());
return builder.build();
}
Aggregations