Merge "Refactor nsh fields to new encoding"
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / java / org / opendaylight / openflowjava / nx / codec / match / Nshc3Codec.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.openflowjava.nx.codec.match;
10
11 import org.opendaylight.openflowjava.nx.api.NiciraConstants;
12 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
13 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
14 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc3;
18
19 public class Nshc3Codec extends AbstractNshcCodec {
20
21     private static final int NXM_FIELD_CODE = 8;
22     public static final MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc3> SERIALIZER_KEY =
23             createSerializerKey(
24                     EncodeConstants.OF13_VERSION_ID,
25                     NiciraConstants.NX_NSH_VENDOR_ID,
26                     NxmNxNshc3.class);
27     public static final MatchEntryDeserializerKey DESERIALIZER_KEY =
28             createDeserializerKey(
29                     EncodeConstants.OF13_VERSION_ID,
30                     NiciraConstants.NX_NSH_VENDOR_ID,
31                     NXM_FIELD_CODE);
32
33     @Override
34     public int getNxmFieldCode() {
35         return NXM_FIELD_CODE;
36     }
37
38     @Override
39     public Class<? extends MatchField> getNxmField() {
40         return NxmNxNshc3.class;
41     }
42 }