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.inet.types.rev130715.IetfInetUtil;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCase;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
17 * Serializes OF 1.0 SetNwDst actions.
19 * @author michal.polkorab
21 public class OF10SetNwDstActionSerializer extends AbstractActionSerializer {
22 public OF10SetNwDstActionSerializer() {
23 super(ActionConstants.SET_NW_DST_CODE, ActionConstants.GENERAL_ACTION_LENGTH);
27 protected void serializeBody(final Action action, final ByteBuf outBuffer) {
28 outBuffer.writeBytes(IetfInetUtil.ipv4AddressBytes(
29 ((SetNwDstCase) action.getActionChoice()).getSetNwDstAction().getIpAddress()));