diff --git a/.gitignore b/.gitignore index dcc106a8e1436ff767ad147545bdfe308800b665..6bb47c581906a2d592173e1b0532486f4ace9bdc 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ thrift *.swp *.pyc findbugs-results +*.launch diff --git a/setup-eclipse.sh b/setup-eclipse.sh index 01a6a95ef0f34cee64e85d0707c3d5b29ca0d219..4224a3c5c982f4fee5768a0e5bd788ea36f0b765 100755 --- a/setup-eclipse.sh +++ b/setup-eclipse.sh @@ -25,6 +25,36 @@ cat >"$d/.project" <<EOF </projectDescription> EOF +cat >"$d/Floodlight-Default-Conf.launch" << EOF +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> + <listEntry value="/floodlight/src/main/java/net/floodlightcontroller/core/Main.java"/> + </listAttribute> + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> + <listEntry value="1"/> + </listAttribute> + <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.floodlightcontroller.core.Main"/> + <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="floodlight"/> + <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/> +</launchConfiguration> +EOF + +cat > "$d/Floodlight-Quantum-Conf.launch" << EOF +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> + <listEntry value="/floodlight/src/main/java/net/floodlightcontroller/core/Main.java"/> + </listAttribute> + <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> + <listEntry value="1"/> + </listAttribute> + <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.floodlightcontroller.core.Main"/> + <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-cf src/main/resources/quantum.properties"/> + <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="floodlight"/> + <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/> +</launchConfiguration> +EOF cat >"$d/.classpath" <<EOF <?xml version="1.0" encoding="UTF-8"?> diff --git a/src/main/java/net/floodlightcontroller/devicemanager/IDeviceService.java b/src/main/java/net/floodlightcontroller/devicemanager/IDeviceService.java index 69fac694665f14e6df08ada226d0a5496e2b9884..5e8f221a9829bdcf25d0f37a41fd33047db3affe 100755 --- a/src/main/java/net/floodlightcontroller/devicemanager/IDeviceService.java +++ b/src/main/java/net/floodlightcontroller/devicemanager/IDeviceService.java @@ -51,6 +51,12 @@ public interface IDeviceService extends IFloodlightService { public static final String CONTEXT_DST_DEVICE = "net.floodlightcontroller.devicemanager.dstDevice"; + /** + * The original destination device for the current packet-in + */ + public static final String CONTEXT_ORIG_DST_DEVICE = + "net.floodlightcontroller.devicemanager.origDstDevice"; + /** * A FloodlightContextStore object that can be used to interact with the * FloodlightContext information created by BVS manager. diff --git a/src/main/java/net/floodlightcontroller/routing/IRoutingDecision.java b/src/main/java/net/floodlightcontroller/routing/IRoutingDecision.java index 81c3c138f60a59d4eedce92173f2595682347a76..ab09375486b9f61b2cfa98b83a5e9eeb483bd20b 100644 --- a/src/main/java/net/floodlightcontroller/routing/IRoutingDecision.java +++ b/src/main/java/net/floodlightcontroller/routing/IRoutingDecision.java @@ -1,7 +1,7 @@ /** -* Copyright 2011, Big Switch Networks, Inc. +* Copyright 2011, Big Switch Networks, Inc. * Originally created by David Erickson, Stanford University -* +* * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at @@ -29,18 +29,23 @@ public interface IRoutingDecision { /* * NONE: NO-OP, continue with the packet processing chain * DROP: Drop this packet and this flow - * FORWARD: Forward this packet, and this flow, to the first (and only device) in getDestinationDevices(), - * if the destination is not known at this time, initiate a discovery action for it (e.g. ARP) - * FORWARD_OR_FLOOD: Forward this packet, and this flow, to the first (and only device) in getDestinationDevices(), - * if the destination is not known at this time, flood this packet on the source switch - * MULTICAST: Multicast this packet to all the interfaces and devices attached + * FORWARD: Forward this packet, and this flow, to the first + * (and only device) in getDestinationDevices(), + * if the destination is not known at this time, + * initiate a discovery action for it (e.g. ARP) + * FORWARD_OR_FLOOD: Forward this packet, and this flow, to the first + * (and only device) in getDestinationDevices(), + * if the destination is not known at this time, + * flood this packet on the source switch + * MULTICAST: Multicast this packet to all the interfaces + * and devices attached */ NONE, DROP, FORWARD, FORWARD_OR_FLOOD, MULTICAST } - + public static final FloodlightContextStore<IRoutingDecision> rtStore = new FloodlightContextStore<IRoutingDecision>(); - public static final String CONTEXT_DECISION = + public static final String CONTEXT_DECISION = "net.floodlightcontroller.routing.decision"; public void addToContext(FloodlightContext cntx); diff --git a/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java b/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java index 94553f3c8a2e318d07ddaadc0377fe921825fac9..fd373279e85f151de765bd4c5cfc7af5de3fac68 100644 --- a/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java +++ b/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java @@ -1138,12 +1138,14 @@ public class ControllerTest extends FloodlightTestCase // Make sure controller attempts to reset switch master expect(sw.getAttribute("supportsNxRole")).andReturn(true).anyTimes(); expect(sw.getNextTransactionId()).andReturn(0).anyTimes(); + sw.write(EasyMock.<List<OFMessage>> anyObject(), + (FloodlightContext)anyObject()); // test replay(sw, lock); chdlr.processOFMessage(error); // Verify there is a pending role change request - assertTrue(controller.roleChanger.pendingTasks.poll() != null); + assertTrue(controller.roleChanger.pendingTasks.peek() != null); } // Helper function.