2 * Copyright (c) 2016 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.openflowplugin.impl.protocol.serialization.match;
10 import io.netty.buffer.ByteBuf;
11 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
12 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
15 public class IpEcnEntrySerializer extends AbstractMatchEntrySerializer {
18 public void serialize(final Match match, final ByteBuf outBuffer) {
19 super.serialize(match, outBuffer);
20 outBuffer.writeByte(match.getIpMatch().getIpEcn().toJava());
24 public boolean matchTypeCheck(final Match match) {
25 return match.getIpMatch() != null && match.getIpMatch().getIpEcn() != null;
29 protected boolean getHasMask(final Match match) {
34 protected int getOxmFieldCode() {
35 return OxmMatchConstants.IP_ECN;
39 protected int getOxmClassCode() {
40 return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
44 protected int getValueLength() {
45 return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;