/**
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
+ *
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
package org.opendaylight.openflowjava.nx.api;
/**
- * @author msunal
+ * Deserializer key for a Nicira action.
*
+ * @author msunal
*/
public final class NiciraActionDeserializerKey {
private final int subtype;
/**
+ * Contructor.
+ *
* @param version protocol wire version
* @param subtype nx_action_subtype
*/
return subtype;
}
- private static final boolean isValueUint16(int value) {
+ private static boolean isValueUint16(int value) {
if (value >= 0 && value <= 65535L) {
return true;
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
/**
- * @author msunal
+ * Serializer key for a Nicira action.
*
+ * @author msunal
*/
public class NiciraActionSerializerKey {
private final Class<? extends ActionChoice> subtype;
/**
+ * Contructor.
+ *
* @param version protocol wire version
* @param subtype nx_action_subtype
*/
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((subtype == null) ? 0 : subtype.hashCode());
+ result = prime * result + (subtype == null ? 0 : subtype.hashCode());
result = prime * result + version;
return result;
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
/**
- * @author msunal
+ * Registry for Nicira extension codecs.
*
+ * @author msunal
*/
public interface NiciraExtensionCodecRegistrator extends AutoCloseable {
import org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey;
/**
+ * Nicira utilities.
+ *
* @author msunal
*/
public final class NiciraUtil {
private NiciraUtil() { }
- public static final ActionSerializerKey<?> createOfJavaKeyFrom(NiciraActionSerializerKey key) {
+ public static ActionSerializerKey<?> createOfJavaKeyFrom(NiciraActionSerializerKey key) {
return new ActionSerializerKey<>(key.getVersion(), key.getSubtype(), NiciraConstants.NX_VENDOR_ID);
}
/**
- * If SUBTYPE is not Uint16 exception should be thrown
+ * If SUBTYPE is not Uint16 exception should be thrown.
*/
@Test(expected = IllegalArgumentException.class)
public void niciraActionDeserializerKeyTest1() {
}
/**
- * If SUBTYPE is Uint16 it should be set and version should be set also
+ * If SUBTYPE is Uint16 it should be set and version should be set also.
*/
@Test
public void niciraActionDeserializerKeyTest2() {
}
/**
- * If input param obj is null FALSE should be returned
+ * If input param obj is null FALSE should be returned.
*/
@Test
public void equalsTest1() {
}
/**
- * If input param obj is NOT null but is different class FALSE should be returned
+ * If input param obj is NOT null but is different class FALSE should be returned.
*/
@Test
public void equalsTest2() {
}
/**
- * If input param obj is same class but has different SUBTYPE value FALSE should be returned
+ * If input param obj is same class but has different SUBTYPE value FALSE should be returned.
*/
@Test
public void equalsTest3() {
}
/**
- * If input param obj is same class but has different VERSION value FALSE should be returned
+ * If input param obj is same class but has different VERSION value FALSE should be returned.
*/
@Test
public void equalsTest4() {
}
/**
- * If input param obj is absolutely same TRUE should be returned
+ * If input param obj is absolutely same TRUE should be returned.
*/
@Test
public void equalsTest5() {
}
/**
- * If input param obj is same instance TRUE should be returned
+ * If input param obj is same instance TRUE should be returned.
*/
@Test
public void equalsTest6() {
assertEquals(shouldBe, niciraActionDeserializerKey.toString());
}
-}
\ No newline at end of file
+}
}
/**
- * If input param obj is NULL then FALSE should be returned
+ * If input param obj is NULL then FALSE should be returned.
*/
@Test
public void equalsTest1() {
}
/**
- * If input param obj is NOT NULL but is instance of different class then FALSE should be returned
+ * If input param obj is NOT NULL but is instance of different class then FALSE should be returned.
*/
@Test
public void equalsTest2() {
}
/**
- * If input param obj is instance of the same class but this.subtype is NULL then FALSE should be returned
+ * If input param obj is instance of the same class but this.subtype is NULL then FALSE should be returned.
*/
@Test
public void equalsTest3() {
}
/**
- * If input param obj is instance of the same class but has different SUBTYPE then FALSE should be returned
+ * If input param obj is instance of the same class but has different SUBTYPE then FALSE should be returned.
*/
@Test
public void equalsTest4() {
}
/**
- * If input param obj is instance of the same class but has different VERSION then FALSE should be returned
+ * If input param obj is instance of the same class but has different VERSION then FALSE should be returned.
*/
@Test
public void equalsTest5() {
}
/**
- * If input param obj is instance of the same class and has same VERSION and SUBTYPE then TRUE should be returned
+ * If input param obj is instance of the same class and has same VERSION and SUBTYPE then TRUE should be returned.
*/
@Test
public void equalsTest6() {
}
/**
- * If input param obj is exactly same TRUE should be returned
+ * If input param obj is exactly same TRUE should be returned.
*/
@Test
public void equalsTest7() {
private interface SubtypeClass extends ActionChoice {}
-}
\ No newline at end of file
+}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
/**
- * @author msunal
+ * Implementation of NiciraExtensionCodecRegistrator.
*
+ * @author msunal
*/
public class NiciraExtensionCodecRegistratorImpl implements NiciraExtensionCodecRegistrator {
- private static final Map<NiciraActionDeserializerKey, OFDeserializer<Action>> actionDeserializers = new ConcurrentHashMap<>();
+ private static final Map<NiciraActionDeserializerKey, OFDeserializer<Action>> ACTION_DESERIALIZERS =
+ new ConcurrentHashMap<>();
private final List<SwitchConnectionProvider> providers;
- /**
- * @param providers
- */
public NiciraExtensionCodecRegistratorImpl(List<SwitchConnectionProvider> providers) {
this.providers = providers;
ActionDeserializer of10ActionDeserializer = new ActionDeserializer(EncodeConstants.OF10_VERSION_ID);
}
}
- private void registerActionSerializer(ActionSerializerKey<?> key, OFGeneralSerializer serializer) {
- for (SwitchConnectionProvider provider : providers) {
- provider.registerActionSerializer(key, serializer);
- }
- }
-
- private void unregisterDeserializer(ExperimenterDeserializerKey key) {
- for (SwitchConnectionProvider provider : providers) {
- provider.unregisterDeserializer(key);
- }
- }
-
- private void unregisterSerializer(ExperimenterSerializerKey key) {
- for (SwitchConnectionProvider provider : providers) {
- provider.unregisterSerializer(key);
- }
- }
-
/*
* (non-Javadoc)
*
*/
@Override
public void registerActionDeserializer(NiciraActionDeserializerKey key, OFDeserializer<Action> deserializer) {
- actionDeserializers.put(key, deserializer);
+ ACTION_DESERIALIZERS.put(key, deserializer);
+ }
+
+ private void registerActionSerializer(ActionSerializerKey<?> key, OFGeneralSerializer serializer) {
+ for (SwitchConnectionProvider provider : providers) {
+ provider.registerActionSerializer(key, serializer);
+ }
}
/*
*
* @see org.opendaylight.openflow.extension.nicira.api.
* NiciraExtensionCodecRegistrator
- * #unregisterActionDeserializer(org.opendaylight
- * .openflow.extension.nicira.api.NiciraActionDeserializerKey)
+ * #registerActionSerializer(org.opendaylight.
+ * openflow.extension.nicira.api.NiciraActionSerializerKey,
+ * org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer)
*/
@Override
- public void unregisterActionDeserializer(NiciraActionDeserializerKey key) {
- actionDeserializers.remove(key);
+ public void registerActionSerializer(NiciraActionSerializerKey key, OFSerializer<Action> serializer) {
+ registerActionSerializer(NiciraUtil.createOfJavaKeyFrom(key), serializer);
}
- public static OFDeserializer<Action> getActionDeserializer(NiciraActionDeserializerKey key) {
- return actionDeserializers.get(key);
+ private void unregisterDeserializer(ExperimenterDeserializerKey key) {
+ for (SwitchConnectionProvider provider : providers) {
+ provider.unregisterDeserializer(key);
+ }
+ }
+
+ private void unregisterSerializer(ExperimenterSerializerKey key) {
+ for (SwitchConnectionProvider provider : providers) {
+ provider.unregisterSerializer(key);
+ }
}
/*
*
* @see org.opendaylight.openflow.extension.nicira.api.
* NiciraExtensionCodecRegistrator
- * #registerActionSerializer(org.opendaylight.
- * openflow.extension.nicira.api.NiciraActionSerializerKey,
- * org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer)
+ * #unregisterActionDeserializer(org.opendaylight
+ * .openflow.extension.nicira.api.NiciraActionDeserializerKey)
*/
@Override
- public void registerActionSerializer(NiciraActionSerializerKey key, OFSerializer<Action> serializer) {
- registerActionSerializer(NiciraUtil.createOfJavaKeyFrom(key), serializer);
+ public void unregisterActionDeserializer(NiciraActionDeserializerKey key) {
+ ACTION_DESERIALIZERS.remove(key);
+ }
+
+ public static OFDeserializer<Action> getActionDeserializer(NiciraActionDeserializerKey key) {
+ return ACTION_DESERIALIZERS.get(key);
}
/*
* .openflowjava.protocol.api.keys.MatchEntrySerializerKey)
*/
@Override
- public void unregisterMatchEntrySerializer(MatchEntrySerializerKey<? extends OxmClassBase, ? extends MatchField> key) {
+ public void unregisterMatchEntrySerializer(
+ MatchEntrySerializerKey<? extends OxmClassBase, ? extends MatchField> key) {
unregisterSerializer(key);
}
@VisibleForTesting
boolean isEmptyActionDeserializers() {
- return actionDeserializers.isEmpty();
+ return ACTION_DESERIALIZERS.isEmpty();
}
}
package org.opendaylight.openflowjava.nx;
+import com.google.common.base.Preconditions;
import org.opendaylight.openflowjava.nx.api.NiciraExtensionCodecRegistrator;
import org.opendaylight.openflowjava.nx.codec.action.ConntrackCodec;
import org.opendaylight.openflowjava.nx.codec.action.FinTimeoutCodec;
import org.opendaylight.openflowjava.nx.codec.action.MultipathCodec;
import org.opendaylight.openflowjava.nx.codec.action.NiciraActionCodecs;
import org.opendaylight.openflowjava.nx.codec.action.OutputRegCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PushNshCodec;
import org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec;
import org.opendaylight.openflowjava.nx.codec.action.RegMoveCodec;
import org.opendaylight.openflowjava.nx.codec.action.ResubmitCodec;
-import org.opendaylight.openflowjava.nx.codec.action.PushNshCodec;
-import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
import org.opendaylight.openflowjava.nx.codec.match.ArpOpCodec;
import org.opendaylight.openflowjava.nx.codec.match.ArpShaCodec;
import org.opendaylight.openflowjava.nx.codec.match.ArpSpaCodec;
import org.opendaylight.openflowjava.nx.codec.match.CtMarkCodec;
import org.opendaylight.openflowjava.nx.codec.match.CtStateCodec;
import org.opendaylight.openflowjava.nx.codec.match.CtZoneCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthDstCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthSrcCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthTypeCodec;
import org.opendaylight.openflowjava.nx.codec.match.EthDstCodec;
import org.opendaylight.openflowjava.nx.codec.match.EthSrcCodec;
import org.opendaylight.openflowjava.nx.codec.match.EthTypeCodec;
+import org.opendaylight.openflowjava.nx.codec.match.InPortCodec;
+import org.opendaylight.openflowjava.nx.codec.match.MplsLabelCodec;
import org.opendaylight.openflowjava.nx.codec.match.NiciraMatchCodecs;
+import org.opendaylight.openflowjava.nx.codec.match.NshMdtypeCodec;
+import org.opendaylight.openflowjava.nx.codec.match.NshNpCodec;
import org.opendaylight.openflowjava.nx.codec.match.Nshc1Codec;
import org.opendaylight.openflowjava.nx.codec.match.Nshc2Codec;
import org.opendaylight.openflowjava.nx.codec.match.Nshc3Codec;
import org.opendaylight.openflowjava.nx.codec.match.Nshc4Codec;
import org.opendaylight.openflowjava.nx.codec.match.NsiCodec;
import org.opendaylight.openflowjava.nx.codec.match.NspCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthTypeCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthSrcCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthDstCodec;
-import org.opendaylight.openflowjava.nx.codec.match.NshMdtypeCodec;
-import org.opendaylight.openflowjava.nx.codec.match.NshNpCodec;
-import org.opendaylight.openflowjava.nx.codec.match.TunGpeNpCodec;
import org.opendaylight.openflowjava.nx.codec.match.Reg0Codec;
import org.opendaylight.openflowjava.nx.codec.match.Reg1Codec;
import org.opendaylight.openflowjava.nx.codec.match.Reg2Codec;
import org.opendaylight.openflowjava.nx.codec.match.Reg7Codec;
import org.opendaylight.openflowjava.nx.codec.match.TcpDstCodec;
import org.opendaylight.openflowjava.nx.codec.match.TcpSrcCodec;
+import org.opendaylight.openflowjava.nx.codec.match.TunGpeNpCodec;
import org.opendaylight.openflowjava.nx.codec.match.TunIdCodec;
import org.opendaylight.openflowjava.nx.codec.match.TunIpv4DstCodec;
import org.opendaylight.openflowjava.nx.codec.match.TunIpv4SrcCodec;
import org.opendaylight.openflowjava.nx.codec.match.UdpDstCodec;
import org.opendaylight.openflowjava.nx.codec.match.UdpSrcCodec;
-import org.opendaylight.openflowjava.nx.codec.match.InPortCodec;
-import org.opendaylight.openflowjava.nx.codec.match.MplsLabelCodec;
-
-import com.google.common.base.Preconditions;
public class NiciraExtensionsRegistrator implements AutoCloseable {
private final NiciraExtensionCodecRegistrator registrator;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
/**
+ * Base class for an action codec.
+ *
* @author msunal
*/
public abstract class AbstractActionCodec implements OFSerializer<Action>, OFDeserializer<Action> {
writeMsgLengthVendorIdSubtypeToBuffer(msgLength, subtype, outBuffer);
}
- private static final void writeMsgLengthVendorIdSubtypeToBuffer(final int msgLength, final int subtype, final ByteBuf outBuffer) {
+ private static void writeMsgLengthVendorIdSubtypeToBuffer(final int msgLength, final int subtype,
+ final ByteBuf outBuffer) {
outBuffer.writeShort(msgLength);
outBuffer.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
outBuffer.writeShort(subtype);
return actionBuilder;
}
- protected static final ExperimenterId getExperimenterId(){
+ protected static final ExperimenterId getExperimenterId() {
return new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
}
package org.opendaylight.openflowjava.nx.codec.action;
import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.nx.NiciraExtensionCodecRegistratorImpl;
import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
-import org.opendaylight.openflowjava.nx.NiciraExtensionCodecRegistratorImpl;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
private final short version;
/**
+ * Constructor.
+ *
* @param version protocol wire version
*/
public ActionDeserializer(short version) {
@Override
public Action deserialize(ByteBuf message) {
- int startPossition = message.readerIndex();
+ final int startPosition = message.readerIndex();
// size of experimenter type
message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
// size of length
LOG.info("No deserializer was found for key {}", key);
return null;
}
- message.readerIndex(startPossition);
+
+ message.readerIndex(startPosition);
return actionDeserializer.deserialize(message);
}
package org.opendaylight.openflowjava.nx.codec.action;
+import com.google.common.net.InetAddresses;
import io.netty.buffer.ByteBuf;
-
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
-
import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
import org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.nx.action.conntrack.CtActions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.nx.action.conntrack.CtActionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionCtMarkCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionNatCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionCtMarkCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionNatCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionNatCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.ct.mark._case.NxActionCtMark;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNat;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.ct.mark._case.NxActionCtMarkBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNat;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNatBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.net.InetAddresses;
-
/**
+ * Action codec for conntrack.
+ *
* @author Aswin Suryanarayanan.
*/
-
public class ConntrackCodec extends AbstractActionCodec {
private static final Logger LOG = LoggerFactory.getLogger(ConntrackCodec.class);
public static final int CT_LENGTH = 24;
NxActionNatCase nxActionNatCase = (NxActionNatCase)ctActions.getOfpactActions();
NxActionNat natAction = nxActionNatCase.getNxActionNat();
int natLength = getNatActionLength(natAction);
- int pad = 8 - (natLength % 8);
+ int pad = 8 - natLength % 8;
length += natLength + pad;
} else if (ctActions.getOfpactActions() instanceof NxActionCtMarkCase) {
length += SET_FIELD_LENGTH;
List<CtActions> ctActionsList = action.getNxActionConntrack().getCtActions();
if (ctActionsList != null) {
for (CtActions ctActions : ctActionsList) {
- if (ctActions.getOfpactActions() instanceof NxActionNatCase){
+ if (ctActions.getOfpactActions() instanceof NxActionNatCase) {
NxActionNatCase nxActionNatCase = (NxActionNatCase)ctActions.getOfpactActions();
NxActionNat natAction = nxActionNatCase.getNxActionNat();
int natLength = getNatActionLength(natAction);
- int pad = 8 - (natLength % 8);
+ int pad = 8 - natLength % 8;
serializeHeader(natLength + pad, NXAST_NAT_SUBTYPE, outBuffer);
outBuffer.writeZero(2);
outBuffer.writeShort(natAction.getFlags().shortValue());
outBuffer.writeShort(natAction.getPortMax());
}
outBuffer.writeZero(pad);
- } else if (ctActions.getOfpactActions() instanceof NxActionCtMarkCase){
+ } else if (ctActions.getOfpactActions() instanceof NxActionCtMarkCase) {
NxActionCtMarkCase nxActionCtMarkCase = (NxActionCtMarkCase)ctActions.getOfpactActions();
NxActionCtMark ctMarkAction = nxActionCtMarkCase.getNxActionCtMark();
@Override
public Action deserialize(final ByteBuf message) {
- short length = deserializeCtHeader(message);
+ final short length = deserializeCtHeader(message);
NxActionConntrackBuilder nxActionConntrackBuilder = new NxActionConntrackBuilder();
nxActionConntrackBuilder.setFlags(message.readUnsignedShort());
nxActionConntrackBuilder.setZoneSrc(message.readUnsignedInt());
nxActionConntrackBuilder.setConntrackZone(message.readUnsignedShort());
nxActionConntrackBuilder.setRecircTable(message.readUnsignedByte());
message.skipBytes(5);
+
if (length > CT_LENGTH) {
deserializeCtAction(message,nxActionConntrackBuilder, length - CT_LENGTH);
}
List<CtActions> ctActionsList = new ArrayList<>();
int processedCtActionsLength = ctActionsLength;
- while (processedCtActionsLength > 0){
+ while (processedCtActionsLength > 0) {
int startReaderIndex = message.readerIndex();
if (EncodeConstants.EXPERIMENTER_VALUE == message.readUnsignedShort()) {
// reset indices
message.setIndex(startReaderIndex, message.writerIndex());
- int startIndex = message.readerIndex();
+ final int startIndex = message.readerIndex();
int length = deserializeCtHeader(message);
processedCtActionsLength = processedCtActionsLength - length;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder;
/**
- * Codec for the NX_FIN_TIMEOUT
+ * Codec for the NX_FIN_TIMEOUT.
*/
public class FinTimeoutCodec extends AbstractActionCodec {
short idleTimeOut = OFP_NO_TIMEOUT;
short hardTimeOut = OFP_NO_TIMEOUT;
- ActionFinTimeout action = ((ActionFinTimeout) input.getActionChoice());
+ ActionFinTimeout action = (ActionFinTimeout) input.getActionChoice();
serializeHeader(LENGTH, NXAST_FIN_TIMEOUT_SUBTYPE, outBuffer);
if (action.getNxActionFinTimeout().getFinIdleTimeout() != null) {
@Override
public Action deserialize(final ByteBuf message) {
- ActionBuilder actionBuilder = deserializeHeader(message);
+ final ActionBuilder actionBuilder = deserializeHeader(message);
ActionFinTimeoutBuilder builder = new ActionFinTimeoutBuilder();
NxActionFinTimeoutBuilder nxActionFinTimeoutBuilder = new NxActionFinTimeoutBuilder();
package org.opendaylight.openflowjava.nx.codec.action;
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
import org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.NxActionLearnBuilder;
/**
+ * Codec for the learn action.
+ *
* @author Slava Radune
*/
-
public class LearnCodec extends AbstractActionCodec {
public static final byte NXAST_LEARN_SUBTYPE = 16;
public static final NiciraActionSerializerKey SERIALIZER_KEY =
ActionLearn action = (ActionLearn) input.getActionChoice();
int length = LearnCodecUtil.calcLength(action);
int lengthMod = length % MUL_LENGTH;
- if(lengthMod != 0){
+ if (lengthMod != 0) {
lengthMod = MUL_LENGTH - lengthMod;
}
- serializeHeader(length+lengthMod, NXAST_LEARN_SUBTYPE, outBuffer);
+ serializeHeader(length + lengthMod, NXAST_LEARN_SUBTYPE, outBuffer);
LearnCodecUtil.serializeLearnHeader(outBuffer, action);
LearnCodecUtil.serializeFlowMods(outBuffer, action);
//pad with zeros for the length to be multiplication by 8
- if(lengthMod != 0){
+ if (lengthMod != 0) {
outBuffer.writeZero(lengthMod);
}
actionBuilder.setExperimenterId(new ExperimenterId(NiciraConstants.NX_VENDOR_ID));
short length = LearnCodecUtil.deserializeHeader(message);
- ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
+ final ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
NxActionLearnBuilder nxActionLearnBuilder = new NxActionLearnBuilder();
LearnCodecUtil.deserializeLearnHeader(message, nxActionLearnBuilder);
return actionBuilder.build();
}
-
}
*/
package org.opendaylight.openflowjava.nx.codec.action;
+import io.netty.buffer.ByteBuf;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
-
-import io.netty.buffer.ByteBuf;
-
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearn;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class LearnCodecUtil {
+public final class LearnCodecUtil {
private static final Logger LOG = LoggerFactory.getLogger(LearnCodecUtil.class);
public static final int HEADER_LENGTH = 32;
private static final int EMPTY_FLOW_MOD_LENGTH = 2;
private static short length;
+ private LearnCodecUtil() {
+ }
static short deserializeHeader(ByteBuf message) {
// size of experimenter type
message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
// size of length
- short length = message.readShort();
+ short messageLength = message.readShort();
// vendor id
message.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
// subtype
message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- return length;
+ return messageLength;
}
/*
}
static void serializeFlowMods(final ByteBuf outBuffer, ActionLearn action) {
- if(action.getNxActionLearn().getFlowMods() != null){
- for(FlowMods flowMod : action.getNxActionLearn().getFlowMods()){
- if(flowMod.getFlowModSpec() instanceof FlowModAddMatchFromFieldCase){
- FlowModAddMatchFromField flowModSpecFromField = ((FlowModAddMatchFromFieldCase)flowMod.getFlowModSpec()).getFlowModAddMatchFromField();
+ if (action.getNxActionLearn().getFlowMods() != null) {
+ for (FlowMods flowMod : action.getNxActionLearn().getFlowMods()) {
+ if (flowMod.getFlowModSpec() instanceof FlowModAddMatchFromFieldCase) {
+ FlowModAddMatchFromField flowModSpecFromField = ((FlowModAddMatchFromFieldCase) flowMod
+ .getFlowModSpec()).getFlowModAddMatchFromField();
toFlowModSpecHeader(flowModSpecFromField, outBuffer);
outBuffer.writeInt(flowModSpecFromField.getSrcField().intValue());
outBuffer.writeShort(flowModSpecFromField.getSrcOfs().shortValue());
outBuffer.writeInt(flowModSpecFromField.getDstField().intValue());
outBuffer.writeShort(flowModSpecFromField.getDstOfs().shortValue());
- }else if( flowMod.getFlowModSpec() instanceof FlowModAddMatchFromValueCase){
- FlowModAddMatchFromValue flowModSpec = ((FlowModAddMatchFromValueCase)flowMod.getFlowModSpec()).getFlowModAddMatchFromValue();
+ } else if (flowMod.getFlowModSpec() instanceof FlowModAddMatchFromValueCase) {
+ FlowModAddMatchFromValue flowModSpec = ((FlowModAddMatchFromValueCase) flowMod.getFlowModSpec())
+ .getFlowModAddMatchFromValue();
toFlowModSpecHeader(flowModSpec, outBuffer);
outBuffer.writeShort(flowModSpec.getValue().shortValue());
outBuffer.writeInt(flowModSpec.getSrcField().intValue());
outBuffer.writeShort(flowModSpec.getSrcOfs().shortValue());
- }else if( flowMod.getFlowModSpec() instanceof FlowModCopyFieldIntoFieldCase){
- FlowModCopyFieldIntoField flowModSpec = ((FlowModCopyFieldIntoFieldCase)flowMod.getFlowModSpec()).getFlowModCopyFieldIntoField();
+ } else if (flowMod.getFlowModSpec() instanceof FlowModCopyFieldIntoFieldCase) {
+ FlowModCopyFieldIntoField flowModSpec = ((FlowModCopyFieldIntoFieldCase) flowMod.getFlowModSpec())
+ .getFlowModCopyFieldIntoField();
toFlowModSpecHeader(flowModSpec, outBuffer);
outBuffer.writeInt(flowModSpec.getSrcField().intValue());
outBuffer.writeShort(flowModSpec.getSrcOfs().shortValue());
outBuffer.writeInt(flowModSpec.getDstField().intValue());
outBuffer.writeShort(flowModSpec.getDstOfs().shortValue());
- }else if( flowMod.getFlowModSpec() instanceof FlowModCopyValueIntoFieldCase){
- FlowModCopyValueIntoField flowModSpec = ((FlowModCopyValueIntoFieldCase)flowMod.getFlowModSpec()).getFlowModCopyValueIntoField();
+ } else if (flowMod.getFlowModSpec() instanceof FlowModCopyValueIntoFieldCase) {
+ FlowModCopyValueIntoField flowModSpec = ((FlowModCopyValueIntoFieldCase) flowMod.getFlowModSpec())
+ .getFlowModCopyValueIntoField();
toFlowModSpecHeader(flowModSpec, outBuffer);
outBuffer.writeShort(flowModSpec.getValue().shortValue());
outBuffer.writeInt(flowModSpec.getDstField().intValue());
outBuffer.writeShort(flowModSpec.getDstOfs().shortValue());
- }else if( flowMod.getFlowModSpec() instanceof FlowModOutputToPortCase){
- FlowModOutputToPort flowModSpec = ((FlowModOutputToPortCase)flowMod.getFlowModSpec()).getFlowModOutputToPort();
+ } else if (flowMod.getFlowModSpec() instanceof FlowModOutputToPortCase) {
+ FlowModOutputToPort flowModSpec = ((FlowModOutputToPortCase) flowMod.getFlowModSpec())
+ .getFlowModOutputToPort();
toFlowModSpecHeader(flowModSpec, outBuffer);
outBuffer.writeInt(flowModSpec.getSrcField().intValue());
outBuffer.writeShort(flowModSpec.getSrcOfs().shortValue());
}
private static void serializeFlowModSpecHeader(int src, int dst, short bitNum, ByteBuf outBuffer) {
- short s = 0;
- s |= (src << SRC_POS);
- s |= (dst << DST_POS);
- s |= bitNum;
- outBuffer.writeShort(s);
+ short value = 0;
+ value |= src << SRC_POS;
+ value |= dst << DST_POS;
+ value |= bitNum;
+ outBuffer.writeShort(value);
}
static int calcLength(ActionLearn action) {
- int length = HEADER_LENGTH;
- if(action.getNxActionLearn().getFlowMods() == null){
- return length;
+ int actionLength = HEADER_LENGTH;
+ if (action.getNxActionLearn().getFlowMods() == null) {
+ return actionLength;
}
- for(FlowMods flowMod : action.getNxActionLearn().getFlowMods()){
- if(flowMod.getFlowModSpec() instanceof FlowModAddMatchFromFieldCase){
- length += FROM_FIELD_LENGTH;
- } else if( flowMod.getFlowModSpec() instanceof FlowModAddMatchFromValueCase){
- length += FROM_VALUE_LENGTH;
- } else if( flowMod.getFlowModSpec() instanceof FlowModCopyFieldIntoFieldCase){
- length += FROM_FIELD_LENGTH;
- } else if( flowMod.getFlowModSpec() instanceof FlowModCopyValueIntoFieldCase){
- length += FROM_VALUE_LENGTH;
- } else if( flowMod.getFlowModSpec() instanceof FlowModOutputToPortCase){
- length += TO_PORT_LENGTH;
+ for (FlowMods flowMod : action.getNxActionLearn().getFlowMods()) {
+ if (flowMod.getFlowModSpec() instanceof FlowModAddMatchFromFieldCase) {
+ actionLength += FROM_FIELD_LENGTH;
+ } else if (flowMod.getFlowModSpec() instanceof FlowModAddMatchFromValueCase) {
+ actionLength += FROM_VALUE_LENGTH;
+ } else if (flowMod.getFlowModSpec() instanceof FlowModCopyFieldIntoFieldCase) {
+ actionLength += FROM_FIELD_LENGTH;
+ } else if (flowMod.getFlowModSpec() instanceof FlowModCopyValueIntoFieldCase) {
+ actionLength += FROM_VALUE_LENGTH;
+ } else if (flowMod.getFlowModSpec() instanceof FlowModOutputToPortCase) {
+ actionLength += TO_PORT_LENGTH;
}
}
- return length;
+ return actionLength;
}
/*
nxActionLearnBuilder.setFinHardTimeout(message.readUnsignedShort());
}
- static synchronized void buildFlowModSpecs(NxActionLearnBuilder nxActionLearnBuilder, ByteBuf message, short length) {
- LearnCodecUtil.length = length;
- List<FlowMods> flowModeList = new ArrayList<FlowMods>();
+ static synchronized void buildFlowModSpecs(NxActionLearnBuilder nxActionLearnBuilder, ByteBuf message,
+ short messageLength) {
+ LearnCodecUtil.length = messageLength;
+ List<FlowMods> flowModeList = new ArrayList<>();
- while(LearnCodecUtil.length > 0){
+ while (LearnCodecUtil.length > 0) {
FlowMods flowMod = readFlowMod(message);
- if(flowMod != null){
+ if (flowMod != null) {
flowModeList.add(flowMod);
- }else{
+ } else {
LOG.trace("skipping padding bytes");
}
}
- if(LearnCodecUtil.length != 0){
- LOG.error("Learn Codec read " + Math.abs(length) + " bytes more than needed from stream. Packet might be corrupted");
+ if (LearnCodecUtil.length != 0) {
+ LOG.error("Learn Codec read " + Math.abs(messageLength)
+ + " bytes more than needed from stream. Packet might be corrupted");
}
nxActionLearnBuilder.setFlowMods(flowModeList);
}
private static FlowMods readFlowMod(ByteBuf message) {
short header = message.readShort();
length -= EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
- if(header == 0){
+ if (header == 0) {
return null;
}
short dst = (short) ((header & DST_MASK) >> DST_POS);
short numBits = (short) (header & NUM_BITS_MASK);
- if(src == 0 && dst == 0 && numBits != 0){
+ if (src == 0 && dst == 0 && numBits != 0) {
return readFlowModAddMatchFromField(message, numBits);
- } else if(src == 0 && dst == 0){
+ } else if (src == 0 && dst == 0) {
message.skipBytes(EMPTY_FLOW_MOD_LENGTH);
length -= EMPTY_FLOW_MOD_LENGTH;
- } else if(src == 1 && dst == 0){
+ } else if (src == 1 && dst == 0) {
return readFlowModAddMatchFromValue(message, numBits);
- } else if(src == 0 && dst == 1){
+ } else if (src == 0 && dst == 1) {
return readFlowModCopyFromField(message, numBits);
- } else if(src == 1 && dst == 1){
+ } else if (src == 1 && dst == 1) {
return readFlowModCopyFromValue(message, numBits);
- } else if(src == 0 && dst == 2){
+ } else if (src == 0 && dst == 2) {
return readFlowToPort(message, numBits);
}
return null;
private static FlowMods readFlowModAddMatchFromValue(ByteBuf message, short numBits) {
FlowModAddMatchFromValueBuilder builder = new FlowModAddMatchFromValueBuilder();
- builder.setValue((int) message.readUnsignedShort());
+ builder.setValue(message.readUnsignedShort());
builder.setSrcField((long) message.readInt());
builder.setSrcOfs((int) message.readShort());
builder.setFlowModNumBits((int) numBits);
private static FlowMods readFlowModCopyFromValue(ByteBuf message, short numBits) {
FlowModCopyValueIntoFieldBuilder builder = new FlowModCopyValueIntoFieldBuilder();
- builder.setValue((int) message.readUnsignedShort());
+ builder.setValue(message.readUnsignedShort());
builder.setDstField((long) message.readInt());
builder.setDstOfs((int) message.readShort());
builder.setFlowModNumBits((int) numBits);
flowModsBuilder.setFlowModSpec(caseBuilder.build());
return flowModsBuilder.build();
}
-
-
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipath;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipathBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.NxActionMultipathBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
- * Codec for the NX_MULTIPATH
+ * Codec for the NX_MULTIPATH.
*/
public class MultipathCodec extends AbstractActionCodec {
public static final int LENGTH = 32;
@Override
public void serialize(final Action input, final ByteBuf outBuffer) {
- ActionMultipath action = ((ActionMultipath) input.getActionChoice());
+ ActionMultipath action = (ActionMultipath) input.getActionChoice();
serializeHeader(LENGTH, NXAST_MULTIPATH_SUBTYPE, outBuffer);
outBuffer.writeShort(action.getNxActionMultipath().getFields().getIntValue());
@Override
public Action deserialize(final ByteBuf message) {
- ActionBuilder actionBuilder = deserializeHeader(message);
- ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();
+ final ActionBuilder actionBuilder = deserializeHeader(message);
+ final ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();
NxActionMultipathBuilder nxActionMultipathBuilder = new NxActionMultipathBuilder();
nxActionMultipathBuilder.setFields(OfjNxHashFields.forValue(message.readUnsignedShort()));
package org.opendaylight.openflowjava.nx.codec.action;
/**
- * @author msunal
+ * Defines the Nicira action codecs.
*
+ * @author msunal
*/
-public class NiciraActionCodecs {
-
- private NiciraActionCodecs() {
- }
-
- public static final RegMoveCodec REG_MOVE_CODEC = new RegMoveCodec();
- public static final RegLoadCodec REG_LOAD_CODEC = new RegLoadCodec();
- public static final OutputRegCodec OUTPUT_REG_CODEC = new OutputRegCodec();
- public static final ResubmitCodec RESUBMIT_CODEC = new ResubmitCodec();
- public static final MultipathCodec MULTIPATH_CODEC = new MultipathCodec();
- public static final PushNshCodec PUSH_NSH_CODEC = new PushNshCodec();
- public static final PopNshCodec POP_NSH_CODEC = new PopNshCodec();
- public static final ConntrackCodec CONNTRACK_CODEC = new ConntrackCodec();
- public static final LearnCodec LEARN_CODEC = new LearnCodec();
- public static final FinTimeoutCodec FIN_TIMEOUT_CODEC = new FinTimeoutCodec();
+public interface NiciraActionCodecs {
+ RegMoveCodec REG_MOVE_CODEC = new RegMoveCodec();
+ RegLoadCodec REG_LOAD_CODEC = new RegLoadCodec();
+ OutputRegCodec OUTPUT_REG_CODEC = new OutputRegCodec();
+ ResubmitCodec RESUBMIT_CODEC = new ResubmitCodec();
+ MultipathCodec MULTIPATH_CODEC = new MultipathCodec();
+ PushNshCodec PUSH_NSH_CODEC = new PushNshCodec();
+ PopNshCodec POP_NSH_CODEC = new PopNshCodec();
+ ConntrackCodec CONNTRACK_CODEC = new ConntrackCodec();
+ LearnCodec LEARN_CODEC = new LearnCodec();
+ FinTimeoutCodec FIN_TIMEOUT_CODEC = new FinTimeoutCodec();
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder;
/**
- * Codec for the Nicira OutputRegAction
+ * Codec for the Nicira OutputRegAction.
*
* @author readams
*/
@Override
public void serialize(final Action input, final ByteBuf outBuffer) {
- ActionOutputReg action = ((ActionOutputReg) input.getActionChoice());
+ ActionOutputReg action = (ActionOutputReg) input.getActionChoice();
serializeHeader(LENGTH, SUBTYPE, outBuffer);
outBuffer.writeShort(action.getNxActionOutputReg().getNBits().shortValue());
outBuffer.writeInt(action.getNxActionOutputReg().getSrc().intValue());
@Override
public Action deserialize(final ByteBuf message) {
- ActionBuilder actionBuilder = deserializeHeader(message);
- ActionOutputRegBuilder builder = new ActionOutputRegBuilder();
+ final ActionBuilder actionBuilder = deserializeHeader(message);
+ final ActionOutputRegBuilder builder = new ActionOutputRegBuilder();
NxActionOutputRegBuilder nxActionOutputRegBuilder = new NxActionOutputRegBuilder();
nxActionOutputRegBuilder.setNBits(message.readUnsignedShort());
nxActionOutputRegBuilder.setSrc(message.readUnsignedInt());
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.pop.nsh.grouping.NxActionPopNshBuilder;
/**
- * Codec for the pop_nsh
+ * Codec for the pop_nsh.
*/
public class PopNshCodec extends AbstractActionCodec {
public static final int LENGTH = 16;
new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPopNsh.class);
public static final NiciraActionDeserializerKey DESERIALIZER_KEY =
new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, NXAST_POP_NSH_SUBTYPE);
- private static final int padding = 6;
+ private static final int PADDING = 6;
@Override
public void serialize(Action input, ByteBuf outBuffer) {
- ActionPopNsh action = ((ActionPopNsh) input.getActionChoice());
+ ActionPopNsh action = (ActionPopNsh) input.getActionChoice();
serializeHeader(LENGTH, NXAST_POP_NSH_SUBTYPE, outBuffer);
- outBuffer.writeZero(padding);
+ outBuffer.writeZero(PADDING);
}
@Override
ActionBuilder actionBuilder = deserializeHeader(message);
ActionPopNshBuilder builder = new ActionPopNshBuilder();
NxActionPopNshBuilder nxActionPopNshBuilder = new NxActionPopNshBuilder();
- message.skipBytes(padding);
+ message.skipBytes(PADDING);
builder.setNxActionPopNsh(nxActionPopNshBuilder.build());
actionBuilder.setActionChoice(builder.build());
return actionBuilder.build();
}
-
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.push.nsh.grouping.NxActionPushNshBuilder;
/**
- * Codec for the push_nsh
+ * Codec for the push_nsh.
*/
public class PushNshCodec extends AbstractActionCodec {
public static final int LENGTH = 16;
new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPushNsh.class);
public static final NiciraActionDeserializerKey DESERIALIZER_KEY =
new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, NXAST_PUSH_NSH_SUBTYPE);
- private static final int padding = 6;
+ private static final int PADDING = 6;
@Override
public void serialize(Action input, ByteBuf outBuffer) {
- ActionPushNsh action = ((ActionPushNsh) input.getActionChoice());
+ ActionPushNsh action = (ActionPushNsh) input.getActionChoice();
serializeHeader(LENGTH, NXAST_PUSH_NSH_SUBTYPE, outBuffer);
- outBuffer.writeZero(padding);
+ outBuffer.writeZero(PADDING);
}
@Override
ActionBuilder actionBuilder = deserializeHeader(message);
ActionPushNshBuilder builder = new ActionPushNshBuilder();
NxActionPushNshBuilder nxActionPushNshBuilder = new NxActionPushNshBuilder();
- message.skipBytes(padding);
+ message.skipBytes(PADDING);
builder.setNxActionPushNsh(nxActionPushNshBuilder.build());
actionBuilder.setActionChoice(builder.build());
return actionBuilder.build();
@Override
public void serialize(final Action input, final ByteBuf outBuffer) {
- ActionRegLoad actionRegLoad = ((ActionRegLoad) input.getActionChoice());
+ ActionRegLoad actionRegLoad = (ActionRegLoad) input.getActionChoice();
serializeHeader(LENGTH, SUBTYPE, outBuffer);
outBuffer.writeShort(actionRegLoad.getNxActionRegLoad().getOfsNbits());
outBuffer.writeInt(actionRegLoad.getNxActionRegLoad().getDst().intValue());
@Override
public Action deserialize(final ByteBuf message) {
- ActionBuilder actionBuilder = deserializeHeader(message);
+ final ActionBuilder actionBuilder = deserializeHeader(message);
NxActionRegLoadBuilder nxActionRegLoadBuilder = new NxActionRegLoadBuilder();
- ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
+ final ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
nxActionRegLoadBuilder.setOfsNbits(message.readUnsignedShort());
nxActionRegLoadBuilder.setDst(message.readUnsignedInt());
nxActionRegLoadBuilder.setValue(BigInteger.valueOf(message.readLong()));
actionBuilder.setActionChoice(actionRegLoadBuilder.build());
return actionBuilder.build();
}
-
}
@Override
public void serialize(final Action input, final ByteBuf outBuffer) {
- ActionRegMove actionRegMove = ((ActionRegMove) input.getActionChoice());
+ ActionRegMove actionRegMove = (ActionRegMove) input.getActionChoice();
serializeHeader(LENGTH, SUBTYPE, outBuffer);
outBuffer.writeShort(actionRegMove.getNxActionRegMove().getNBits());
outBuffer.writeShort(actionRegMove.getNxActionRegMove().getSrcOfs());
@Override
public Action deserialize(final ByteBuf message) {
- ActionBuilder actionBuilder = deserializeHeader(message);
- ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
+ final ActionBuilder actionBuilder = deserializeHeader(message);
+ final ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
NxActionRegMoveBuilder nxActionRegMoveBuilder = new NxActionRegMoveBuilder();
nxActionRegMoveBuilder.setNBits(message.readUnsignedShort());
nxActionRegMoveBuilder.setSrcOfs(message.readUnsignedShort());
actionBuilder.setActionChoice(actionRegMoveBuilder.build());
return actionBuilder.build();
}
-
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.resubmit.grouping.NxActionResubmitBuilder;
/**
- * Codec for the NX_RESUBMIT and NX_RESUBMIT_TABLE
+ * Codec for the NX_RESUBMIT and NX_RESUBMIT_TABLE.
*/
public class ResubmitCodec extends AbstractActionCodec {
private static final byte OFP_TABLE_ALL = (byte) 255;
private static final short OFP_IN_PORT = (short) 0xfff8;
- private static final int padding = 3; // nx_action_resubmit : uint8_t pad[3];
+ private static final int PADDING = 3; // nx_action_resubmit : uint8_t pad[3];
public byte getSubType(final ActionResubmit action) {
- if ((action.getNxActionResubmit().getTable() == null) || (action.getNxActionResubmit().getTable().byteValue() == OFP_TABLE_ALL)) {
+ if (action.getNxActionResubmit().getTable() == null
+ || action.getNxActionResubmit().getTable().byteValue() == OFP_TABLE_ALL) {
return NXAST_RESUBMIT_SUBTYPE;
}
return NXAST_RESUBMIT_TABLE_SUBTYPE;
byte table = OFP_TABLE_ALL;
short inPort = OFP_IN_PORT;
- ActionResubmit action = ((ActionResubmit) input.getActionChoice());
+ ActionResubmit action = (ActionResubmit) input.getActionChoice();
serializeHeader(LENGTH, getSubType(action), outBuffer);
if (action.getNxActionResubmit().getInPort() != null) {
}
outBuffer.writeShort(inPort);
outBuffer.writeByte(table);
- outBuffer.writeZero(padding);
+ outBuffer.writeZero(PADDING);
}
@Override
public Action deserialize(final ByteBuf message) {
- ActionBuilder actionBuilder = deserializeHeader(message);
+ final ActionBuilder actionBuilder = deserializeHeader(message);
ActionResubmitBuilder builder = new ActionResubmitBuilder();
NxActionResubmitBuilder nxActionResubmitBuilder = new NxActionResubmitBuilder();
nxActionResubmitBuilder.setInPort(message.readUnsignedShort());
nxActionResubmitBuilder.setTable(message.readUnsignedByte());
builder.setNxActionResubmit(nxActionResubmitBuilder.build());
- message.skipBytes(padding);
+ message.skipBytes(PADDING);
actionBuilder.setActionChoice(builder.build());
return actionBuilder.build();
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
}
/**
- * @return numeric representation of nxm_field
+ * Returns the numeric representation of nxm_field.
*/
public abstract int getNxmFieldCode();
/**
- * @return numeric representation of oxm_class
+ * Returns the numeric representation of oxm_class.
*/
public abstract int getOxmClassCode();
/**
- * @return match entry value length
+ * Returns the match entry value length.
*/
public abstract int getValueLength();
/**
- * @return nxm_field class
+ * Returns the nxm_field class.
*/
public abstract Class<? extends MatchField> getNxmField();
/**
- * @return oxm_class class
+ * Returns the oxm_class class.
*/
public abstract Class<? extends OxmClassBase> getOxmClass();
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtMark;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.mark.grouping.CtMarkValuesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtMarkCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtMarkCaseValueBuilder;
/**
+ * Codec for CtMark.
+ * s
* @author Bertrand Low.
*/
-
public class CtMarkCodec extends AbstractMatchCodec {
private static final int VALUE_LENGTH = 8;
@Override
public MatchEntry deserialize(ByteBuf message) {
- MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
+ final MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
CtMarkCaseValueBuilder caseBuilder = new CtMarkCaseValueBuilder();
CtMarkValuesBuilder ctMarkValuesBuilder = new CtMarkValuesBuilder();
if (matchEntryBuilder.isHasMask()) {
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtState;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.state.grouping.CtStateValuesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtStateCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtStateCaseValueBuilder;
/**
+ * Codec for CtSate.
+ *
* @author Aswin Suryanarayanan.
*/
-
public class CtStateCodec extends AbstractMatchCodec {
private static final int VALUE_LENGTH = 8;
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- CtStateCaseValue ctStateCase = ((CtStateCaseValue) input.getMatchEntryValue());
+ CtStateCaseValue ctStateCase = (CtStateCaseValue) input.getMatchEntryValue();
outBuffer.writeInt(ctStateCase.getCtStateValues().getCtState().intValue());
outBuffer.writeInt(ctStateCase.getCtStateValues().getMask().intValue());
}
@Override
public MatchEntry deserialize(ByteBuf message) {
- MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
+ final MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
CtStateCaseValueBuilder caseBuilder = new CtStateCaseValueBuilder();
CtStateValuesBuilder ctStateValuesBuilder = new CtStateValuesBuilder();
ctStateValuesBuilder.setCtState(message.readUnsignedInt());
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtZone;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.zone.grouping.CtZoneValuesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValueBuilder;
/**
+ * Codec for CtZone.
+ *
* @author Aswin Suryanarayanan.
*/
-
public class CtZoneCodec extends AbstractMatchCodec {
private static final int VALUE_LENGTH = 2;
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- CtZoneCaseValue ctZoneCase = ((CtZoneCaseValue) input.getMatchEntryValue());
+ CtZoneCaseValue ctZoneCase = (CtZoneCaseValue) input.getMatchEntryValue();
outBuffer.writeShort(ctZoneCase.getCtZoneValues().getCtZone());
}
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
private static final int VALUE_LENGTH = 6;
private static final int NXM_FIELD_CODE = 122;
- public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthDst> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthDst.class);
+ public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthDst> SERIALIZER_KEY =
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthDst.class);
public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- EncapEthDstCaseValue value = ((EncapEthDstCaseValue) input.getMatchEntryValue());
+ EncapEthDstCaseValue value = (EncapEthDstCaseValue) input.getMatchEntryValue();
outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(value.getEncapEthDstValues().getMacAddress().getValue()));
}
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
private static final int VALUE_LENGTH = 6;
private static final int NXM_FIELD_CODE = 121;
- public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthSrc> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthSrc.class);
+ public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthSrc> SERIALIZER_KEY =
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthSrc.class);
public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- EncapEthSrcCaseValue value = ((EncapEthSrcCaseValue) input.getMatchEntryValue());
+ EncapEthSrcCaseValue value = (EncapEthSrcCaseValue) input.getMatchEntryValue();
outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(value.getEncapEthSrcValues().getMacAddress().getValue()));
}
private static final int VALUE_LENGTH = 2;
private static final int NXM_FIELD_CODE = 123;
- public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthType> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthType.class);
+ public static final MatchEntrySerializerKey<Nxm1Class, NxmNxEncapEthType> SERIALIZER_KEY =
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxEncapEthType.class);
public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- EncapEthTypeCaseValue encapEthTypeCaseValue = ((EncapEthTypeCaseValue) input.getMatchEntryValue());
+ EncapEthTypeCaseValue encapEthTypeCaseValue = (EncapEthTypeCaseValue) input.getMatchEntryValue();
outBuffer.writeShort(encapEthTypeCaseValue.getEncapEthTypeValues().getEncapEthType().intValue());
}
@Override
public MatchEntry deserialize(ByteBuf message) {
MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
- EncapEthTypeCaseValueBuilder encapEthTypeCaseValueBuilder= new EncapEthTypeCaseValueBuilder();
- encapEthTypeCaseValueBuilder.setEncapEthTypeValues(new EncapEthTypeValuesBuilder().setEncapEthType(message.readUnsignedShort()).build());
+ EncapEthTypeCaseValueBuilder encapEthTypeCaseValueBuilder = new EncapEthTypeCaseValueBuilder();
+ encapEthTypeCaseValueBuilder.setEncapEthTypeValues(
+ new EncapEthTypeValuesBuilder().setEncapEthType(message.readUnsignedShort()).build());
matchEntryBuilder.setMatchEntryValue(encapEthTypeCaseValueBuilder.build());
matchEntryBuilder.setHasMask(false);
return matchEntryBuilder.build();
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIcmpType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IcmpTypeCaseValue;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIcmpType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.icmp.type.grouping.IcmpTypeValuesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IcmpTypeCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IcmpTypeCaseValueBuilder;
/**
+ * Codec for the Icmp type message.
+ *
* @author Josh Hershberg (jhershbe@redhat.com)
*/
public class IcmpTypeCodec extends AbstractMatchCodec {
private static final int VALUE_LENGTH = 1;
private static final int NXM_FIELD_CODE = 13;
- public static final MatchEntrySerializerKey<Nxm0Class, NxmOfIcmpType> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfIcmpType.class);
+ public static final MatchEntrySerializerKey<Nxm0Class, NxmOfIcmpType> SERIALIZER_KEY =
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfIcmpType.class);
public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, NXM_FIELD_CODE);
public MatchEntry deserialize(ByteBuf message) {
MatchEntryBuilder matchEntriesBuilder = deserializeHeaderToBuilder(message);
IcmpTypeCaseValueBuilder icmpTypeCaseValueBuilder = new IcmpTypeCaseValueBuilder();
- icmpTypeCaseValueBuilder.setIcmpTypeValues(new IcmpTypeValuesBuilder().setValue(message.readUnsignedByte()).build());
+ icmpTypeCaseValueBuilder.setIcmpTypeValues(new IcmpTypeValuesBuilder()
+ .setValue(message.readUnsignedByte()).build());
matchEntriesBuilder.setMatchEntryValue(icmpTypeCaseValueBuilder.build());
matchEntriesBuilder.setHasMask(false);
return matchEntriesBuilder.build();
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- IcmpTypeCaseValue icmpTypeValue = ((IcmpTypeCaseValue) input.getMatchEntryValue());
+ IcmpTypeCaseValue icmpTypeValue = (IcmpTypeCaseValue) input.getMatchEntryValue();
outBuffer.writeByte(icmpTypeValue.getIcmpTypeValues().getValue());
}
*/
package org.opendaylight.openflowjava.nx.codec.match;
+import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfInPortCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfInPortCaseValueBuilder;
-import io.netty.buffer.ByteBuf;
-
public class InPortCodec extends AbstractMatchCodec {
private static final int VALUE_LENGTH = 2;
public Class<? extends OxmClassBase> getOxmClass() {
return Nxm0Class.class;
}
-
}
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIpDst;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.ip.dst.grouping.IpDstValuesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpDstCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpDstCaseValueBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.ip.dst.grouping.IpDstValuesBuilder;
/**
+ * Codec for the IpDst message.
+ *
* @author Josh Hershberg (jhershbe@redhat.com)
*/
public class IpDstCodec extends AbstractMatchCodec {
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- IpDstCaseValue ipDstCase = ((IpDstCaseValue) input.getMatchEntryValue());
+ IpDstCaseValue ipDstCase = (IpDstCaseValue) input.getMatchEntryValue();
outBuffer.writeInt(ipDstCase.getIpDstValues().getValue().intValue());
}
public Class<? extends OxmClassBase> getOxmClass() {
return Nxm0Class.class;
}
-
}
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIpSrc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfIpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.ip.src.grouping.IpSrcValuesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpSrcCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpSrcCaseValueBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.ip.src.grouping.IpSrcValuesBuilder;
/**
+ * Codec for the IpSrc message.
+ *
* @author Josh Hershberg (jhershbe@redhat.com)
*/
public class IpSrcCodec extends AbstractMatchCodec {
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- IpSrcCaseValue ipSrcCase = ((IpSrcCaseValue) input.getMatchEntryValue());
+ IpSrcCaseValue ipSrcCase = (IpSrcCaseValue) input.getMatchEntryValue();
outBuffer.writeInt(ipSrcCase.getIpSrcValues().getValue().intValue());
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpDstCaseValueBuilder;
/**
+ * Codec for the Ipv6Dst message.
+ *
* @author Sridhar Gaddam (sgaddam@redhat.com)
*/
public class Ipv6DstCodec extends AbstractMatchCodec {
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- IpDstCaseValue ipDstCase = ((IpDstCaseValue) input.getMatchEntryValue());
+ IpDstCaseValue ipDstCase = (IpDstCaseValue) input.getMatchEntryValue();
outBuffer.writeInt(ipDstCase.getIpDstValues().getValue().intValue());
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.IpSrcCaseValueBuilder;
/**
+ * Codec for the Ipv6Src message.
+ *
* @author Sridhar Gaddam (sgaddam@redhat.com)
*/
public class Ipv6SrcCodec extends AbstractMatchCodec {
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- IpSrcCaseValue ipSrcCase = ((IpSrcCaseValue) input.getMatchEntryValue());
+ IpSrcCaseValue ipSrcCase = (IpSrcCaseValue) input.getMatchEntryValue();
outBuffer.writeInt(ipSrcCase.getIpSrcValues().getValue().intValue());
}
*/
package org.opendaylight.openflowjava.nx.codec.match;
+import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfMplsLabelCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfMplsLabelCaseValueBuilder;
-import io.netty.buffer.ByteBuf;
-
public class MplsLabelCodec extends AbstractMatchCodec {
- private static final int VALUE_LENGTH = 4;
- private static final int NXM_FIELD_CODE = 34;
+ private static final int VALUE_LENGTH = 4;
+ private static final int NXM_FIELD_CODE = 34;
- public static final MatchEntrySerializerKey<Nxm0Class, NxmOfMplsLabel> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, Nxm0Class.class,
- NxmOfMplsLabel.class);
+ public static final MatchEntrySerializerKey<Nxm0Class, NxmOfMplsLabel> SERIALIZER_KEY =
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfMplsLabel.class);
- public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
- EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS,
- NXM_FIELD_CODE);
+ public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
+ EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, NXM_FIELD_CODE);
- @Override
- public void serialize(MatchEntry input, ByteBuf outBuffer) {
- serializeHeader(input, outBuffer);
- OfMplsLabelCaseValue value = (OfMplsLabelCaseValue) input.getMatchEntryValue();
- outBuffer.writeInt(value.getMplsLabelValues().getMplsLabel().intValue());
- }
+ @Override
+ public void serialize(MatchEntry input, ByteBuf outBuffer) {
+ serializeHeader(input, outBuffer);
+ OfMplsLabelCaseValue value = (OfMplsLabelCaseValue) input.getMatchEntryValue();
+ outBuffer.writeInt(value.getMplsLabelValues().getMplsLabel().intValue());
+ }
- @Override
- public MatchEntry deserialize(ByteBuf message) {
- MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
- OfMplsLabelCaseValueBuilder caseBuilder = new OfMplsLabelCaseValueBuilder();
- MplsLabelValuesBuilder valuesBuilder = new MplsLabelValuesBuilder();
- valuesBuilder.setMplsLabel(message.readLong()).build();
- caseBuilder.setMplsLabelValues(valuesBuilder.build());
- matchEntryBuilder.setMatchEntryValue(caseBuilder.build());
- return matchEntryBuilder.build();
- }
+ @Override
+ public MatchEntry deserialize(ByteBuf message) {
+ MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
+ OfMplsLabelCaseValueBuilder caseBuilder = new OfMplsLabelCaseValueBuilder();
+ MplsLabelValuesBuilder valuesBuilder = new MplsLabelValuesBuilder();
+ valuesBuilder.setMplsLabel(message.readLong()).build();
+ caseBuilder.setMplsLabelValues(valuesBuilder.build());
+ matchEntryBuilder.setMatchEntryValue(caseBuilder.build());
+ return matchEntryBuilder.build();
+ }
- @Override
- public int getNxmFieldCode() {
- return NXM_FIELD_CODE;
- }
+ @Override
+ public int getNxmFieldCode() {
+ return NXM_FIELD_CODE;
+ }
- @Override
- public int getOxmClassCode() {
- return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
- }
+ @Override
+ public int getOxmClassCode() {
+ return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
+ }
- @Override
- public int getValueLength() {
- return VALUE_LENGTH;
- }
+ @Override
+ public int getValueLength() {
+ return VALUE_LENGTH;
+ }
- @Override
- public Class<? extends MatchField> getNxmField() {
- return NxmOfMplsLabel.class;
- }
+ @Override
+ public Class<? extends MatchField> getNxmField() {
+ return NxmOfMplsLabel.class;
+ }
- @Override
- public Class<? extends OxmClassBase> getOxmClass() {
- return Nxm0Class.class;
- }
+ @Override
+ public Class<? extends OxmClassBase> getOxmClass() {
+ return Nxm0Class.class;
+ }
}
package org.opendaylight.openflowjava.nx.codec.match;
/**
+ * Defines Nicira match codecs.
+ *
* @author msunal
* @author Josh Hershberg (jhershbe@redhat.com)
*/
-public class NiciraMatchCodecs {
- private NiciraMatchCodecs () { }
-
- public static final Reg0Codec REG0_CODEC = new Reg0Codec();
- public static final Reg1Codec REG1_CODEC = new Reg1Codec();
- public static final Reg2Codec REG2_CODEC = new Reg2Codec();
- public static final Reg3Codec REG3_CODEC = new Reg3Codec();
- public static final Reg4Codec REG4_CODEC = new Reg4Codec();
- public static final Reg5Codec REG5_CODEC = new Reg5Codec();
- public static final Reg6Codec REG6_CODEC = new Reg6Codec();
- public static final Reg7Codec REG7_CODEC = new Reg7Codec();
- public static final TunIdCodec TUN_ID_CODEC = new TunIdCodec();
- public static final ArpOpCodec ARP_OP_CODEC = new ArpOpCodec();
- public static final ArpShaCodec ARP_SHA_CODEC = new ArpShaCodec();
- public static final ArpSpaCodec ARP_SPA_CODEC = new ArpSpaCodec();
- public static final ArpThaCodec ARP_THA_CODEC = new ArpThaCodec();
- public static final ArpTpaCodec ARP_TPA_CODEC = new ArpTpaCodec();
- public static final InPortCodec NXM_OF_IN_PORT_CODEC = new InPortCodec();
- public static final MplsLabelCodec OXM_OF_MPLS_LABEL = new MplsLabelCodec();
- public static final MetadataCodec OXM_OF_METADATA_CODEC = new MetadataCodec();
- public static final EthDstCodec ETH_DST_CODEC = new EthDstCodec();
- public static final EthSrcCodec ETH_SRC_CODEC = new EthSrcCodec();
- public static final TunIpv4DstCodec TUN_IPV4_DST_CODEC = new TunIpv4DstCodec();
- public static final TunIpv4SrcCodec TUN_IPV4_SRC_CODEC = new TunIpv4SrcCodec();
- public static final EthTypeCodec ETH_TYPE_CODEC = new EthTypeCodec();
- public static final NspCodec NSP_CODEC = new NspCodec();
- public static final NsiCodec NSI_CODEC = new NsiCodec();
- public static final Nshc1Codec NSC1_CODEC = new Nshc1Codec();
- public static final Nshc2Codec NSC2_CODEC = new Nshc2Codec();
- public static final Nshc3Codec NSC3_CODEC = new Nshc3Codec();
- public static final Nshc4Codec NSC4_CODEC = new Nshc4Codec();
- public static final EncapEthTypeCodec ENCAP_ETH_TYPE_CODEC = new EncapEthTypeCodec();
- public static final EncapEthSrcCodec ENCAP_ETH_SRC_CODEC = new EncapEthSrcCodec();
- public static final EncapEthDstCodec ENCAP_ETH_DST_CODEC = new EncapEthDstCodec();
- public static final NshMdtypeCodec NSH_MDTYPE_CODEC = new NshMdtypeCodec();
- public static final NshNpCodec NSH_NP_CODEC = new NshNpCodec();
- public static final TunGpeNpCodec TUN_GPE_NP_CODEC = new TunGpeNpCodec();
- public static final TcpSrcCodec TCP_SRC_CODEC = new TcpSrcCodec();
- public static final TcpDstCodec TCP_DST_CODEC = new TcpDstCodec();
- public static final UdpSrcCodec UDP_SRC_CODEC = new UdpSrcCodec();
- public static final UdpDstCodec UDP_DST_CODEC = new UdpDstCodec();
- public static final CtStateCodec CT_ST_CODEC = new CtStateCodec();
- public static final CtZoneCodec CT_ZONE_CODEC = new CtZoneCodec();
- public static final IpSrcCodec IP_SRC_CODEC = new IpSrcCodec();
- public static final IpDstCodec IP_DST_CODEC = new IpDstCodec();
- public static final Ipv6SrcCodec IPV6_SRC_CODEC = new Ipv6SrcCodec();
- public static final Ipv6DstCodec IPV6_DST_CODEC = new Ipv6DstCodec();
- public static final IcmpTypeCodec ICMP_TYPE_CODEC = new IcmpTypeCodec();
- public static final CtMarkCodec CT_MARK_CODEC = new CtMarkCodec();
+public interface NiciraMatchCodecs {
+ Reg0Codec REG0_CODEC = new Reg0Codec();
+ Reg1Codec REG1_CODEC = new Reg1Codec();
+ Reg2Codec REG2_CODEC = new Reg2Codec();
+ Reg3Codec REG3_CODEC = new Reg3Codec();
+ Reg4Codec REG4_CODEC = new Reg4Codec();
+ Reg5Codec REG5_CODEC = new Reg5Codec();
+ Reg6Codec REG6_CODEC = new Reg6Codec();
+ Reg7Codec REG7_CODEC = new Reg7Codec();
+ TunIdCodec TUN_ID_CODEC = new TunIdCodec();
+ ArpOpCodec ARP_OP_CODEC = new ArpOpCodec();
+ ArpShaCodec ARP_SHA_CODEC = new ArpShaCodec();
+ ArpSpaCodec ARP_SPA_CODEC = new ArpSpaCodec();
+ ArpThaCodec ARP_THA_CODEC = new ArpThaCodec();
+ ArpTpaCodec ARP_TPA_CODEC = new ArpTpaCodec();
+ InPortCodec NXM_OF_IN_PORT_CODEC = new InPortCodec();
+ MplsLabelCodec OXM_OF_MPLS_LABEL = new MplsLabelCodec();
+ MetadataCodec OXM_OF_METADATA_CODEC = new MetadataCodec();
+ EthDstCodec ETH_DST_CODEC = new EthDstCodec();
+ EthSrcCodec ETH_SRC_CODEC = new EthSrcCodec();
+ TunIpv4DstCodec TUN_IPV4_DST_CODEC = new TunIpv4DstCodec();
+ TunIpv4SrcCodec TUN_IPV4_SRC_CODEC = new TunIpv4SrcCodec();
+ EthTypeCodec ETH_TYPE_CODEC = new EthTypeCodec();
+ NspCodec NSP_CODEC = new NspCodec();
+ NsiCodec NSI_CODEC = new NsiCodec();
+ Nshc1Codec NSC1_CODEC = new Nshc1Codec();
+ Nshc2Codec NSC2_CODEC = new Nshc2Codec();
+ Nshc3Codec NSC3_CODEC = new Nshc3Codec();
+ Nshc4Codec NSC4_CODEC = new Nshc4Codec();
+ EncapEthTypeCodec ENCAP_ETH_TYPE_CODEC = new EncapEthTypeCodec();
+ EncapEthSrcCodec ENCAP_ETH_SRC_CODEC = new EncapEthSrcCodec();
+ EncapEthDstCodec ENCAP_ETH_DST_CODEC = new EncapEthDstCodec();
+ NshMdtypeCodec NSH_MDTYPE_CODEC = new NshMdtypeCodec();
+ NshNpCodec NSH_NP_CODEC = new NshNpCodec();
+ TunGpeNpCodec TUN_GPE_NP_CODEC = new TunGpeNpCodec();
+ TcpSrcCodec TCP_SRC_CODEC = new TcpSrcCodec();
+ TcpDstCodec TCP_DST_CODEC = new TcpDstCodec();
+ UdpSrcCodec UDP_SRC_CODEC = new UdpSrcCodec();
+ UdpDstCodec UDP_DST_CODEC = new UdpDstCodec();
+ CtStateCodec CT_ST_CODEC = new CtStateCodec();
+ CtZoneCodec CT_ZONE_CODEC = new CtZoneCodec();
+ IpSrcCodec IP_SRC_CODEC = new IpSrcCodec();
+ IpDstCodec IP_DST_CODEC = new IpDstCodec();
+ Ipv6SrcCodec IPV6_SRC_CODEC = new Ipv6SrcCodec();
+ Ipv6DstCodec IPV6_DST_CODEC = new Ipv6DstCodec();
+ IcmpTypeCodec ICMP_TYPE_CODEC = new IcmpTypeCodec();
+ CtMarkCodec CT_MARK_CODEC = new CtMarkCodec();
}
private static final int VALUE_LENGTH = 1;
private static final int NXM_FIELD_CODE = 119;
- public static final MatchEntrySerializerKey<Nxm1Class, NxmNxNshMdtype> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshMdtype.class);
+ public static final MatchEntrySerializerKey<Nxm1Class, NxmNxNshMdtype> SERIALIZER_KEY =
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshMdtype.class);
public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- NshMdtypeCaseValue nshMdtypeCaseValue = ((NshMdtypeCaseValue) input.getMatchEntryValue());
+ NshMdtypeCaseValue nshMdtypeCaseValue = (NshMdtypeCaseValue) input.getMatchEntryValue();
outBuffer.writeByte(nshMdtypeCaseValue.getNshMdtypeValues().getValue());
}
public MatchEntry deserialize(ByteBuf message) {
MatchEntryBuilder matchEntriesBuilder = deserializeHeaderToBuilder(message);
NshMdtypeCaseValueBuilder nshMdtypeCaseValueBuilder = new NshMdtypeCaseValueBuilder();
- nshMdtypeCaseValueBuilder.setNshMdtypeValues(new NshMdtypeValuesBuilder().setValue(message.readUnsignedByte()).build());
+ nshMdtypeCaseValueBuilder.setNshMdtypeValues(new NshMdtypeValuesBuilder()
+ .setValue(message.readUnsignedByte()).build());
matchEntriesBuilder.setMatchEntryValue(nshMdtypeCaseValueBuilder.build());
matchEntriesBuilder.setHasMask(false);
return matchEntriesBuilder.build();
/**
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
+ *
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
import com.google.common.primitives.Ints;
/**
- * @author msunal
+ * Nxm header.
*
+ * @author msunal
*/
public class NxmHeader {
this.nxmField = nxmField;
this.hasMask = hasMask;
this.length = length;
- this.headerAsLong = ((((long) oxmClass) << 16) | (nxmField << 9) | ((hasMask ? 1 : 0) << 8) | (length));
+ this.headerAsLong = (long) oxmClass << 16 | nxmField << 9 | (hasMask ? 1 : 0) << 8 | length;
}
- private static long extractSub(final long l, final int nrBits, final int offset) {
- final long rightShifted = l >>> offset;
+ private static long extractSub(final long value, final int nrBits, final int offset) {
+ final long rightShifted = value >>> offset;
final long mask = (1L << nrBits) - 1L;
return rightShifted & mask;
}
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + (int) (headerAsLong ^ (headerAsLong >>> 32));
+ result = prime * result + (int) (headerAsLong ^ headerAsLong >>> 32);
return result;
}
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfTcpDst;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.tcp.dst.grouping.TcpDstValuesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TcpDstCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TcpDstCaseValueBuilder;
/**
+ * Codec for the TcpDst message.
+ *
* @author Aswin Suryanarayanan.
*/
-
public class TcpDstCodec extends AbstractMatchCodec {
private static final int VALUE_LENGTH = 4;
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- TcpDstCaseValue tcpDstCase = ((TcpDstCaseValue) input.getMatchEntryValue());
+ TcpDstCaseValue tcpDstCase = (TcpDstCaseValue) input.getMatchEntryValue();
outBuffer.writeShort(tcpDstCase.getTcpDstValues().getPort().getValue());
outBuffer.writeShort(tcpDstCase.getTcpDstValues().getMask());
}
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfTcpSrc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.tcp.src.grouping.TcpSrcValuesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TcpSrcCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TcpSrcCaseValueBuilder;
/**
+ * Codec for the TcpSrc message..
+ *
* @author Aswin Suryanarayanan.
*/
-
public class TcpSrcCodec extends AbstractMatchCodec {
private static final int VALUE_LENGTH = 4;
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- TcpSrcCaseValue tcpSrcCase = ((TcpSrcCaseValue) input.getMatchEntryValue());
+ TcpSrcCaseValue tcpSrcCase = (TcpSrcCaseValue) input.getMatchEntryValue();
outBuffer.writeShort(tcpSrcCase.getTcpSrcValues().getPort().getValue());
outBuffer.writeShort(tcpSrcCase.getTcpSrcValues().getMask());
}
private static final int VALUE_LENGTH = 1;
private static final int NXM_FIELD_CODE = 111;
- public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunGpeNp> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunGpeNp.class);
+ public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunGpeNp> SERIALIZER_KEY =
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunGpeNp.class);
public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- TunGpeNpCaseValue tunGpeNpCaseValue = ((TunGpeNpCaseValue) input.getMatchEntryValue());
+ TunGpeNpCaseValue tunGpeNpCaseValue = (TunGpeNpCaseValue) input.getMatchEntryValue();
outBuffer.writeByte(tunGpeNpCaseValue.getTunGpeNpValues().getValue());
}
public MatchEntry deserialize(ByteBuf message) {
MatchEntryBuilder matchEntriesBuilder = deserializeHeaderToBuilder(message);
TunGpeNpCaseValueBuilder tunGpeNpCaseValueBuilder = new TunGpeNpCaseValueBuilder();
- tunGpeNpCaseValueBuilder.setTunGpeNpValues(new TunGpeNpValuesBuilder().setValue(message.readUnsignedByte()).build());
+ tunGpeNpCaseValueBuilder.setTunGpeNpValues(new TunGpeNpValuesBuilder()
+ .setValue(message.readUnsignedByte()).build());
matchEntriesBuilder.setMatchEntryValue(tunGpeNpCaseValueBuilder.build());
matchEntriesBuilder.setHasMask(false);
return matchEntriesBuilder.build();
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
private static final int VALUE_LENGTH = 4;
private static final int NXM_FIELD_CODE = 32;
- public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunIpv4Dst> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class);
+ public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunIpv4Dst> SERIALIZER_KEY =
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class);
public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
private static final int VALUE_LENGTH = 4;
private static final int NXM_FIELD_CODE = 31;
- public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunIpv4Src> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class);
+ public static final MatchEntrySerializerKey<Nxm1Class, NxmNxTunIpv4Src> SERIALIZER_KEY =
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class);
public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfUdpDst;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.udp.dst.grouping.UdpDstValuesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.UdpDstCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.UdpDstCaseValueBuilder;
/**
+ * Codec for the UdpDst message.
+ *
* @author Aswin Suryanarayanan.
*/
-
public class UdpDstCodec extends AbstractMatchCodec {
private static final int VALUE_LENGTH = 4;
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- UdpDstCaseValue udpDstCase = ((UdpDstCaseValue) input.getMatchEntryValue());
+ UdpDstCaseValue udpDstCase = (UdpDstCaseValue) input.getMatchEntryValue();
outBuffer.writeShort(udpDstCase.getUdpDstValues().getPort().getValue());
outBuffer.writeShort(udpDstCase.getUdpDstValues().getMask());
}
package org.opendaylight.openflowjava.nx.codec.match;
import io.netty.buffer.ByteBuf;
-
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
-
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfUdpSrc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.udp.src.grouping.UdpSrcValuesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.UdpSrcCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.UdpSrcCaseValueBuilder;
/**
+ * Codec for the UdpSrc message.
+ *
* @author Aswin Suryanarayanan.
*/
-
public class UdpSrcCodec extends AbstractMatchCodec {
private static final int VALUE_LENGTH = 4;
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
- UdpSrcCaseValue udpSrcCase = ((UdpSrcCaseValue) input.getMatchEntryValue());
+ UdpSrcCaseValue udpSrcCase = (UdpSrcCaseValue) input.getMatchEntryValue();
outBuffer.writeShort(udpSrcCase.getUdpSrcValues().getPort().getValue());
outBuffer.writeShort(udpSrcCase.getUdpSrcValues().getMask());
}
@Test
public void niciraExtensionsCodecRegistratorImplTest() {
- Mockito.verify(provider).registerActionDeserializer(Matchers.eq(ActionDeserializer.OF10_DESERIALIZER_KEY), Matchers.any(ActionDeserializer.class));
- Mockito.verify(provider).registerActionDeserializer(Matchers.eq(ActionDeserializer.OF13_DESERIALIZER_KEY), Matchers.any(ActionDeserializer.class));
+ Mockito.verify(provider).registerActionDeserializer(Matchers.eq(ActionDeserializer.OF10_DESERIALIZER_KEY),
+ Matchers.any(ActionDeserializer.class));
+ Mockito.verify(provider).registerActionDeserializer(Matchers.eq(ActionDeserializer.OF13_DESERIALIZER_KEY),
+ Matchers.any(ActionDeserializer.class));
}
@Test
niciraExtensionCodecRegistrator.unregisterMatchEntryDeserializer(matchDeserializerKey);
Mockito.verify(provider).unregisterDeserializer(matchDeserializerKey);
}
-
-
-}
\ No newline at end of file
+}
import org.opendaylight.openflowjava.nx.api.NiciraExtensionCodecRegistrator;
import org.opendaylight.openflowjava.nx.codec.action.MultipathCodec;
import org.opendaylight.openflowjava.nx.codec.action.OutputRegCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PushNshCodec;
import org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec;
import org.opendaylight.openflowjava.nx.codec.action.RegMoveCodec;
import org.opendaylight.openflowjava.nx.codec.action.ResubmitCodec;
-import org.opendaylight.openflowjava.nx.codec.action.PushNshCodec;
-import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
import org.opendaylight.openflowjava.nx.codec.match.ArpOpCodec;
import org.opendaylight.openflowjava.nx.codec.match.ArpShaCodec;
import org.opendaylight.openflowjava.nx.codec.match.ArpSpaCodec;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionConntrack;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipath;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionOutputReg;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPopNsh;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPushNsh;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMove;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPushNsh;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPopNsh;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxArpSha;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxArpTha;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtMark;
@Test
public void registerNiciraExtensionsTest() {
- Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7)), Matchers.any(RegLoadCodec.class));
- Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class)), Matchers.any(RegLoadCodec.class));
- Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6)), Matchers.any(RegMoveCodec.class));
- Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class)), Matchers.any(RegMoveCodec.class));
- Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15)), Matchers.any(OutputRegCodec.class));
- Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class)), Matchers.any(OutputRegCodec.class));
- Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class)), Matchers.any(ResubmitCodec.class));
- Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1)), Matchers.any(ResubmitCodec.class));
- Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14)), Matchers.any(ResubmitCodec.class));
- Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class)), Matchers.any(MultipathCodec.class));
- Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10)), Matchers.any(MultipathCodec.class));
- Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 38)), Matchers.any(PushNshCodec.class));
- Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPushNsh.class)), Matchers.any(PushNshCodec.class));
- Mockito.verify(registrator).registerActionDeserializer(Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 39)), Matchers.any(PopNshCodec.class));
- Mockito.verify(registrator).registerActionSerializer(Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPopNsh.class)), Matchers.any(PopNshCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class)), Matchers.any(Reg0Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0)), Matchers.any(Reg0Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class)), Matchers.any(Reg1Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1)), Matchers.any(Reg1Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class)), Matchers.any(Reg2Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2)), Matchers.any(Reg2Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class)), Matchers.any(Reg3Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3)), Matchers.any(Reg3Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class)), Matchers.any(Reg4Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4)), Matchers.any(Reg4Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class)), Matchers.any(Reg5Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5)), Matchers.any(Reg5Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class)), Matchers.any(Reg6Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6)), Matchers.any(Reg6Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class)), Matchers.any(Reg7Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7)), Matchers.any(Reg7Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class)), Matchers.any(TunIdCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16)), Matchers.any(TunIdCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class)), Matchers.any(ArpOpCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15)), Matchers.any(ArpOpCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class)), Matchers.any(ArpShaCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17)), Matchers.any(ArpShaCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class)), Matchers.any(ArpSpaCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16)), Matchers.any(ArpSpaCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class)), Matchers.any(ArpThaCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18)), Matchers.any(ArpThaCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class)), Matchers.any(ArpTpaCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17)), Matchers.any(ArpTpaCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class)), Matchers.any(EthDstCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1)), Matchers.any(EthDstCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class)), Matchers.any(EthSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2)), Matchers.any(EthSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthType.class)), Matchers.any(EthTypeCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3)), Matchers.any(EthTypeCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsp.class)), Matchers.any(NspCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 113)), Matchers.any(NspCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc1.class)), Matchers.any(Nshc1Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 115)), Matchers.any(Nshc1Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc2.class)), Matchers.any(Nshc2Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 116)), Matchers.any(Nshc2Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc3.class)), Matchers.any(Nshc3Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 117)), Matchers.any(Nshc3Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc4.class)), Matchers.any(Nshc4Codec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 118)), Matchers.any(Nshc4Codec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsi.class)), Matchers.any(NsiCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 114)), Matchers.any(NsiCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class)), Matchers.any(TunIpv4DstCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32)), Matchers.any(TunIpv4DstCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class)), Matchers.any(TunIpv4SrcCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31)), Matchers.any(TunIpv4SrcCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class)), Matchers.any(TcpSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9)), Matchers.any(TcpSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class)), Matchers.any(TcpDstCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10)), Matchers.any(TcpDstCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class)), Matchers.any(UdpSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11)), Matchers.any(UdpSrcCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class)), Matchers.any(UdpDstCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12)), Matchers.any(UdpDstCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtState.class)), Matchers.any(CtStateCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105)), Matchers.any(CtStateCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class)), Matchers.any(CtZoneCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106)), Matchers.any(CtZoneCodec.class));
- Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class)), Matchers.any(CtMarkCodec.class));
- Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers.eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107)), Matchers.any(CtMarkCodec.class));
+ Mockito.verify(registrator).registerActionDeserializer(
+ Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7)),
+ Matchers.any(RegLoadCodec.class));
+ Mockito.verify(registrator).registerActionSerializer(
+ Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class)),
+ Matchers.any(RegLoadCodec.class));
+ Mockito.verify(registrator).registerActionDeserializer(
+ Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6)),
+ Matchers.any(RegMoveCodec.class));
+ Mockito.verify(registrator).registerActionSerializer(
+ Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class)),
+ Matchers.any(RegMoveCodec.class));
+ Mockito.verify(registrator).registerActionDeserializer(
+ Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15)),
+ Matchers.any(OutputRegCodec.class));
+ Mockito.verify(registrator).registerActionSerializer(
+ Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class)),
+ Matchers.any(OutputRegCodec.class));
+ Mockito.verify(registrator).registerActionSerializer(
+ Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class)),
+ Matchers.any(ResubmitCodec.class));
+ Mockito.verify(registrator).registerActionDeserializer(
+ Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1)),
+ Matchers.any(ResubmitCodec.class));
+ Mockito.verify(registrator).registerActionDeserializer(
+ Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14)),
+ Matchers.any(ResubmitCodec.class));
+ Mockito.verify(registrator).registerActionSerializer(
+ Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class)),
+ Matchers.any(MultipathCodec.class));
+ Mockito.verify(registrator).registerActionDeserializer(
+ Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10)),
+ Matchers.any(MultipathCodec.class));
+ Mockito.verify(registrator).registerActionDeserializer(
+ Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 38)),
+ Matchers.any(PushNshCodec.class));
+ Mockito.verify(registrator).registerActionSerializer(
+ Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPushNsh.class)),
+ Matchers.any(PushNshCodec.class));
+ Mockito.verify(registrator).registerActionDeserializer(
+ Matchers.eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 39)),
+ Matchers.any(PopNshCodec.class));
+ Mockito.verify(registrator).registerActionSerializer(
+ Matchers.eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPopNsh.class)),
+ Matchers.any(PopNshCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class)),
+ Matchers.any(Reg0Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0)),
+ Matchers.any(Reg0Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class)),
+ Matchers.any(Reg1Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1)),
+ Matchers.any(Reg1Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class)),
+ Matchers.any(Reg2Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2)),
+ Matchers.any(Reg2Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class)),
+ Matchers.any(Reg3Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3)),
+ Matchers.any(Reg3Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class)),
+ Matchers.any(Reg4Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4)),
+ Matchers.any(Reg4Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class)),
+ Matchers.any(Reg5Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5)),
+ Matchers.any(Reg5Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class)),
+ Matchers.any(Reg6Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6)),
+ Matchers.any(Reg6Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class)),
+ Matchers.any(Reg7Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7)),
+ Matchers.any(Reg7Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class)),
+ Matchers.any(TunIdCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16)),
+ Matchers.any(TunIdCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class)),
+ Matchers.any(ArpOpCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15)),
+ Matchers.any(ArpOpCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class)),
+ Matchers.any(ArpShaCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17)),
+ Matchers.any(ArpShaCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class)),
+ Matchers.any(ArpSpaCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16)),
+ Matchers.any(ArpSpaCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class)),
+ Matchers.any(ArpThaCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18)),
+ Matchers.any(ArpThaCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class)),
+ Matchers.any(ArpTpaCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17)),
+ Matchers.any(ArpTpaCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class)),
+ Matchers.any(EthDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1)),
+ Matchers.any(EthDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class)),
+ Matchers.any(EthSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2)),
+ Matchers.any(EthSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthType.class)),
+ Matchers.any(EthTypeCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3)),
+ Matchers.any(EthTypeCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsp.class)),
+ Matchers.any(NspCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 113)),
+ Matchers.any(NspCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc1.class)),
+ Matchers.any(Nshc1Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 115)),
+ Matchers.any(Nshc1Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc2.class)),
+ Matchers.any(Nshc2Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 116)),
+ Matchers.any(Nshc2Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc3.class)),
+ Matchers.any(Nshc3Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 117)),
+ Matchers.any(Nshc3Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc4.class)),
+ Matchers.any(Nshc4Codec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 118)),
+ Matchers.any(Nshc4Codec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsi.class)),
+ Matchers.any(NsiCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 114)),
+ Matchers.any(NsiCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class)),
+ Matchers.any(TunIpv4DstCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32)),
+ Matchers.any(TunIpv4DstCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class)),
+ Matchers.any(TunIpv4SrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31)),
+ Matchers.any(TunIpv4SrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class)),
+ Matchers.any(TcpSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9)),
+ Matchers.any(TcpSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class)),
+ Matchers.any(TcpDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10)),
+ Matchers.any(TcpDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class)),
+ Matchers.any(UdpSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11)),
+ Matchers.any(UdpSrcCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class)),
+ Matchers.any(UdpDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12)),
+ Matchers.any(UdpDstCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers.eq(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtState.class)),
+ Matchers.any(CtStateCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105)),
+ Matchers.any(CtStateCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class)),
+ Matchers.any(CtZoneCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106)),
+ Matchers.any(CtZoneCodec.class));
+ Mockito.verify(registrator).registerMatchEntrySerializer(Matchers
+ .eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class)),
+ Matchers.any(CtMarkCodec.class));
+ Mockito.verify(registrator).registerMatchEntryDeserializer(Matchers
+ .eq(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107)),
+ Matchers.any(CtMarkCodec.class));
}
@Test
public void unregisterExtensionsTest() throws Exception {
niciraExtensionsRegistrator.close();
- Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7));
- Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class));
- Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6));
- Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class));
- Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15));
- Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class));
- Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1));
- Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14));
- Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class));
- Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10));
- Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class));
- Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 38));
- Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPushNsh.class));
- Mockito.verify(registrator).unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 39));
- Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPopNsh.class));
- Mockito.verify(registrator).unregisterActionSerializer(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionConntrack.class));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthType.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsp.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 113));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsi.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 114));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc1.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 115));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc2.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 116));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc3.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 117));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc4.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 118));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtState.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106));
- Mockito.verify(registrator).unregisterMatchEntrySerializer(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class));
- Mockito.verify(registrator).unregisterMatchEntryDeserializer(new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107));
+ Mockito.verify(registrator)
+ .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7));
+ Mockito.verify(registrator).unregisterActionSerializer(
+ new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class));
+ Mockito.verify(registrator)
+ .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6));
+ Mockito.verify(registrator).unregisterActionSerializer(
+ new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class));
+ Mockito.verify(registrator)
+ .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15));
+ Mockito.verify(registrator).unregisterActionSerializer(
+ new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class));
+ Mockito.verify(registrator)
+ .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1));
+ Mockito.verify(registrator)
+ .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14));
+ Mockito.verify(registrator).unregisterActionSerializer(
+ new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class));
+ Mockito.verify(registrator)
+ .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10));
+ Mockito.verify(registrator).unregisterActionSerializer(
+ new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class));
+ Mockito.verify(registrator)
+ .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 38));
+ Mockito.verify(registrator).unregisterActionSerializer(
+ new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPushNsh.class));
+ Mockito.verify(registrator)
+ .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 39));
+ Mockito.verify(registrator).unregisterActionSerializer(
+ new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionPopNsh.class));
+ Mockito.verify(registrator).unregisterActionSerializer(
+ new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionConntrack.class));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthType.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsp.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 113));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNsi.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 114));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc1.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 115));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc2.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 116));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc3.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 117));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxNshc4.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 118));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtState.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106));
+ Mockito.verify(registrator).unregisterMatchEntrySerializer(
+ new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class));
+ Mockito.verify(registrator).unregisterMatchEntryDeserializer(
+ new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107));
}
}
}
-
/**
* If NiciraExtensionCodecRegistratorImpl.getActionDeserializer(actionSerializerKey) returns NULL
- * then NULL should be returned
+ * then NULL should be returned.
*/
@Test
public void deserializeTest() {
}
/**
- * If experimentId is different from NiciraConstants.NX_VENDOR_ID
- * then exception should be thrown
+ * If experimentId is different from NiciraConstants.NX_VENDOR_ID then exception should be thrown.
*/
@Test(expected = IllegalStateException.class)
public void deserializeTest1() {
niciraExtensionCodecRegistrator.registerActionDeserializer(key, deserializer);
}
-}
\ No newline at end of file
+}
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Assert.assertEquals(length + nxNatLengthAction1 + nxNatLengthAction2 + setFieldLength, buffer.readableBytes());
Assert.assertEquals(EncodeConstants.EXPERIMENTER_VALUE, buffer.readUnsignedShort());
- Assert.assertEquals(length + nxNatLengthAction1 + nxNatLengthAction2 + setFieldLength, buffer.readUnsignedShort());
+ Assert.assertEquals(length + nxNatLengthAction1 + nxNatLengthAction2 + setFieldLength,
+ buffer.readUnsignedShort());
Assert.assertEquals(NiciraConstants.NX_VENDOR_ID.intValue(), buffer.readUnsignedInt());
Assert.assertEquals(nxastConntrackSubtype, buffer.readUnsignedShort());
Assert.assertEquals(1, buffer.readUnsignedShort());
Assert.assertEquals(4000, natAction.getPortMax().shortValue());
NxActionCtMarkCase nxActionCtMarkCase = (NxActionCtMarkCase) ctActions.get(2).getOfpactActions();
NxActionCtMark ctMarkAction = nxActionCtMarkCase.getNxActionCtMark();
- Assert.assertEquals((long) 36, ctMarkAction.getCtMark().longValue());
+ Assert.assertEquals(36, ctMarkAction.getCtMark().longValue());
}
@Test
import static org.junit.Assert.assertEquals;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.ByteBufAllocator;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.openflowjava.nx.api.NiciraConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionFinTimeoutBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder;
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.ByteBufAllocator;
-
public class FinTimeoutCodecTest {
FinTimeoutCodec finTimeoutCodec;
ByteBuf buffer;
Action action;
- private final int LENGTH = 16;
- private final byte NXAST_FIN_TIMEOUT_SUBTYPE = 19;
+ private static final int LENGTH = 16;
+ private static final byte NXAST_FIN_TIMEOUT_SUBTYPE = 19;
- private final int OFP_NO_TIMEOUT = 0;
- private final int padding = 2;
+ private static final int OFP_NO_TIMEOUT = 0;
+ private static final int PADDING = 2;
@Before
public void setUp() {
message.writeShort(1);
message.writeShort(2);
- message.writeZero(padding);
+ message.writeZero(PADDING);
}
-}
\ No newline at end of file
+}
*/
package org.opendaylight.openflowjava.nx.codec.action;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.ByteBufAllocator;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.ByteBufAllocator;
-
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearn;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearnBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.FlowModSpec;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyFieldIntoFieldCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyValueIntoFieldCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModOutputToPortCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromFieldBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.value._case.FlowModAddMatchFromValueBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.field.into.field._case.FlowModCopyFieldIntoFieldBuilder;
private ByteBuf buffer;
private Action action;
- private final byte LEARN_HEADER_LEN = 32;
- private final byte NXAST_LEARN_SUBTYPE = 16;
+ private static final byte LEARN_HEADER_LEN = 32;
+ private static final byte NXAST_LEARN_SUBTYPE = 16;
private static final short SRC_MASK = 0x2000;
private static final short DST_MASK = 0x1800;
private static final short NUM_BITS_MASK = 0x07FF;
action = createAction();
learnCodec.serialize(action, buffer);
- Assert.assertEquals(LEARN_HEADER_LEN+56, buffer.readableBytes());
+ Assert.assertEquals(LEARN_HEADER_LEN + 56, buffer.readableBytes());
Assert.assertEquals(EncodeConstants.EXPERIMENTER_VALUE, buffer.readUnsignedShort());
- Assert.assertEquals(LEARN_HEADER_LEN+56, buffer.readUnsignedShort());
+ Assert.assertEquals(LEARN_HEADER_LEN + 56, buffer.readUnsignedShort());
Assert.assertEquals(NiciraConstants.NX_VENDOR_ID.intValue(), buffer.readUnsignedInt());
Assert.assertEquals(NXAST_LEARN_SUBTYPE, buffer.readUnsignedShort());
Assert.assertEquals(1, buffer.readUnsignedShort());
action = learnCodec.deserialize(buffer);
ActionLearn result = (ActionLearn) action.getActionChoice();
- Action act= createAction();
+ Action act = createAction();
ActionLearn expResult = (ActionLearn)act.getActionChoice();
Assert.assertEquals(expResult, result);
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
- ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
+ final ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
NxActionLearnBuilder nxActionLearnBuilder = new NxActionLearnBuilder();
nxActionLearnBuilder.setIdleTimeout(1);
private List<FlowMods> createFlowMods() {
- List<FlowMods> flowMods = new ArrayList<FlowMods>();
+ final List<FlowMods> flowMods = new ArrayList<>();
//length = 14
- FlowModsBuilder flowMod = new FlowModsBuilder();
+ final FlowModsBuilder flowMod = new FlowModsBuilder();
FlowModAddMatchFromFieldBuilder spec = new FlowModAddMatchFromFieldBuilder();
spec.setFlowModNumBits(48);
spec.setSrcField((long)9);
flowMods.add(flowMod.build());
//length = 14
- FlowModsBuilder flowMod2 = new FlowModsBuilder();
+ final FlowModsBuilder flowMod2 = new FlowModsBuilder();
FlowModCopyFieldIntoFieldBuilder spec2 = new FlowModCopyFieldIntoFieldBuilder();
spec2.setFlowModNumBits(48);
spec2.setSrcField((long)9);
flowMods.add(flowMod2.build());
//length = 10
- FlowModsBuilder flowMod3 = new FlowModsBuilder();
+ final FlowModsBuilder flowMod3 = new FlowModsBuilder();
FlowModCopyValueIntoFieldBuilder spec3 = new FlowModCopyValueIntoFieldBuilder();
spec3.setFlowModNumBits(48);
spec3.setValue(9);
flowMods.add(flowMod3.build());
//length = 10
- FlowModsBuilder flowMod4 = new FlowModsBuilder();
+ final FlowModsBuilder flowMod4 = new FlowModsBuilder();
FlowModAddMatchFromValueBuilder spec4 = new FlowModAddMatchFromValueBuilder();
spec4.setFlowModNumBits(48);
spec4.setValue(9);
flowMods.add(flowMod4.build());
//length = 8
- FlowModsBuilder flowMod5 = new FlowModsBuilder();
+ final FlowModsBuilder flowMod5 = new FlowModsBuilder();
FlowModOutputToPortBuilder spec5 = new FlowModOutputToPortBuilder();
spec5.setFlowModNumBits(48);
spec5.setSrcField((long) 9);
}
private void toFlowModSpecHeader(ByteBuf message, int src, int dst) {
- short b = 0;
+ short value = 0;
short bitNum = 48;
- b |= (src << 13);
- b |= (dst << 11);
- b |= bitNum;
+ value |= src << 13;
+ value |= dst << 11;
+ value |= bitNum;
- message.writeShort(b);
+ message.writeShort(value);
}
-}
\ No newline at end of file
+}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.multipath.grouping.NxActionMultipathBuilder;
public class MultipathCodecTest {
+ private static final int LENGTH = 32;
+ private static final byte NXAST_MULTIPATH_SUBTYPE = 10;
MultipathCodec multipathCodec;
ByteBuf buffer;
Action action;
- private final int LENGTH = 32;
- private final byte NXAST_MULTIPATH_SUBTYPE = 10;
-
-
@Before
public void setUp() {
multipathCodec = new MultipathCodec();
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
- ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();
+ final ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();
NxActionMultipathBuilder nxActionMultipathBuilder = new NxActionMultipathBuilder();
nxActionMultipathBuilder.setFields(OfjNxHashFields.NXHASHFIELDSETHSRC);
//Dst = 5
message.writeInt(5);
}
-}
\ No newline at end of file
+}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder;
public class OutputRegCodecTest {
+ private static final int LENGTH = 24;
+ private static final byte SUBTYPE = 15;
+ private static final byte PADDING = 6;
OutputRegCodec outRegCodec;
ByteBuf buffer;
Action action;
- private final int LENGTH = 24;
- private final byte SUBTYPE = 15;
- private final byte PADDING = 6;
-
-
@Before
public void setUp() {
outRegCodec = new OutputRegCodec();
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
- ActionOutputRegBuilder actionOutputRegBuilder = new ActionOutputRegBuilder();
+ final ActionOutputRegBuilder actionOutputRegBuilder = new ActionOutputRegBuilder();
NxActionOutputRegBuilder nxActionOutputBuilder = new NxActionOutputRegBuilder();
nxActionOutputBuilder.setNBits(1);
message.writeInt(2);
message.writeShort(3);
message.writeZero(PADDING);
-
}
-
-}
\ No newline at end of file
+}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoadBuilder;
public class RegLoadCodecTest {
+ private static final int LENGTH = 24;
+ private static final byte SUBTYPE = 7;
RegLoadCodec regLoadCodec;
ByteBuf buffer;
Action action;
- private final int LENGTH = 24;
- private final byte SUBTYPE = 7;
-
@Before
public void setUp() {
regLoadCodec = new RegLoadCodec();
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
- ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
+ final ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
NxActionRegLoadBuilder nxActionRegLoadBuilder = new NxActionRegLoadBuilder();
nxActionRegLoadBuilder.setOfsNbits(1);
message.writeInt(2);
message.writeLong(3);
}
-
-}
\ No newline at end of file
+}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder;
public class RegMoveCodecTest {
+ private static final int LENGTH = 24;
+ private static final byte SUBTYPE = 6;
RegMoveCodec regMoveCodec;
ByteBuf buffer;
Action action;
- private final int LENGTH = 24;
- private final byte SUBTYPE = 6;
-
@Before
public void setUp() {
regMoveCodec = new RegMoveCodec();
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
- ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
+ final ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
NxActionRegMoveBuilder nxActionRegMoveBuilder = new NxActionRegMoveBuilder();
nxActionRegMoveBuilder.setNBits(1);
message.writeInt(5);
}
-}
\ No newline at end of file
+}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.resubmit.grouping.NxActionResubmitBuilder;
public class ResubmitCodecTest {
+ private static final int LENGTH = 16;
+ private static final byte NXAST_RESUBMIT_SUBTYPE = 1;
+ private static final byte NXAST_RESUBMIT_TABLE_SUBTYPE = 14;
+
+ private static final short OFP_TABLE_ALL = 255;
+ private static final int OFP_IN_PORT = 0xfff8;
+ private static final int PADDING = 3;
ResubmitCodec resubmitCodec;
ByteBuf buffer;
Action action;
- private final int LENGTH = 16;
- private final byte NXAST_RESUBMIT_SUBTYPE = 1;
- private final byte NXAST_RESUBMIT_TABLE_SUBTYPE = 14;
-
- private final short OFP_TABLE_ALL = 255;
- private final int OFP_IN_PORT = 0xfff8;
- private final int padding = 3;
-
-
@Before
public void setUp() {
resubmitCodec = new ResubmitCodec();
/**
* If table == null or table == OFP_TABLE_ALL
- * SUBTYPE should be set to NXAST_RESUBMIT_SUBTYPE
+ * SUBTYPE should be set to NXAST_RESUBMIT_SUBTYPE.
*/
@Test
public void getSubTypeTest1() {
action = createAction(null, null);
- ActionResubmit actionResubmit = ((ActionResubmit) action.getActionChoice());
+ ActionResubmit actionResubmit = (ActionResubmit) action.getActionChoice();
byte result = resubmitCodec.getSubType(actionResubmit);
assertEquals(NXAST_RESUBMIT_SUBTYPE, result);
/**
* If table != null or table != OFP_TABLE_ALL
- * SUBTYPE should be set to NXAST_RESUBMIT_TABLE_SUBTYPE
+ * SUBTYPE should be set to NXAST_RESUBMIT_TABLE_SUBTYPE.
*/
@Test
public void getSubTypeTest2() {
Byte table = new Byte((byte)1);
action = createAction(null, table);
- ActionResubmit actionResubmit = ((ActionResubmit) action.getActionChoice());
+ ActionResubmit actionResubmit = (ActionResubmit) action.getActionChoice();
byte result = resubmitCodec.getSubType(actionResubmit);
assertEquals(NXAST_RESUBMIT_TABLE_SUBTYPE, result);
/**
* If table and inPort are NOT NULL they should be used instead of
- * hardcoded values OFP_TABLE_ALL and OFP_IN_PORT
+ * hardcoded values OFP_TABLE_ALL and OFP_IN_PORT.
*/
@Test
public void serializeTest1() {
}
/**
- * If table and inPort are NULL they
- * hardcoded values OFP_TABLE_ALL and OFP_IN_PORT
- * should be used
+ * If table and inPort are NULL they hardcoded values OFP_TABLE_ALL and OFP_IN_PORT should be used.
*/
@Test
public void serializeTest2() {
ActionResubmitBuilder actionResubmitBuilder = new ActionResubmitBuilder();
NxActionResubmitBuilder nxActionResubmitBuilder = new NxActionResubmitBuilder();
- if(inPort != null) {
+ if (inPort != null) {
nxActionResubmitBuilder.setInPort(inPort.intValue());
}
- if(table != null) {
+ if (table != null) {
nxActionResubmitBuilder.setTable(table.shortValue());
}
message.writeShort(1);
message.writeByte(2);
- message.writeZero(padding);
+ message.writeZero(PADDING);
}
-}
\ No newline at end of file
+}
input = arpOpCodec.deserialize(buffer);
- ArpOpCaseValue result = ((ArpOpCaseValue) input.getMatchEntryValue());
+ final ArpOpCaseValue result = (ArpOpCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfArpOp.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- ArpOpCaseValueBuilder caseBuilder = new ArpOpCaseValueBuilder();
- ArpOpValuesBuilder valuesBuilder = new ArpOpValuesBuilder();
+ final ArpOpCaseValueBuilder caseBuilder = new ArpOpCaseValueBuilder();
+ final ArpOpValuesBuilder valuesBuilder = new ArpOpValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfArpOp.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeShort(2);
}
-
-}
\ No newline at end of file
+}
private static final int NXM_FIELD_CODE = 17;
private static byte[] resAddress = new byte[VALUE_LENGTH];
- private static final MacAddress resultAddress = new MacAddress(ByteBufUtils.macAddressToString(resAddress));
+ private static final MacAddress RESULT_ADDRESS = new MacAddress(ByteBufUtils.macAddressToString(resAddress));
@Before
assertEquals(NXM_FIELD_CODE, fieldMask >> 1);
assertEquals(0, fieldMask & 1);
assertEquals(VALUE_LENGTH, buffer.readUnsignedByte());
- assertEquals(resultAddress, ByteBufUtils.readIetfMacAddress(buffer));
+ assertEquals(RESULT_ADDRESS, ByteBufUtils.readIetfMacAddress(buffer));
}
@Test
input = arpShaCodec.deserialize(buffer);
- ArpShaCaseValue result = ((ArpShaCaseValue) input.getMatchEntryValue());
+ final ArpShaCaseValue result = (ArpShaCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxArpSha.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
- assertEquals(resultAddress, result.getArpShaValues().getMacAddress());
+ assertEquals(RESULT_ADDRESS, result.getArpShaValues().getMacAddress());
}
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- ArpShaCaseValueBuilder caseBuilder = new ArpShaCaseValueBuilder();
- ArpShaValuesBuilder valuesBuilder = new ArpShaValuesBuilder();
+ final ArpShaCaseValueBuilder caseBuilder = new ArpShaCaseValueBuilder();
+ final ArpShaValuesBuilder valuesBuilder = new ArpShaValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxArpSha.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeBytes(resAddress);
}
-
}
createBuffer(buffer);
input = arpSpaCodec.deserialize(buffer);
- ArpSpaCaseValue result = ((ArpSpaCaseValue) input.getMatchEntryValue());
+ final ArpSpaCaseValue result = (ArpSpaCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfArpSpa.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- ArpSpaCaseValueBuilder caseBuilder = new ArpSpaCaseValueBuilder();
- ArpSpaValuesBuilder valuesBuilder = new ArpSpaValuesBuilder();
+ final ArpSpaCaseValueBuilder caseBuilder = new ArpSpaCaseValueBuilder();
+ final ArpSpaValuesBuilder valuesBuilder = new ArpSpaValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfArpSpa.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(2);
}
-
-
-}
\ No newline at end of file
+}
private static final int VALUE_LENGTH = 6;
private static final int NXM_FIELD_CODE = 18;
- private static final byte[] testAddr = new byte[VALUE_LENGTH];
- private static final MacAddress testAddress = new MacAddress(ByteBufUtils.macAddressToString(testAddr));
+ private static final byte[] TEST_ADDR = new byte[VALUE_LENGTH];
+ private static final MacAddress TEST_ADDRESS = new MacAddress(ByteBufUtils.macAddressToString(TEST_ADDR));
@Before
public void setUp() {
assertEquals(NXM_FIELD_CODE, fieldMask >> 1);
assertEquals(0, fieldMask & 1);
assertEquals(VALUE_LENGTH, buffer.readUnsignedByte());
- assertEquals(testAddress, ByteBufUtils.readIetfMacAddress(buffer));
+ assertEquals(TEST_ADDRESS, ByteBufUtils.readIetfMacAddress(buffer));
}
@Test
createBuffer(buffer);
input = arpThaCodec.deserialize(buffer);
- ArpThaCaseValue result = ((ArpThaCaseValue) input.getMatchEntryValue());
+ final ArpThaCaseValue result = (ArpThaCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxArpTha.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
- assertEquals(testAddress, result.getArpThaValues().getMacAddress());
+ assertEquals(TEST_ADDRESS, result.getArpThaValues().getMacAddress());
}
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- ArpThaCaseValueBuilder caseBuilder = new ArpThaCaseValueBuilder();
- ArpThaValuesBuilder valuesBuilder = new ArpThaValuesBuilder();
+ final ArpThaCaseValueBuilder caseBuilder = new ArpThaCaseValueBuilder();
+ final ArpThaValuesBuilder valuesBuilder = new ArpThaValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxArpTha.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
- message.writeBytes(testAddr);
+ message.writeBytes(TEST_ADDR);
}
}
createBuffer(buffer);
input = arpTpaCodec.deserialize(buffer);
- ArpTpaCaseValue result = ((ArpTpaCaseValue) input.getMatchEntryValue());
+ final ArpTpaCaseValue result = (ArpTpaCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfArpTpa.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- ArpTpaCaseValueBuilder caseBuilder = new ArpTpaCaseValueBuilder();
- ArpTpaValuesBuilder valuesBuilder = new ArpTpaValuesBuilder();
+ final ArpTpaCaseValueBuilder caseBuilder = new ArpTpaCaseValueBuilder();
+ final ArpTpaValuesBuilder valuesBuilder = new ArpTpaValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfArpTpa.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(2);
}
-
-}
\ No newline at end of file
+}
createBuffer(buffer);
input = ctStateCodec.deserialize(buffer);
- CtStateCaseValue result = ((CtStateCaseValue) input.getMatchEntryValue());
+ final CtStateCaseValue result = (CtStateCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxCtState.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- CtStateCaseValueBuilder caseBuilder = new CtStateCaseValueBuilder();
- CtStateValuesBuilder valuesBuilder = new CtStateValuesBuilder();
+ final CtStateCaseValueBuilder caseBuilder = new CtStateCaseValueBuilder();
+ final CtStateValuesBuilder valuesBuilder = new CtStateValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxCtState.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
//CtState = 1
//Mask = 2
message.writeInt(2);
}
-
-}
\ No newline at end of file
+}
createBuffer(buffer);
input = ctZoneCodec.deserialize(buffer);
- CtZoneCaseValue result = ((CtZoneCaseValue) input.getMatchEntryValue());
+ final CtZoneCaseValue result = (CtZoneCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxCtZone.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- CtZoneCaseValueBuilder caseBuilder = new CtZoneCaseValueBuilder();
- CtZoneValuesBuilder valuesBuilder = new CtZoneValuesBuilder();
+ final CtZoneCaseValueBuilder caseBuilder = new CtZoneCaseValueBuilder();
+ final CtZoneValuesBuilder valuesBuilder = new CtZoneValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxCtZone.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeShort(2);
}
-}
\ No newline at end of file
+}
private static final int VALUE_LENGTH = 6;
private static final int NXM_FIELD_CODE = 1;
- private static final byte[] testAddr = new byte[VALUE_LENGTH];
- private static final MacAddress testAddress = new MacAddress(ByteBufUtils.macAddressToString(testAddr));
+ private static final byte[] TEST_ADDR = new byte[VALUE_LENGTH];
+ private static final MacAddress TEST_ADDRESS = new MacAddress(ByteBufUtils.macAddressToString(TEST_ADDR));
@Before
public void setUp() {
assertEquals(NXM_FIELD_CODE, fieldMask >> 1);
assertEquals(0, fieldMask & 1);
assertEquals(VALUE_LENGTH, buffer.readUnsignedByte());
- assertEquals(testAddress, ByteBufUtils.readIetfMacAddress(buffer));
+ assertEquals(TEST_ADDRESS, ByteBufUtils.readIetfMacAddress(buffer));
}
@Test
input = ethDstCodec.deserialize(buffer);
- EthDstCaseValue result = ((EthDstCaseValue) input.getMatchEntryValue());
+ final EthDstCaseValue result = (EthDstCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfEthDst.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
- assertEquals(testAddress, result.getEthDstValues().getMacAddress());
+ assertEquals(TEST_ADDRESS, result.getEthDstValues().getMacAddress());
}
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- EthDstCaseValueBuilder caseBuilder = new EthDstCaseValueBuilder();
- EthDstValuesBuilder valuesBuilder = new EthDstValuesBuilder();
+ final EthDstCaseValueBuilder caseBuilder = new EthDstCaseValueBuilder();
+ final EthDstValuesBuilder valuesBuilder = new EthDstValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfEthDst.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
- message.writeBytes(testAddr);
+ message.writeBytes(TEST_ADDR);
}
}
private static final int VALUE_LENGTH = 6;
private static final int NXM_FIELD_CODE = 2;
- private static final byte[] testAddr = new byte[VALUE_LENGTH];
- private static final MacAddress testAddress = new MacAddress(ByteBufUtils.macAddressToString(testAddr));
+ private static final byte[] TEST_ADDR = new byte[VALUE_LENGTH];
+ private static final MacAddress TEST_ADDRESS = new MacAddress(ByteBufUtils.macAddressToString(TEST_ADDR));
@Before
public void setUp() {
assertEquals(NXM_FIELD_CODE, fieldMask >> 1);
assertEquals(0, fieldMask & 1);
assertEquals(VALUE_LENGTH, buffer.readUnsignedByte());
- assertEquals(testAddress, ByteBufUtils.readIetfMacAddress(buffer));
+ assertEquals(TEST_ADDRESS, ByteBufUtils.readIetfMacAddress(buffer));
}
@Test
input = ethSrcCodec.deserialize(buffer);
- EthSrcCaseValue result = ((EthSrcCaseValue) input.getMatchEntryValue());
+ final EthSrcCaseValue result = (EthSrcCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfEthSrc.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
- assertEquals(testAddress, result.getEthSrcValues().getMacAddress());
+ assertEquals(TEST_ADDRESS, result.getEthSrcValues().getMacAddress());
}
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- EthSrcCaseValueBuilder caseBuilder = new EthSrcCaseValueBuilder();
- EthSrcValuesBuilder valuesBuilder = new EthSrcValuesBuilder();
+ final EthSrcCaseValueBuilder caseBuilder = new EthSrcCaseValueBuilder();
+ final EthSrcValuesBuilder valuesBuilder = new EthSrcValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfEthDst.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
- message.writeBytes(testAddr);
+ message.writeBytes(TEST_ADDR);
}
-
-
}
input = ethTypeCodec.deserialize(buffer);
- EthTypeCaseValue result = ((EthTypeCaseValue) input.getMatchEntryValue());
+ final EthTypeCaseValue result = (EthTypeCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfEthType.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- EthTypeCaseValueBuilder caseBuilder = new EthTypeCaseValueBuilder();
- EthTypeValuesBuilder valuesBuilder = new EthTypeValuesBuilder();
+ final EthTypeCaseValueBuilder caseBuilder = new EthTypeCaseValueBuilder();
+ final EthTypeValuesBuilder valuesBuilder = new EthTypeValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfEthType.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeShort(2);
}
-}
\ No newline at end of file
+}
input = icmpTypeCodec.deserialize(buffer);
- IcmpTypeCaseValue result = ((IcmpTypeCaseValue) input.getMatchEntryValue());
+ final IcmpTypeCaseValue result = (IcmpTypeCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfIcmpType.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- IcmpTypeCaseValueBuilder caseBuilder = new IcmpTypeCaseValueBuilder();
- IcmpTypeValuesBuilder valuesBuilder = new IcmpTypeValuesBuilder();
+ final IcmpTypeCaseValueBuilder caseBuilder = new IcmpTypeCaseValueBuilder();
+ final IcmpTypeValuesBuilder valuesBuilder = new IcmpTypeValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfIcmpType.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeByte(2);
}
-
-}
\ No newline at end of file
+}
input = ipDstCodec.deserialize(buffer);
- IpDstCaseValue result = ((IpDstCaseValue) input.getMatchEntryValue());
+ final IpDstCaseValue result = (IpDstCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfIpDst.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- IpDstCaseValueBuilder caseBuilder = new IpDstCaseValueBuilder();
- IpDstValuesBuilder valuesBuilder = new IpDstValuesBuilder();
+ final IpDstCaseValueBuilder caseBuilder = new IpDstCaseValueBuilder();
+ final IpDstValuesBuilder valuesBuilder = new IpDstValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfIpDst.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(2);
}
-
-}
\ No newline at end of file
+}
input = ipSrcCodec.deserialize(buffer);
- IpSrcCaseValue result = ((IpSrcCaseValue) input.getMatchEntryValue());
+ final IpSrcCaseValue result = (IpSrcCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfIpSrc.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- IpSrcCaseValueBuilder caseBuilder = new IpSrcCaseValueBuilder();
- IpSrcValuesBuilder valuesBuilder = new IpSrcValuesBuilder();
+ final IpSrcCaseValueBuilder caseBuilder = new IpSrcCaseValueBuilder();
+ final IpSrcValuesBuilder valuesBuilder = new IpSrcValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfIpSrc.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(2);
}
-
-}
\ No newline at end of file
+}
input = ipv6DstCodec.deserialize(buffer);
- IpDstCaseValue result = ((IpDstCaseValue) input.getMatchEntryValue());
+ final IpDstCaseValue result = (IpDstCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmOfIpDst.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- IpDstCaseValueBuilder caseBuilder = new IpDstCaseValueBuilder();
- IpDstValuesBuilder valuesBuilder = new IpDstValuesBuilder();
+ final IpDstCaseValueBuilder caseBuilder = new IpDstCaseValueBuilder();
+ final IpDstValuesBuilder valuesBuilder = new IpDstValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfIpDst.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(2);
}
-
}
input = ipv6SrcCodec.deserialize(buffer);
- IpSrcCaseValue result = ((IpSrcCaseValue) input.getMatchEntryValue());
+ final IpSrcCaseValue result = (IpSrcCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmOfIpSrc.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- IpSrcCaseValueBuilder caseBuilder = new IpSrcCaseValueBuilder();
- IpSrcValuesBuilder valuesBuilder = new IpSrcValuesBuilder();
+ final IpSrcCaseValueBuilder caseBuilder = new IpSrcCaseValueBuilder();
+ final IpSrcValuesBuilder valuesBuilder = new IpSrcValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfIpSrc.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(2);
}
-
}
private static final int NXM_FIELD_CODE = 115;
@Before
- public void setUp(){
+ public void setUp() {
nshc1Codec = new Nshc1Codec();
buffer = ByteBufAllocator.DEFAULT.buffer();
}
input = nshc1Codec.deserialize(buffer);
- Nshc1CaseValue result = ((Nshc1CaseValue) input.getMatchEntryValue());
+ final Nshc1CaseValue result = (Nshc1CaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxNshc1.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- Nshc1CaseValueBuilder caseBuilder = new Nshc1CaseValueBuilder();
- Nshc1ValuesBuilder valuesBuilder = new Nshc1ValuesBuilder();
+ final Nshc1CaseValueBuilder caseBuilder = new Nshc1CaseValueBuilder();
+ final Nshc1ValuesBuilder valuesBuilder = new Nshc1ValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxNshc1.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(2);
}
-
}
input = nshc2Codec.deserialize(buffer);
- Nshc2CaseValue result = ((Nshc2CaseValue) input.getMatchEntryValue());
+ final Nshc2CaseValue result = (Nshc2CaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxNshc2.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- Nshc2CaseValueBuilder caseBuilder = new Nshc2CaseValueBuilder();
- Nshc2ValuesBuilder valuesBuilder = new Nshc2ValuesBuilder();
+ final Nshc2CaseValueBuilder caseBuilder = new Nshc2CaseValueBuilder();
+ final Nshc2ValuesBuilder valuesBuilder = new Nshc2ValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxNshc2.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(2);
input = nshc3Codec.deserialize(buffer);
- Nshc3CaseValue result = ((Nshc3CaseValue) input.getMatchEntryValue());
+ final Nshc3CaseValue result = (Nshc3CaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxNshc3.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- Nshc3CaseValueBuilder caseBuilder = new Nshc3CaseValueBuilder();
- Nshc3ValuesBuilder valuesBuilder = new Nshc3ValuesBuilder();
+ final Nshc3CaseValueBuilder caseBuilder = new Nshc3CaseValueBuilder();
+ final Nshc3ValuesBuilder valuesBuilder = new Nshc3ValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxNshc3.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(2);
input = nshc4Codec.deserialize(buffer);
- Nshc4CaseValue result = ((Nshc4CaseValue) input.getMatchEntryValue());
+ final Nshc4CaseValue result = (Nshc4CaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxNshc4.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- Nshc4CaseValueBuilder caseBuilder = new Nshc4CaseValueBuilder();
- Nshc4ValuesBuilder valuesBuilder = new Nshc4ValuesBuilder();
+ final Nshc4CaseValueBuilder caseBuilder = new Nshc4CaseValueBuilder();
+ final Nshc4ValuesBuilder valuesBuilder = new Nshc4ValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxNshc4.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(2);
input = nsiCodec.deserialize(buffer);
- NsiCaseValue result = ((NsiCaseValue) input.getMatchEntryValue());
+ final NsiCaseValue result = (NsiCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxNsi.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- NsiCaseValueBuilder caseBuilder = new NsiCaseValueBuilder();
- NsiValuesBuilder valuesBuilder = new NsiValuesBuilder();
+ final NsiCaseValueBuilder caseBuilder = new NsiCaseValueBuilder();
+ final NsiValuesBuilder valuesBuilder = new NsiValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxNsi.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeByte(2);
input = nspCodec.deserialize(buffer);
- NspCaseValue result = ((NspCaseValue) input.getMatchEntryValue());
+ final NspCaseValue result = (NspCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxNsp.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- NspCaseValueBuilder caseBuilder = new NspCaseValueBuilder();
- NspValuesBuilder valuesBuilder = new NspValuesBuilder();
+ final NspCaseValueBuilder caseBuilder = new NspCaseValueBuilder();
+ final NspValuesBuilder valuesBuilder = new NspValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxNsp.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(2);
private static final int VALUE_LENGTH = 14;
@Test
- public void NxmHeaderTest() {
+ public void nxmHeaderTest() {
header = createHeader();
nxmHeader = new NxmHeader(header);
header = createHeader();
nxmHeader = new NxmHeader(header);
- String shouldBe = new String("NxmHeader " +
- "[headerAsLong=" + header + ", " +
- "oxmClass=" + OxmMatchConstants.NXM_1_CLASS + "," +
- " nxmField=" + NXM_FIELD_CODE + "," +
- " hasMask=" + false + "," +
- " length=" + VALUE_LENGTH + "]");
+ String shouldBe = new String("NxmHeader " + "[headerAsLong=" + header + ", " + "oxmClass="
+ + OxmMatchConstants.NXM_1_CLASS + "," + " nxmField=" + NXM_FIELD_CODE + "," + " hasMask=" + false + ","
+ + " length=" + VALUE_LENGTH + "]");
assertEquals(shouldBe, nxmHeader.toString());
}
return result;
}
-}
\ No newline at end of file
+}
input = reg0Codec.deserialize(buffer);
- RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+ final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxReg0.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
- RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+ final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+ final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxReg0.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(1);
}
-
-}
\ No newline at end of file
+}
input = reg1Codec.deserialize(buffer);
- RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+ final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxReg1.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
- RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+ final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+ final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxReg1.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(1);
}
-
-}
\ No newline at end of file
+}
input = reg2Codec.deserialize(buffer);
- RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+ final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxReg2.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
- RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+ final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+ final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxReg2.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(1);
}
-}
\ No newline at end of file
+}
input = reg3Codec.deserialize(buffer);
- RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+ final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxReg3.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
- RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+ final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+ final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxReg3.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(1);
}
-
-}
\ No newline at end of file
+}
input = reg4Codec.deserialize(buffer);
- RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+ final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxReg4.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
- RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+ final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+ final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxReg4.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(1);
}
-
-}
\ No newline at end of file
+}
input = reg5Codec.deserialize(buffer);
- RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+ final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxReg5.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
- RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+ final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+ final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxReg5.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(1);
}
-
-}
\ No newline at end of file
+}
input = reg6Codec.deserialize(buffer);
- RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+ final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxReg6.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
- RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+ final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+ final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxReg6.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(1);
}
-}
\ No newline at end of file
+}
input = reg7Codec.deserialize(buffer);
- RegCaseValue result = ((RegCaseValue) input.getMatchEntryValue());
+ final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxReg7.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
- RegValuesBuilder valuesBuilder = new RegValuesBuilder();
+ final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
+ final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxReg7.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(1);
}
-
-}
\ No newline at end of file
+}
input = tcpDstCodec.deserialize(buffer);
- TcpDstCaseValue result = ((TcpDstCaseValue) input.getMatchEntryValue());
+ final TcpDstCaseValue result = (TcpDstCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfTcpDst.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- TcpDstCaseValueBuilder caseBuilder = new TcpDstCaseValueBuilder();
- TcpDstValuesBuilder valuesBuilder = new TcpDstValuesBuilder();
+ final TcpDstCaseValueBuilder caseBuilder = new TcpDstCaseValueBuilder();
+ final TcpDstValuesBuilder valuesBuilder = new TcpDstValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfTcpDst.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
//Port num = 1
message.writeShort(1);
message.writeShort(0xffff);
}
-
}
private static final int NXM_FIELD_CODE = 9;
@Before
- public void setUp(){
+ public void setUp() {
tcpSrcCodec = new TcpSrcCodec();
buffer = ByteBufAllocator.DEFAULT.buffer();
}
input = tcpSrcCodec.deserialize(buffer);
- TcpSrcCaseValue result = ((TcpSrcCaseValue) input.getMatchEntryValue());
+ final TcpSrcCaseValue result = (TcpSrcCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfTcpSrc.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- TcpSrcCaseValueBuilder caseBuilder = new TcpSrcCaseValueBuilder();
- TcpSrcValuesBuilder valuesBuilder = new TcpSrcValuesBuilder();
+ final TcpSrcCaseValueBuilder caseBuilder = new TcpSrcCaseValueBuilder();
+ final TcpSrcValuesBuilder valuesBuilder = new TcpSrcValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfTcpSrc.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
//Port num = 1
message.writeShort(1);
message.writeShort(0xffff);
}
-
}
input = tunIdCodec.deserialize(buffer);
- TunIdCaseValue result = ((TunIdCaseValue) input.getMatchEntryValue());
+ final TunIdCaseValue result = (TunIdCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxTunId.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- TunIdCaseValueBuilder caseBuilder = new TunIdCaseValueBuilder();
- TunIdValuesBuilder valuesBuilder = new TunIdValuesBuilder();
+ final TunIdCaseValueBuilder caseBuilder = new TunIdCaseValueBuilder();
+ final TunIdValuesBuilder valuesBuilder = new TunIdValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxTunId.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
byte[] value = new byte[VALUE_LENGTH];
message.writeLong(new BigInteger(value).longValue());
}
-
-}
\ No newline at end of file
+}
input = tunIpv4DstCodec.deserialize(buffer);
- TunIpv4DstCaseValue result = ((TunIpv4DstCaseValue) input.getMatchEntryValue());
+ final TunIpv4DstCaseValue result = (TunIpv4DstCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxTunIpv4Dst.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- TunIpv4DstCaseValueBuilder caseBuilder = new TunIpv4DstCaseValueBuilder();
- TunIpv4DstValuesBuilder valuesBuilder = new TunIpv4DstValuesBuilder();
+ final TunIpv4DstCaseValueBuilder caseBuilder = new TunIpv4DstCaseValueBuilder();
+ final TunIpv4DstValuesBuilder valuesBuilder = new TunIpv4DstValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxTunIpv4Dst.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(1);
}
-
-}
\ No newline at end of file
+}
input = tunIpv4SrcCodec.deserialize(buffer);
- TunIpv4SrcCaseValue result = ((TunIpv4SrcCaseValue) input.getMatchEntryValue());
+ final TunIpv4SrcCaseValue result = (TunIpv4SrcCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxTunIpv4Src.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- TunIpv4SrcCaseValueBuilder caseBuilder = new TunIpv4SrcCaseValueBuilder();
- TunIpv4SrcValuesBuilder valuesBuilder = new TunIpv4SrcValuesBuilder();
+ final TunIpv4SrcCaseValueBuilder caseBuilder = new TunIpv4SrcCaseValueBuilder();
+ final TunIpv4SrcValuesBuilder valuesBuilder = new TunIpv4SrcValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm1Class.class);
matchEntryBuilder.setOxmMatchField(NxmNxTunIpv4Src.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
message.writeInt(1);
}
-
-
-}
\ No newline at end of file
+}
input = udpDstCodec.deserialize(buffer);
- UdpDstCaseValue result = ((UdpDstCaseValue) input.getMatchEntryValue());
+ final UdpDstCaseValue result = (UdpDstCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfUdpDst.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- UdpDstCaseValueBuilder caseBuilder = new UdpDstCaseValueBuilder();
- UdpDstValuesBuilder valuesBuilder = new UdpDstValuesBuilder();
+ final UdpDstCaseValueBuilder caseBuilder = new UdpDstCaseValueBuilder();
+ final UdpDstValuesBuilder valuesBuilder = new UdpDstValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfUdpDst.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
//Port num = 1
input = udpSrcCodec.deserialize(buffer);
- UdpSrcCaseValue result = ((UdpSrcCaseValue) input.getMatchEntryValue());
+ final UdpSrcCaseValue result = (UdpSrcCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfUdpSrc.class, input.getOxmMatchField());
private MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
- UdpSrcCaseValueBuilder caseBuilder = new UdpSrcCaseValueBuilder();
- UdpSrcValuesBuilder valuesBuilder = new UdpSrcValuesBuilder();
+ final UdpSrcCaseValueBuilder caseBuilder = new UdpSrcCaseValueBuilder();
+ final UdpSrcValuesBuilder valuesBuilder = new UdpSrcValuesBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfUdpSrc.class);
private void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
//Port num = 1
message.writeShort(1);
message.writeShort(0xffff);
}
-
}