From eaa081097a880a03117338a31734e43effd6ccbd Mon Sep 17 00:00:00 2001
From: Subrata Banerjee <subrata.banerjee@bigswitch.com>
Date: Thu, 23 Feb 2012 21:33:08 -0800
Subject: [PATCH] Moved cookie creation to Forwarding from ForwardingBase.
 Removed one of the pushRoute method that is not needed anymore.

---
 .../forwarding/Forwarding.java                |  6 +++++-
 .../routing/ForwardingBase.java               | 21 +------------------
 2 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/src/main/java/net/floodlightcontroller/forwarding/Forwarding.java b/src/main/java/net/floodlightcontroller/forwarding/Forwarding.java
index e3db41311..10fd3f86c 100644
--- a/src/main/java/net/floodlightcontroller/forwarding/Forwarding.java
+++ b/src/main/java/net/floodlightcontroller/forwarding/Forwarding.java
@@ -31,6 +31,7 @@ import net.floodlightcontroller.core.module.FloodlightModuleContext;
 import net.floodlightcontroller.core.module.FloodlightModuleException;
 import net.floodlightcontroller.core.module.IFloodlightModule;
 import net.floodlightcontroller.core.module.IFloodlightService;
+import net.floodlightcontroller.core.util.AppCookie;
 import net.floodlightcontroller.counter.ICounterStoreService;
 import net.floodlightcontroller.devicemanager.Device;
 import net.floodlightcontroller.devicemanager.DeviceAttachmentPoint;
@@ -162,9 +163,12 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule {
                                           new Object[] {match, route, dstDap.getSwitchPort().getSw(),
                                           dstDap.getSwitchPort().getPort()});
                             }
+                            long cookie = 
+                                    AppCookie.makeCookie(FORWARDING_APP_ID, 0);
                             pushRoute(route, match, 0,
                                       srcDap.getSwitchPort(), dstDap.getSwitchPort(), bufferId,
-                                      sw, pi, cntx, reqeustFlowRemovedNotifn);
+                                      sw, pi, cookie,
+                                      cntx, reqeustFlowRemovedNotifn);
                         }
                     }
                     iSrcDaps++;
diff --git a/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java b/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java
index 79c786d19..082305fea 100644
--- a/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java
+++ b/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java
@@ -126,26 +126,7 @@ public abstract class ForwardingBase implements IOFMessageListener, IDeviceManag
             }
         }
     }
-    
-    /**
-     * Push routes from back to front
-     * @param route Route to push
-     * @param match OpenFlow fields to match on
-     * @param srcSwPort Source switch port for the first hop
-     * @param dstSwPort Destination switch port for final hop
-     * @param bufferId BufferId of the original PacketIn
-     * @return srcSwitchIincluded True if the source switch is included in this route
-     */
-    public boolean pushRoute(Route route, OFMatch match, Integer wildcard_hints,
-            SwitchPortTuple srcSwPort,
-            SwitchPortTuple dstSwPort, int bufferId,
-            IOFSwitch srcSwitch, OFPacketIn pi, FloodlightContext cntx,
-            boolean reqeustFlowRemovedNotifn) {
-        long cookie = AppCookie.makeCookie(FORWARDING_APP_ID, 0);
-        return pushRoute(route, match, wildcard_hints, srcSwPort, dstSwPort, 
-                bufferId, srcSwitch, pi, cookie, cntx, reqeustFlowRemovedNotifn);
-    }
-    
+
     /**
      * Push routes from back to front
      * @param route Route to push
-- 
GitLab