X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Futil%2FActionsSerializer.java;h=10cd78d7cd2fa31a9710bd5d79e6afccc69bfa4a;hb=43bd504b4692ef655187cd4182585e8141d8611e;hp=6c26cc2c65e1c9a879a2ff407cc558cea726e511;hpb=4e1850419d83c2da11c844c307deab65acb5b087;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsSerializer.java index 6c26cc2c..10cd78d7 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsSerializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsSerializer.java @@ -70,7 +70,7 @@ public abstract class ActionsSerializer { private static final byte SET_QUEUE_LENGTH = 8; private static final byte GROUP_LENGTH = 8; private static final byte SET_NW_TTL_LENGTH = 8; - private static final byte EXPERIMENTER_LENGTH = 8; + private static final byte EXPERIMENTER_ACTION_HEADER_LENGTH = 8; private static final byte ACTION_HEADER_LENGTH = 8; private static final byte LENGTH_OF_ETHERTYPE_ACTION = 8; private static final byte LENGTH_OF_OTHER_ACTIONS = 8; @@ -293,9 +293,15 @@ public abstract class ActionsSerializer { private static void encodeExperimenterAction(Action action, ByteBuf outBuffer) { outBuffer.writeShort(EXPERIMENTER_CODE); - outBuffer.writeShort(EXPERIMENTER_LENGTH); ExperimenterAction experimenter = action.getAugmentation(ExperimenterAction.class); - outBuffer.writeInt(experimenter.getExperimenter().intValue()); + if (experimenter.getData() != null) { + outBuffer.writeShort(EXPERIMENTER_ACTION_HEADER_LENGTH + experimenter.getData().length); + outBuffer.writeInt(experimenter.getExperimenter().intValue()); + outBuffer.writeBytes(experimenter.getData()); + } else { + outBuffer.writeShort(EXPERIMENTER_ACTION_HEADER_LENGTH); + outBuffer.writeInt(experimenter.getExperimenter().intValue()); + } } private static void encodeRestOfActionHeader(ByteBuf outBuffer) {