\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.openflowjava.protocol.impl.util.ByteBufUtils;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput;\r
\r
/**\r
\r
/** Code type of SetConfig message */\r
public static final byte MESSAGE_TYPE = 9;\r
+ private static final int MESSAGE_LENGTH = 12;\r
private static SetConfigMessageFactory instance;\r
\r
private SetConfigMessageFactory() {\r
@Override\r
public void messageToBuffer(short version, ByteBuf out,\r
SetConfigInput message) {\r
- out.writeByte(message.getVersion());\r
- out.writeByte(MESSAGE_TYPE);\r
- out.writeShort(OFFrameDecoder.LENGTH_OF_HEADER);\r
- out.writeInt(message.getXid().intValue());\r
- // TODO - finish implementation after enums provide needed funcionality\r
- out.writeInt(message.getMissSendLen());\r
+ ByteBufUtils.writeOFHeader(instance, message, out);\r
+ // TODO - finish implementation after list of enums is generated\r
+ //out.writeShort(message.getFlags().getIntValue());\r
+ out.writeShort(message.getMissSendLen());\r
+ }\r
+\r
+ @Override\r
+ public int computeLength() {\r
+ return MESSAGE_LENGTH;\r
+ }\r
+\r
+ @Override\r
+ public byte getMessageType() {\r
+ return MESSAGE_TYPE;\r
}\r
\r
}\r