2 * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
9 package org.opendaylight.openflowjava.protocol.ext.serialization;
\r
11 import io.netty.buffer.ByteBuf;
\r
13 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
\r
14 import org.opendaylight.openflowjava.protocol.ext.util.ExtBufferUtils;
\r
15 import org.opendaylight.openflowjava.protocol.ext.util.ExtConstants;
\r
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;
\r
19 * Translates Experimenter messages
\r
20 * @author michal.polkorab
\r
21 * @author timotej.kubas
\r
23 public class OF13ExperimenterInputMessageFactory implements OFSerializer<ExperimenterInput>{
\r
25 /** Code type of Experimenter message */
\r
26 public static final byte MESSAGE_TYPE = 4;
\r
29 public void serialize(ExperimenterInput message, ByteBuf outBuffer) {
\r
30 ExtBufferUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, ExtConstants.EMPTY_LENGTH);
\r
31 outBuffer.writeInt(message.getExperimenter().intValue());
\r
32 outBuffer.writeInt(message.getExpType().intValue());
\r
33 byte[] data = message.getData();
\r
35 outBuffer.writeBytes(data);
\r
37 ExtBufferUtils.updateOFHeaderLength(outBuffer);
\r