<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib;\r
+package org.opendaylight.openflowjava.protocol.impl.core;\r
\r
import io.netty.buffer.ByteBuf;\r
import io.netty.channel.ChannelHandlerContext;\r
import io.netty.channel.ChannelInboundHandlerAdapter;\r
\r
-import org.openflow.lib.deserialization.DeserializationFactory;\r
-import org.openflow.util.ByteBufUtils;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializationFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
*\r
* @author michal.polkorab\r
*/\r
-public class Of13Codec extends ChannelInboundHandlerAdapter {\r
+public class OF13Codec extends ChannelInboundHandlerAdapter {\r
\r
// TODO - fix with enum in API\r
private static final int MESSAGE_TYPES = 29;\r
- private static final Logger LOGGER = LoggerFactory.getLogger(Of13Codec.class);\r
+ private static final Logger LOGGER = LoggerFactory.getLogger(OF13Codec.class);\r
\r
/**\r
* Constructor of class\r
*/\r
- public Of13Codec() {\r
+ public OF13Codec() {\r
LOGGER.info("Creating OF 1.3 Codec");\r
\r
}\r
}\r
\r
private static boolean checkOFHeader(short type, int length) {\r
- return !((type > MESSAGE_TYPES) || (length < OfFrameDecoder.LENGTH_OF_HEADER));\r
+ return !((type > MESSAGE_TYPES) || (length < OFFrameDecoder.LENGTH_OF_HEADER));\r
}\r
}\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
-package org.openflow.lib;
+package org.opendaylight.openflowjava.protocol.impl.core;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.openflow.lib.TcpHandler.COMPONENT_NAMES;
+import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler.COMPONENT_NAMES;
/**
* Class for decoding incoming messages into message frames.
*
* @author michal.polkorab
*/
-public class OfFrameDecoder extends ByteToMessageDecoder {
+public class OFFrameDecoder extends ByteToMessageDecoder {
/** Length of OpenFlow 1.3 header */
public static final byte LENGTH_OF_HEADER = 8;
private static final byte LENGTH_INDEX_IN_HEADER = 2;
- private static final Logger LOGGER = LoggerFactory.getLogger(OfFrameDecoder.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(OFFrameDecoder.class);
/**
* Constructor of class.
*/
- public OfFrameDecoder() {
+ public OFFrameDecoder() {
LOGGER.info("Creating OFFrameDecoder");
}
private static void enableOFVersionDetector(ChannelHandlerContext ctx) {
if (ctx.pipeline().get(COMPONENT_NAMES.OF_VERSION_DETECTOR.name()) == null) {
LOGGER.info("Adding OFVD");
- ctx.pipeline().addLast(COMPONENT_NAMES.OF_VERSION_DETECTOR.name(), new OfVersionDetector());
+ ctx.pipeline().addLast(COMPONENT_NAMES.OF_VERSION_DETECTOR.name(), new OFVersionDetector());
} else {
LOGGER.debug("OFVD already in pipeline");
}
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
-package org.openflow.lib;
+package org.opendaylight.openflowjava.protocol.impl.core;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.openflow.lib.TcpHandler.COMPONENT_NAMES;
+import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler.COMPONENT_NAMES;
/**
* Class that detects version of used OpenFlow Protocol and engages right OFCodec into
*
* @author michal.polkorab
*/
-public class OfVersionDetector extends ByteToMessageDecoder {
+public class OFVersionDetector extends ByteToMessageDecoder {
/** Version number of OpenFlow 1.3 protocol */
public static final byte OF13_VERSION_ID = 0x04;
- private static final Logger LOGGER = LoggerFactory.getLogger(OfVersionDetector.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(OFVersionDetector.class);
/**
* Constructor of class.
*/
- public OfVersionDetector() {
+ public OFVersionDetector() {
LOGGER.info("Creating OFVersionDetector");
}
private static void enableOF13Codec(ChannelHandlerContext chc) {
if (chc.pipeline().get(COMPONENT_NAMES.OF_CODEC.name()) == null) {
LOGGER.info("Engaging OF13Codec");
- chc.pipeline().addLast(COMPONENT_NAMES.OF_CODEC.name(), new Of13Codec());
+ chc.pipeline().addLast(COMPONENT_NAMES.OF_CODEC.name(), new OF13Codec());
} else {
LOGGER.debug("OF13Codec already in pipeline");
}
-package org.openflow.lib;\r
+package org.opendaylight.openflowjava.protocol.impl.core;\r
\r
import io.netty.channel.Channel;\r
import io.netty.channel.ChannelInitializer;\r
\r
import java.util.Iterator;\r
\r
-import org.openflow.lib.TcpHandler.COMPONENT_NAMES;\r
+import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler.COMPONENT_NAMES;\r
\r
/**\r
* @author michal.polkorab\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
-package org.openflow.lib;
+package org.opendaylight.openflowjava.protocol.impl.core;
import java.security.KeyStore;
import java.security.Security;
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
-package org.openflow.lib;
+package org.opendaylight.openflowjava.protocol.impl.core;
import java.io.InputStream;
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
-package org.openflow.lib;
+package org.opendaylight.openflowjava.protocol.impl.core;
import javax.net.ssl.ManagerFactoryParameters;
import javax.net.ssl.TrustManager;
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
-package org.openflow.lib;
+package org.opendaylight.openflowjava.protocol.impl.core;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
-package org.openflow.lib;
+package org.opendaylight.openflowjava.protocol.impl.core;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.openflow.lib.TcpHandler.COMPONENT_NAMES;
-import org.openflow.util.ByteBufUtils;
+import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler.COMPONENT_NAMES;
+import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;
/**
* Class for detecting TLS encrypted connection. If TLS encrypted connection is detected,
ChannelPipeline p = ctx.channel().pipeline();
if (p.get(COMPONENT_NAMES.OF_FRAME_DECODER.name()) == null) {
LOGGER.debug("Engaging OFFrameDecoder");
- p.addLast(COMPONENT_NAMES.OF_FRAME_DECODER.name(), new OfFrameDecoder());
+ p.addLast(COMPONENT_NAMES.OF_FRAME_DECODER.name(), new OFFrameDecoder());
} else {
LOGGER.debug("OFFD already in pipeline");
}
--- /dev/null
+/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization;\r
+\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.core.OFVersionDetector;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.BarrierReplyMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.EchoReplyMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.EchoRequestMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.ExperimenterMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.FeaturesReplyMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.HelloMessageFactory;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ * \r
+ * <pre> \r
+ * Type Message\r
+ * 0: HELLO\r
+ * 1: ERROR\r
+ * 2: ECHO_REQUEST\r
+ * 3: ECHO_REPLY\r
+ * 4: EXPERIMENTER\r
+ * 5: FEATURES_REQUEST\r
+ * 6: FEATURES_REPLY\r
+ * 7: GET_CONFIG_REQUEST\r
+ * 8: GET_CONFIG_REPLY\r
+ * 9: SET_CONFIG\r
+ * 10: PACKET_IN\r
+ * 11: FLOW_REMOVED\r
+ * 12: PORT_STATUS\r
+ * 13: PACKET_OUT\r
+ * 14: FLOW_MOD\r
+ * 15: GROUP_MOD\r
+ * 16: PORT_MOD\r
+ * 17: TABLE_MOD\r
+ * 18: MULTIPART_REQUEST\r
+ * 19: MULTIPART_REPLY\r
+ * 20: BARRIER_REQUEST\r
+ * 21: BARRIER_REPLY\r
+ * 22: QUEUE_GET_CONFIG_REQUEST\r
+ * 23: QUEUE_GET_CONFIG_REPLY\r
+ * 24: ROLE_REQUEST\r
+ * 25: ROLE_REPLY \r
+ * 26: GET_ASYNC_REQUEST\r
+ * 27: GET_ASYNC_REPLY\r
+ * 28: SET_ASYNC\r
+ * 29: METER_MOD\r
+ * </pre>\r
+ */\r
+public class DecoderTable {\r
+ \r
+ private static final short OF13 = OFVersionDetector.OF13_VERSION_ID;\r
+ private Map<MessageTypeCodeKey, OFDeserializer<?>> table;\r
+ private static DecoderTable instance;\r
+ \r
+ \r
+ private DecoderTable() {\r
+ // do nothing\r
+ }\r
+ \r
+ /**\r
+ * @return singleton instance\r
+ */\r
+ public static DecoderTable getInstance() {\r
+ if (instance == null) {\r
+ synchronized (DecoderTable.class) {\r
+ instance = new DecoderTable();\r
+ instance.init();\r
+ }\r
+ }\r
+ return instance;\r
+ }\r
+ \r
+ /**\r
+ * Decoder table provisioning\r
+ */\r
+ public void init() {\r
+ table = new HashMap<>();\r
+ table.put(new MessageTypeCodeKey(OF13, (short) 0), HelloMessageFactory.getInstance());\r
+ table.put(new MessageTypeCodeKey(OF13, (short) 2), EchoRequestMessageFactory.getInstance());\r
+ table.put(new MessageTypeCodeKey(OF13, (short) 3), EchoReplyMessageFactory.getInstance());\r
+ table.put(new MessageTypeCodeKey(OF13, (short) 4), ExperimenterMessageFactory.getInstance());\r
+ table.put(new MessageTypeCodeKey(OF13, (short) 6), FeaturesReplyMessageFactory.getInstance());\r
+ table.put(new MessageTypeCodeKey(OF13, (short) 21), BarrierReplyMessageFactory.getInstance());\r
+ }\r
+ \r
+ /**\r
+ * @param msgTypeKey\r
+ * @return decoder for given message types\r
+ */\r
+ public OFDeserializer<?> getDecoder(MessageTypeCodeKey msgTypeKey) {\r
+ return table.get(msgTypeKey);\r
+ }\r
+\r
+}\r
--- /dev/null
+/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.yangtools.yang.binding.DataObject;\r
+\r
+/**\r
+ *\r
+ * @author michal.polkorab\r
+ */\r
+public abstract class DeserializationFactory {\r
+\r
+ /**\r
+ * Transforms ByteBuf into correct POJO message\r
+ * @param rawMessage \r
+ * @param version version decoded from OpenFlow protocol message\r
+ * @return correct POJO as DataObject\r
+ */\r
+ public static DataObject bufferToMessage(ByteBuf rawMessage, short version) {\r
+ DataObject dataObject = null;\r
+ short type = rawMessage.readUnsignedByte();\r
+ \r
+ // TODO - check if no change happened, so that skipping length would cause problems\r
+ rawMessage.skipBytes(Short.SIZE / Byte.SIZE);\r
+\r
+ MessageTypeCodeKey msgTypeCodeKey = new MessageTypeCodeKey(version, type);\r
+ OFDeserializer<?> decoder = DecoderTable.getInstance().getDecoder(msgTypeCodeKey);\r
+ dataObject = decoder.bufferToMessage(rawMessage, version);\r
+ return dataObject;\r
+ }\r
+}\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.deserialization;\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization;\r
\r
/**\r
* @author michal.polkorab\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.deserialization;\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization;\r
\r
import org.opendaylight.yangtools.yang.binding.DataObject;\r
\r
*\r
* @param <E> message code type\r
*/\r
-public interface OfDeserializer<E extends DataObject> {\r
+public interface OFDeserializer<E extends DataObject> {\r
\r
/**\r
* Transforms byte message into POJO/DTO (of type E).\r
--- /dev/null
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutputBuilder;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ * @author timotej.kubas\r
+ * \r
+ */\r
+public class BarrierReplyMessageFactory implements\r
+ OFDeserializer<BarrierOutput> {\r
+\r
+ private static BarrierReplyMessageFactory instance;\r
+\r
+ private BarrierReplyMessageFactory() {\r
+ // do nothing, just singleton\r
+ }\r
+\r
+ /**\r
+ * @return singleton factory\r
+ */\r
+ public static BarrierReplyMessageFactory getInstance() {\r
+ if (instance == null) {\r
+ instance = new BarrierReplyMessageFactory();\r
+ }\r
+ return instance;\r
+ }\r
+\r
+ @Override\r
+ public BarrierOutput bufferToMessage(ByteBuf rawMessage, short version) {\r
+ BarrierOutputBuilder bob = new BarrierOutputBuilder();\r
+ bob.setVersion(version);\r
+ bob.setXid(rawMessage.readUnsignedInt());\r
+ return bob.build();\r
+ }\r
+\r
+}\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.deserialization.factories;\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
\r
import io.netty.buffer.ByteBuf;\r
\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutput;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutputBuilder;\r
-import org.openflow.lib.deserialization.OfDeserializer;\r
\r
/**\r
* @author michal.polkorab\r
*\r
*/\r
-public class EchoReplyMessageFactory implements OfDeserializer<EchoOutput> {\r
+public class EchoReplyMessageFactory implements OFDeserializer<EchoOutput> {\r
\r
private static EchoReplyMessageFactory instance;\r
\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.deserialization.factories;\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
\r
import io.netty.buffer.ByteBuf;\r
\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoRequestMessage;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoRequestMessageBuilder;\r
-import org.openflow.lib.deserialization.OfDeserializer;\r
\r
/**\r
* @author michal.polkorab\r
*\r
*/\r
-public class EchoRequestMessageFactory implements OfDeserializer<EchoRequestMessage>{\r
+public class EchoRequestMessageFactory implements OFDeserializer<EchoRequestMessage>{\r
\r
\r
private static EchoRequestMessageFactory instance;\r
--- /dev/null
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessageBuilder;\r
+\r
+/**\r
+ * \r
+ * @author michal.polkorab, \r
+ * @author timotej.kubas\r
+ *\r
+ */\r
+public class ExperimenterMessageFactory implements OFDeserializer<ExperimenterMessage>{\r
+\r
+ private static ExperimenterMessageFactory instance;\r
+ \r
+ private ExperimenterMessageFactory() {\r
+ //singleton\r
+ }\r
+ \r
+ \r
+ /**\r
+ * @return singleton factory\r
+ */\r
+ public static ExperimenterMessageFactory getInstance(){\r
+ if (instance == null){\r
+ instance = new ExperimenterMessageFactory(); \r
+ }\r
+ \r
+ return instance;\r
+ }\r
+\r
+ @Override\r
+ public ExperimenterMessage bufferToMessage(ByteBuf rawMessage, short version) {\r
+ ExperimenterMessageBuilder emb = new ExperimenterMessageBuilder();\r
+ emb.setVersion(version);\r
+ emb.setXid(rawMessage.readUnsignedInt());\r
+ emb.setExperimenter(rawMessage.readUnsignedInt());\r
+ emb.setExpType(rawMessage.readUnsignedInt());\r
+ return emb.build();\r
+ }\r
+ \r
+ \r
+}\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.deserialization.factories;\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
\r
import io.netty.buffer.ByteBuf;\r
\r
import java.math.BigInteger;\r
\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutputBuilder;\r
-import org.openflow.lib.deserialization.OfDeserializer;\r
\r
/**\r
* @author michal.polkorab\r
*\r
*/\r
-public class FeaturesReplyMessageFactory implements OfDeserializer<GetFeaturesOutput>{\r
+public class FeaturesReplyMessageFactory implements OFDeserializer<GetFeaturesOutput>{\r
\r
private static final byte PADDING_IN_FEATURES_REPLY_HEADER = 2;\r
\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.deserialization.factories;\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
\r
import io.netty.buffer.ByteBuf;\r
\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessage;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessageBuilder;\r
-import org.openflow.lib.deserialization.OfDeserializer;\r
\r
/**\r
* @author michal.polkorab\r
*\r
*/\r
-public class HelloMessageFactory implements OfDeserializer<HelloMessage> {\r
+public class HelloMessageFactory implements OFDeserializer<HelloMessage> {\r
\r
private static HelloMessageFactory instance;\r
\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.serialization;\r
+package org.opendaylight.openflowjava.protocol.impl.serialization;\r
\r
import java.util.HashMap;\r
import java.util.Map;\r
\r
+import org.opendaylight.openflowjava.protocol.impl.core.OFVersionDetector;\r
+import org.opendaylight.openflowjava.protocol.impl.serialization.factories.HelloInputMessageFactory;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;\r
import org.opendaylight.yangtools.yang.binding.DataObject;\r
-import org.openflow.lib.OfVersionDetector;\r
-import org.openflow.lib.serialization.factories.HelloInputMessageFactory;\r
\r
/**\r
* @author michal.polkorab\r
*/\r
public class EncoderTable {\r
\r
- private static final short OF13 = OfVersionDetector.OF13_VERSION_ID;\r
+ private static final short OF13 = OFVersionDetector.OF13_VERSION_ID;\r
private static EncoderTable instance;\r
- private Map<MessageTypeKey<?>, OfSerializer<?>> table;\r
+ private Map<MessageTypeKey<?>, OFSerializer<?>> table;\r
\r
\r
private EncoderTable() {\r
* @return encoder for current type of message (msgTypeKey)\r
*/\r
@SuppressWarnings("unchecked")\r
- public <E extends DataObject> OfSerializer<E> getEncoder(MessageTypeKey<E> msgTypeKey) {\r
- return (OfSerializer<E>) table.get(msgTypeKey);\r
+ public <E extends DataObject> OFSerializer<E> getEncoder(MessageTypeKey<E> msgTypeKey) {\r
+ return (OFSerializer<E>) table.get(msgTypeKey);\r
}\r
\r
}\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.serialization;\r
+package org.opendaylight.openflowjava.protocol.impl.serialization;\r
\r
import org.opendaylight.yangtools.yang.binding.DataObject;\r
\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.serialization;\r
+package org.opendaylight.openflowjava.protocol.impl.serialization;\r
\r
import io.netty.buffer.ByteBuf;\r
\r
*\r
* @param <E> message type\r
*/\r
-public interface OfSerializer <E extends DataObject> {\r
+public interface OFSerializer <E extends DataObject> {\r
\r
/**\r
* Transforms POJO/DTO into byte message (ByteBuf).\r
--- /dev/null
+/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
+package org.opendaylight.openflowjava.protocol.impl.serialization;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.opendaylight.yangtools.yang.binding.DataObject;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class SerializationFactory {\r
+\r
+ /**\r
+ * Transforms POJO message into ByteBuf\r
+ * @param version version used for encoding received message\r
+ * @param out ByteBuf for storing and sending transformed message\r
+ * @param message POJO message\r
+ */\r
+ public static <E extends DataObject> void messageToBuffer(short version, ByteBuf out, E message) {\r
+ @SuppressWarnings("unchecked")\r
+ MessageTypeKey<E> msgTypeKey = new MessageTypeKey<E>(version, (Class<E>) message.getClass());\r
+ OFSerializer<E> encoder = EncoderTable.getInstance().getEncoder(msgTypeKey);\r
+ encoder.messageToBuffer(version, out, message);\r
+ }\r
+}\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.serialization.factories;\r
+package org.opendaylight.openflowjava.protocol.impl.serialization.factories;\r
\r
import io.netty.buffer.ByteBuf;\r
\r
+import org.opendaylight.openflowjava.protocol.impl.core.OFFrameDecoder;\r
+import org.opendaylight.openflowjava.protocol.impl.serialization.OFSerializer;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;\r
-import org.openflow.lib.OfFrameDecoder;\r
-import org.openflow.lib.serialization.OfSerializer;\r
\r
/**\r
* @author michal.polkorab\r
*\r
*/\r
-public class HelloInputMessageFactory implements OfSerializer<HelloInput>{\r
+public class HelloInputMessageFactory implements OFSerializer<HelloInput>{\r
\r
/** Code type of HelloMessage */\r
public static final byte MESSAGE_TYPE = 0;\r
public void messageToBuffer(short version, ByteBuf out, HelloInput message) {\r
out.writeByte(message.getVersion());\r
out.writeByte(MESSAGE_TYPE);\r
- out.writeShort(OfFrameDecoder.LENGTH_OF_HEADER);\r
+ out.writeShort(OFFrameDecoder.LENGTH_OF_HEADER);\r
out.writeInt(message.getXid().intValue());\r
// TODO - fill list of elements into ByteBuf, check length too\r
}\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
\r
-package org.openflow.util;\r
+package org.opendaylight.openflowjava.protocol.impl.util;\r
\r
import io.netty.buffer.ByteBuf;\r
\r
+++ /dev/null
-/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.deserialization;\r
-\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-\r
-import org.openflow.deserialization.factories.EchoReplyMessageFactory;\r
-import org.openflow.deserialization.factories.EchoRequestMessageFactory;\r
-import org.openflow.deserialization.factories.FeaturesReplyMessageFactory;\r
-import org.openflow.deserialization.factories.HelloMessageFactory;\r
-import org.openflow.lib.OfVersionDetector;\r
-\r
-/**\r
- * @author michal.polkorab\r
- *\r
- */\r
-public class DecoderTable {\r
- \r
- private static final short OF13 = OfVersionDetector.OF13_VERSION_ID;\r
- private Map<MessageTypeCodeKey, OfDeserializer<?>> table;\r
- private static DecoderTable instance;\r
- \r
- \r
- private DecoderTable() {\r
- // do nothing\r
- }\r
- \r
- /**\r
- * @return singleton instance\r
- */\r
- public static DecoderTable getInstance() {\r
- if (instance == null) {\r
- synchronized (DecoderTable.class) {\r
- instance = new DecoderTable();\r
- instance.init();\r
- }\r
- }\r
- return instance;\r
- }\r
- \r
- /**\r
- * Decoder table provisioning\r
- */\r
- public void init() {\r
- table = new HashMap<>();\r
- table.put(new MessageTypeCodeKey(OF13, (short) 0), HelloMessageFactory.getInstance());\r
- table.put(new MessageTypeCodeKey(OF13, (short) 2), EchoRequestMessageFactory.getInstance());\r
- table.put(new MessageTypeCodeKey(OF13, (short) 3), EchoReplyMessageFactory.getInstance());\r
- table.put(new MessageTypeCodeKey(OF13, (short) 6), FeaturesReplyMessageFactory.getInstance());\r
- }\r
- \r
- /**\r
- * @param msgTypeKey\r
- * @return decoder for given message types\r
- */\r
- public OfDeserializer<?> getDecoder(MessageTypeCodeKey msgTypeKey) {\r
- return table.get(msgTypeKey);\r
- }\r
-\r
-}\r
+++ /dev/null
-/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.deserialization;\r
-\r
-import io.netty.buffer.ByteBuf;\r
-\r
-import org.opendaylight.yangtools.yang.binding.DataObject;\r
-\r
-/**\r
- *\r
- * @author michal.polkorab\r
- */\r
-public abstract class DeserializationFactory {\r
-\r
- /**\r
- * Transforms ByteBuf into correct POJO message\r
- * @param rawMessage \r
- * @param version version decoded from OpenFlow protocol message\r
- * @return correct POJO as DataObject\r
- */\r
- public static DataObject bufferToMessage(ByteBuf rawMessage, short version) {\r
- DataObject dataObject = null;\r
- short type = rawMessage.readUnsignedByte();\r
- \r
- // TODO - check if no change happened, so that skipping length would cause problems\r
- rawMessage.skipBytes(Short.SIZE / Byte.SIZE);\r
-\r
- MessageTypeCodeKey msgTypeCodeKey = new MessageTypeCodeKey(version, type);\r
- OfDeserializer<?> decoder = DecoderTable.getInstance().getDecoder(msgTypeCodeKey);\r
- dataObject = decoder.bufferToMessage(rawMessage, version);\r
- /* \r
- Type Message\r
- 0: HELLO\r
- 1: ERROR\r
- 2: ECHO_REQUEST\r
- 3: ECHO_REPLY\r
- 4: EXPERIMENTER\r
- 5: FEATURES_REQUEST\r
- 6: FEATURES_REPLY\r
- 7: GET_CONFIG_REQUEST\r
- 8: GET_CONFIG_REPLY\r
- 9: SET_CONFIG\r
- 10: PACKET_IN\r
- 11: FLOW_REMOVED\r
- 12: PORT_STATUS\r
- 13: PACKET_OUT\r
- 14: FLOW_MOD\r
- 15: GROUP_MOD\r
- 16: PORT_MOD\r
- 17: TABLE_MOD\r
- 18: MULTIPART_REQUEST\r
- 19: MULTIPART_REPLY\r
- 20: BARRIER_REQUEST\r
- 21: BARRIER_REPLY\r
- 22: QUEUE_GET_CONFIG_REQUEST\r
- 23: QUEUE_GET_CONFIG_REPLY\r
- 24: ROLE_REQUEST\r
- 25: ROLE_REPLY \r
- 26: GET_ASYNC_REQUEST\r
- 27: GET_ASYNC_REPLY\r
- 28: SET_ASYNC\r
- 29: METER_MOD\r
- */\r
- return dataObject;\r
- }\r
-}\r
+++ /dev/null
-/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.serialization;\r
-\r
-import io.netty.buffer.ByteBuf;\r
-\r
-import org.opendaylight.yangtools.yang.binding.DataObject;\r
-\r
-/**\r
- * @author michal.polkorab\r
- *\r
- */\r
-public class SerializationFactory {\r
-\r
- /**\r
- * Transforms POJO message into ByteBuf\r
- * @param version version used for encoding received message\r
- * @param out ByteBuf for storing and sending transformed message\r
- * @param message POJO message\r
- */\r
- public static <E extends DataObject> void messageToBuffer(short version, ByteBuf out, E message) {\r
- @SuppressWarnings("unchecked")\r
- MessageTypeKey<E> msgTypeKey = new MessageTypeKey<E>(version, (Class<E>) message.getClass());\r
- OfSerializer<E> encoder = EncoderTable.getInstance().getEncoder(msgTypeKey);\r
- encoder.messageToBuffer(version, out, message);\r
- /* \r
- Type Message\r
- 0: HELLO\r
- 1: ERROR\r
- 2: ECHO_REQUEST\r
- 3: ECHO_REPLY\r
- 4: EXPERIMENTER\r
- 5: FEATURES_REQUEST\r
- 6: FEATURES_REPLY\r
- 7: GET_CONFIG_REQUEST\r
- 8: GET_CONFIG_REPLY\r
- 9: SET_CONFIG\r
- 10: PACKET_IN\r
- 11: FLOW_REMOVED\r
- 12: PORT_STATUS\r
- 13: PACKET_OUT\r
- 14: FLOW_MOD\r
- 15: GROUP_MOD\r
- 16: PORT_MOD\r
- 17: TABLE_MOD\r
- 18: MULTIPART_REQUEST\r
- 19: MULTIPART_REPLY\r
- 20: BARRIER_REQUEST\r
- 21: BARRIER_REPLY\r
- 22: QUEUE_GET_CONFIG_REQUEST\r
- 23: QUEUE_GET_CONFIG_REPLY\r
- 24: ROLE_REQUEST\r
- 25: ROLE_REPLY \r
- 26: GET_ASYNC_REQUEST\r
- 27: GET_ASYNC_REPLY\r
- 28: SET_ASYNC\r
- 29: METER_MOD\r
- */\r
- }\r
-}\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
-package org.openflow.lib.clients;
+package org.opendaylight.openflowjava.protocol.impl.clients;
import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.ByteBuf;
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
\r
-package org.openflow.lib.clients;\r
+package org.opendaylight.openflowjava.protocol.impl.clients;\r
\r
import io.netty.buffer.ByteBuf;\r
import io.netty.channel.ChannelHandlerContext;\r
import io.netty.channel.ChannelInboundHandlerAdapter;\r
\r
-import org.openflow.util.ByteBufUtils;\r
+import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
-package org.openflow.lib.clients;
+package org.opendaylight.openflowjava.protocol.impl.clients;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import javax.net.ssl.SSLEngine;
-import org.openflow.lib.SslContextFactory;
+import org.opendaylight.openflowjava.protocol.impl.core.SslContextFactory;
import com.google.common.util.concurrent.SettableFuture;
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib;\r
+package org.opendaylight.openflowjava.protocol.impl.core;\r
\r
import io.netty.buffer.ByteBuf;\r
import io.netty.channel.ChannelHandlerContext;\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib;\r
+package org.opendaylight.openflowjava.protocol.impl.core;\r
\r
import io.netty.buffer.ByteBuf;\r
import io.netty.channel.embedded.EmbeddedChannel;\r
import org.junit.Assert;\r
import org.junit.Before;\r
import org.junit.Test;\r
-import org.openflow.lib.OfFrameDecoder;\r
+import org.opendaylight.openflowjava.protocol.impl.core.OFFrameDecoder;\r
\r
/**\r
- * Testing class of {@link OfFrameDecoder}\r
+ * Testing class of {@link OFFrameDecoder}\r
* @author michal.polkorab\r
*/\r
public class OFFrameDecoderTest {\r
*/\r
@Before\r
public void setUp() {\r
- embch = new EmbeddedChannel(new OfFrameDecoder());\r
+ embch = new EmbeddedChannel(new OFFrameDecoder());\r
}\r
\r
/**\r
- * Test of decoding {@link OfFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}\r
+ * Test of decoding {@link OFFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}\r
* @throws Exception \r
*/\r
@Test\r
}\r
\r
/**\r
- * Test of decoding {@link OfFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}\r
+ * Test of decoding {@link OFFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}\r
* @throws Exception \r
*/\r
@Test\r
}\r
\r
/**\r
- * Test of decoding {@link OfFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}\r
+ * Test of decoding {@link OFFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}\r
* @throws Exception \r
*/\r
@Test\r
}\r
\r
/**\r
- * Test of decoding {@link OfFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}\r
+ * Test of decoding {@link OFFrameDecoder#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)}\r
* @throws Exception \r
*/\r
@Test\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib;\r
+package org.opendaylight.openflowjava.protocol.impl.core;\r
\r
import io.netty.buffer.ByteBuf;\r
import io.netty.channel.embedded.EmbeddedChannel;\r
import org.junit.Assert;\r
import org.junit.Before;\r
import org.junit.Test;\r
-import org.openflow.lib.OfVersionDetector;\r
-import org.openflow.lib.TcpHandler.COMPONENT_NAMES;\r
+import org.opendaylight.openflowjava.protocol.impl.core.OFVersionDetector;\r
+import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler.COMPONENT_NAMES;\r
\r
/**\r
*\r
*/\r
@Before\r
public void setUp() {\r
- embch = new EmbeddedChannel(new OfVersionDetector());\r
+ embch = new EmbeddedChannel(new OFVersionDetector());\r
}\r
\r
/**\r
- * Test of decode {@link OfVersionDetector#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)\r
+ * Test of decode {@link OFVersionDetector#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)\r
* }\r
* @throws Exception \r
*/\r
}\r
\r
/**\r
- * Test of decode {@link OfVersionDetector#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)\r
+ * Test of decode {@link OFVersionDetector#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List)\r
* }\r
* @throws Exception \r
*/\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
-package org.openflow.lib;
+package org.opendaylight.openflowjava.protocol.impl.core;
import io.netty.channel.Channel;
import io.netty.util.concurrent.Future;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openflow.lib.clients.SimpleClient;
+import org.opendaylight.openflowjava.protocol.impl.clients.SimpleClient;
+import org.opendaylight.openflowjava.protocol.impl.core.PublishingChannelInitializer;
+import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*
* @author michal.polkorab
*/
-public class TCPHandlerTest {
+public class TcpHandlerTest {
/** Name of file in which OpenFLow protocol messages are stored in binary format */
private static final String OF_BINARY_MESSAGE_INPUT_TXT = "OFBinaryMessageInput.txt";
protected static final Logger LOGGER = LoggerFactory
- .getLogger(TCPHandlerTest.class);
+ .getLogger(TcpHandlerTest.class);
private static final long CONNECTION_TIMEOUT = 2000;
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib;\r
+package org.opendaylight.openflowjava.protocol.impl.core;\r
\r
import io.netty.buffer.ByteBuf;\r
import io.netty.channel.embedded.EmbeddedChannel;\r
import org.junit.Assert;\r
import org.junit.Before;\r
import org.junit.Test;\r
-import org.openflow.lib.TcpHandler;\r
-import org.openflow.lib.TlsDetector;\r
-import org.openflow.lib.TcpHandler.COMPONENT_NAMES;\r
+import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler;\r
+import org.opendaylight.openflowjava.protocol.impl.core.TlsDetector;\r
+import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler.COMPONENT_NAMES;\r
\r
/**\r
*\r
* @author michal.polkorab\r
*/\r
-public class TLSDetectorTest {\r
+public class TlsDetectorTest {\r
\r
private EmbeddedChannel embch;\r
\r
--- /dev/null
+/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.junit.Assert;\r
+import org.junit.Test;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.BarrierReplyMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class BarrierReplyMessageFactoryTest {\r
+\r
+ /**\r
+ * Testing of {@link BarrierReplyMessageFactory} for correct translation into POJO\r
+ */\r
+ @Test\r
+ public void test() {\r
+ ByteBuf bb = BufferHelper.buildBuffer(new byte[0]);\r
+ BarrierOutput builtByFactory = BarrierReplyMessageFactory.getInstance().bufferToMessage(bb, HelloMessageFactoryTest.VERSION_YET_SUPPORTED);\r
+\r
+ Assert.assertTrue(builtByFactory.getVersion() == HelloMessageFactoryTest.VERSION_YET_SUPPORTED);\r
+ Assert.assertEquals(builtByFactory.getXid().longValue(), 16909060L);\r
+ }\r
+}\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.deserialization.factories;\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
\r
import io.netty.buffer.ByteBuf;\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.EchoReplyMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutput;\r
-import org.openflow.deserialization.factories.EchoReplyMessageFactory;\r
-import org.openflow.lib.util.BufferHelper;\r
\r
/**\r
* @author michal.polkorab\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.deserialization.factories;\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
\r
import io.netty.buffer.ByteBuf;\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.EchoRequestMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoRequestMessage;\r
-import org.openflow.deserialization.factories.EchoRequestMessageFactory;\r
-import org.openflow.lib.util.BufferHelper;\r
\r
/**\r
* @author michal.polkorab\r
--- /dev/null
+/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+\r
+import org.junit.Assert;\r
+import org.junit.Test;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.ExperimenterMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public class ExperimenterMessageFactoryTest {\r
+\r
+ /**\r
+ * Testing {@link ExperimenterMessageFactory} for correct translation into POJO\r
+ */\r
+ @Test\r
+ public void test() {\r
+ byte[] data = new byte[]{0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04};\r
+ ByteBuf bb = BufferHelper.buildBuffer(data);\r
+ ExperimenterMessage builtByFactory = ExperimenterMessageFactory.getInstance().bufferToMessage(bb, HelloMessageFactoryTest.VERSION_YET_SUPPORTED);\r
+\r
+ Assert.assertTrue(builtByFactory.getVersion() == HelloMessageFactoryTest.VERSION_YET_SUPPORTED);\r
+ Assert.assertEquals(builtByFactory.getXid().longValue(), 16909060L);\r
+ Assert.assertEquals(builtByFactory.getExperimenter().longValue(), 16909060L);\r
+ Assert.assertEquals(builtByFactory.getExpType().longValue(), 16909060L);\r
+ }\r
+\r
+}\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.deserialization.factories;\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
\r
import io.netty.buffer.ByteBuf;\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.FeaturesReplyMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;\r
-import org.openflow.deserialization.factories.FeaturesReplyMessageFactory;\r
-import org.openflow.lib.util.BufferHelper;\r
\r
/**\r
* @author michal.polkorab\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.deserialization.factories;\r
+package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
\r
import io.netty.buffer.ByteBuf;\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.HelloMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessage;\r
-import org.openflow.deserialization.factories.HelloMessageFactory;\r
-import org.openflow.lib.util.BufferHelper;\r
\r
/**\r
* @author michal.polkorab\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.serialization.factories;\r
+package org.opendaylight.openflowjava.protocol.impl.serialization.factories;\r
\r
import io.netty.buffer.ByteBuf;\r
import io.netty.buffer.UnpooledByteBufAllocator;\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
+import org.opendaylight.openflowjava.protocol.impl.core.OFFrameDecoder;\r
+import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.HelloMessageFactoryTest;\r
+import org.opendaylight.openflowjava.protocol.impl.serialization.factories.HelloInputMessageFactory;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInputBuilder;\r
-import org.openflow.lib.OfFrameDecoder;\r
-import org.openflow.lib.deserialization.factories.HelloMessageFactoryTest;\r
\r
/**\r
* @author michal.polkorab\r
\r
Assert.assertTrue(out.readByte() == HelloMessageFactoryTest.VERSION_YET_SUPPORTED);\r
Assert.assertTrue(out.readByte() == HELLO_MESSAGE_CODE_TYPE);\r
- Assert.assertTrue(out.readUnsignedShort() == OfFrameDecoder.LENGTH_OF_HEADER);\r
+ Assert.assertTrue(out.readUnsignedShort() == OFFrameDecoder.LENGTH_OF_HEADER);\r
Assert.assertTrue(out.readUnsignedInt() == 16909060L);\r
}\r
\r
/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.openflow.lib.util;\r
+package org.opendaylight.openflowjava.protocol.impl.util;\r
\r
import io.netty.buffer.ByteBuf;\r
import io.netty.buffer.UnpooledByteBufAllocator;\r