2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.openflowjava.nx.codec.action;
10 import io.netty.buffer.ByteBuf;
12 import org.opendaylight.openflowjava.nx.NiciraConstants;
13 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
14 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
21 public abstract class AbstractActionSerializer implements OFSerializer<Action> {
23 protected final static void serializeHeader(int msgLength, int subtype, ByteBuf outBuffer) {
24 outBuffer.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
25 writeMsgLengthVendorIdSubtypeToBuffer(msgLength, subtype, outBuffer);
28 private final static void writeMsgLengthVendorIdSubtypeToBuffer(int msgLength, int subtype, ByteBuf outBuffer) {
29 outBuffer.writeShort(msgLength);
30 outBuffer.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
31 outBuffer.writeShort(subtype);