package org.opendaylight.openflowjava.protocol.impl.deserialization;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
-import org.opendaylight.openflowjava.protocol.impl.deserialization.match.NxmTcpFlagDeserializer;
-import org.opendaylight.openflowjava.protocol.impl.deserialization.match.NxmTunnelIpv4DstDeserializer;
-import org.opendaylight.openflowjava.protocol.impl.deserialization.match.NxmTunnelIpv4SrcDeserializer;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpOpDeserializer;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpShaDeserializer;
import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmArpSpaDeserializer;
helper.register(OxmMatchConstants.PBB_ISID, new OxmPbbIsidDeserializer());
helper.register(OxmMatchConstants.TUNNEL_ID, new OxmTunnelIdDeserializer());
helper.register(OxmMatchConstants.IPV6_EXTHDR, new OxmIpv6ExtHdrDeserializer());
-
- // Register NXM1Class match entry deserializers
- MatchEntryDeserializerRegistryHelper nxm1helper =
- new MatchEntryDeserializerRegistryHelper(EncodeConstants.OF13_VERSION_ID,
- OxmMatchConstants.NXM_1_CLASS, registry);
- nxm1helper.register(OxmMatchConstants.NXM_NX_TUN_IPV4_SRC, new NxmTunnelIpv4SrcDeserializer());
- nxm1helper.register(OxmMatchConstants.NXM_NX_TUN_IPV4_DST, new NxmTunnelIpv4DstDeserializer());
- nxm1helper.register(OxmMatchConstants.NXM_NX_TCP_FLAG, new NxmTcpFlagDeserializer());
-
}
}
+++ /dev/null
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TcpFlagMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm1Class;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpFlag;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author brent.salisbury
- *
- */
-public class NxmTcpFlagDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
- private static final Logger logger = LoggerFactory.getLogger(NxmTcpFlagDeserializer.class);
-
- @Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addTcpFlagAugmentation(input, builder);
- return builder.build();
- }
-
- private static void addTcpFlagAugmentation(ByteBuf input, MatchEntriesBuilder builder) {
- TcpFlagMatchEntryBuilder tcpFlagMatchEntryBuilder = new TcpFlagMatchEntryBuilder();
- tcpFlagMatchEntryBuilder.setTcpFlag(input.readUnsignedShort());
- }
-
- @Override
- protected Class<? extends MatchField> getOxmField() {
- return TcpFlag.class;
- }
-
- @Override
- protected Class<? extends OxmClassBase> getOxmClass() {
- return Nxm1Class.class;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm1Class;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TunnelIpv4Dst;
-
-/**
- * @author brent.salisbury
- *
- */
-public class NxmTunnelIpv4DstDeserializer extends AbstractOxmIpv4AddressDeserializer {
-
- @Override
- protected Class<? extends MatchField> getOxmField() {
- return TunnelIpv4Dst.class;
- }
-
- @Override
- protected Class<? extends OxmClassBase> getOxmClass() {
- return Nxm1Class.class;
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm1Class;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TunnelIpv4Src;
-
-/**
- * @author brent.salisbury
- *
- */
-public class NxmTunnelIpv4SrcDeserializer extends AbstractOxmIpv4AddressDeserializer {
-
- @Override
- protected Class<? extends MatchField> getOxmField() {
- return TunnelIpv4Src.class;
- }
-
- @Override
- protected Class<? extends OxmClassBase> getOxmClass() {
- return Nxm1Class.class;
- }
-}
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.impl.serialization.match.NxmTcpFlagSerializer;
-import org.opendaylight.openflowjava.protocol.impl.serialization.match.NxmTunnelIpv4DstSerializer;
-import org.opendaylight.openflowjava.protocol.impl.serialization.match.NxmTunnelIpv4SrcSerializer;
import org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmArpOpSerializer;
import org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmArpShaSerializer;
import org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmArpSpaSerializer;
helper.registerSerializer(PbbIsid.class, new OxmPbbIsidSerializer());
helper.registerSerializer(TunnelId.class, new OxmTunnelIdSerializer());
helper.registerSerializer(Ipv6Exthdr.class, new OxmIpv6ExtHdrSerializer());
-
- // Register OpenFlow NXM1Class match entry serializer
- Class<Nxm1Class> nxm1Class = Nxm1Class.class;
- MatchEntrySerializerRegistryHelper<Nxm1Class> nxm1RegistryHelper =
- new MatchEntrySerializerRegistryHelper<>(EncodeConstants.OF13_VERSION_ID,
- nxm1Class, serializerRegistry);
- nxm1RegistryHelper.registerSerializer(TunnelIpv4Dst.class, new NxmTunnelIpv4DstSerializer());
- nxm1RegistryHelper.registerSerializer(TunnelIpv4Src.class, new NxmTunnelIpv4SrcSerializer());
- nxm1RegistryHelper.registerSerializer(TcpFlag.class, new NxmTcpFlagSerializer());
}
}
+++ /dev/null
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.impl.serialization.match;
-
-import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TcpFlagMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author brent.salisbury
- *
- */
-public class NxmTcpFlagSerializer extends AbstractOxmMatchEntrySerializer {
-
- private static final Logger logger = LoggerFactory.getLogger(NxmTcpFlagSerializer.class);
-
- @Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
- super.serialize(entry, outBuffer);
- outBuffer.writeShort(entry.getAugmentation(TcpFlagMatchEntry.class).getTcpFlag());
- }
-
- @Override
- protected int getOxmClassCode() {
- return OxmMatchConstants.NXM_1_CLASS;
- }
-
- @Override
- protected int getOxmFieldCode() {
- return OxmMatchConstants.NXM_NX_TCP_FLAG;
- }
-
- @Override
- protected int getValueLength() {
- return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.impl.serialization.match;
-
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-
-/**
- * @author brent.salisbury
- *
- */
-public class NxmTunnelIpv4DstSerializer extends AbstractOxmIpv4AddressSerializer {
-
- @Override
- protected int getOxmClassCode() {
- return OxmMatchConstants.NXM_1_CLASS;
- }
-
- @Override
- protected int getOxmFieldCode() {
- return OxmMatchConstants.NXM_NX_TUN_IPV4_DST;
- }
-
- @Override
- protected int getValueLength() {
- return EncodeConstants.SIZE_OF_INT_IN_BYTES;
- }
-
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.impl.serialization.match;
-
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
-
-/**
- * @author brent.salisbury
- *
- */
-public class NxmTunnelIpv4SrcSerializer extends AbstractOxmIpv4AddressSerializer {
-
- @Override
- protected int getOxmClassCode() {
- return OxmMatchConstants.NXM_1_CLASS;
- }
-
- @Override
- protected int getOxmFieldCode() {
- return OxmMatchConstants.NXM_NX_TUN_IPV4_SRC;
- }
-
- @Override
- protected int getValueLength() {
- return EncodeConstants.SIZE_OF_INT_IN_BYTES;
- }
-
-}