use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress in project lispflowmapping by opendaylight.
the class InstanceIdSerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
InstanceId iid = (InstanceId) lispAddress.getAddress();
// The IID mask-len field is in the LCAF header on the res2 position
buffer.put(buffer.position() - 3, iid.getInstanceId().getMaskLength().byteValue());
buffer.putInt(iid.getInstanceId().getIid().getValue().intValue());
LispAddressSerializer.getInstance().serialize(buffer, lispAddress);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress in project lispflowmapping by opendaylight.
the class Ipv6PrefixBinarySerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
Ipv6PrefixBinary prefix = (Ipv6PrefixBinary) lispAddress.getAddress();
buffer.put(prefix.getIpv6AddressBinary().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress in project lispflowmapping by opendaylight.
the class MacSerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
Mac mac = (Mac) lispAddress.getAddress();
buffer.put(IetfYangUtil.INSTANCE.bytesFor(mac.getMac()));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress 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