Bump upstreams for 2022.09 Chlorine
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / java / org / opendaylight / openflowjava / nx / codec / match / Reg2Codec.java
1 /*
2  * Copyright (c) 2014, 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 package org.opendaylight.openflowjava.nx.codec.match;
9
10 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
11 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
12 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
13 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg2;
17
18 public class Reg2Codec extends AbstractRegCodec {
19
20     private static final int NXM_FIELD_CODE = 2;
21     public static final MatchEntrySerializerKey<Nxm1Class, NxmNxReg2> SERIALIZER_KEY = new MatchEntrySerializerKey<>(
22             EncodeConstants.OF_VERSION_1_3, Nxm1Class.VALUE, NxmNxReg2.VALUE);
23     public static final MatchEntryDeserializerKey DESERIALIZER_KEY = new MatchEntryDeserializerKey(
24             EncodeConstants.OF_VERSION_1_3, OxmMatchConstants.NXM_1_CLASS, NXM_FIELD_CODE);
25
26     @Override
27     public int getNxmFieldCode() {
28         return NXM_FIELD_CODE;
29     }
30
31     @Override
32     public MatchField getNxmField() {
33         return NxmNxReg2.VALUE;
34     }
35 }