Remove unused code and imports
authorStephen Kitt <skitt@redhat.com>
Thu, 26 Nov 2015 08:55:13 +0000 (09:55 +0100)
committerStephen Kitt <skitt@redhat.com>
Thu, 26 Nov 2015 08:55:13 +0000 (09:55 +0100)
Change-Id: I9f9fe46abc4feba4a0795b8380b5c9bf4e894716
Signed-off-by: Stephen Kitt <skitt@redhat.com>
openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java
openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/SouthboundMapper.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/workaround/NetvirtSfcWorkaroundOF13Provider.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/workaround/services/SfcClassifierService.java

index cdc846e53d93977e80cf12b42f6430514cada88f..3cfb7f28a54c33385f2fbf0c903b10560d8ac62d 100644 (file)
@@ -23,7 +23,6 @@ import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configure
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
 
-import com.google.common.collect.ImmutableBiMap;
 import com.google.common.collect.Lists;
 
 import java.net.InetAddress;
@@ -32,7 +31,6 @@ import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
-import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.junit.Assert;
@@ -45,9 +43,7 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
 import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
 import org.opendaylight.ovsdb.utils.config.ConfigProperties;
@@ -59,11 +55,8 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.*;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.BridgeExternalIds;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.BridgeOtherConfigs;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntryBuilder;
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.InterfaceTypeEntryBuilder;
@@ -552,21 +545,6 @@ public class NetvirtIT extends AbstractMdsalTestBase {
         //Assume.assumeTrue(disconnectOvsdbNode(connectionInfo));
     }
 
-    private void setManagedBy(final OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder,
-                              final ConnectionInfo connectionInfo) {
-        InstanceIdentifier<Node> connectionNodePath = SouthboundMapper.createInstanceIdentifier(connectionInfo);
-        ovsdbBridgeAugmentationBuilder.setManagedBy(new OvsdbNodeRef(connectionNodePath));
-    }
-
-    private List<ProtocolEntry> createMdsalProtocols() {
-        List<ProtocolEntry> protocolList = new ArrayList<>();
-        ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
-                SouthboundConstants.OVSDB_PROTOCOL_MAP.inverse();
-        protocolList.add(new ProtocolEntryBuilder().
-                setProtocol(mapper.get("OpenFlow13")).build());
-        return protocolList;
-    }
-
     private OvsdbTerminationPointAugmentationBuilder createGenericOvsdbTerminationPointAugmentationBuilder() {
         OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointAugmentationBuilder =
                 new OvsdbTerminationPointAugmentationBuilder();
@@ -598,77 +576,6 @@ public class NetvirtIT extends AbstractMdsalTestBase {
         return result;
     }
 
-    /*
-     * base method for adding test bridges.  Other helper methods used to create bridges should utilize this method.
-     *
-     * @param connectionInfo
-     * @param bridgeIid if passed null, one is created
-     * @param bridgeName cannot be null
-     * @param bridgeNodeId if passed null, one is created based on <code>bridgeIid</code>
-     * @param setProtocolEntries toggles whether default protocol entries are set for the bridge
-     * @param failMode toggles whether default fail mode is set for the bridge
-     * @param setManagedBy toggles whether to setManagedBy for the bridge
-     * @param dpType if passed null, this parameter is ignored
-     * @param externalIds if passed null, this parameter is ignored
-     * @param otherConfig if passed null, this parameter is ignored
-     * @return success of bridge addition
-     * @throws InterruptedException
-     */
-    private boolean addBridge(final ConnectionInfo connectionInfo, InstanceIdentifier<Node> bridgeIid,
-            final String bridgeName, NodeId bridgeNodeId, final boolean setProtocolEntries,
-            final Class<? extends OvsdbFailModeBase> failMode, final boolean setManagedBy,
-            final Class<? extends DatapathTypeBase> dpType,
-            final List<BridgeExternalIds> externalIds,
-            final List<BridgeOtherConfigs> otherConfigs) throws InterruptedException {
-
-        NodeBuilder bridgeNodeBuilder = new NodeBuilder();
-        if (bridgeIid == null) {
-            bridgeIid = SouthboundMapper.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName));
-        }
-        if (bridgeNodeId == null) {
-            bridgeNodeId = SouthboundMapper.createManagedNodeId(bridgeIid);
-        }
-        bridgeNodeBuilder.setNodeId(bridgeNodeId);
-        OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder = new OvsdbBridgeAugmentationBuilder();
-        ovsdbBridgeAugmentationBuilder.setBridgeName(new OvsdbBridgeName(bridgeName));
-        if (setProtocolEntries) {
-            ovsdbBridgeAugmentationBuilder.setProtocolEntry(createMdsalProtocols());
-        }
-        if (failMode != null) {
-            ovsdbBridgeAugmentationBuilder.setFailMode(failMode);
-        }
-        if (setManagedBy) {
-            setManagedBy(ovsdbBridgeAugmentationBuilder, connectionInfo);
-        }
-        if (dpType != null) {
-            ovsdbBridgeAugmentationBuilder.setDatapathType(dpType);
-        }
-        if (externalIds != null) {
-            ovsdbBridgeAugmentationBuilder.setBridgeExternalIds(externalIds);
-        }
-        if (otherConfigs != null) {
-            ovsdbBridgeAugmentationBuilder.setBridgeOtherConfigs(otherConfigs);
-        }
-        bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
-        LOG.debug("Built with the intent to store bridge data {}",
-                ovsdbBridgeAugmentationBuilder.toString());
-        boolean result = mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
-                bridgeIid, bridgeNodeBuilder.build());
-        Thread.sleep(OVSDB_UPDATE_TIMEOUT);
-        return result;
-    }
-
-    private boolean addBridge(final ConnectionInfo connectionInfo, final String bridgeName)
-        throws InterruptedException {
-
-        return addBridge(connectionInfo, null, bridgeName, null, true,
-                SouthboundConstants.OVSDB_FAIL_MODE_MAP.inverse().get("secure"), true, null, null, null);
-    }
-
-    private OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo) {
-        return getBridge(connectionInfo, NetvirtITConstants.BRIDGE_NAME);
-    }
-
     /**
      * Extract the <code>store</code> type data store contents for the particular bridge identified by
      * <code>bridgeName</code>.
@@ -716,22 +623,6 @@ public class NetvirtIT extends AbstractMdsalTestBase {
         return mdsalUtils.read(store, bridgeIid);
     }
 
-    /**
-     * Extract the node contents from <code>LogicalDataStoreType.OPERATIONAL</code> data store for the
-     * bridge identified by <code>bridgeName</code>
-     *
-     * @param connectionInfo
-     * @param bridgeName
-     * @return <code>LogicalDatastoreType.OPERATIONAL</code> type data store contents
-     */
-    private Node getBridgeNode(ConnectionInfo connectionInfo, String bridgeName) {
-        return getBridgeNode(connectionInfo, bridgeName, LogicalDatastoreType.OPERATIONAL);
-    }
-
-    private boolean deleteBridge(ConnectionInfo connectionInfo) throws InterruptedException {
-        return deleteBridge(connectionInfo, NetvirtITConstants.BRIDGE_NAME);
-    }
-
     private boolean deleteBridge(final ConnectionInfo connectionInfo, final String bridgeName)
         throws InterruptedException {
 
index 33a9d7b7813dc5a17eff7b418ac10cc470584f71..b61be197bb18bbee2efc09d5231878f11da88ce8 100644 (file)
@@ -10,24 +10,16 @@ package org.opendaylight.ovsdb.openstack.netvirt.it;
 import java.net.Inet4Address;
 import java.net.Inet6Address;
 import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.HashSet;
-import java.util.Set;
 
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathTypeBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathTypeSystem;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
@@ -40,10 +32,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Joiner;
 import com.google.common.base.Preconditions;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ImmutableBiMap;
 
 public class SouthboundMapper {
     private static final Logger LOG = LoggerFactory.getLogger(SouthboundMapper.class);
@@ -130,86 +119,8 @@ public class SouthboundMapper {
         return new NodeId(uri);
     }
 
-    public static InetAddress createInetAddress(IpAddress ip) throws UnknownHostException {
-        if (ip.getIpv4Address() != null) {
-            return InetAddress.getByName(ip.getIpv4Address().getValue());
-        } else if (ip.getIpv6Address() != null) {
-            return InetAddress.getByName(ip.getIpv6Address().getValue());
-        } else {
-            throw new UnknownHostException("IP Address has no value");
-        }
-    }
-
-    public static DatapathId createDatapathId(Set<String> dpids) {
-        Preconditions.checkNotNull(dpids);
-        if (dpids.isEmpty()) {
-            return null;
-        } else {
-            String[] dpidArray = new String[dpids.size()];
-            dpids.toArray(dpidArray);
-            return createDatapathId(dpidArray[0]);
-        }
-    }
-
-    public static String createDatapathType(OvsdbBridgeAugmentation mdsalbridge) {
-        String datapathtype = SouthboundConstants.DATAPATH_TYPE_MAP.get(DatapathTypeSystem.class);
-
-        if (mdsalbridge.getDatapathType() != null && !mdsalbridge.getDatapathType().equals(DatapathTypeBase.class)) {
-            datapathtype = SouthboundConstants.DATAPATH_TYPE_MAP.get(mdsalbridge.getDatapathType());
-            if (datapathtype == null) {
-                throw new IllegalArgumentException("Unknown datapath type " + mdsalbridge.getDatapathType().getName());
-            }
-        }
-        return datapathtype;
-    }
-
-    public static  Class<? extends DatapathTypeBase> createDatapathType(String type) {
-        Preconditions.checkNotNull(type);
-        if (type.isEmpty()) {
-            return DatapathTypeSystem.class;
-        } else {
-            ImmutableBiMap<String, Class<? extends DatapathTypeBase>> mapper =
-                    SouthboundConstants.DATAPATH_TYPE_MAP.inverse();
-            return mapper.get(type);
-        }
-    }
-
-    public static DatapathId createDatapathId(String dpid) {
-        Preconditions.checkNotNull(dpid);
-        DatapathId datapath;
-        if (dpid.matches("^[0-9a-fA-F]{16}")) {
-            Splitter splitter = Splitter.fixedLength(2);
-            Joiner joiner = Joiner.on(":");
-            datapath = new DatapathId(joiner.join(splitter.split(dpid)));
-        } else {
-            datapath = new DatapathId(dpid);
-        }
-        return datapath;
-    }
-
-    public static Set<String> createOvsdbBridgeProtocols(OvsdbBridgeAugmentation ovsdbBridgeNode) {
-        Set<String> protocols = new HashSet<>();
-        if (ovsdbBridgeNode.getProtocolEntry() != null && ovsdbBridgeNode.getProtocolEntry().size() > 0) {
-            for (ProtocolEntry protocol : ovsdbBridgeNode.getProtocolEntry()) {
-                if (SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocol.getProtocol()) != null) {
-                    protocols.add(SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocol.getProtocol()));
-                } else {
-                    throw new IllegalArgumentException("Unknown protocol " + protocol.getProtocol());
-                }
-            }
-        }
-        return protocols;
-    }
-
     public static  Class<? extends InterfaceTypeBase> createInterfaceType(String type) {
         Preconditions.checkNotNull(type);
         return SouthboundConstants.OVSDB_INTERFACE_TYPE_MAP.get(type);
     }
-
-    public static String createOvsdbInterfaceType(Class<? extends InterfaceTypeBase> mdsaltype) {
-        Preconditions.checkNotNull(mdsaltype);
-        ImmutableBiMap<Class<? extends InterfaceTypeBase>, String> mapper =
-                SouthboundConstants.OVSDB_INTERFACE_TYPE_MAP.inverse();
-        return mapper.get(mdsaltype);
-    }
 }
index c4d1ad57f84b30fc3904cd4b82d7d8755514c2fe..b3b43a6fdccb59e479be5e3cf2d4a76dbdbffa9d 100644 (file)
@@ -20,13 +20,11 @@ import org.opendaylight.ovsdb.openstack.netvirt.sfc.INetvirtSfcOF13Provider;
 import org.opendaylight.ovsdb.openstack.netvirt.sfc.ISfcClassifierService;
 import org.opendaylight.ovsdb.openstack.netvirt.sfc.NshUtils;
 import org.opendaylight.ovsdb.openstack.netvirt.sfc.SfcUtils;
-import org.opendaylight.ovsdb.southbound.SouthboundConstants;
 import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
 import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
 import org.opendaylight.sfc.provider.api.SfcProviderRenderedPathAPI;
 import org.opendaylight.sfc.provider.api.SfcProviderServiceForwarderAPI;
 import org.opendaylight.sfc.provider.api.SfcProviderServiceFunctionAPI;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfName;
 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sl.rev140701.data.plane.locator.locator.type.Ip;
 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.CreateRenderedPathInput;
 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.CreateRenderedPathInputBuilder;
@@ -39,8 +37,6 @@ import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfp.rev1407
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.Ace;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.Matches;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.acl.rev150105.RedirectToSfc;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.Classifiers;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers.Classifier;
@@ -50,7 +46,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.Options;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
 import org.osgi.framework.ServiceReference;
@@ -63,13 +58,9 @@ public class NetvirtSfcWorkaroundOF13Provider implements INetvirtSfcOF13Provider
     private volatile Southbound southbound;
     private volatile ISfcClassifierService sfcClassifierService;
     private static final short SFC_TABLE = 150;
-    private static final int GPE_PORT = 6633;
-    private static final String NETWORK_TYPE_VXLAN = "vxlan";
     private MdsalUtils mdsalUtils;
     private SfcUtils sfcUtils;
     private static final String VXGPE = "vxgpe";
-    private static final String TUNNEL_DST = "192.168.120.31";
-    private static final String TUNNEL_VNID = "10";
     public static final String TUNNEL_ENDPOINT_KEY = "local_ip";
 
     public NetvirtSfcWorkaroundOF13Provider(final DataBroker dataBroker, MdsalUtils mdsalUtils, SfcUtils sfcUtils) {
@@ -139,105 +130,6 @@ public class NetvirtSfcWorkaroundOF13Provider implements INetvirtSfcOF13Provider
         handleRenderedServicePath(rsp, entry);
     }
 
-    private void handleRenderedServicePathOld(RenderedServicePath rsp, Ace entry) {
-        LOG.info("handleRenderedServicePath: RSP: {}", rsp);
-
-        Matches matches = entry.getMatches();
-        if (matches == null) {
-            LOG.warn("processAclEntry: matches not found");
-            return;
-        }
-
-        List<RenderedServicePathHop> pathHopList = rsp.getRenderedServicePathHop();
-        if (pathHopList.isEmpty()) {
-            LOG.warn("handleRenderedServicePath: RSP {} has empty hops!!", rsp.getName());
-            return;
-        }
-        LOG.info("handleRenderedServicePath: pathHopList: {}", pathHopList);
-
-        final List<Node> bridgeNodes = nodeCacheManager.getBridgeNodes();
-        if (bridgeNodes == null || bridgeNodes.isEmpty()) {
-            LOG.warn("handleRenderedServicePath: There are no bridges to process");
-            return;
-        }
-        for (Node bridgeNode : bridgeNodes) {
-            OvsdbBridgeAugmentation ovsdbBridgeAugmentation = southbound.getBridge(bridgeNode, "br-int");
-            if (ovsdbBridgeAugmentation == null) {
-                continue;
-            }
-            long vxGpeOfPort = getOFPort(bridgeNode, VXGPE);
-            if (vxGpeOfPort == 0L) {
-                LOG.warn("programAclEntry: Could not identify tunnel port {} -> OF ({}) on {}",
-                        VXGPE, vxGpeOfPort, bridgeNode);
-                continue;
-            }
-            long dataPathId = southbound.getDataPathId(bridgeNode);
-            if (dataPathId == 0L) {
-                LOG.warn("programAclEntry: Could not identify datapathId on {}", bridgeNode);
-                continue;
-            }
-
-            // Find the first Hop within an RSP.
-            // The classifier flow needs to send all matched traffic to this first hop SFF.
-            RenderedServicePathFirstHop firstRspHop = SfcProviderRenderedPathAPI
-                    .readRenderedServicePathFirstHop(rsp.getName());
-
-            LOG.info("handleRenderedServicePath: firstRspHop: {}", firstRspHop);
-            LOG.debug("handleRenderedServicePath: First Hop IPAddress = {}, Port = {}",
-                    firstRspHop.getIp().getIpv4Address().getValue(),
-                    firstRspHop.getPort().getValue());
-
-            NshUtils nshHeader = new NshUtils();
-            nshHeader.setNshMetaC1(NshUtils.convertIpAddressToLong(new Ipv4Address(TUNNEL_DST)));
-            nshHeader.setNshMetaC2(Long.parseLong(TUNNEL_VNID)); // get from register //get from
-            nshHeader.setNshNsp(rsp.getPathId());
-
-            RenderedServicePathHop firstHop = pathHopList.get(0);
-            RenderedServicePathHop lastHop = pathHopList.get(pathHopList.size()-1);
-            ServiceFunction serviceFunction =
-                    SfcProviderServiceFunctionAPI.readServiceFunction(
-                            SfName.getDefaultInstance(firstHop.getServiceFunctionName().getValue()));
-            if (serviceFunction == null) {
-                LOG.warn("programAclEntry: Could not identify ServiceFunction {} on {}",
-                        firstHop.getServiceFunctionName().getValue(), bridgeNode);
-                continue;
-            }
-
-            nshHeader.setNshNsi(firstHop.getServiceIndex());
-            // workaround: bypass sff and got directly to sf
-            //nshHeader.setNshTunIpDst(firstRspHop.getIp().getIpv4Address());
-            IpAddress sfIpAddress = sfcUtils.getSfIpAddress(serviceFunction);
-            String sfDplName = sfcUtils.getSfDplName(serviceFunction);
-            //sfcUtils.getSfIp(firstHop.getServiceFunctionName().getValue());
-            nshHeader.setNshTunIpDst(sfIpAddress.getIpv4Address());
-            nshHeader.setNshTunUdpPort(firstRspHop.getPort());
-            LOG.debug("handleRenderedServicePath: NSH Header = {}", nshHeader);
-
-            sfcClassifierService.programIngressClassifier(dataPathId, entry.getRuleName(), matches,
-                    nshHeader, vxGpeOfPort, true);
-
-            sfcClassifierService.program_sfEgress(dataPathId, GPE_PORT, true);
-            long sfOfPort = getSfPort(bridgeNode, sfDplName);
-
-            String sfMac = getMacFromExternalIds(bridgeNode, sfDplName);
-            String sfIpString = new String(sfIpAddress.getValue());
-            LOG.info("handleRenderedServicePath: sfDplName: {}, sfMac: {}, sfOfPort: {}, sfIpAddress: {}",
-                    sfDplName, sfMac, sfOfPort, sfIpString);
-            if (sfMac != null) { // install if the sf is on this bridge, expand when using multiple bridges
-                sfcClassifierService.program_sfIngress(dataPathId, GPE_PORT, sfOfPort, sfIpString, sfDplName, true);
-                sfcClassifierService.programStaticArpEntry(dataPathId, 0L, sfMac, sfIpString, true);
-            }
-
-            short lastServiceindex = (short)((lastHop.getServiceIndex()).intValue() - 1);
-            sfcClassifierService.programEgressClassifier(dataPathId, vxGpeOfPort, rsp.getPathId(),
-                    lastServiceindex, sfOfPort, 0, true);
-            sfcClassifierService.programEgressClassifierBypass(dataPathId, vxGpeOfPort, rsp.getPathId(),
-                    lastServiceindex, sfOfPort, 0, true);
-
-            sfcClassifierService.programSfcTable(dataPathId, vxGpeOfPort, SFC_TABLE, true);
-        }
-    }
-
     private void handleRenderedServicePath(RenderedServicePath rsp, Ace entry) {
         LOG.info("handleRenderedServicePath: RSP: {}", rsp);
 
@@ -476,28 +368,6 @@ public class NetvirtSfcWorkaroundOF13Provider implements INetvirtSfcOF13Provider
         return rsp;
     }
 
-    // loop through all ports looking for vxlan types, skip vxgpe, keep the rest
-    // first pass we only have two tunnels: one for normal vxlan and the other for gpe
-    // so just return the first non-gpe vxlan port
-    private long getTunnelOfPort(Node bridgeNode, String vxGpePortName) {
-        long port = 0L;
-        List<OvsdbTerminationPointAugmentation> ovsdbTerminationPointAugmentations =
-                southbound.getTerminationPointsOfBridge(bridgeNode);
-        if (!ovsdbTerminationPointAugmentations.isEmpty()) {
-            for (OvsdbTerminationPointAugmentation terminationPointAugmentation :
-                    ovsdbTerminationPointAugmentations) {
-                if (terminationPointAugmentation.getInterfaceType() ==
-                        SouthboundConstants.OVSDB_INTERFACE_TYPE_MAP.get(NETWORK_TYPE_VXLAN)) {
-                    if (!terminationPointAugmentation.getName().equals(vxGpePortName)) {
-                        port = terminationPointAugmentation.getOfport();
-                        break;
-                    }
-                }
-            }
-        }
-        return port;
-    }
-
     private long getSfPort(Node bridgeNode, String sfPortName) {
         return getOFPort(bridgeNode, sfPortName);
     }
@@ -530,23 +400,6 @@ public class NetvirtSfcWorkaroundOF13Provider implements INetvirtSfcOF13Provider
         return ofPort;
     }
 
-    private String getMacFromOptions(Node bridgeNode, String portName) {
-        String mac = null;
-        OvsdbTerminationPointAugmentation port = southbound.extractTerminationPointAugmentation(bridgeNode, portName);
-        LOG.info("getMac: portName: {}, bridgeNode: {},,, port: {}", portName, bridgeNode, port);
-        if (port != null && port.getOptions() != null) {
-            //mac = southbound.getOptionsValue(port.getOptions(), EXTERNAL_ID_VM_MAC);
-            for (Options option : port.getOptions()) {
-                LOG.info("getMac: option: {}", option);
-                if (option.getOption().equals(Constants.EXTERNAL_ID_VM_MAC)) {
-                    mac = option.getValue();
-                    break;
-                }
-            }
-        }
-        return mac;
-    }
-
     private String getMacFromExternalIds(Node bridgeNode, String portName) {
         String mac = null;
         OvsdbTerminationPointAugmentation port = southbound.getTerminationPointOfBridge(bridgeNode, portName);
index 182dc77aa11b89d259ffab004a858cf4735a65fb..8ebc06314b7c09fe3e360d9eb1ec3a54aa9a0412 100644 (file)
@@ -214,25 +214,8 @@ public class SfcClassifierService extends AbstractServiceInstance implements Con
         if (write) {
             InstructionsBuilder isb = new InstructionsBuilder();
             List<Instruction> instructions = Lists.newArrayList();
-            InstructionBuilder ib = new InstructionBuilder();
-
-            /*List<Action> actionList = Lists.newArrayList();
-
-            ActionBuilder ab = new ActionBuilder();
-            ab.setAction(ActionUtils.nxMoveNshc2ToTunId());
-            ab.setOrder(0);
-            ab.setKey(new ActionKey(0));
-            actionList.add(ab.build());
-
-            ApplyActionsBuilder aab = new ApplyActionsBuilder();
-            aab.setAction(actionList);
-            ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-
-            ib.setOrder(instructions.size());
-            ib.setKey(new InstructionKey(instructions.size()));
-            instructions.add(ib.build());*/
 
-            ib = InstructionUtils.createGotoTableInstructions(new InstructionBuilder(), getTable());
+            InstructionBuilder ib = InstructionUtils.createGotoTableInstructions(new InstructionBuilder(), getTable());
             ib.setOrder(instructions.size());
             ib.setKey(new InstructionKey(instructions.size()));
             instructions.add(ib.build());
@@ -544,8 +527,6 @@ public class SfcClassifierService extends AbstractServiceInstance implements Con
         // Build the Actions to Add the NSH Header
         org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nshC1Load =
                 ActionUtils.nxLoadNshc1RegAction(header.getNshMetaC1());
-        org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nshC2Load =
-                ActionUtils.nxLoadNshc2RegAction(header.getNshMetaC2());
         org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nspLoad =
                 ActionUtils.nxSetNspAction(header.getNshNsp());
         org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nsiLoad =
@@ -558,8 +539,6 @@ public class SfcClassifierService extends AbstractServiceInstance implements Con
         int count = actionList.size();
         actionList.add(new ActionBuilder()
                 .setKey(new ActionKey(count)).setOrder(count++).setAction(nshC1Load).build());
-        //actionList.add(new ActionBuilder()
-        // .setKey(new ActionKey(count)).setOrder(count++).setAction(nshC2Load).build());
         actionList.add(new ActionBuilder()
                 .setKey(new ActionKey(count)).setOrder(count++).setAction(nspLoad).build());
         actionList.add(new ActionBuilder()
@@ -577,9 +556,6 @@ public class SfcClassifierService extends AbstractServiceInstance implements Con
         if (matches.getAceType() instanceof AceIp) {
             AceIp aceIp = (AceIp)matches.getAceType();
             if (aceIp.getAceIpVersion() instanceof AceIpv4) {
-                //AceIpv4 aceIpv4 = (AceIpv4) aceIp.getAceIpVersion();
-                //MatchUtils.createSrcL3IPv4Match(matchBuilder, aceIpv4.getSourceIpv4Network());
-                //MatchUtils.createDstL3IPv4Match(matchBuilder, aceIpv4.getDestinationIpv4Network());
                 MatchUtils.createIpProtocolMatch(matchBuilder, aceIp.getProtocol());
                 MatchUtils.addLayer4Match(matchBuilder, aceIp.getProtocol().intValue(), 0,
                         aceIp.getDestinationPortRange().getLowerPort().getValue());