use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method ipAddressToByteArray_ipv4.
/**
* Tests {@link LispAddressUtil#ipAddressToByteArray(Address)} method with ipv4 value.
*/
@Test
public void ipAddressToByteArray_ipv4() {
final Ipv4 expectedIpv4 = new Ipv4Builder().setIpv4(IPV4_ADDRESS_TEST).build();
final byte[] testedAddress = LispAddressUtil.ipAddressToByteArray(expectedIpv4);
assertArrayEquals(IPV4_ADDRESS_BYTES_A_TEST, testedAddress);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder in project lispflowmapping by opendaylight.
the class LispAddressUtil method toRloc.
public static Rloc toRloc(Ipv4Address address) {
RlocBuilder builder = new RlocBuilder();
builder.setAddressType(Ipv4Afi.class);
builder.setVirtualNetworkId(null);
builder.setAddress((Address) new Ipv4Builder().setIpv4(address).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.Ipv4Builder in project lispflowmapping by opendaylight.
the class Ipv4Serializer method deserializeEidData.
@Override
protected Eid deserializeEidData(ByteBuffer buffer, LispAddressSerializerContext ctx) {
EidBuilder eb = new EidBuilder();
eb.setAddressType(Ipv4Afi.class);
eb.setVirtualNetworkId(getVni(ctx));
eb.setAddress(new Ipv4Builder().setIpv4(deserializeData(buffer)).build());
return eb.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder in project lispflowmapping by opendaylight.
the class Ipv4Serializer method deserializeRlocData.
@Override
protected Rloc deserializeRlocData(ByteBuffer buffer) {
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(Ipv4Afi.class);
rb.setVirtualNetworkId(null);
rb.setAddress(new Ipv4Builder().setIpv4(deserializeData(buffer)).build());
return rb.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder in project lispflowmapping by opendaylight.
the class LispAddressUtil method toEid.
public static Eid toEid(Ipv4Address address, InstanceIdType vni) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv4Afi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress((Address) new Ipv4Builder().setIpv4(address).build());
return builder.build();
}
Aggregations