Skeleton implementation of L3 using PipelineOrchestration 78/10578/5
authorDave Tucker <djt@redhat.com>
Mon, 1 Sep 2014 14:42:43 +0000 (15:42 +0100)
committerDave Tucker <djt@redhat.com>
Tue, 2 Sep 2014 14:39:13 +0000 (15:39 +0100)
This refactors the L3 interface to fit the static pipeline model

L3 logic stays in net-virt and the service tables in net-virt-providers
implement the new interfaces. The logic in net-virt can resolve the
implementation of these interfaces through the OSGi SR.

Ideally service lookup should not be handled in the net-virt Activator,
instead we should allow the OFXProvider classes to handle this by
watching for implementations of AbstractServiceInstance with a service
property that matches their name.

Change-Id: I0e41d992e0ff1d8de2d25b02ce8e5a36e27e6ae7
Signed-off-by: Dave Tucker <djt@redhat.com>
30 files changed:
integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/neutron/NeutronIT.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/Activator.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow10/OF10Provider.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/OF13Provider.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/Service.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/ArpResponderService.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/InboundNatService.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/L3ForwardingService.java [new file with mode: 0644]
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/OutboundNatService.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/RoutingService.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/AbstractEvent.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/Activator.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/FloatingIPHandler.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/NetworkHandler.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/NorthboundEvent.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/PortHandler.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/RouterHandler.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/SouthboundEvent.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/SouthboundHandler.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/SubnetHandler.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/Action.java [new file with mode: 0644]
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/ArpProvider.java [new file with mode: 0644]
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/Constants.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/InboundNatProvider.java [new file with mode: 0644]
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/L3ForwardingProvider.java [new file with mode: 0644]
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/MultiTenantRouterForwardingProvider.java [deleted file]
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/NetworkingProvider.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/OutboundNatProvider.java [new file with mode: 0644]
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/RoutingProvider.java [new file with mode: 0644]
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java

index 5661151ea749739d539b7cf37d37f25101c99e2c..4365809a614af623b6055869905768068d98d0cf 100644 (file)
@@ -255,6 +255,16 @@ public class NeutronIT extends OvsdbIntegrationTestBase {
 
     private class FakeOF10Provider implements NetworkingProvider {
 
+        @Override
+        public String getName() {
+            return null;
+        }
+
+        @Override
+        public boolean supportsServices() {
+            return false;
+        }
+
         @Override
         public boolean hasPerTenantTunneling() {
             return true;
@@ -289,6 +299,16 @@ public class NeutronIT extends OvsdbIntegrationTestBase {
 
     private class FakeOF13Provider implements NetworkingProvider {
 
+        @Override
+        public String getName() {
+            return null;
+        }
+
+        @Override
+        public boolean supportsServices() {
+            return false;
+        }
+
         @Override
         public boolean hasPerTenantTunneling() {
             return false;
index 0a09b75918d2fc2993402a6ac6ab655497d8d257..8638b34b5ae43d4e6ba6804869a4dde43a096891 100644 (file)
@@ -17,9 +17,14 @@ import org.opendaylight.controller.forwardingrulesmanager.IForwardingRulesManage
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
 import org.opendaylight.controller.switchmanager.ISwitchManager;
+import org.opendaylight.ovsdb.openstack.netvirt.api.ArpProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
 import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
+import org.opendaylight.ovsdb.openstack.netvirt.api.InboundNatProvider;
+import org.opendaylight.ovsdb.openstack.netvirt.api.L3ForwardingProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProvider;
+import org.opendaylight.ovsdb.openstack.netvirt.api.OutboundNatProvider;
+import org.opendaylight.ovsdb.openstack.netvirt.api.RoutingProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow10.OF10Provider;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
@@ -36,6 +41,7 @@ import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.In
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.IngressAclService;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.L2ForwardingService;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.L2RewriteService;
+import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.L3ForwardingService;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.LoadBalancerService;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.OutboundNatService;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.RoutingService;
@@ -84,6 +90,7 @@ public class Activator extends ComponentActivatorAbstractBase {
                         IngressAclService.class,
                         LoadBalancerService.class,
                         RoutingService.class,
+                        L3ForwardingService.class,
                         L2RewriteService.class,
                         L2ForwardingService.class,
                         EgressAclService.class,
@@ -175,61 +182,83 @@ public class Activator extends ComponentActivatorAbstractBase {
         if (imp.equals(ClassifierService.class)) {
             Properties properties = new Properties();
             properties.put(AbstractServiceInstance.SERVICE_PROPERTY, Service.CLASSIFIER);
+            properties.put(Constants.PROVIDER_NAME_PROPERTY, OF13Provider.NAME);
             c.setInterface(AbstractServiceInstance.class.getName(), properties);
         }
 
         if (imp.equals(ArpResponderService.class)) {
             Properties properties = new Properties();
             properties.put(AbstractServiceInstance.SERVICE_PROPERTY, Service.ARP_RESPONDER);
-            c.setInterface(AbstractServiceInstance.class.getName(), properties);
+            properties.put(Constants.PROVIDER_NAME_PROPERTY, OF13Provider.NAME);
+            c.setInterface(new String[] {AbstractServiceInstance.class.getName(), ArpProvider.class.getName()},
+                           properties);
         }
 
         if (imp.equals(InboundNatService.class)) {
             Properties properties = new Properties();
             properties.put(AbstractServiceInstance.SERVICE_PROPERTY, Service.INBOUND_NAT);
-            c.setInterface(AbstractServiceInstance.class.getName(), properties);
+            properties.put(Constants.PROVIDER_NAME_PROPERTY, OF13Provider.NAME);
+            c.setInterface(new String[] {AbstractServiceInstance.class.getName(), InboundNatProvider.class.getName()},
+                           properties);
         }
 
         if (imp.equals(IngressAclService.class)) {
             Properties properties = new Properties();
             properties.put(AbstractServiceInstance.SERVICE_PROPERTY, Service.INGRESS_ACL);
+            properties.put(Constants.PROVIDER_NAME_PROPERTY, OF13Provider.NAME);
             c.setInterface(AbstractServiceInstance.class.getName(), properties);
         }
 
         if (imp.equals(LoadBalancerService.class)) {
             Properties properties = new Properties();
             properties.put(AbstractServiceInstance.SERVICE_PROPERTY, Service.LOAD_BALANCER);
+            properties.put(Constants.PROVIDER_NAME_PROPERTY, OF13Provider.NAME);
             c.setInterface(AbstractServiceInstance.class.getName(), properties);
         }
 
         if (imp.equals(RoutingService.class)) {
             Properties properties = new Properties();
             properties.put(AbstractServiceInstance.SERVICE_PROPERTY, Service.ROUTING);
-            c.setInterface(AbstractServiceInstance.class.getName(), properties);
+            properties.put(Constants.PROVIDER_NAME_PROPERTY, OF13Provider.NAME);
+            c.setInterface(new String[] {AbstractServiceInstance.class.getName(), RoutingProvider.class.getName()},
+                           properties);
+        }
+
+        if (imp.equals(L3ForwardingService.class)) {
+            Properties properties = new Properties();
+            properties.put(AbstractServiceInstance.SERVICE_PROPERTY, Service.L3_FORWARDING);
+            properties.put(Constants.PROVIDER_NAME_PROPERTY, OF13Provider.NAME);
+            c.setInterface(new String[] {AbstractServiceInstance.class.getName(), L3ForwardingProvider.class.getName()},
+                           properties);
         }
 
         if (imp.equals(L2RewriteService.class)) {
             Properties properties = new Properties();
             properties.put(AbstractServiceInstance.SERVICE_PROPERTY, Service.L2_REWRITE);
+            properties.put(Constants.PROVIDER_NAME_PROPERTY, OF13Provider.NAME);
             c.setInterface(AbstractServiceInstance.class.getName(), properties);
         }
 
         if (imp.equals(L2ForwardingService.class)) {
             Properties properties = new Properties();
             properties.put(AbstractServiceInstance.SERVICE_PROPERTY, Service.L2_FORWARDING);
+            properties.put(Constants.PROVIDER_NAME_PROPERTY, OF13Provider.NAME);
             c.setInterface(AbstractServiceInstance.class.getName(), properties);
         }
 
         if (imp.equals(IngressAclService.class)) {
             Properties properties = new Properties();
             properties.put(AbstractServiceInstance.SERVICE_PROPERTY, Service.INGRESS_ACL);
+            properties.put(Constants.PROVIDER_NAME_PROPERTY, OF13Provider.NAME);
             c.setInterface(AbstractServiceInstance.class.getName(), properties);
         }
 
         if (imp.equals(OutboundNatService.class)) {
             Properties properties = new Properties();
             properties.put(AbstractServiceInstance.SERVICE_PROPERTY, Service.OUTBOUND_NAT);
-            c.setInterface(AbstractServiceInstance.class.getName(), properties);
+            properties.put(Constants.PROVIDER_NAME_PROPERTY, OF13Provider.NAME);
+            c.setInterface(new String[] {AbstractServiceInstance.class.getName(), OutboundNatProvider.class.getName()},
+                           properties);
         }
     }
 }
index 2cfe6962a5c503018c5d5059e0347e291dc4bc94..5710c70330da396054c32ad95a495f681aca670b 100644 (file)
@@ -68,6 +68,16 @@ public class OF10Provider implements NetworkingProvider {
     public OF10Provider(){
     }
 
+    @Override
+    public String getName() {
+        return "OF10Provider";
+    }
+
+    @Override
+    public boolean supportsServices() {
+        return false;
+    }
+
     @Override
     public boolean hasPerTenantTunneling() {
         return true;
index 00e28248c7d7e093049d34b31f9085c5a385bbaa..98ac9015b00a3e596cd3e90a13ec91aeb7a96df1 100644 (file)
@@ -117,10 +117,22 @@ public class OF13Provider implements NetworkingProvider {
     private volatile OvsdbConnectionService connectionService;
     private volatile MdsalConsumer mdsalConsumer;
 
+    public static final String NAME = "OF13Provider";
+
     public OF13Provider(){
 
     }
 
+    @Override
+    public String getName() {
+        return NAME;
+    }
+
+    @Override
+    public boolean supportsServices() {
+        return true;
+    }
+
     @Override
     public boolean hasPerTenantTunneling() {
         return false;
index ad4be89dc958a1ae019d360325a5cd4a329f0cd8..f309b9869eda2fa04e79a66a0e551914e181bc1e 100644 (file)
@@ -19,10 +19,11 @@ public enum Service {
     INGRESS_ACL ((short) 40, "Ingress Acces-control. Typically Openstack Egress Security group policies are applied here."),
     LOAD_BALANCER ((short) 50, "Distributed LBaaS"),
     ROUTING ((short) 60, "Distributed Virtual Routing (DVR)"),
-    L2_REWRITE ((short) 70, "Layer2 rewrite service"),
-    L2_FORWARDING ((short) 80, "Layer2 mac,vlan based forwarding"),
-    EGRESS_ACL ((short) 90, "Egress Acces-control.Typically Openstack Ingress Security group policies are applied here."),
-    OUTBOUND_NAT ((short) 100, "SNAT for traffic accessing external network");
+    L3_FORWARDING ((short) 70, "Layer 3 forwarding/lookup service"),
+    L2_REWRITE ((short) 80, "Layer2 rewrite service"),
+    L2_FORWARDING ((short) 90, "Layer2 mac,vlan based forwarding"),
+    EGRESS_ACL ((short) 100, "Egress Acces-control.Typically Openstack Ingress Security group policies are applied here."),
+    OUTBOUND_NAT ((short) 110, "SNAT for traffic accessing external network");
 
     short table;
     String description;
index 9efa6e6e703acf4b89d7be2b1249fec5d7df58d8..32bc30ae49b19af0689e62791df1d7633c57813f 100644 (file)
@@ -5,14 +5,21 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  *
- * Authors : Madhu Venugopal
+ * Authors : Madhu Venugopal, Dave Tucker
  */
 package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
 
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.sal.utils.StatusCode;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.ovsdb.openstack.netvirt.api.ArpProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
 
-public class ArpResponderService extends AbstractServiceInstance {
+import java.net.InetAddress;
+
+public class ArpResponderService extends AbstractServiceInstance implements ArpProvider {
     public ArpResponderService() {
         super(Service.ARP_RESPONDER);
     }
@@ -25,4 +32,10 @@ public class ArpResponderService extends AbstractServiceInstance {
     public boolean isBridgeInPipeline (String nodeId) {
         return true;
     }
-}
\ No newline at end of file
+
+    @Override
+    public Status programStaticArpEntry(Node node, Long dpid, String segmentationId, String macAddress,
+                                        InetAddress ipAddress, Action action) {
+        return new Status(StatusCode.NOTIMPLEMENTED);
+    }
+}
index b617e1feded03a72dcaba5e8b4b8bedf42a404ae..1f512bab163ce63487ff0744bf0354802ee7efdc 100644 (file)
@@ -5,14 +5,21 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  *
- * Authors : Madhu Venugopal
+ * Authors : Madhu Venugopal, Dave Tucker
  */
 package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
 
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.sal.utils.StatusCode;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.ovsdb.openstack.netvirt.api.InboundNatProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
 
-public class InboundNatService extends AbstractServiceInstance {
+import java.net.InetAddress;
+
+public class InboundNatService extends AbstractServiceInstance implements InboundNatProvider {
     public InboundNatService() {
         super(Service.INBOUND_NAT);
     }
@@ -25,4 +32,16 @@ public class InboundNatService extends AbstractServiceInstance {
     public boolean isBridgeInPipeline (String nodeId) {
         return true;
     }
-}
\ No newline at end of file
+
+    @Override
+    public Status programIpRewriteRule(Node node, Long dpid, String segmentationId, InetAddress matchAddress,
+                                       InetAddress rewriteAddress, Action action) {
+        return new Status(StatusCode.NOTIMPLEMENTED);
+    }
+
+    @Override
+    public Status programIpRewriteExclusion(Node node, Long dpid, String segmentationId, String excludedCidr,
+                                            Action action) {
+        return new Status(StatusCode.NOTIMPLEMENTED);
+    }
+}
diff --git a/openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/L3ForwardingService.java b/openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/L3ForwardingService.java
new file mode 100644 (file)
index 0000000..8fa97bd
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * 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
+ *
+ * Authors : Dave Tucker
+ */
+
+package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.ovsdb.openstack.netvirt.api.L3ForwardingProvider;
+import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+
+import java.net.InetAddress;
+
+public class L3ForwardingService extends AbstractServiceInstance implements L3ForwardingProvider {
+    public L3ForwardingService() {
+        super(Service.L3_FORWARDING);
+    }
+
+    public L3ForwardingService(Service service) {
+        super(service);
+    }
+
+    @Override
+    public boolean isBridgeInPipeline (String nodeId) {
+        return true;
+    }
+
+    @Override
+    public Status programForwardingTableEntry(Node node, Long dpid, String segmentationId, InetAddress ipAddress,
+                                              String macAddress, Action action) {
+        return null;
+    }
+}
index 103b127c291579e19b614eb082a8c6211e8b8df6..7086a26dc536f2e4a3a00536d4f1f4cca5cde4bc 100644 (file)
@@ -5,14 +5,22 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  *
- * Authors : Madhu Venugopal
+ * Authors : Madhu Venugopal, Dave Tucker
  */
+
 package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
 
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.sal.utils.StatusCode;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.ovsdb.openstack.netvirt.api.OutboundNatProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
 
-public class OutboundNatService extends AbstractServiceInstance {
+import java.net.InetAddress;
+
+public class OutboundNatService extends AbstractServiceInstance implements OutboundNatProvider {
     public OutboundNatService() {
         super(Service.OUTBOUND_NAT);
     }
@@ -25,4 +33,16 @@ public class OutboundNatService extends AbstractServiceInstance {
     public boolean isBridgeInPipeline (String nodeId) {
         return true;
     }
-}
\ No newline at end of file
+
+    @Override
+    public Status programIpRewriteRule(Node node, Long dpid, String segmentationId, InetAddress matchAddress,
+                                       InetAddress rewriteAddress, Action action) {
+        return new Status(StatusCode.NOTIMPLEMENTED);
+    }
+
+    @Override
+    public Status programIpRewriteExclusion(Node node, Long dpid, String segmentationId, String excludedCidr,
+                                            Action action) {
+        return new Status(StatusCode.NOTIMPLEMENTED);
+    }
+}
index 9bbe4438d448cf446d5616ecb45f0b05c191139c..81cb184968a7292459d2ce0012b10f351637f362 100644 (file)
@@ -5,14 +5,22 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  *
- * Authors : Madhu Venugopal
+ * Authors : Madhu Venugopal, Dave Tucker
  */
+
 package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
 
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.sal.utils.StatusCode;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.ovsdb.openstack.netvirt.api.RoutingProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
 
-public class RoutingService extends AbstractServiceInstance {
+import java.net.InetAddress;
+
+public class RoutingService extends AbstractServiceInstance implements RoutingProvider {
     public RoutingService() {
         super(Service.ROUTING);
     }
@@ -25,4 +33,16 @@ public class RoutingService extends AbstractServiceInstance {
     public boolean isBridgeInPipeline (String nodeId) {
         return true;
     }
-}
\ No newline at end of file
+
+    @Override
+    public Status programRouterInterface(Node node, Long dpid, String segmentationId, String macAddress,
+                                         InetAddress address, int mask, Action action) {
+        return new Status(StatusCode.NOTIMPLEMENTED);
+    }
+
+    @Override
+    public Status programDefaultRouteEntry(Node node, Long dpid, String segmentationId, String macAddress,
+                                           InetAddress nextHop, Action action) {
+        return new Status(StatusCode.NOTIMPLEMENTED);
+    }
+}
index 7e78be94148a7b20d9cd20b87d29808521093282..7a57032b0b79a4a7d99221ee8112cfb8e39cbebf 100644 (file)
@@ -10,6 +10,8 @@
 
 package org.opendaylight.ovsdb.openstack.netvirt;
 
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+
 /**
  * Abstract class for events used by neutron northbound and southbound events.
  */
@@ -27,7 +29,6 @@ public abstract class AbstractEvent {
 
         public static final int size = HandlerType.values().length;
     }
-    public enum Action { ADD, UPDATE, DELETE }
 
     private HandlerType handlerType;
     private Action action;
index 9b460816ee6ce7dc492cef394b7f1b5508d5a66e..d13cb33e766a679993766a7e1d1f0d6e7ccff7a3 100644 (file)
@@ -28,13 +28,17 @@ import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
 import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetAware;
 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
 import org.opendaylight.controller.switchmanager.IInventoryListener;
+import org.opendaylight.ovsdb.openstack.netvirt.api.ArpProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
 import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
 import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.ovsdb.openstack.netvirt.api.InboundNatProvider;
+import org.opendaylight.ovsdb.openstack.netvirt.api.L3ForwardingProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.api.MultiTenantAwareRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.api.MultiTenantRouterForwardingProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
+import org.opendaylight.ovsdb.openstack.netvirt.api.OutboundNatProvider;
+import org.opendaylight.ovsdb.openstack.netvirt.api.RoutingProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
 import org.opendaylight.ovsdb.openstack.netvirt.api.VlanConfigurationCache;
 import org.opendaylight.ovsdb.openstack.netvirt.impl.BridgeConfigurationManagerImpl;
@@ -296,8 +300,17 @@ public class Activator extends ComponentActivatorAbstractBase {
             c.add(createServiceDependency().setService(INeutronSubnetCRUD.class).setRequired(true));
             c.add(createServiceDependency().setService(INeutronPortCRUD.class).setRequired(true));
             c.add(createServiceDependency().setService(MultiTenantAwareRouter.class).setRequired(true));
-            // TODO: it should require MultiTenantRouterForwardingProvider
-            c.add(createServiceDependency().setService(MultiTenantRouterForwardingProvider.class).setRequired(false));
+            /* ToDo, we should probably just use the NetworkingProvider interface
+             * This should provide a way of getting service implementations
+             * Either that, or we should do service lookup at runtime based on getProvider().getName()
+             * This is a shortcut as for now there will only be one implementation of these classes.
+             */
+            c.add(createServiceDependency().setService(MultiTenantAwareRouter.class).setRequired(false));
+            c.add(createServiceDependency().setService(ArpProvider.class).setRequired(false));
+            c.add(createServiceDependency().setService(InboundNatProvider.class).setRequired(false));
+            c.add(createServiceDependency().setService(OutboundNatProvider.class).setRequired(false));
+            c.add(createServiceDependency().setService(RoutingProvider.class).setRequired(false));
+            c.add(createServiceDependency().setService(L3ForwardingProvider.class).setRequired(false));
         }
 
         if (imp.equals(OpenstackRouter.class)) {
index 581aba4d4c82ad5425a1f7524a3b35391b70e1cf..b9585a164640f94147adb1104469bc047b0601bd 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.ovsdb.openstack.netvirt;
 
 import org.opendaylight.controller.networkconfig.neutron.INeutronFloatingIPAware;
 import org.opendaylight.controller.networkconfig.neutron.NeutronFloatingIP;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
 import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
 
 import org.slf4j.Logger;
@@ -56,7 +57,7 @@ public class FloatingIPHandler extends AbstractHandler
      */
     @Override
     public void neutronFloatingIPCreated(NeutronFloatingIP floatingIP) {
-        enqueueEvent(new NorthboundEvent(floatingIP, AbstractEvent.Action.ADD));
+        enqueueEvent(new NorthboundEvent(floatingIP, Action.ADD));
     }
 
     /**
@@ -85,7 +86,7 @@ public class FloatingIPHandler extends AbstractHandler
      */
     @Override
     public void neutronFloatingIPUpdated(NeutronFloatingIP floatingIP) {
-        enqueueEvent(new NorthboundEvent(floatingIP, AbstractEvent.Action.UPDATE));
+        enqueueEvent(new NorthboundEvent(floatingIP, Action.UPDATE));
     }
 
     /**
@@ -111,7 +112,7 @@ public class FloatingIPHandler extends AbstractHandler
      */
     @Override
     public void neutronFloatingIPDeleted(NeutronFloatingIP floatingIP) {
-        enqueueEvent(new NorthboundEvent(floatingIP, AbstractEvent.Action.DELETE));
+        enqueueEvent(new NorthboundEvent(floatingIP, Action.DELETE));
     }
 
     /**
index 8fc2a231b13bb8417e0e4a51c3832aa59179c344..d4b60688009e5199d19d24fca0f6b0fc4d1f2484 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.ovsdb.lib.notation.Row;
 import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
 import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
 import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
 import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
@@ -88,10 +89,10 @@ public class NetworkHandler extends AbstractHandler
             return;
         }
 
-        enqueueEvent(new NorthboundEvent(network, AbstractEvent.Action.ADD));
+        enqueueEvent(new NorthboundEvent(network, Action.ADD));
     }
     private void doNeutronNetworkCreated(NeutronNetwork network) {
-        neutronL3Adapter.handleNeutronNetworkEvent(network, AbstractEvent.Action.ADD);
+        neutronL3Adapter.handleNeutronNetworkEvent(network, Action.ADD);
     }
 
     /**
@@ -118,10 +119,10 @@ public class NetworkHandler extends AbstractHandler
      */
     @Override
     public void neutronNetworkUpdated(NeutronNetwork network) {
-        enqueueEvent(new NorthboundEvent(network, AbstractEvent.Action.UPDATE));
+        enqueueEvent(new NorthboundEvent(network, Action.UPDATE));
     }
     private void doNeutronNetworkUpdated(NeutronNetwork network) {
-        neutronL3Adapter.handleNeutronNetworkEvent(network, AbstractEvent.Action.UPDATE);
+        neutronL3Adapter.handleNeutronNetworkEvent(network, Action.UPDATE);
     }
 
     /**
@@ -143,10 +144,10 @@ public class NetworkHandler extends AbstractHandler
      */
     @Override
     public void neutronNetworkDeleted(NeutronNetwork network) {
-        enqueueEvent(new NorthboundEvent(network, AbstractEvent.Action.DELETE));
+        enqueueEvent(new NorthboundEvent(network, Action.DELETE));
     }
     private void doNeutronNetworkDeleted(NeutronNetwork network) {
-        neutronL3Adapter.handleNeutronNetworkEvent(network, AbstractEvent.Action.DELETE);
+        neutronL3Adapter.handleNeutronNetworkEvent(network, Action.DELETE);
 
         int result = canDeleteNetwork(network);
         logger.trace("canDeleteNetwork: network: {}", network);
index efa9739c690de3f2f63675d12dfc5cf783183ae3..ca3dbf2a19beec0390d77822f20b75bf566fc2ff 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
 import org.opendaylight.controller.networkconfig.neutron.NeutronRouter;
 import org.opendaylight.controller.networkconfig.neutron.NeutronRouter_Interface;
 import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
 
 public class NorthboundEvent extends AbstractEvent {
 
index 1a9fe8b7d74d8251c3ff940bfc52bd0fcb583999..6c1699b111da7ac91f1174fbd1e81622e7e534e2 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.ovsdb.lib.notation.Row;
 import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
 import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
 import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
 import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
@@ -72,14 +73,14 @@ public class PortHandler extends AbstractHandler
             return;
         }
 
-        enqueueEvent(new NorthboundEvent(neutronPort, NorthboundEvent.Action.ADD));
+        enqueueEvent(new NorthboundEvent(neutronPort, Action.ADD));
     }
     private void doNeutronPortCreated(NeutronPort neutronPort) {
         logger.debug(" Port-ADD successful for tenant-id - {}," +
                      " network-id - {}, port-id - {}",
                      neutronPort.getTenantID(), neutronPort.getNetworkUUID(),
                      neutronPort.getID());
-        neutronL3Adapter.handleNeutronPortEvent(neutronPort, NorthboundEvent.Action.ADD);
+        neutronL3Adapter.handleNeutronPortEvent(neutronPort, Action.ADD);
     }
 
     /**
@@ -114,11 +115,11 @@ public class PortHandler extends AbstractHandler
      */
     @Override
     public void neutronPortUpdated(NeutronPort neutronPort) {
-        enqueueEvent(new NorthboundEvent(neutronPort, NorthboundEvent.Action.UPDATE));
+        enqueueEvent(new NorthboundEvent(neutronPort, Action.UPDATE));
     }
     private void doNeutronPortUpdated(NeutronPort neutronPort) {
         logger.debug("Handling neutron update port " + neutronPort);
-        neutronL3Adapter.handleNeutronPortEvent(neutronPort, NorthboundEvent.Action.UPDATE);
+        neutronL3Adapter.handleNeutronPortEvent(neutronPort, Action.UPDATE);
     }
 
     /**
@@ -147,11 +148,11 @@ public class PortHandler extends AbstractHandler
             return;
         }
 
-        enqueueEvent(new NorthboundEvent(neutronPort, NorthboundEvent.Action.DELETE));
+        enqueueEvent(new NorthboundEvent(neutronPort, Action.DELETE));
     }
     private void doNeutronPortDeleted(NeutronPort neutronPort) {
         logger.debug("Handling neutron delete port " + neutronPort);
-        neutronL3Adapter.handleNeutronPortEvent(neutronPort, NorthboundEvent.Action.DELETE);
+        neutronL3Adapter.handleNeutronPortEvent(neutronPort, Action.DELETE);
 
         List<Node> nodes = connectionService.getNodes();
         for (Node node : nodes) {
index a7cf21c95212e8212485ea876c40500c139cad36..9953d21ba241795e23512f52de4da794c0797db7 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.ovsdb.openstack.netvirt;
 import org.opendaylight.controller.networkconfig.neutron.INeutronRouterAware;
 import org.opendaylight.controller.networkconfig.neutron.NeutronRouter;
 import org.opendaylight.controller.networkconfig.neutron.NeutronRouter_Interface;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
 import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
 
 import org.slf4j.Logger;
@@ -56,7 +57,7 @@ public class RouterHandler extends AbstractHandler
      */
     @Override
     public void neutronRouterCreated(NeutronRouter router) {
-        enqueueEvent(new NorthboundEvent(router, AbstractEvent.Action.ADD));
+        enqueueEvent(new NorthboundEvent(router, Action.ADD));
     }
 
     /**
@@ -85,7 +86,7 @@ public class RouterHandler extends AbstractHandler
      */
     @Override
     public void neutronRouterUpdated(NeutronRouter router) {
-        enqueueEvent(new NorthboundEvent(router, AbstractEvent.Action.UPDATE));
+        enqueueEvent(new NorthboundEvent(router, Action.UPDATE));
     }
 
     /**
@@ -111,7 +112,7 @@ public class RouterHandler extends AbstractHandler
      */
     @Override
     public void neutronRouterDeleted(NeutronRouter router) {
-        enqueueEvent(new NorthboundEvent(router, AbstractEvent.Action.DELETE));
+        enqueueEvent(new NorthboundEvent(router, Action.DELETE));
     }
 
     /**
@@ -146,7 +147,7 @@ public class RouterHandler extends AbstractHandler
      */
     @Override
     public void neutronRouterInterfaceAttached(NeutronRouter router, NeutronRouter_Interface routerInterface) {
-        enqueueEvent(new NorthboundEvent(router, routerInterface, AbstractEvent.Action.ADD));
+        enqueueEvent(new NorthboundEvent(router, routerInterface, Action.ADD));
     }
 
     /**
@@ -182,7 +183,7 @@ public class RouterHandler extends AbstractHandler
      */
     @Override
     public void neutronRouterInterfaceDetached(NeutronRouter router, NeutronRouter_Interface routerInterface) {
-        enqueueEvent(new NorthboundEvent(router, routerInterface, AbstractEvent.Action.DELETE));
+        enqueueEvent(new NorthboundEvent(router, routerInterface, Action.DELETE));
     }
 
     /**
index 1562f8c1c9a036f3a47cbe7f21d14a3603d74332..1b8001a1227c9e387e0780331b255e3402d1afd7 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.ovsdb.openstack.netvirt;
 
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.ovsdb.lib.notation.Row;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
 
 public class SouthboundEvent extends AbstractEvent {
     public enum Type { NODE, ROW };
index 1e2bff422f5695bd143ce844c60bf9dca963a397..c9a122ffb4ddfa9ca1085b71f4d04da527e9e763 100644 (file)
@@ -17,6 +17,7 @@ import org.opendaylight.controller.sal.core.UpdateType;
 import org.opendaylight.controller.switchmanager.IInventoryListener;
 import org.opendaylight.ovsdb.lib.notation.Row;
 import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
 import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
 import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
 import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
@@ -63,23 +64,23 @@ public class SouthboundHandler extends AbstractHandler implements OvsdbInventory
 
     @Override
     public void nodeAdded(Node node, InetAddress address, int port) {
-        this.enqueueEvent(new SouthboundEvent(node, SouthboundEvent.Action.ADD));
+        this.enqueueEvent(new SouthboundEvent(node, Action.ADD));
     }
 
     @Override
     public void nodeRemoved(Node node) {
-        this.enqueueEvent(new SouthboundEvent(node, SouthboundEvent.Action.DELETE));
+        this.enqueueEvent(new SouthboundEvent(node, Action.DELETE));
     }
 
     @Override
     public void rowAdded(Node node, String tableName, String uuid, Row row) {
-        this.enqueueEvent(new SouthboundEvent(node, tableName, uuid, row, SouthboundEvent.Action.ADD));
+        this.enqueueEvent(new SouthboundEvent(node, tableName, uuid, row, Action.ADD));
     }
 
     @Override
     public void rowUpdated(Node node, String tableName, String uuid, Row oldRow, Row newRow) {
         if (this.isUpdateOfInterest(node, oldRow, newRow)) {
-            this.enqueueEvent(new SouthboundEvent(node, tableName, uuid, newRow, SouthboundEvent.Action.UPDATE));
+            this.enqueueEvent(new SouthboundEvent(node, tableName, uuid, newRow, Action.UPDATE));
         }
     }
 
@@ -119,18 +120,18 @@ public class SouthboundHandler extends AbstractHandler implements OvsdbInventory
 
     @Override
     public void rowRemoved(Node node, String tableName, String uuid, Row row, Object context) {
-        this.enqueueEvent(new SouthboundEvent(node, tableName, uuid, row, context, SouthboundEvent.Action.DELETE));
+        this.enqueueEvent(new SouthboundEvent(node, tableName, uuid, row, context, Action.DELETE));
     }
 
-    public void processNodeUpdate(Node node, SouthboundEvent.Action action) {
-        if (action == SouthboundEvent.Action.DELETE) return;
+    public void processNodeUpdate(Node node, Action action) {
+        if (action == Action.DELETE) return;
         logger.trace("Process Node added {}", node);
         bridgeConfigurationManager.prepareNode(node);
     }
 
     private void processRowUpdate(Node node, String tableName, String uuid, Row row,
-                                  Object context, SouthboundEvent.Action action) {
-        if (action == SouthboundEvent.Action.DELETE) {
+                                  Object context, Action action) {
+        if (action == Action.DELETE) {
             if (tableName.equalsIgnoreCase(ovsdbConfigurationService.getTableName(node, Interface.class))) {
                 logger.debug("Processing update of {}. Deleted node: {}, uuid: {}, row: {}", tableName, node, uuid, row);
                 Interface deletedIntf = ovsdbConfigurationService.getTypedRow(node, Interface.class, row);
@@ -237,7 +238,7 @@ public class SouthboundHandler extends AbstractHandler implements OvsdbInventory
         logger.trace("Interface update of node: {}, uuid: {}", node, uuid);
         NeutronNetwork network = tenantNetworkManager.getTenantNetwork(intf);
         if (network != null) {
-            neutronL3Adapter.handleInterfaceEvent(node, intf, network, AbstractEvent.Action.UPDATE);
+            neutronL3Adapter.handleInterfaceEvent(node, intf, network, Action.UPDATE);
             if (bridgeConfigurationManager.createLocalNetwork(node, network))
                 networkingProviderManager.getProvider(node).handleInterfaceUpdate(network, node, intf);
         } else {
@@ -250,7 +251,7 @@ public class SouthboundHandler extends AbstractHandler implements OvsdbInventory
         logger.debug("handleInterfaceDelete: node: {}, uuid: {}, isLastInstanceOnNode: {}, interface: {}",
                 node, uuid, isLastInstanceOnNode, intf);
 
-        neutronL3Adapter.handleInterfaceEvent(node, intf, network, AbstractEvent.Action.DELETE);
+        neutronL3Adapter.handleInterfaceEvent(node, intf, network, Action.DELETE);
         List<String> phyIfName = bridgeConfigurationManager.getAllPhysicalInterfaceNames(node);
         if (intf.getTypeColumn().getData().equalsIgnoreCase(NetworkHandler.NETWORK_TYPE_VXLAN) ||
             intf.getTypeColumn().getData().equalsIgnoreCase(NetworkHandler.NETWORK_TYPE_GRE) ||
index 26e791d1be03ad6fa72dbc287f6d061880d726ad..0ecac867522e6cbd5da9bc5592b983fa42942941 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.ovsdb.openstack.netvirt;
 
 import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetAware;
 import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
 import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
 
 import com.google.common.base.Preconditions;
@@ -34,7 +35,7 @@ public class SubnetHandler extends AbstractHandler implements INeutronSubnetAwar
 
     @Override
     public void neutronSubnetCreated(NeutronSubnet subnet) {
-        enqueueEvent(new NorthboundEvent(subnet, NorthboundEvent.Action.ADD));
+        enqueueEvent(new NorthboundEvent(subnet, Action.ADD));
     }
 
     @Override
@@ -44,7 +45,7 @@ public class SubnetHandler extends AbstractHandler implements INeutronSubnetAwar
 
     @Override
     public void neutronSubnetUpdated(NeutronSubnet subnet) {
-        enqueueEvent(new NorthboundEvent(subnet, NorthboundEvent.Action.UPDATE));
+        enqueueEvent(new NorthboundEvent(subnet, Action.UPDATE));
     }
 
     @Override
@@ -55,7 +56,7 @@ public class SubnetHandler extends AbstractHandler implements INeutronSubnetAwar
 
     @Override
     public void neutronSubnetDeleted(NeutronSubnet subnet) {
-        enqueueEvent(new NorthboundEvent(subnet, NorthboundEvent.Action.DELETE));
+        enqueueEvent(new NorthboundEvent(subnet, Action.DELETE));
     }
 
     /**
diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/Action.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/Action.java
new file mode 100644 (file)
index 0000000..3408d71
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * 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
+ *
+ * Authors : Dave Tucker, Flavio Fernandes
+ */
+
+package org.opendaylight.ovsdb.openstack.netvirt.api;
+
+/**
+ * This enumeration represents the type of action being perfomed
+ */
+public enum Action {
+    ADD,
+    UPDATE,
+    DELETE
+}
diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/ArpProvider.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/ArpProvider.java
new file mode 100644 (file)
index 0000000..2ab6b51
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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
+ *
+ * Authors : Dave Tucker, Flavio Fernandes
+ */
+
+package org.opendaylight.ovsdb.openstack.netvirt.api;
+
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.Status;
+
+import java.net.InetAddress;
+
+/**
+ * This interface allows ARP flows to be written to devices
+ */
+public interface ArpProvider {
+
+    Status programStaticArpEntry(Node node, Long dpid, String segmentationId,
+                                 String macAddress, InetAddress ipAddress, Action action);
+
+}
index 7741f61c04162765c9328f9982da91314aebf5de..e354799aa352514b1b8f0a9a653dd735de56508f 100644 (file)
@@ -60,4 +60,6 @@ public final class Constants {
     public static final String PROVIDER_TYPE_PROPERTY = "providerType";
     public static final String OPENFLOW_VERSION_PROPERTY = "openflowVersion";
     public static final String EVENT_HANDLER_TYPE_PROPERTY = "eventHandlerType";
+    public static final String PROVIDER_NAME_PROPERTY = "providerName";
+    public static final String NAT_PROVIDER_DIRECTION = "natDirection";
 }
diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/InboundNatProvider.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/InboundNatProvider.java
new file mode 100644 (file)
index 0000000..7cde041
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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
+ *
+ * Authors : Dave Tucker, Flavio Fernandes
+ */
+
+package org.opendaylight.ovsdb.openstack.netvirt.api;
+
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.Status;
+
+import java.net.InetAddress;
+
+/**
+ *  This interface allows NAT flows to be written to devices
+ */
+public interface InboundNatProvider {
+    Status programIpRewriteRule(Node node, Long dpid, String segmentationId, InetAddress matchAddress,
+                                InetAddress rewriteAddress, Action action);
+
+    Status programIpRewriteExclusion(Node node, Long dpid, String segmentationId,
+                                     String excludedCidr, Action action);
+
+}
diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/L3ForwardingProvider.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/L3ForwardingProvider.java
new file mode 100644 (file)
index 0000000..b410cab
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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
+ *
+ * Authors : Dave Tucker, Flavio Fernandes
+ */
+
+package org.opendaylight.ovsdb.openstack.netvirt.api;
+
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.Status;
+
+import java.net.InetAddress;
+
+/**
+ * This interface allows L3 Forwarding flows to be written to devices
+ */
+public interface L3ForwardingProvider {
+
+    Status programForwardingTableEntry(Node node, Long dpid, String segmentationId, InetAddress ipAddress,
+                                       String macAddress, Action action);
+
+}
diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/MultiTenantRouterForwardingProvider.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/MultiTenantRouterForwardingProvider.java
deleted file mode 100644 (file)
index f565185..0000000
+++ /dev/null
@@ -1,42 +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
- *
- * Authors : Dave Tucker, Flavio Fernandes
- */
-
-package org.opendaylight.ovsdb.openstack.netvirt.api;
-
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent;
-
-import java.net.InetAddress;
-
-/**
- * A MultiTenantForwardingProvider provides Multi-Tenant L3 Forwarding
- */
-public interface MultiTenantRouterForwardingProvider {
-
-    Status programStaticArpEntry(Node node, Long dpid, String segmentationId,
-                                 String macAddress, InetAddress ipAddress, AbstractEvent.Action action);
-
-    Status programIpRewriteRule(Node node, Long dpid, String segmentationId, InetAddress matchAddress,
-                                InetAddress rewriteAddress, AbstractEvent.Action action);
-
-    Status programIpRewriteExclusion(Node node, Long dpid, String segmentationId,
-                                     String excludedCidr, AbstractEvent.Action action);
-
-    Status programRouterInterface(Node node, Long dpid, String segmentationId, String macAddress,
-                                  InetAddress address, int mask, AbstractEvent.Action action);
-
-    Status programForwardingTableEntry(Node node, Long dpid, String segmentationId, InetAddress ipAddress,
-                                       String macAddress, AbstractEvent.Action action);
-
-    Status programDefaultRouteEntry(Node node, Long dpid, String segmentationId, String macAddress,
-                                    InetAddress nextHop, AbstractEvent.Action action);
-
-}
index 109fb1ad4ae9b739b8aca78bdc68e3bf88e30da4..19dc1a8358e3b6f23136e08058dd66dd61c0509a 100644 (file)
@@ -20,6 +20,16 @@ import org.opendaylight.ovsdb.schema.openvswitch.Interface;
  */
 public interface NetworkingProvider {
 
+    /**
+     * Returns the name of the NetworkingProvider
+     */
+    public String getName();
+
+    /**
+     * Return true if the provider supports Network Service Instances
+     */
+    public boolean supportsServices();
+
     /**
      * Return true if the provider supports per-tenant or "static" tunneling
      */
diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/OutboundNatProvider.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/OutboundNatProvider.java
new file mode 100644 (file)
index 0000000..e278a02
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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
+ *
+ * Authors : Dave Tucker, Flavio Fernandes
+ */
+
+package org.opendaylight.ovsdb.openstack.netvirt.api;
+
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.Status;
+
+import java.net.InetAddress;
+
+/**
+ *  This interface allows NAT flows to be written to devices
+ */
+public interface OutboundNatProvider {
+    Status programIpRewriteRule(Node node, Long dpid, String segmentationId, InetAddress matchAddress,
+                                InetAddress rewriteAddress, Action action);
+
+    Status programIpRewriteExclusion(Node node, Long dpid, String segmentationId,
+                                     String excludedCidr, Action action);
+
+}
diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/RoutingProvider.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/RoutingProvider.java
new file mode 100644 (file)
index 0000000..18b3f31
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * 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
+ *
+ * Authors : Dave Tucker, Flavio Fernandes
+ */
+
+package org.opendaylight.ovsdb.openstack.netvirt.api;
+
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.Status;
+
+import java.net.InetAddress;
+
+/**
+ * This interface allows Routing flows to be written to devices
+ */
+public interface RoutingProvider {
+
+    Status programRouterInterface(Node node, Long dpid, String segmentationId, String macAddress,
+                                  InetAddress address, int mask, Action action);
+
+    Status programDefaultRouteEntry(Node node, Long dpid, String segmentationId, String macAddress,
+                                    InetAddress nextHop, Action action);
+
+}
index 5618f67192cb4f4b1a04b3581c2db3ec4096d934..d9b51a958df894043e232b0427ae7d497de2fa50 100644 (file)
@@ -25,15 +25,18 @@ import org.opendaylight.controller.sal.utils.HexEncode;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
 import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent;
-import org.opendaylight.ovsdb.openstack.netvirt.NorthboundEvent;
 import org.opendaylight.ovsdb.openstack.netvirt.api.MultiTenantAwareRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.api.MultiTenantRouterForwardingProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
 import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
 import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
 import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
 import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.ovsdb.openstack.netvirt.api.ArpProvider;
+import org.opendaylight.ovsdb.openstack.netvirt.api.InboundNatProvider;
+import org.opendaylight.ovsdb.openstack.netvirt.api.L3ForwardingProvider;
+import org.opendaylight.ovsdb.openstack.netvirt.api.OutboundNatProvider;
+import org.opendaylight.ovsdb.openstack.netvirt.api.RoutingProvider;
 import org.opendaylight.ovsdb.schema.openvswitch.Interface;
 
 import com.google.common.base.Preconditions;
@@ -70,7 +73,11 @@ public class NeutronL3Adapter {
     private volatile INeutronSubnetCRUD neutronSubnetCache;
     private volatile INeutronPortCRUD neutronPortCache;
     private volatile MultiTenantAwareRouter multiTenantAwareRouter;
-    private volatile MultiTenantRouterForwardingProvider multiTenantRouterForwardingProvider;
+    private volatile L3ForwardingProvider l3ForwardingProvider;
+    private volatile InboundNatProvider inboundNatProvider;
+    private volatile OutboundNatProvider outboundNatProvider;
+    private volatile ArpProvider arpProvider;
+    private volatile RoutingProvider routingProvider;
 
     private Set<String> ipRewriteCache;
     private Set<String> ipRewriteExclusionCache;
@@ -92,19 +99,19 @@ public class NeutronL3Adapter {
     // Callbacks from OVSDB's northbound handlers
     //
 
-    public void handleNeutronSubnetEvent(final NeutronSubnet subnet, NorthboundEvent.Action action) {
+    public void handleNeutronSubnetEvent(final NeutronSubnet subnet, Action action) {
         logger.debug("Neutron subnet {} event : {}", action, subnet.toString());
 
         // TODO
     }
 
-    public void handleNeutronPortEvent(final NeutronPort neutronPort, NorthboundEvent.Action action) {
+    public void handleNeutronPortEvent(final NeutronPort neutronPort, Action action) {
         logger.debug("Neutron port {} event : {}", action, neutronPort.toString());
 
         // TODO
     }
 
-    public void handleNeutronRouterEvent(final NeutronRouter neutronRouter, NorthboundEvent.Action action) {
+    public void handleNeutronRouterEvent(final NeutronRouter neutronRouter, Action action) {
         logger.debug("Neutron router {} event : {}", action, neutronRouter.toString());
 
         // TODO
@@ -112,27 +119,27 @@ public class NeutronL3Adapter {
 
     public void handleNeutronRouterInterfaceEvent(final NeutronRouter neutronRouter,
                                                   final NeutronRouter_Interface neutronRouterInterface,
-                                                  NorthboundEvent.Action action) {
+                                                  Action action) {
         logger.debug(" Router {} interface {} got event {}. Subnet {}",
                      neutronRouter.getName(),
                      neutronRouterInterface.getPortUUID(),
                      action,
                      neutronRouterInterface.getSubnetUUID());
 
-        this.programFlowsForNeutronRouterInterface(neutronRouterInterface, action == AbstractEvent.Action.DELETE);
+        this.programFlowsForNeutronRouterInterface(neutronRouterInterface, action == Action.DELETE);
     }
 
     public void handleNeutronFloatingIPEvent(final NeutronFloatingIP neutronFloatingIP,
-                                             NorthboundEvent.Action action) {
+                                             Action action) {
         logger.debug(" Floating IP {} {}<->{}, network uuid {}", action,
                      neutronFloatingIP.getFixedIPAddress(),
                      neutronFloatingIP.getFloatingIPAddress(),
                      neutronFloatingIP.getFloatingNetworkUUID());
 
-        this.programFlowsForFloatingIP(neutronFloatingIP, action == AbstractEvent.Action.DELETE);
+        this.programFlowsForFloatingIP(neutronFloatingIP, action == Action.DELETE);
     }
 
-    public void handleNeutronNetworkEvent(final NeutronNetwork neutronNetwork, NorthboundEvent.Action action) {
+    public void handleNeutronNetworkEvent(final NeutronNetwork neutronNetwork, Action action) {
         logger.debug("neutronNetwork {}: network: {}", action, neutronNetwork);
 
         // TODO
@@ -141,9 +148,8 @@ public class NeutronL3Adapter {
     //
     // Callbacks from OVSDB's southbound handler
     //
-
     public void handleInterfaceEvent(final Node node, final Interface intf, final NeutronNetwork neutronNetwork,
-                                     AbstractEvent.Action action) {
+                                     Action action) {
         logger.debug("southbound interface {} node:{} interface:{}, neutronNetwork:{}",
                      action, node, intf, neutronNetwork);
 
@@ -153,7 +159,6 @@ public class NeutronL3Adapter {
     //
     // Internal helpers
     //
-
     private void programFlowsForNeutronRouterInterface(final NeutronRouter_Interface neutronRouterInterface,
                                                        Boolean isDelete) {
         Preconditions.checkNotNull(neutronRouterInterface);
@@ -178,8 +183,8 @@ public class NeutronL3Adapter {
             return;  // done: go no further w/out all the info needed...
         }
 
-        final AbstractEvent.Action action =
-                isDelete ? AbstractEvent.Action.DELETE : AbstractEvent.Action.ADD;
+        final Action action =
+                isDelete ? Action.DELETE : Action.ADD;
 
         // Keep cache for finding router's mac from network uuid
         //
@@ -192,9 +197,9 @@ public class NeutronL3Adapter {
         List<Node> nodes = connectionService.getNodes();
         for (Node node : nodes) {
             final Long dpid = getDpid(node);
-            final AbstractEvent.Action actionForNode =
+            final Action actionForNode =
                     tenantNetworkManager.isTenantNetworkPresentInNode(node, providerSegmentationId) ?
-                    action : AbstractEvent.Action.DELETE;
+                    action : Action.DELETE;
 
             for (Neutron_IPs neutronIP : ipList) {
                 final String ipStr = neutronIP.getIpAddress();
@@ -207,16 +212,16 @@ public class NeutronL3Adapter {
             // for the external neutron networks.
             //
             {
-                final AbstractEvent.Action actionForRewriteExclusion =
-                        isExternal ? AbstractEvent.Action.DELETE : actionForNode;
+                final Action actionForRewriteExclusion =
+                        isExternal ? Action.DELETE : actionForNode;
                 programIpRewriteExclusionStage1(node, dpid, providerSegmentationId, cidr, actionForRewriteExclusion);
             }
 
             // Default route. For non-external subnets, make sure that there is none configured.
             //
             if (gatewayIp != null && !gatewayIp.isEmpty()) {
-                final AbstractEvent.Action actionForNodeDefaultRoute =
-                        isExternal ? actionForNode : AbstractEvent.Action.DELETE;
+                final Action actionForNodeDefaultRoute =
+                        isExternal ? actionForNode : Action.DELETE;
                 final String defaultGatewayMacAddress = "00:01:02:03:04:05";  // FIXME!
                 programDefaultRouteStage1(node, dpid, providerSegmentationId, defaultGatewayMacAddress, gatewayIp,
                                           actionForNodeDefaultRoute);
@@ -226,7 +231,7 @@ public class NeutronL3Adapter {
 
     private void programRouterInterfaceStage1(Node node, Long dpid, String providerSegmentationId,
                                               String macAddress, String ipStr, int mask,
-                                              AbstractEvent.Action actionForNode) {
+                                              Action actionForNode) {
         // Based on the local cache, figure out whether programming needs to occur. To do this, we
         // will look at desired action for node.
         //
@@ -234,14 +239,14 @@ public class NeutronL3Adapter {
                                 ipStr + "/" + Integer.toString(mask);
         final Boolean isProgrammed = routerInterfacesCache.contains(cacheKey);
 
-        if (actionForNode == AbstractEvent.Action.DELETE && isProgrammed == Boolean.FALSE) return;
-        if (actionForNode == AbstractEvent.Action.ADD && isProgrammed == Boolean.TRUE) return;
+        if (actionForNode == Action.DELETE && isProgrammed == Boolean.FALSE) return;
+        if (actionForNode == Action.ADD && isProgrammed == Boolean.TRUE) return;
 
         Status status = this.programRouterInterfaceStage2(node, dpid, providerSegmentationId,
                                                           macAddress, ipStr, mask, actionForNode);
         if (status.isSuccess()) {
             // Update cache
-            if (actionForNode == AbstractEvent.Action.ADD) {
+            if (actionForNode == Action.ADD) {
                 // TODO: multiTenantAwareRouter.addInterface(UUID.fromString(tenant), ...);
                 routerInterfacesCache.add(cacheKey);
             } else {
@@ -254,22 +259,21 @@ public class NeutronL3Adapter {
     private Status programRouterInterfaceStage2(Node node, Long dpid, String providerSegmentationId,
                                                 String macAddress,
                                                 String address, int mask,
-                                                AbstractEvent.Action actionForNode) {
+                                                Action actionForNode) {
         Status status;
         try {
             InetAddress inetAddress = InetAddress.getByName(address);
-            status = multiTenantRouterForwardingProvider == null ?
+            status = routingProvider == null ?
                      new Status(StatusCode.SUCCESS) :
-                     multiTenantRouterForwardingProvider
-                             .programRouterInterface(node, dpid, providerSegmentationId,
-                                                     macAddress, inetAddress, mask, actionForNode);
+                     routingProvider.programRouterInterface(node, dpid, providerSegmentationId,
+                                                            macAddress, inetAddress, mask, actionForNode);
         } catch (UnknownHostException e) {
             status = new Status(StatusCode.BADREQUEST);
         }
 
         if (status.isSuccess()) {
             logger.debug("ProgramRouterInterface {} for mac:{} addr:{}/{} node:{} action:{}",
-                         multiTenantRouterForwardingProvider == null ? "skipped" : "programmed",
+                         routingProvider == null ? "skipped" : "programmed",
                          macAddress, address, mask, node, actionForNode);
         } else {
             logger.error("ProgramRouterInterface failed for mac:{} addr:{}/{} node:{} action:{} status:{}",
@@ -280,21 +284,21 @@ public class NeutronL3Adapter {
 
     private void programStaticArpStage1(Node node, Long dpid, String providerSegmentationId,
                                         String macAddress, String ipStr,
-                                        AbstractEvent.Action actionForNode) {
+                                        Action actionForNode) {
         // Based on the local cache, figure out whether programming needs to occur. To do this, we
         // will look at desired action for node.
         //
         final String cacheKey = node.toString() + ":" + providerSegmentationId + ":" + ipStr;
         final Boolean isProgrammed = staticArpEntryCache.contains(cacheKey);
 
-        if (actionForNode == AbstractEvent.Action.DELETE && isProgrammed == Boolean.FALSE) return;
-        if (actionForNode == AbstractEvent.Action.ADD && isProgrammed == Boolean.TRUE) return;
+        if (actionForNode == Action.DELETE && isProgrammed == Boolean.FALSE) return;
+        if (actionForNode == Action.ADD && isProgrammed == Boolean.TRUE) return;
 
         Status status = this.programStaticArpStage2(node, dpid, providerSegmentationId,
                                                     macAddress, ipStr, actionForNode);
         if (status.isSuccess()) {
             // Update cache
-            if (actionForNode == AbstractEvent.Action.ADD) {
+            if (actionForNode == Action.ADD) {
                 staticArpEntryCache.add(cacheKey);
             } else {
                 staticArpEntryCache.remove(cacheKey);
@@ -305,22 +309,21 @@ public class NeutronL3Adapter {
     private Status programStaticArpStage2(Node node, Long dpid, String providerSegmentationId,
                                                 String macAddress,
                                                 String address,
-                                                AbstractEvent.Action actionForNode) {
+                                                Action actionForNode) {
         Status status;
         try {
             InetAddress inetAddress = InetAddress.getByName(address);
-            status = multiTenantRouterForwardingProvider == null ?
+            status = arpProvider == null ?
                      new Status(StatusCode.SUCCESS) :
-                     multiTenantRouterForwardingProvider
-                             .programStaticArpEntry(node, dpid, providerSegmentationId,
-                                                    macAddress, inetAddress, actionForNode);
+                     arpProvider.programStaticArpEntry(node, dpid, providerSegmentationId,
+                                                       macAddress, inetAddress, actionForNode);
         } catch (UnknownHostException e) {
             status = new Status(StatusCode.BADREQUEST);
         }
 
         if (status.isSuccess()) {
             logger.debug("ProgramStaticArp {} for mac:{} addr:{} node:{} action:{}",
-                         multiTenantRouterForwardingProvider == null ? "skipped" : "programmed",
+                         arpProvider == null ? "skipped" : "programmed",
                          macAddress, address, node, actionForNode);
         } else {
             logger.error("ProgramStaticArp failed for mac:{} addr:{} node:{} action:{} status:{}",
@@ -329,23 +332,26 @@ public class NeutronL3Adapter {
         return status;
     }
 
+    /* ToDo: IP Rewrites have been broken in to two tables
+       As such we need to modify the interfaces to program in to the correct tables
+     */
     private void programIpRewriteExclusionStage1(Node node, Long dpid, String providerSegmentationId,
                                                  String cidr,
-                                                 AbstractEvent.Action actionForRewriteExclusion) {
+                                                 Action actionForRewriteExclusion) {
         // Based on the local cache, figure out whether programming needs to occur. To do this, we
         // will look at desired action for node.
         //
         final String cacheKey = node.toString() + ":" + providerSegmentationId + ":" + cidr;
         final Boolean isProgrammed = ipRewriteExclusionCache.contains(cacheKey);
 
-        if (actionForRewriteExclusion == AbstractEvent.Action.DELETE && isProgrammed == Boolean.FALSE) return;
-        if (actionForRewriteExclusion == AbstractEvent.Action.ADD && isProgrammed == Boolean.TRUE) return;
+        if (actionForRewriteExclusion == Action.DELETE && isProgrammed == Boolean.FALSE) return;
+        if (actionForRewriteExclusion == Action.ADD && isProgrammed == Boolean.TRUE) return;
 
         Status status = this.programIpRewriteExclusionStage2(node, dpid, providerSegmentationId, cidr,
                                                              actionForRewriteExclusion);
         if (status.isSuccess()) {
             // Update cache
-            if (actionForRewriteExclusion == AbstractEvent.Action.ADD) {
+            if (actionForRewriteExclusion == Action.ADD) {
                 ipRewriteExclusionCache.add(cacheKey);
             } else {
                 ipRewriteExclusionCache.remove(cacheKey);
@@ -354,14 +360,13 @@ public class NeutronL3Adapter {
     }
 
     private Status programIpRewriteExclusionStage2(Node node, Long dpid, String providerSegmentationId, String cidr,
-                                                   AbstractEvent.Action actionForNode) {
-        Status status = multiTenantRouterForwardingProvider == null ?
+                                                   Action actionForNode) {
+        Status status = inboundNatProvider == null ?
                         new Status(StatusCode.SUCCESS) :
-                        multiTenantRouterForwardingProvider
-                                .programIpRewriteExclusion(node, dpid, providerSegmentationId, cidr, actionForNode);
+                        inboundNatProvider.programIpRewriteExclusion(node, dpid, providerSegmentationId, cidr, actionForNode);
         if (status.isSuccess()) {
             logger.debug("IpRewriteExclusion {} for cidr:{} node:{} action:{}",
-                         multiTenantRouterForwardingProvider == null ? "skipped" : "programmed",
+                         inboundNatProvider == null ? "skipped" : "programmed",
                          cidr, node, actionForNode);
         } else {
             logger.error("IpRewriteExclusion failed for cidr:{} node:{} action:{} status:{}",
@@ -372,21 +377,21 @@ public class NeutronL3Adapter {
 
     private void programDefaultRouteStage1(Node node, Long dpid, String providerSegmentationId,
                                            String defaultGatewayMacAddress, String gatewayIp,
-                                           AbstractEvent.Action actionForNodeDefaultRoute) {
+                                           Action actionForNodeDefaultRoute) {
         // Based on the local cache, figure out whether programming needs to occur. To do this, we
         // will look at desired action for node.
         //
         final String cacheKey = node.toString() + ":" + providerSegmentationId + ":" + gatewayIp;
         final Boolean isProgrammed = defaultRouteCache.contains(cacheKey);
 
-        if (actionForNodeDefaultRoute == AbstractEvent.Action.DELETE && isProgrammed == Boolean.FALSE) return;
-        if (actionForNodeDefaultRoute == AbstractEvent.Action.ADD && isProgrammed == Boolean.TRUE) return;
+        if (actionForNodeDefaultRoute == Action.DELETE && isProgrammed == Boolean.FALSE) return;
+        if (actionForNodeDefaultRoute == Action.ADD && isProgrammed == Boolean.TRUE) return;
 
         Status status = this.programDefaultRouteStage2(node, dpid, providerSegmentationId,
                                                        defaultGatewayMacAddress, gatewayIp, actionForNodeDefaultRoute);
         if (status.isSuccess()) {
             // Update cache
-            if (actionForNodeDefaultRoute == AbstractEvent.Action.ADD) {
+            if (actionForNodeDefaultRoute == Action.ADD) {
                 defaultRouteCache.add(cacheKey);
             } else {
                 defaultRouteCache.remove(cacheKey);
@@ -397,23 +402,22 @@ public class NeutronL3Adapter {
     private Status programDefaultRouteStage2(Node node, Long dpid, String providerSegmentationId,
                                           String defaultGatewayMacAddress,
                                           String gatewayIp,
-                                          AbstractEvent.Action actionForNodeDefaultRoute) {
+                                          Action actionForNodeDefaultRoute) {
         Status status;
         try {
             InetAddress inetAddress = InetAddress.getByName(gatewayIp);
-            status = multiTenantRouterForwardingProvider == null ?
+            status = routingProvider == null ?
                      new Status(StatusCode.SUCCESS) :
-                     multiTenantRouterForwardingProvider
-                             .programDefaultRouteEntry(node, dpid, providerSegmentationId,
-                                                       defaultGatewayMacAddress, inetAddress,
-                                                       actionForNodeDefaultRoute);
+                     routingProvider.programDefaultRouteEntry(node, dpid, providerSegmentationId,
+                                                              defaultGatewayMacAddress, inetAddress,
+                                                              actionForNodeDefaultRoute);
         } catch (UnknownHostException e) {
             status = new Status(StatusCode.BADREQUEST);
         }
 
         if (status.isSuccess()) {
             logger.debug("ProgramDefaultRoute {} for mac:{} gatewayIp:{} node:{} action:{}",
-                         multiTenantRouterForwardingProvider == null ? "skipped" : "programmed",
+                         routingProvider == null ? "skipped" : "programmed",
                          defaultGatewayMacAddress, gatewayIp, node, actionForNodeDefaultRoute);
         } else {
             logger.error("ProgramDefaultRoute failed for mac:{} gatewayIp:{} node:{} action:{} status:{}",
@@ -440,13 +444,13 @@ public class NeutronL3Adapter {
             return;  // done: go no further w/out all the info needed...
         }
 
-        final AbstractEvent.Action action = isDelete ? AbstractEvent.Action.DELETE : AbstractEvent.Action.ADD;
+        final Action action = isDelete ? Action.DELETE : Action.ADD;
         List<Node> nodes = connectionService.getNodes();
         for (Node node : nodes) {
             final Long dpid = getDpid(node);
-            final AbstractEvent.Action actionForNode =
+            final Action actionForNode =
                     tenantNetworkManager.isTenantNetworkPresentInNode(node, providerSegmentationId) ?
-                    action : AbstractEvent.Action.DELETE;
+                    action : Action.DELETE;
 
             // Rewrite from float to fixed and vice-versa
             //
@@ -462,7 +466,7 @@ public class NeutronL3Adapter {
 
     private void programIpRewriteStage1(Node node, Long dpid, String providerSegmentationId,
                                         String matchAddress, String rewriteAddress,
-                                        AbstractEvent.Action actionForNode) {
+                                        Action actionForNode) {
         // Based on the local cache, figure out whether programming needs to occur. To do this, we
         // will look at desired action for node.
         //
@@ -470,14 +474,14 @@ public class NeutronL3Adapter {
                                 matchAddress + ":" + rewriteAddress;
         final Boolean isProgrammed = ipRewriteCache.contains(cacheKey);
 
-        if (actionForNode == AbstractEvent.Action.DELETE && isProgrammed == Boolean.FALSE) return;
-        if (actionForNode == AbstractEvent.Action.ADD && isProgrammed == Boolean.TRUE) return;
+        if (actionForNode == Action.DELETE && isProgrammed == Boolean.FALSE) return;
+        if (actionForNode == Action.ADD && isProgrammed == Boolean.TRUE) return;
 
         Status status = this.programIpRewriteStage2(node, dpid, providerSegmentationId,
                                                     matchAddress, rewriteAddress, actionForNode);
         if (status.isSuccess()) {
             // Update cache
-            if (actionForNode == AbstractEvent.Action.ADD) {
+            if (actionForNode == Action.ADD) {
                 ipRewriteCache.add(cacheKey);
             } else {
                 ipRewriteCache.remove(cacheKey);
@@ -487,23 +491,22 @@ public class NeutronL3Adapter {
 
     private Status programIpRewriteStage2(Node node, Long dpid, String providerSegmentationId,
                                           String matchAddress, String rewriteAddress,
-                                          AbstractEvent.Action actionForNode) {
+                                          Action actionForNode) {
         Status status;
         try {
             InetAddress inetMatchAddress = InetAddress.getByName(matchAddress);
             InetAddress inetRewriteAddress = InetAddress.getByName(rewriteAddress);
-            status = multiTenantRouterForwardingProvider == null ?
+            status = inboundNatProvider == null ?
                      new Status(StatusCode.SUCCESS) :
-                     multiTenantRouterForwardingProvider
-                             .programIpRewriteRule(node, dpid, providerSegmentationId,
-                                                   inetMatchAddress, inetRewriteAddress, actionForNode);
+                     inboundNatProvider.programIpRewriteRule(node, dpid, providerSegmentationId,
+                                                             inetMatchAddress, inetRewriteAddress, actionForNode);
         } catch (UnknownHostException e) {
             status = new Status(StatusCode.BADREQUEST);
         }
 
         if (status.isSuccess()) {
             logger.debug("ProgramIpRewrite {} for match:{} rewrite:{} node:{} action:{}",
-                         multiTenantRouterForwardingProvider == null ? "skipped" : "programmed",
+                         inboundNatProvider == null ? "skipped" : "programmed",
                          matchAddress, rewriteAddress, node, actionForNode);
         } else {
             logger.error("ProgramIpRewrite failed for match:{} rewrite:{} node:{} action:{} status:{}",