use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.source.dest.key.SourceDestKey in project lispflowmapping by opendaylight.
the class SourceDestKeySerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
SourceDestKey sdk = (SourceDestKey) lispAddress.getAddress();
buffer.putShort((short) 0);
short srcMaskLength = MaskUtil.getMaskForAddress(sdk.getSourceDestKey().getSource());
short dstMaskLength = MaskUtil.getMaskForAddress(sdk.getSourceDestKey().getDest());
// org.opendaylight.lispflowmammping.type.Constants
if (srcMaskLength == -1) {
srcMaskLength = 0;
}
if (dstMaskLength == -1) {
dstMaskLength = 0;
}
buffer.put((byte) srcMaskLength);
buffer.put((byte) dstMaskLength);
SimpleAddressSerializer.getInstance().serialize(buffer, new SimpleAddress(sdk.getSourceDestKey().getSource()));
SimpleAddressSerializer.getInstance().serialize(buffer, new SimpleAddress(sdk.getSourceDestKey().getDest()));
}
Aggregations