2 * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.protocol.impl.serialization.action;
10 import io.netty.buffer.ByteBuf;
11 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.IetfYangUtil;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlDstCase;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
17 * Serializes OF 1.0 SetDlDst actions.
19 * @author michal.polkorab
21 public class OF10SetDlDstActionSerializer extends AbstractActionSerializer {
22 public OF10SetDlDstActionSerializer() {
23 super(ActionConstants.SET_DL_DST_CODE, ActionConstants.LARGER_ACTION_LENGTH);
27 protected void serializeBody(final Action action, final ByteBuf outBuffer) {
28 outBuffer.writeBytes(IetfYangUtil.macAddressBytes(((SetDlDstCase) action.getActionChoice())
29 .getSetDlDstAction().getDlDstAddress()));
30 outBuffer.writeZero(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);