import io.netty.buffer.ByteBuf;\r
\r
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
\r
super.serialize(action, outBuffer);\r
EthertypeAction ethertype = action.getAugmentation(EthertypeAction.class);\r
outBuffer.writeShort(ethertype.getEthertype().getValue());\r
- ByteBufUtils.padBuffer(ActionConstants.ETHERTYPE_ACTION_PADDING, outBuffer);\r
+ outBuffer.writeZero(ActionConstants.ETHERTYPE_ACTION_PADDING);\r
}\r
\r
@Override\r
import io.netty.buffer.ByteBuf;\r
\r
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
\r
/**\r
@Override\r
public void serialize(Action action, ByteBuf outBuffer) {\r
super.serialize(action, outBuffer);\r
- ByteBufUtils.padBuffer(ActionConstants.PADDING_IN_ACTION_HEADER, outBuffer);\r
+ outBuffer.writeZero(ActionConstants.PADDING_IN_ACTION_HEADER);\r
}\r
\r
@Override\r
super.serialize(action, outBuffer);\r
outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(action\r
.getAugmentation(DlAddressAction.class).getDlAddress().getValue()));\r
- ByteBufUtils.padBuffer(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION, outBuffer);\r
+ outBuffer.writeZero(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);\r
}\r
\r
}\r
import io.netty.buffer.ByteBuf;\r
\r
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
\r
super.serialize(action, outBuffer);\r
PortAction port = action.getAugmentation(PortAction.class);\r
outBuffer.writeShort(port.getPort().getValue().intValue());\r
- ByteBufUtils.padBuffer(ActionConstants.PADDING_IN_TP_PORT_ACTION, outBuffer);\r
+ outBuffer.writeZero(ActionConstants.PADDING_IN_TP_PORT_ACTION);\r
}\r
}\r
import io.netty.buffer.ByteBuf;\r
\r
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
super.serialize(action, outBuffer);\r
PortAction port = action.getAugmentation(PortAction.class);\r
outBuffer.writeShort(port.getPort().getValue().intValue());\r
- ByteBufUtils.padBuffer(ActionConstants.PADDING_IN_ENQUEUE_ACTION, outBuffer);\r
+ outBuffer.writeZero(ActionConstants.PADDING_IN_ENQUEUE_ACTION);\r
QueueIdAction queueId = action.getAugmentation(QueueIdAction.class);\r
outBuffer.writeInt(queueId.getQueueId().intValue());\r
}\r
import io.netty.buffer.ByteBuf;\r
\r
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTosAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
\r
public void serialize(Action action, ByteBuf outBuffer) {\r
super.serialize(action, outBuffer);\r
outBuffer.writeByte(action.getAugmentation(NwTosAction.class).getNwTos());\r
- ByteBufUtils.padBuffer(ActionConstants.PADDING_IN_SET_NW_TOS_ACTION, outBuffer);\r
+ outBuffer.writeZero(ActionConstants.PADDING_IN_SET_NW_TOS_ACTION);\r
}\r
\r
@Override\r
import io.netty.buffer.ByteBuf;\r
\r
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
\r
public void serialize(Action action, ByteBuf outBuffer) {\r
super.serialize(action, outBuffer);\r
outBuffer.writeByte(action.getAugmentation(VlanPcpAction.class).getVlanPcp());\r
- ByteBufUtils.padBuffer(ActionConstants.PADDING_IN_SET_VLAN_PCP_ACTION, outBuffer);\r
+ outBuffer.writeZero(ActionConstants.PADDING_IN_SET_VLAN_PCP_ACTION);\r
}\r
\r
@Override\r
import io.netty.buffer.ByteBuf;\r
\r
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
\r
public void serialize(Action action, ByteBuf outBuffer) {\r
super.serialize(action, outBuffer);\r
outBuffer.writeShort(action.getAugmentation(VlanVidAction.class).getVlanVid());\r
- ByteBufUtils.padBuffer(ActionConstants.PADDING_IN_SET_VLAN_VID_ACTION, outBuffer);\r
+ outBuffer.writeZero(ActionConstants.PADDING_IN_SET_VLAN_VID_ACTION);\r
}\r
\r
@Override\r
import io.netty.buffer.ByteBuf;\r
\r
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
outBuffer.writeInt(port.getPort().getValue().intValue());\r
MaxLengthAction maxlength = action.getAugmentation(MaxLengthAction.class);\r
outBuffer.writeShort(maxlength.getMaxLength());\r
- ByteBufUtils.padBuffer(ActionConstants.OUTPUT_PADDING, outBuffer);\r
+ outBuffer.writeZero(ActionConstants.OUTPUT_PADDING);\r
}\r
\r
@Override\r
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;\r
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;\r
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMatchEntry;\r
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ExperimenterClass;\r
serializer.serialize(entry, outBuffer);\r
int paddingRemainder = (outBuffer.writerIndex() - startIndex) % EncodeConstants.PADDING;\r
if (paddingRemainder != 0) {\r
- ByteBufUtils.padBuffer(EncodeConstants.PADDING - paddingRemainder, outBuffer);\r
+ outBuffer.writeZero(EncodeConstants.PADDING - paddingRemainder);\r
}\r
outBuffer.setShort(lengthIndex, outBuffer.writerIndex() - startIndex);\r
}\r
import io.netty.buffer.ByteBuf;\r
\r
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
\r
super.serialize(action, outBuffer);\r
MplsTtlAction mplsTtl = action.getAugmentation(MplsTtlAction.class);\r
outBuffer.writeByte(mplsTtl.getMplsTtl());\r
- ByteBufUtils.padBuffer(ActionConstants.SET_MPLS_TTL_PADDING, outBuffer);\r
+ outBuffer.writeZero(ActionConstants.SET_MPLS_TTL_PADDING);\r
}\r
\r
@Override\r
import io.netty.buffer.ByteBuf;\r
\r
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
\r
super.serialize(action, outBuffer);\r
NwTtlAction nwTtl = action.getAugmentation(NwTtlAction.class);\r
outBuffer.writeByte(nwTtl.getNwTtl());\r
- ByteBufUtils.padBuffer(ActionConstants.SET_NW_TTL_PADDING, outBuffer);\r
+ outBuffer.writeZero(ActionConstants.SET_NW_TTL_PADDING);\r
}\r
\r
@Override\r
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMaker;
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
import org.opendaylight.openflowjava.protocol.impl.util.ListSerializer;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
outBuffer.writeInt(message.getOutPort().getValue().intValue());
outBuffer.writeInt(message.getOutGroup().intValue());
outBuffer.writeShort(createFlowModFlagsBitmask(message.getFlags()));
- ByteBufUtils.padBuffer(PADDING_IN_FLOW_MOD_MESSAGE, outBuffer);
+ outBuffer.writeZero(PADDING_IN_FLOW_MOD_MESSAGE);
registry.<Match, OFSerializer<Match>>getSerializer(new MessageTypeKey<>(message.getVersion(), Match.class))
.serialize(message.getMatch(), outBuffer);
ListSerializer.serializeList(message.getInstruction(), INSTRUCTION_KEY_MAKER, registry, outBuffer);
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
/**
public void serialize(GetQueueConfigInput message, ByteBuf outBuffer) {
ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
outBuffer.writeInt(message.getPort().getValue().intValue());
- ByteBufUtils.padBuffer(PADDING_IN_GET_QUEUE_CONFIG_MESSAGE, outBuffer);
+ outBuffer.writeZero(PADDING_IN_GET_QUEUE_CONFIG_MESSAGE);
ByteBufUtils.updateOFHeaderLength(outBuffer);
}
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
import org.opendaylight.openflowjava.protocol.impl.util.ListSerializer;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList;
ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
outBuffer.writeShort(message.getCommand().getIntValue());
outBuffer.writeByte(message.getType().getIntValue());
- ByteBufUtils.padBuffer(PADDING_IN_GROUP_MOD_MESSAGE, outBuffer);
+ outBuffer.writeZero(PADDING_IN_GROUP_MOD_MESSAGE);
outBuffer.writeInt(message.getGroupId().getValue().intValue());
serializerBuckets(message.getBucketsList(), outBuffer);
ByteBufUtils.updateOFHeaderLength(outBuffer);
outBuffer.writeShort(currentBucket.getWeight().shortValue());
outBuffer.writeInt(currentBucket.getWatchPort().getValue().intValue());
outBuffer.writeInt(currentBucket.getWatchGroup().intValue());
- ByteBufUtils.padBuffer(PADDING_IN_BUCKET, outBuffer);
+ outBuffer.writeZero(PADDING_IN_BUCKET);
ListSerializer.serializeList(currentBucket.getAction(), TypeKeyMakerFactory
.createActionKeyMaker(EncodeConstants.OF13_VERSION_ID), registry, outBuffer);
outBuffer.setShort(bucketLengthIndex, outBuffer.writerIndex() - bucketLengthIndex);
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.HelloElementType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.hello.Elements;
}
int length = output.writerIndex() - elementStartIndex;
int padding = length - versionBitmap.length * 4 - HELLO_ELEMENT_HEADER_SIZE;
- ByteBufUtils.padBuffer(padding , output);
+ output.writeZero(padding);
output.setShort(elementLengthIndex, output.writerIndex() - elementStartIndex);
}
}
int endWriterIndex = outBuffer.writerIndex();
int paddingRemainder = (endWriterIndex - startWriterIndex) % EncodeConstants.PADDING;
if (paddingRemainder != 0) {
- ByteBufUtils.padBuffer(EncodeConstants.PADDING - paddingRemainder, outBuffer);
+ outBuffer.writeZero(EncodeConstants.PADDING - paddingRemainder);
}
ByteBufUtils.updateOFHeaderLength(outBuffer);
}
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterBandCommons;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModInput;
MeterBandDropCase dropBandCase = (MeterBandDropCase) meterBand;
MeterBandDrop dropBand = dropBandCase.getMeterBandDrop();
writeBandCommonFields(dropBand, outBuffer);
- ByteBufUtils.padBuffer(PADDING_IN_METER_BAND_DROP, outBuffer);
+ outBuffer.writeZero(PADDING_IN_METER_BAND_DROP);
} else if (meterBand instanceof MeterBandDscpRemarkCase) {
MeterBandDscpRemarkCase dscpRemarkBandCase = (MeterBandDscpRemarkCase) meterBand;
MeterBandDscpRemark dscpRemarkBand = dscpRemarkBandCase.getMeterBandDscpRemark();
writeBandCommonFields(dscpRemarkBand, outBuffer);
outBuffer.writeByte(dscpRemarkBand.getPrecLevel());
- ByteBufUtils.padBuffer(PADDING_IN_METER_BAND_DSCP_REMARK, outBuffer);
+ outBuffer.writeZero(PADDING_IN_METER_BAND_DSCP_REMARK);
} else if (meterBand instanceof MeterBandExperimenterCase) {
OFSerializer<MeterBandExperimenter> serializer = registry.getSerializer(
new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, MeterBandExperimenter.class));
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,
outBuffer.writeInt(createPortConfigBitmask(message.getConfigV10()));
outBuffer.writeInt(createPortConfigBitmask(message.getMaskV10()));
outBuffer.writeInt(createPortFeaturesBitmask(message.getAdvertiseV10()));
- ByteBufUtils.padBuffer(PADDING_IN_PORT_MOD_MESSAGE, outBuffer);
+ outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE);
ByteBufUtils.updateOFHeaderLength(outBuffer);
}
public void serialize(GetQueueConfigInput message, ByteBuf outBuffer) {
ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
outBuffer.writeShort(message.getPort().getValue().intValue());
- ByteBufUtils.padBuffer(PADDING_IN_GET_QUEUE_CONFIG_MESSAGE, outBuffer);
+ outBuffer.writeZero(PADDING_IN_GET_QUEUE_CONFIG_MESSAGE);
ByteBufUtils.updateOFHeaderLength(outBuffer);
}
EncodeConstants.OF10_VERSION_ID, MatchV10.class));
matchSerializer.serialize(flow.getMatchV10(), output);
output.writeByte(flow.getTableId().shortValue());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY);
output.writeShort(flow.getOutPort().intValue());
}
EncodeConstants.OF10_VERSION_ID, MatchV10.class));
matchSerializer.serialize(aggregate.getMatchV10(), output);
output.writeByte(aggregate.getTableId().shortValue());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY);
output.writeShort(aggregate.getOutPort().intValue());
}
MultipartRequestPortStatsCase portstatsCase = (MultipartRequestPortStatsCase) multipartRequestBody;
MultipartRequestPortStats portstats = portstatsCase.getMultipartRequestPortStats();
output.writeShort(portstats.getPortNo().intValue());
- ByteBufUtils.padBuffer(PADDING_IN_MULTIPART_REQUEST_PORT_BODY, output);
+ output.writeZero(PADDING_IN_MULTIPART_REQUEST_PORT_BODY);
}
private static void serializeQueueBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestQueueCase queueCase = (MultipartRequestQueueCase) multipartRequestBody;
MultipartRequestQueue queue = queueCase.getMultipartRequestQueue();
output.writeShort(queue.getPortNo().intValue());
- ByteBufUtils.padBuffer(PADING_IN_QUEUE_BODY, output);
+ output.writeZero(PADING_IN_QUEUE_BODY);
output.writeInt(queue.getQueueId().intValue());
}
outBuffer.writeInt(message.getInPort().getValue().intValue());
int actionsLengthIndex = outBuffer.writerIndex();
outBuffer.writeShort(EncodeConstants.EMPTY_LENGTH);
- ByteBufUtils.padBuffer(PADDING_IN_PACKET_OUT_MESSAGE, outBuffer);
+ outBuffer.writeZero(PADDING_IN_PACKET_OUT_MESSAGE);
int actionsStartIndex = outBuffer.writerIndex();
ListSerializer.serializeList(message.getAction(), TypeKeyMakerFactory
.createActionKeyMaker(EncodeConstants.OF13_VERSION_ID), registry, outBuffer);
public void serialize(final PortModInput message, final ByteBuf outBuffer) {
ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
outBuffer.writeInt(message.getPortNo().getValue().intValue());
- ByteBufUtils.padBuffer(PADDING_IN_PORT_MOD_MESSAGE_01, outBuffer);
+ outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_01);
outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(message.getHwAddress().getValue()));
- ByteBufUtils.padBuffer(PADDING_IN_PORT_MOD_MESSAGE_02, outBuffer);
+ outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_02);
outBuffer.writeInt(createPortConfigBitmask(message.getConfig()));
outBuffer.writeInt(createPortConfigBitmask(message.getMask()));
outBuffer.writeInt(createPortFeaturesBitmask(message.getAdvertise()));
- ByteBufUtils.padBuffer(PADDING_IN_PORT_MOD_MESSAGE_03, outBuffer);
+ outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_03);
ByteBufUtils.updateOFHeaderLength(outBuffer);
}
public void serialize(RoleRequestInput message, ByteBuf outBuffer) {
ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
outBuffer.writeInt(message.getRole().getIntValue());
- ByteBufUtils.padBuffer(PADDING_IN_ROLE_REQUEST_MESSAGE, outBuffer);
+ outBuffer.writeZero(PADDING_IN_ROLE_REQUEST_MESSAGE);
outBuffer.writeLong(message.getGenerationId().longValue());
ByteBufUtils.updateOFHeaderLength(outBuffer);
}
public void serialize(final TableModInput message, final ByteBuf outBuffer) {
ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
outBuffer.writeByte(message.getTableId().getValue().byteValue());
- ByteBufUtils.padBuffer(PADDING_IN_TABLE_MOD_MESSAGE, outBuffer);
+ outBuffer.writeZero(PADDING_IN_TABLE_MOD_MESSAGE);
outBuffer.writeInt(createConfigBitmask(message.getConfig()));
ByteBufUtils.updateOFHeaderLength(outBuffer);
}
\r
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;\r
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMaker;\r
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;\r
List<Action> actions = instruction.getAugmentation(ActionsInstruction.class).getAction();\r
int lengthIndex = outBuffer.writerIndex();\r
outBuffer.writeShort(EncodeConstants.EMPTY_LENGTH);\r
- ByteBufUtils.padBuffer(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION, outBuffer);\r
+ outBuffer.writeZero(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);\r
ListSerializer.serializeList(actions, ACTION_KEY_MAKER, getRegistry(), outBuffer);\r
int instructionLength = outBuffer.writerIndex() - startIndex;\r
outBuffer.setShort(lengthIndex, instructionLength);\r
} else {\r
outBuffer.writeShort(InstructionConstants.STANDARD_INSTRUCTION_LENGTH);\r
- ByteBufUtils.padBuffer(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION, outBuffer);\r
+ outBuffer.writeZero(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);\r
}\r
}\r
\r
\r
import io.netty.buffer.ByteBuf;\r
\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstruction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;\r
outBuffer.writeShort(getType());\r
outBuffer.writeShort(InstructionConstants.STANDARD_INSTRUCTION_LENGTH);\r
outBuffer.writeByte(instruction.getAugmentation(TableIdInstruction.class).getTableId());\r
- ByteBufUtils.padBuffer(InstructionConstants.PADDING_IN_GOTO_TABLE, outBuffer);\r
+ outBuffer.writeZero(InstructionConstants.PADDING_IN_GOTO_TABLE);\r
}\r
\r
@Override\r
\r
import io.netty.buffer.ByteBuf;\r
\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataInstruction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;\r
public void serialize(Instruction instruction, ByteBuf outBuffer) {\r
outBuffer.writeShort(getType());\r
outBuffer.writeShort(InstructionConstants.WRITE_METADATA_LENGTH);\r
- ByteBufUtils.padBuffer(InstructionConstants.PADDING_IN_WRITE_METADATA, outBuffer);\r
+ outBuffer.writeZero(InstructionConstants.PADDING_IN_WRITE_METADATA);\r
MetadataInstruction metadata = instruction.getAugmentation(MetadataInstruction.class);\r
outBuffer.writeBytes(metadata.getMetadata());\r
outBuffer.writeBytes(metadata.getMetadataMask());\r
outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(match.getDlDst().getValue()));
outBuffer.writeShort(match.getDlVlan());
outBuffer.writeByte(match.getDlVlanPcp());
- ByteBufUtils.padBuffer(PADDING_IN_MATCH, outBuffer);
+ outBuffer.writeZero(PADDING_IN_MATCH);
outBuffer.writeShort(match.getDlType());
outBuffer.writeByte(match.getNwTos());
outBuffer.writeByte(match.getNwProto());
- ByteBufUtils.padBuffer(PADDING_IN_MATCH_2, outBuffer);
+ outBuffer.writeZero(PADDING_IN_MATCH_2);
Iterable<String> srcGroups = ByteBufUtils.DOT_SPLITTER.split(match.getNwSrc().getValue());
for (String group : srcGroups) {
outBuffer.writeByte(Short.parseShort(group));
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.StandardMatchType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ExperimenterClass;
outBuffer.setShort(matchLengthIndex, matchLength);
int paddingRemainder = matchLength % EncodeConstants.PADDING;
if (paddingRemainder != 0) {
- ByteBufUtils.padBuffer(EncodeConstants.PADDING - paddingRemainder, outBuffer);
+ outBuffer.writeZero(EncodeConstants.PADDING - paddingRemainder);
}
}
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdAction;
byte[] mfrDescBytes = new byte[256];
mfrDescBytes = mfrDesc.getBytes();
bb.writeBytes(mfrDescBytes);
- ByteBufUtils.padBuffer((DESC_STR_LEN - mfrDescBytes.length), bb);
+ bb.writeZero(DESC_STR_LEN - mfrDescBytes.length);
String hwDesc = "Hardware description";
byte[] hwDescBytes = new byte[256];
hwDescBytes = hwDesc.getBytes();
bb.writeBytes(hwDescBytes);
- ByteBufUtils.padBuffer((DESC_STR_LEN - hwDescBytes.length), bb);
+ bb.writeZero(DESC_STR_LEN - hwDescBytes.length);
String swDesc = "Software description";
byte[] swDescBytes = new byte[256];
swDescBytes = swDesc.getBytes();
bb.writeBytes(swDescBytes);
- ByteBufUtils.padBuffer((DESC_STR_LEN - swDescBytes.length), bb);
+ bb.writeZero(DESC_STR_LEN - swDescBytes.length);
String serialNum = "SN0123456789";
byte[] serialNumBytes = new byte[32];
serialNumBytes = serialNum.getBytes();
bb.writeBytes(serialNumBytes);
- ByteBufUtils.padBuffer((SERIAL_NUM_LEN - serialNumBytes.length), bb);
+ bb.writeZero(SERIAL_NUM_LEN - serialNumBytes.length);
String dpDesc = "switch3 in room 3120";
byte[] dpDescBytes = new byte[256];
dpDescBytes = dpDesc.getBytes();
bb.writeBytes(dpDescBytes);
- ByteBufUtils.padBuffer((DESC_STR_LEN - dpDescBytes.length), bb);
+ bb.writeZero(DESC_STR_LEN - dpDescBytes.length);
MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb);
byte[] portNameBytes = new byte[MAX_PORT_NAME_LEN];
portNameBytes = portName.getBytes();
bb.writeBytes(portNameBytes);
- ByteBufUtils.padBuffer((MAX_PORT_NAME_LEN - portNameBytes.length), bb);
+ bb.writeZero(MAX_PORT_NAME_LEN - portNameBytes.length);
ByteBuf bb2 = BufferHelper.buildBuffer("00 00 00 41 " + //port config
"00 00 00 05 " + //port state
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;\r
import org.opendaylight.openflowjava.protocol.api.extensibility.MessageCodeKey;\r
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;\r
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;\r
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;\r
byte[] mfrDescBytes = new byte[256];\r
mfrDescBytes = mfrDesc.getBytes();\r
bb.writeBytes(mfrDescBytes);\r
- ByteBufUtils.padBuffer((DESC_STR_LEN - mfrDescBytes.length), bb);\r
+ bb.writeZero(DESC_STR_LEN - mfrDescBytes.length);\r
\r
String hwDesc = "Hardware description";\r
byte[] hwDescBytes = new byte[256];\r
hwDescBytes = hwDesc.getBytes();\r
bb.writeBytes(hwDescBytes);\r
- ByteBufUtils.padBuffer((DESC_STR_LEN - hwDescBytes.length), bb);\r
+ bb.writeZero(DESC_STR_LEN - hwDescBytes.length);\r
\r
String swDesc = "Software description";\r
byte[] swDescBytes = new byte[256];\r
swDescBytes = swDesc.getBytes();\r
bb.writeBytes(swDescBytes);\r
- ByteBufUtils.padBuffer((DESC_STR_LEN - swDescBytes.length), bb);\r
+ bb.writeZero(DESC_STR_LEN - swDescBytes.length);\r
\r
String serialNum = "SN0123456789";\r
byte[] serialNumBytes = new byte[32];\r
serialNumBytes = serialNum.getBytes();\r
bb.writeBytes(serialNumBytes);\r
- ByteBufUtils.padBuffer((SERIAL_NUM_LEN - serialNumBytes.length), bb);\r
+ bb.writeZero(SERIAL_NUM_LEN - serialNumBytes.length);\r
\r
String dpDesc = "switch3 in room 3120";\r
byte[] dpDescBytes = new byte[256];\r
dpDescBytes = dpDesc.getBytes();\r
bb.writeBytes(dpDescBytes);\r
- ByteBufUtils.padBuffer((DESC_STR_LEN - dpDescBytes.length), bb);\r
+ bb.writeZero(DESC_STR_LEN - dpDescBytes.length);\r
\r
MultipartReplyMessage builtByFactory = BufferHelper.deserialize(statsFactory, bb);\r
\r