use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.DistinguishedNameBuilder in project lispflowmapping by opendaylight.
the class DistinguishedNameSerializer method deserializeEidData.
@Override
protected Eid deserializeEidData(ByteBuffer buffer, LispAddressSerializerContext ctx) {
EidBuilder eb = new EidBuilder();
eb.setAddressType(DistinguishedNameAfi.class);
eb.setVirtualNetworkId(getVni(ctx));
eb.setAddress(new DistinguishedNameBuilder().setDistinguishedName(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.DistinguishedNameBuilder in project lispflowmapping by opendaylight.
the class DistinguishedNameSerializerTest method serialize__Simple.
@Test
public void serialize__Simple() throws Exception {
EidBuilder eb = new EidBuilder();
eb.setAddressType(DistinguishedNameAfi.class);
eb.setVirtualNetworkId(null);
eb.setAddress(new DistinguishedNameBuilder().setDistinguishedName(new DistinguishedNameType("david")).build());
ByteBuffer buf = ByteBuffer.allocate(LispAddressSerializer.getInstance().getAddressSize(eb.build()));
LispAddressSerializer.getInstance().serialize(buf, eb.build());
ByteBuffer expectedBuf = hexToByteBuffer("00 11 64 61 76 69 64 00");
ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.DistinguishedNameBuilder in project lispflowmapping by opendaylight.
the class LispAddressUtil method toEid.
public static Eid toEid(DistinguishedNameType dn, InstanceIdType vni) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(DistinguishedNameAfi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress((Address) new DistinguishedNameBuilder().setDistinguishedName(dn).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.DistinguishedNameBuilder in project lispflowmapping by opendaylight.
the class DistinguishedNameSerializer method deserializeRlocData.
@Override
protected Rloc deserializeRlocData(ByteBuffer buffer) {
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(DistinguishedNameAfi.class);
rb.setVirtualNetworkId(null);
rb.setAddress(new DistinguishedNameBuilder().setDistinguishedName(deserializeData(buffer)).build());
return rb.build();
}
Aggregations