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.deserialization.action;
10 import io.netty.buffer.ByteBuf;
11 import org.opendaylight.openflowjava.util.ByteBufUtils;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCaseBuilder;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.dst._case.SetNwDstActionBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
19 * OF10SetNwDstActionDeserializer.
21 * @author michal.polkorab
23 public class OF10SetNwDstActionDeserializer extends AbstractActionDeserializer {
25 public Action deserialize(final ByteBuf input) {
26 final ActionBuilder builder = new ActionBuilder();
27 input.skipBytes(2 * Short.BYTES);
28 SetNwDstCaseBuilder caseBuilder = new SetNwDstCaseBuilder();
29 SetNwDstActionBuilder actionBuilder = new SetNwDstActionBuilder();
30 actionBuilder.setIpAddress(ByteBufUtils.readIetfIpv4Address(input));
31 caseBuilder.setSetNwDstAction(actionBuilder.build());
32 builder.setActionChoice(caseBuilder.build());
33 return builder.build();
37 protected ActionChoice getType() {
38 return new SetNwDstCaseBuilder().build();