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;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6Match;
16 public class Ipv6NdSllEntrySerializer extends AbstractMatchEntrySerializer {
19 public void serialize(Match match, ByteBuf outBuffer) {
20 super.serialize(match, outBuffer);
21 writeMacAddress(((Ipv6Match) match.getLayer3Match()).getIpv6NdSll(), outBuffer);
25 public boolean matchTypeCheck(Match match) {
26 return match.getLayer3Match() != null
27 && match.getLayer3Match() instanceof Ipv6Match
28 && ((Ipv6Match) match.getLayer3Match()).getIpv6NdSll() != null;
32 protected boolean getHasMask(Match match) {
37 protected int getOxmFieldCode() {
38 return OxmMatchConstants.IPV6_ND_SLL;
42 protected int getOxmClassCode() {
43 return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
47 protected int getValueLength() {
48 return EncodeConstants.MAC_ADDRESS_LENGTH;