ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
outBuffer.writeShort(message.getType().getIntValue());
outBuffer.writeShort(createMultipartRequestFlagsBitmask(message.getFlags()));
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_MESSAGE, outBuffer);
+ outBuffer.writeZero(PADDING_IN_MULTIPART_REQUEST_MESSAGE);
if (message.getMultipartRequestBody() instanceof MultipartRequestDescCase){
serializeDescBody(message.getMultipartRequestBody(), outBuffer);
MultipartRequestFlowCase flowCase = (MultipartRequestFlowCase) multipartRequestBody;
MultipartRequestFlow flow = flowCase.getMultipartRequestFlow();
output.writeByte(flow.getTableId().byteValue());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01);
output.writeInt(flow.getOutPort().intValue());
output.writeInt(flow.getOutGroup().intValue());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02);
output.writeLong(flow.getCookie().longValue());
output.writeLong(flow.getCookieMask().longValue());
OFSerializer<Match> serializer = registry.getSerializer(new MessageTypeKey<>(
MultipartRequestAggregateCase aggregateCase = (MultipartRequestAggregateCase) multipartRequestBody;
MultipartRequestAggregate aggregate = aggregateCase.getMultipartRequestAggregate();
output.writeByte(aggregate.getTableId().byteValue());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_AGREGGATE_BODY_01, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_AGREGGATE_BODY_01);
output.writeInt(aggregate.getOutPort().intValue());
output.writeInt(aggregate.getOutGroup().intValue());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_AGREGGATE_BODY_02, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_AGREGGATE_BODY_02);
output.writeLong(aggregate.getCookie().longValue());
output.writeLong(aggregate.getCookieMask().longValue());
OFSerializer<Match> serializer = registry.getSerializer(new MessageTypeKey<>(
MultipartRequestPortStatsCase portstatsCase = (MultipartRequestPortStatsCase) multipartRequestBody;
MultipartRequestPortStats portstats = portstatsCase.getMultipartRequestPortStats();
output.writeInt(portstats.getPortNo().intValue());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY);
}
private static void serializeQueueBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestGroupCase groupStatsCase = (MultipartRequestGroupCase) multipartRequestBody;
MultipartRequestGroup groupStats = groupStatsCase.getMultipartRequestGroup();
output.writeInt(groupStats.getGroupId().getValue().intValue());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_GROUP_BODY, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_GROUP_BODY);
}
private static void serializeMeterBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestMeterCase meterCase = (MultipartRequestMeterCase) multipartRequestBody;
MultipartRequestMeter meter = meterCase.getMultipartRequestMeter();
output.writeInt(meter.getMeterId().getValue().intValue());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_METER_BODY, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_METER_BODY);
}
private static void serializeMeterConfigBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestMeterConfigCase meterConfigCase = (MultipartRequestMeterConfigCase) multipartRequestBody;
MultipartRequestMeterConfig meterConfig = meterConfigCase.getMultipartRequestMeterConfig();
output.writeInt(meterConfig.getMeterId().getValue().intValue());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_METER_CONFIG_BODY, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_METER_CONFIG_BODY);
}
private void serializeTableFeaturesBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
int tableFeatureLengthIndex = output.writerIndex();
output.writeShort(EncodeConstants.EMPTY_LENGTH);
output.writeByte(currTableFeature.getTableId());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_TABLE_FEATURES_BODY, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_TABLE_FEATURES_BODY);
output.writeBytes(currTableFeature.getName().getBytes());
- ByteBufUtils.padBuffer((32 - currTableFeature.getName().getBytes().length), output);
+ output.writeZero(32 - currTableFeature.getName().getBytes().length);
output.writeLong(currTableFeature.getMetadataMatch().longValue());
output.writeLong(currTableFeature.getMetadataWrite().longValue());
output.writeInt(createTableConfigBitmask(currTableFeature.getConfig()));
padding = paddingNeeded(length);
output.writeShort(length);
}
- ByteBufUtils.padBuffer(padding, output);
+ output.writeZero(padding);
}
private static void writeNextTableRelatedTableProperty(final ByteBuf output,
padding = paddingNeeded(length);
output.writeShort(length + padding);
}
- ByteBufUtils.padBuffer(padding, output);
+ output.writeZero(padding);
}
private static int paddingNeeded(final int length) {
padding = paddingNeeded(length);
output.writeShort(length);
}
- ByteBufUtils.padBuffer(padding, output);
+ output.writeZero(padding);
}
private void writeOxmRelatedTableProperty(final ByteBuf output,
padding = paddingNeeded(length);
output.writeShort(length);
}
- ByteBufUtils.padBuffer(padding, output);
+ output.writeZero(padding);
}
private void writeExperimenterRelatedTableProperty(final ByteBuf output,