Skip to content
Snippets Groups Projects
Commit 30774fac authored by Ryan Izard's avatar Ryan Izard
Browse files

Add in old URIs for static entry pusher for backwards compatibility. Note this...

Add in old URIs for static entry pusher for backwards compatibility. Note this only addresses URI compatibility *not* JSON key:value compatibility. Clean up warnings in LoadBalancer unit test
parent 3280ecf9
No related branches found
No related tags found
No related merge requests found
......@@ -24,14 +24,14 @@ public class FlowModInfo {
private static final Set<FlowMatchProperty> matches = new HashSet<FlowMatchProperty>();
private static final Set<FlowActionProperty> actions = new HashSet<FlowActionProperty>();
//private static final Set<FlowInstructionProperty> instructions = new HashSet<FlowInstructionProperty>();
private FlowModInfo() {}
private static volatile FlowModInfo instance = null;
public static synchronized FlowModInfo getInstance() {
if (instance == null) {
instance = new FlowModInfo();
}
for (MatchFields m : MatchFields.values()) {
FlowMatchProperty fp = new FlowMatchProperty();
fp.property = MatchUtils.getMatchField(m);
......
......@@ -46,6 +46,8 @@ import net.floodlightcontroller.core.module.IFloodlightService;
import net.floodlightcontroller.core.util.AppCookie;
import net.floodlightcontroller.restserver.IRestApiService;
import net.floodlightcontroller.staticentry.web.StaticEntryWebRoutable;
import net.floodlightcontroller.staticentry.web.StaticFlowEntryWebRoutable;
import net.floodlightcontroller.staticentry.web.StaticFlowWebRoutable;
import net.floodlightcontroller.storage.IResultSet;
import net.floodlightcontroller.storage.IStorageSourceListener;
import net.floodlightcontroller.storage.IStorageSourceService;
......@@ -847,7 +849,9 @@ implements IOFSwitchListener, IFloodlightModule, IStaticEntryPusherService, ISto
storageSourceService.addListener(TABLE_NAME, this);
entriesFromStorage = readEntriesFromStorage();
entry2dpid = computeEntry2DpidMap(entriesFromStorage);
restApiService.addRestletRoutable(new StaticEntryWebRoutable());
restApiService.addRestletRoutable(new StaticEntryWebRoutable()); /* current */
restApiService.addRestletRoutable(new StaticFlowWebRoutable()); /* v1.0 - v1.2 (v1.3?) */
restApiService.addRestletRoutable(new StaticFlowEntryWebRoutable()); /* v0.91, v0.90, and before */
}
// IStaticFlowEntryPusherService methods
......
......@@ -22,6 +22,27 @@ import org.restlet.Context;
import org.restlet.Restlet;
import org.restlet.routing.Router;
/**
* As Floodlight has evolved, the purpose and capabilities
* of the original Static Flow Entry Pusher (SFEP) have changed.
* First, many simply referred to the SFEP as Static Flow
* Pusher (SFP), which resulted in incorrect API usage. So, we
* shortened the API. Now, the SFP/SFEP can do more than flows.
* It can also push groups and might also be able to push meters
* and other OpenFlow table entries in the future. Thus, the name
* SFP is misleading and credits the SFP will less than it's
* actually capable of accomplishing. So, the name now is changing
* to an even broader Static Entry Pusher (SEP), where "entry" is
* vague enough to encompasses flows, groups, and other potential
* types.
*
* One thing that hasn't been addressed is that the SEP is also
* capable of pushing non-static entries. (It relies on entry
* removal messages being sent from the switch to the controller
* in order to update its internal store.) Such entries have
* timeouts configured. IMHO, it's still okay to call the SEP
* static though, since this feature isn't used very often at all.
*/
public class StaticEntryWebRoutable implements RestletRoutable {
/**
* Create the Restlet router and bind to the proper resources.
......@@ -29,18 +50,19 @@ public class StaticEntryWebRoutable implements RestletRoutable {
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
router.attach("/json", StaticEntryPusherResource.class);
router.attach("/json", StaticEntryPusherResource.class); /* v2.0 advertised API */
router.attach("/clear/{switch}/json", ClearStaticEntriesResource.class);
router.attach("/list/{switch}/json", ListStaticEntriesResource.class);
router.attach("/usage/json", StaticEntryUsageResource.class);
router.attach("/usage/json", StaticEntryUsageResource.class);
return router;
}
/**
* Set the base path for the Topology
* Set the base path for the SEP
*/
@Override
public String basePath() {
return "/wm/staticflowpusher";
return "/wm/staticentrypusher";
}
}
/**
* Copyright 2013, Big Switch Networks, Inc.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
**/
package net.floodlightcontroller.staticentry.web;
import net.floodlightcontroller.restserver.RestletRoutable;
import org.restlet.Context;
import org.restlet.Restlet;
import org.restlet.routing.Router;
/**
* As Floodlight has evolved, the purpose and capabilities
* of the original Static Flow Entry Pusher (SFEP) have changed.
* First, many simply referred to the SFEP as Static Flow
* Pusher (SFP), which resulted in incorrect API usage. So, we
* shortened the API. Now, the SFP/SFEP can do more than flows.
* It can also push groups and might also be able to push meters
* and other OpenFlow table entries in the future. Thus, the name
* SFP is misleading and credits the SFP will less than it's
* actually capable of accomplishing. So, the name now is changing
* to an even broader Static Entry Pusher (SEP), where "entry" is
* vague enough to encompasses flows, groups, and other potential
* types.
*
* One thing that hasn't been addressed is that the SEP is also
* capable of pushing non-static entries. (It relies on entry
* removal messages being sent from the switch to the controller
* in order to update its internal store.) Such entries have
* timeouts configured. IMHO, it's still okay to call the SEP
* static though, since this feature isn't used very often at all.
*/
public class StaticFlowEntryWebRoutable implements RestletRoutable {
/**
* Create the Restlet router and bind to the proper resources.
*/
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
router.attach("/json", StaticEntryPusherResource.class); /* v0.91, v0.90, and below */
router.attach("/clear/{switch}/json", ClearStaticEntriesResource.class);
router.attach("/list/{switch}/json", ListStaticEntriesResource.class);
router.attach("/usage/json", StaticEntryUsageResource.class);
return router;
}
/**
* Set the base path for the SFEP
*/
@Override
public String basePath() {
return "/wm/staticflowentrypusher";
}
}
/**
* Copyright 2013, Big Switch Networks, Inc.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
**/
package net.floodlightcontroller.staticentry.web;
import net.floodlightcontroller.restserver.RestletRoutable;
import org.restlet.Context;
import org.restlet.Restlet;
import org.restlet.routing.Router;
/**
* As Floodlight has evolved, the purpose and capabilities
* of the original Static Flow Entry Pusher (SFEP) have changed.
* First, many simply referred to the SFEP as Static Flow
* Pusher (SFP), which resulted in incorrect API usage. So, we
* shortened the API. Now, the SFP/SFEP can do more than flows.
* It can also push groups and might also be able to push meters
* and other OpenFlow table entries in the future. Thus, the name
* SFP is misleading and credits the SFP will less than it's
* actually capable of accomplishing. So, the name now is changing
* to an even broader Static Entry Pusher (SEP), where "entry" is
* vague enough to encompasses flows, groups, and other potential
* types.
*
* One thing that hasn't been addressed is that the SEP is also
* capable of pushing non-static entries. (It relies on entry
* removal messages being sent from the switch to the controller
* in order to update its internal store.) Such entries have
* timeouts configured. IMHO, it's still okay to call the SEP
* static though, since this feature isn't used very often at all.
*/
public class StaticFlowWebRoutable implements RestletRoutable {
/**
* Create the Restlet router and bind to the proper resources.
*/
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
router.attach("/json", StaticEntryPusherResource.class); /* backwards compatibility w/ v1.0-v1.2 (v1.3?) */
router.attach("/clear/{switch}/json", ClearStaticEntriesResource.class);
router.attach("/list/{switch}/json", ListStaticEntriesResource.class);
router.attach("/usage/json", StaticEntryUsageResource.class);
return router;
}
/**
* Set the base path for the SFP
*/
@Override
public String basePath() {
return "/wm/staticflowpusher";
}
}
......@@ -56,7 +56,6 @@ import org.projectfloodlight.openflow.types.VlanVid;
import org.projectfloodlight.openflow.protocol.OFPacketInReason;
import org.projectfloodlight.openflow.protocol.action.OFAction;
import org.projectfloodlight.openflow.protocol.match.MatchField;
import org.projectfloodlight.openflow.util.HexString;
import org.projectfloodlight.openflow.types.DatapathId;
import org.sdnplatform.sync.ISyncService;
import org.sdnplatform.sync.test.MockSyncService;
......@@ -504,7 +503,7 @@ public class LoadBalancerTest extends FloodlightTestCase {
// Mock proxy arp packet-out
arpReply1 = new Ethernet()
.setSourceMACAddress(LBVip.LB_PROXY_MAC)
.setDestinationMACAddress(HexString.fromHexString("00:00:00:00:00:01"))
.setDestinationMACAddress(MacAddress.of("00:00:00:00:00:01"))
.setEtherType(EthType.ARP)
.setVlanID((short) 0)
.setPriorityCode((byte) 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment