Replaced usage of BytebufUtils.padBuffer() as it is deprecated 94/8794/2
authorMichal Polkorab <michal.polkorab@pantheon.sk>
Mon, 7 Jul 2014 14:28:18 +0000 (16:28 +0200)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Tue, 22 Jul 2014 08:55:24 +0000 (10:55 +0200)
 - replaced with buffer.writeZero()

Change-Id: Ica7ef6d244fc531419c42d4055f0d42b09e7ebf0
Signed-off-by: Michal Polkorab <michal.polkorab@pantheon.sk>
32 files changed:
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/AbstractEthertypeActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/AbstractHeaderActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10AbstractMacAddressActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10AbstractPortActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10EnqueueActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetNwTosActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetVlanPcpActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetVlanVidActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13OutputActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13SetFieldActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13SetMplsTtlActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13SetNwTtlActionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartRequestInputFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketOutInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/instruction/AbstractActionInstructionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/instruction/GoToTableInstructionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/instruction/WriteMetadataInstructionSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10StatsReplyMessageFactoryTest.java

index 7af91fd61c0a59eadb6180695e3aaf232c539bf6..9c4117a4b6cc8c392e4dd5294f269968b0f45046 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 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
@@ -26,7 +25,7 @@ public abstract class AbstractEthertypeActionSerializer extends AbstractActionSe
         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
index b96146768aa1a4fe91ad4ca0882f5bdc828dd4a7..aa82f49ef051a1519237db3267e6cef0dfffba52 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 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
@@ -23,7 +22,7 @@ public abstract class AbstractHeaderActionSerializer extends AbstractActionSeria
     @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
index e3cb27e37937cb4caf7098ade83860a5526d9b9f..f8c4735245a9af980a910b0637082f36ab5c07dc 100644 (file)
@@ -26,7 +26,7 @@ public abstract class OF10AbstractMacAddressActionSerializer extends AbstractAct
         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
index fee943a5d3e85730d59ee3065a017bbe3fd2a20a..a02df47ea07697f9d943313f4a365535477fb025 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 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
@@ -26,6 +25,6 @@ public abstract class OF10AbstractPortActionSerializer extends AbstractActionSer
         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
index 8c55a7323a2be6cc5a17daddca37601130cd6525..dfc797683f1e2a87c666058560e9cd16013bc6b7 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 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
@@ -27,7 +26,7 @@ public class OF10EnqueueActionSerializer extends AbstractActionSerializer {
         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
index cedae20880ba612a1397b6b433ebe673803c2b9f..0d668248898d86159fbd99d49d3ba64ce3834780 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 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
@@ -25,7 +24,7 @@ public class OF10SetNwTosActionSerializer extends AbstractActionSerializer {
     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
index 59cddfa33d2fe40198be9dbeb94a2327def3eda6..29fdafe0072cb473a8a2075fc04923582a884ec4 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 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
@@ -25,7 +24,7 @@ public class OF10SetVlanPcpActionSerializer extends AbstractActionSerializer {
     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
index 11df22f3bb2492a6342073163f7f197fcb48d582..e788f8d49504de60f1c69c40e60563a596303ceb 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 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
@@ -25,7 +24,7 @@ public class OF10SetVlanVidActionSerializer extends AbstractActionSerializer {
     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
index 19acf94832e18dac848b93ff6ac879ffbf6801e6..2ac79f7dc1985302d90de1ae3c5713a497efe82a 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 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
@@ -29,7 +28,7 @@ public class OF13OutputActionSerializer extends AbstractActionSerializer {
         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
index bd6b9d8e366bd96e4efdef10a913237903386943..6b56fd09f687c4b048fef3f56ea8bfd9731c1d01 100644 (file)
@@ -16,9 +16,8 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegist
 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
@@ -53,7 +52,7 @@ public class OF13SetFieldActionSerializer implements OFSerializer<Action>,
         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
index 495c6bc112d1aeea978d6418870b6bc4df1e4ae5..480bc931d65a901790cf540985f7aef34ae0921b 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 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
@@ -28,7 +27,7 @@ public class OF13SetMplsTtlActionSerializer extends AbstractActionSerializer {
         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
index 02c011571b1cd65fb093279d39eef35dbd8b78dd..b30cf5d5e3a293f85012a3b71d1389f990e7d70c 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.action;
 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
@@ -26,7 +25,7 @@ public class OF13SetNwTtlActionSerializer extends AbstractActionSerializer {
         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
index 421bfc4a4f29e57c1eec0a0b03b8cf3bf21eb861..0e1b3533081878acd24c7083de732d0d6bacd0f0 100644 (file)
@@ -14,11 +14,11 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey;
 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;
@@ -50,7 +50,7 @@ public class FlowModInputMessageFactory implements OFSerializer<FlowModInput>, S
         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);
index f107ccd99723ab298158f4b104c09a6208544cbf..f8ac9f7c736978234aa777b46f5bd1e8a90277f1 100644 (file)
@@ -11,8 +11,8 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 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;
 
 /**
@@ -29,7 +29,7 @@ public class GetQueueConfigInputMessageFactory implements OFSerializer<GetQueueC
     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);
     }
 
index 18155039ff6604625f84d67d903528f04e5d4061..93e4c741c052e948500d55f0f9e918562cc919a6 100644 (file)
@@ -15,10 +15,10 @@ import java.util.List;
 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;
 
@@ -38,7 +38,7 @@ public class GroupModInputMessageFactory implements OFSerializer<GroupModInput>,
         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);
@@ -52,7 +52,7 @@ public class GroupModInputMessageFactory implements OFSerializer<GroupModInput>,
                 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);
index 26af453012d478d6b686cff29c81cb8caee7c8d9..3d95646bd92921f36550babb9b23c7b846f72eb2 100644 (file)
@@ -11,8 +11,8 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 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;
@@ -43,7 +43,7 @@ public class HelloInputMessageFactory implements OFSerializer<HelloInput>{
                     }
                     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);
                 }
             } 
@@ -58,7 +58,7 @@ public class HelloInputMessageFactory implements OFSerializer<HelloInput>{
         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);
     }
index 50f59677673604bad4ebf06a2f5a5ccaf0e8dfcb..0c69f478c54bd5a3fe279c310546faeb5a2203ba 100644 (file)
@@ -16,8 +16,8 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey;
 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;
@@ -70,13 +70,13 @@ public class MeterModInputMessageFactory implements OFSerializer<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));
index 5a428c2fc60b5cd097f26648a06776892aea6f32..507a636e5ee9b75742c6213c71fe1d97a1dc3766 100644 (file)
@@ -107,7 +107,7 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
         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);
@@ -215,10 +215,10 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
         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<>(
@@ -230,10 +230,10 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
         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<>(
@@ -245,7 +245,7 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
         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) {
@@ -259,21 +259,21 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
         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) {
@@ -285,9 +285,9 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
                     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()));
@@ -364,7 +364,7 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
             padding = paddingNeeded(length);
             output.writeShort(length);
         }
-        ByteBufUtils.padBuffer(padding, output);
+        output.writeZero(padding);
     }
 
     private static void writeNextTableRelatedTableProperty(final ByteBuf output,
@@ -385,7 +385,7 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
             padding = paddingNeeded(length);
             output.writeShort(length + padding);
         }
-        ByteBufUtils.padBuffer(padding, output);
+        output.writeZero(padding);
     }
 
     private static int paddingNeeded(final int length) {
@@ -422,7 +422,7 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
             padding = paddingNeeded(length);
             output.writeShort(length);
         }
-        ByteBufUtils.padBuffer(padding, output);
+        output.writeZero(padding);
     }
 
     private void writeOxmRelatedTableProperty(final ByteBuf output,
@@ -454,7 +454,7 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
             padding = paddingNeeded(length);
             output.writeShort(length);
         }
-        ByteBufUtils.padBuffer(padding, output);
+        output.writeZero(padding);
     }
 
     private void writeExperimenterRelatedTableProperty(final ByteBuf output,
index d21838cc6c076b70a0bf1e9026a277b18ab7493b..4002b8fc30c1cda02467e5b3a3b2b29e909401ea 100644 (file)
@@ -34,7 +34,7 @@ public class OF10PortModInputMessageFactory implements OFSerializer<PortModInput
         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);
     }
 
index bbdd122c6a759182e5cfa3c265dadada67186272..606a98c5a8c15684d97f8ef49f5b7efb1d4098ae 100644 (file)
@@ -28,7 +28,7 @@ public class OF10QueueGetConfigInputMessageFactory implements OFSerializer<GetQu
     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);
     }
 
index a64268daaba43c600da8a3d4b96ad948c9c996ae..840b9966a70e3cedf7adc76a76133532ac1b3de1 100644 (file)
@@ -99,7 +99,7 @@ public class OF10StatsRequestInputFactory implements OFSerializer<MultipartReque
                 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());
     }
 
@@ -110,7 +110,7 @@ public class OF10StatsRequestInputFactory implements OFSerializer<MultipartReque
                 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());
     }
 
@@ -118,14 +118,14 @@ public class OF10StatsRequestInputFactory implements OFSerializer<MultipartReque
         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());
     }
 
index 022ddb986c0c48af44ff274ebe7e4f89ab252fa0..44c9249d7004f5af0193bdeeb48cbbe1670f7fa3 100644 (file)
@@ -38,7 +38,7 @@ public class PacketOutInputMessageFactory implements OFSerializer<PacketOutInput
         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);
index 72b0d8bd98abfd293c8145b1e461d26d17bfe2aa..65364aeb95968efaba2a96ff4cf4789b763dc213 100644 (file)
@@ -35,13 +35,13 @@ public class PortModInputMessageFactory implements OFSerializer<PortModInput> {
     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);
     }
 
index 43ec60cd9d32e93d6e918727202f2b9209da8c0c..ce7d0cbf61826e0270aa3cbc046355433e0384e5 100644 (file)
@@ -30,7 +30,7 @@ public class RoleRequestInputMessageFactory implements OFSerializer<RoleRequestI
     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);
     }
index dac909e6042f3874075d6e5834973f5507fa7762..1f5e38a239a52d40f0f917c766c1366101ba431b 100644 (file)
@@ -29,7 +29,7 @@ public class TableModInputMessageFactory implements OFSerializer<TableModInput>
     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);
     }
index 8603f513ea6c70e84b00aa01c6546ac4519ff52f..4b381d3b9c086343317f841522a1f3c91c6ae1a6 100644 (file)
@@ -14,7 +14,6 @@ import java.util.List;
 \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
@@ -44,13 +43,13 @@ public abstract class AbstractActionInstructionSerializer extends AbstractInstru
             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
index 2ab3a517cd03735841261e3ddddb9750ed8748fd..3c65edffacd49fc9047f8dc10a71af32034809f3 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.instruction;
 \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
@@ -26,7 +25,7 @@ public class GoToTableInstructionSerializer extends AbstractInstructionSerialize
         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
index 79e0725d70c50844e7679da9d10f3de0e4741f7c..6c16ea39ffff02d25e3ae26ec1dc39567417437f 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.instruction;
 \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
@@ -25,7 +24,7 @@ public class WriteMetadataInstructionSerializer extends AbstractInstructionSeria
     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
index 813b60841702063505711fa27fcb2dd7ad5b6037..bff38ae2e31372327df3d75716278852d239cc6d 100644 (file)
@@ -39,11 +39,11 @@ public class OF10MatchSerializer implements OFSerializer<MatchV10> {
         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));
index afa3e0dd0fabe175308490a45fb1079afd9bfb58..ceb5963f18ea20f7a23491c58e81754d3d13a8c2 100644 (file)
@@ -17,7 +17,6 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegist
 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;
@@ -54,7 +53,7 @@ public class OF13MatchSerializer implements OFSerializer<Match>, SerializerRegis
         outBuffer.setShort(matchLengthIndex, matchLength);
         int paddingRemainder = matchLength % EncodeConstants.PADDING;
         if (paddingRemainder != 0) {
-            ByteBufUtils.padBuffer(EncodeConstants.PADDING - paddingRemainder, outBuffer);
+            outBuffer.writeZero(EncodeConstants.PADDING - paddingRemainder);
         }
     }
 
index 24985bb8a87e5811945655f5b4a88cb6fea04623..1920e07d897e7e5081a7adce0b703bbb184d366f 100644 (file)
@@ -21,7 +21,6 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
 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;
@@ -125,31 +124,31 @@ public class MultipartReplyMessageFactoryTest {
         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);
         
@@ -827,7 +826,7 @@ public class MultipartReplyMessageFactoryTest {
         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
index 54cdd2ca1ecf27e9c317f69ba7ad03db9ad2bff5..d5a1c779468703a293481e6fb273398eaccbbbe2 100644 (file)
@@ -17,10 +17,9 @@ import org.junit.Test;
 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
@@ -74,31 +73,31 @@ public class OF10StatsReplyMessageFactoryTest {
         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