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 AfiListSerializer method getLcafLength.
@Override
protected short getLcafLength(LispAddress lispAddress) {
short totalSize = 0;
AfiList afiList = (((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.AfiList) lispAddress.getAddress()).getAfiList());
for (SimpleAddress address : afiList.getAddressList()) {
totalSize += SimpleAddressSerializer.getInstance().getAddressSize(address);
}
return totalSize;
}
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 ApplicationDataSerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
ApplicationData appData = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ApplicationData) lispAddress.getAddress()).getApplicationData();
buffer.put(ByteUtil.partialIntToByteArray(NumberUtil.asInt(appData.getIpTos()), Length.TOC));
buffer.put((byte) NumberUtil.asShort(appData.getProtocol()));
if (appData.getLocalPortLow() != null) {
buffer.putShort(NumberUtil.asShort(appData.getLocalPortLow().getValue().shortValue()));
} else {
buffer.putShort((short) 0);
}
if (appData.getLocalPortHigh() != null) {
buffer.putShort(NumberUtil.asShort(appData.getLocalPortHigh().getValue().shortValue()));
} else {
buffer.putShort((short) 0);
}
if (appData.getRemotePortLow() != null) {
buffer.putShort(NumberUtil.asShort(appData.getRemotePortLow().getValue().shortValue()));
} else {
buffer.putShort((short) 0);
}
if (appData.getRemotePortHigh() != null) {
buffer.putShort(NumberUtil.asShort(appData.getRemotePortHigh().getValue().shortValue()));
} else {
buffer.putShort((short) 0);
}
SimpleAddressSerializer.getInstance().serialize(buffer, appData.getAddress());
}
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 DistinguishedNameSerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
DistinguishedName distinguishedNameAddress = (DistinguishedName) lispAddress.getAddress();
buffer.put(distinguishedNameAddress.getDistinguishedName().getValue().getBytes());
buffer.put((byte) 0);
}
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 Ipv4BinarySerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
Ipv4Binary address = (Ipv4Binary) lispAddress.getAddress();
buffer.put(address.getIpv4Binary().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 Ipv4PrefixBinarySerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
Ipv4PrefixBinary prefix = (Ipv4PrefixBinary) lispAddress.getAddress();
buffer.put(prefix.getIpv4AddressBinary().getValue());
}
Aggregations