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;
12 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6CodeMatchEntry;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6CodeMatchEntryBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv6Code;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
23 * @author michal.polkorab
26 public class OxmIcmpv6CodeDeserializer extends AbstractOxmMatchEntryDeserializer
27 implements OFDeserializer<MatchEntries> {
30 public MatchEntries deserialize(ByteBuf input) {
31 MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
32 addIcmpv6CodeAugmentation(input, builder);
33 return builder.build();
36 private static void addIcmpv6CodeAugmentation(ByteBuf input,
37 MatchEntriesBuilder builder) {
38 Icmpv6CodeMatchEntryBuilder icmpv6CodeBuilder = new Icmpv6CodeMatchEntryBuilder();
39 icmpv6CodeBuilder.setIcmpv6Code(input.readUnsignedByte());
40 builder.addAugmentation(Icmpv6CodeMatchEntry.class, icmpv6CodeBuilder.build());
44 protected Class<? extends MatchField> getOxmField() {
45 return Icmpv6Code.class;
49 protected Class<? extends OxmClassBase> getOxmClass() {
50 return OpenflowBasicClass.class;