use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType in project openflowplugin by opendaylight.
the class MultipartRequestMessageSerializer method serialize.
@Override
public void serialize(final MultipartRequest message, final ByteBuf outBuffer) {
final MultipartRequestBody multipartRequestBody = message.getMultipartRequestBody();
final MultipartType multipartType = getMultipartType(multipartRequestBody);
final int index = outBuffer.writerIndex();
super.serialize(message, outBuffer);
outBuffer.writeShort(multipartType.getIntValue());
outBuffer.writeShort(ByteBufUtils.fillBitMask(0, message.isRequestMore()));
outBuffer.writeZero(PADDING_IN_MULTIPART_REQUEST_MESSAGE);
final OFSerializer<MultipartRequestBody> serializer = Preconditions.checkNotNull(registry).getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, multipartRequestBody.getImplementedInterface()));
serializer.serialize(multipartRequestBody, outBuffer);
outBuffer.setShort(index + 2, outBuffer.writerIndex() - index);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType in project openflowplugin by opendaylight.
the class RequestInputUtils method createMultipartHeader.
public static MultipartRequestInputBuilder createMultipartHeader(MultipartType multipart, Long xid, Short version) {
MultipartRequestInputBuilder mprInput = new MultipartRequestInputBuilder();
mprInput.setType(multipart);
mprInput.setVersion(version);
mprInput.setXid(xid);
mprInput.setFlags(new MultipartRequestFlags(false));
return mprInput;
}
Aggregations