use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder in project lispflowmapping by opendaylight.
the class Ipv6Serializer method deserializeEidData.
@Override
protected Eid deserializeEidData(ByteBuffer buffer, LispAddressSerializerContext ctx) {
EidBuilder eb = new EidBuilder();
eb.setAddressType(Ipv6Afi.class);
eb.setVirtualNetworkId(getVni(ctx));
eb.setAddress(new Ipv6Builder().setIpv6(deserializeData(buffer)).build());
return eb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder in project lispflowmapping by opendaylight.
the class NoAddressSerializer method deserializeEidData.
@Override
protected Eid deserializeEidData(ByteBuffer buffer, LispAddressSerializerContext ctx) {
EidBuilder eb = new EidBuilder();
eb.setAddressType(NoAddressAfi.class);
eb.setVirtualNetworkId(getVni(ctx));
eb.setAddress(new NoAddressBuilder().setNoAddress(true).build());
return eb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder in project lispflowmapping by opendaylight.
the class ServicePathSerializer method deserializeLcafEidData.
@Override
protected Eid deserializeLcafEidData(ByteBuffer buffer, byte res2, short length, LispAddressSerializerContext ctx) {
EidBuilder eb = new EidBuilder();
eb.setAddressType(ServicePathLcaf.class);
eb.setVirtualNetworkId(getVni(ctx));
eb.setAddress(deserializeData(buffer));
return eb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder 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.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method registerAndQuery__ListLCAF.
public void registerAndQuery__ListLCAF() throws SocketTimeoutException {
cleanUP();
String macString = "01:02:03:04:05:06";
String ipString = "10.20.255.30";
List<SimpleAddress> addresses = new ArrayList<SimpleAddress>();
addresses.add(new SimpleAddress(new IpAddress(new Ipv4Address(ipString))));
addresses.add(new SimpleAddress(new MacAddress(macString)));
AfiListBuilder listbuilder = new AfiListBuilder();
listbuilder.setAddressList(addresses);
EidBuilder eb = new EidBuilder();
eb.setAddressType(AfiListLcaf.class);
eb.setVirtualNetworkId(null);
eb.setAddress(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.AfiListBuilder().setAfiList(listbuilder.build()).build());
MapReply reply = registerAddressAndQuery(eb.build());
Eid receivedAddress = reply.getMappingRecordItem().get(0).getMappingRecord().getEid();
assertEquals(AfiListLcaf.class, receivedAddress.getAddressType());
AfiList listAddrFromNetwork = (AfiList) receivedAddress.getAddress();
SimpleAddress receivedAddr1 = (SimpleAddress) listAddrFromNetwork.getAfiList().getAddressList().get(0);
SimpleAddress receivedAddr2 = (SimpleAddress) listAddrFromNetwork.getAfiList().getAddressList().get(1);
assertNotNull(receivedAddr1.getIpAddress().getIpv4Address());
assertNotNull(receivedAddr2.getMacAddress());
assertEquals(macString, receivedAddr2.getMacAddress().getValue());
assertEquals(ipString, receivedAddr1.getIpAddress().getIpv4Address().getValue());
}
Aggregations