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.match;
10 import io.netty.buffer.ByteBuf;
11 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
12 import org.opendaylight.openflowjava.util.ByteBufUtils;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Dst;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4DstCaseBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv4.dst._case.Ipv4DstBuilder;
19 * Translates OxmIpv4Dst messages.
21 * @author michal.polkorab
23 public class OxmIpv4DstDeserializer extends AbstractOxmMatchEntryDeserializer {
24 public OxmIpv4DstDeserializer() {
29 protected void deserialize(final ByteBuf input, final MatchEntryBuilder builder) {
30 final Ipv4DstBuilder ipv4Builder = new Ipv4DstBuilder()
31 .setIpv4Address(ByteBufUtils.readIetfIpv4Address(input));
32 if (builder.getHasMask()) {
33 ipv4Builder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.GROUPS_IN_IPV4_ADDRESS));
35 builder.setMatchEntryValue(new Ipv4DstCaseBuilder().setIpv4Dst(ipv4Builder.build()).build());