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.impl.serialization.experimenters;
\r
11 import io.netty.buffer.ByteBuf;
\r
13 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
\r
14 import org.opendaylight.openflowjava.util.ByteBufUtils;
\r
15 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
\r
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;
\r
19 * Translates Vendor messages
\r
20 * @author michal.polkorab
\r
22 public class OF10VendorInputMessageFactory implements OFSerializer<ExperimenterInput> {
\r
24 private static final byte MESSAGE_TYPE = 4;
\r
27 public void serialize(ExperimenterInput input, ByteBuf outBuffer) {
\r
28 ByteBufUtils.writeOFHeader(MESSAGE_TYPE, input, outBuffer, EncodeConstants.EMPTY_LENGTH);
\r
29 outBuffer.writeInt(input.getExperimenter().intValue());
\r
30 byte[] data = input.getData();
\r
32 outBuffer.writeBytes(data);
\r
34 ByteBufUtils.updateOFHeaderLength(outBuffer);
\r