NXM (de)serializers deleted 25/14625/2
authorMartin Uhlir <martin.uhlir@pantheon.sk>
Fri, 30 Jan 2015 12:33:29 +0000 (13:33 +0100)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Mon, 2 Feb 2015 14:09:33 +0000 (14:09 +0000)
Change-Id: I51e279fea8cc8cc619fd2b46a2dfe135be1d24b8
Signed-off-by: Martin Uhlir <martin.uhlir@pantheon.sk>
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MatchEntryDeserializerInitializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/NxmTcpFlagDeserializer.java [deleted file]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/NxmTunnelIpv4DstDeserializer.java [deleted file]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/NxmTunnelIpv4SrcDeserializer.java [deleted file]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/MatchEntriesInitializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/NxmTcpFlagSerializer.java [deleted file]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/NxmTunnelIpv4DstSerializer.java [deleted file]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/NxmTunnelIpv4SrcSerializer.java [deleted file]

index 46273e89de4aa483a345fd008296f68732941380..21d9dcb122289959165084709ba22b2510f1d816 100644 (file)
@@ -8,9 +8,6 @@
 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;
@@ -114,14 +111,5 @@ public final class MatchEntryDeserializerInitializer {
         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());
-
     }
 }
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/NxmTcpFlagDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/NxmTcpFlagDeserializer.java
deleted file mode 100644 (file)
index 7a28723..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/NxmTunnelIpv4DstDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/NxmTunnelIpv4DstDeserializer.java
deleted file mode 100644 (file)
index bca1b88..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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;
-    }
-}
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/NxmTunnelIpv4SrcDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/NxmTunnelIpv4SrcDeserializer.java
deleted file mode 100644 (file)
index b081df9..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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;
-    }
-}
index 884617facbed7c9560ffd5001ec8c11a2869737c..027b800619ef7c1ee1f0b995bef906fd88e87e0c 100644 (file)
@@ -9,9 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization;
 
 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;
@@ -159,14 +156,5 @@ public final class MatchEntriesInitializer {
         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());
     }
 }
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/NxmTcpFlagSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/NxmTcpFlagSerializer.java
deleted file mode 100644 (file)
index 7d963b8..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/NxmTunnelIpv4DstSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/NxmTunnelIpv4DstSerializer.java
deleted file mode 100644 (file)
index 05b9880..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/NxmTunnelIpv4SrcSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/NxmTunnelIpv4SrcSerializer.java
deleted file mode 100644 (file)
index 19bd4a6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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;
-    }
-
-}