Skip to content
Snippets Groups Projects
Commit ee637c39 authored by Sandip Shah's avatar Sandip Shah
Browse files

Committing floodlight changes

parent 2d71b2e6
No related branches found
No related tags found
No related merge requests found
......@@ -97,9 +97,9 @@ public abstract class OFSwitchBase implements IOFSwitch {
// Lock to protect modification of the port maps. We only need to
// synchronize on modifications. For read operations we are fine since
// we rely on ConcurrentMaps which works for our use case.
private Object portLock;
protected Object portLock;
// Map port numbers to the appropriate OFPhysicalPort
private ConcurrentHashMap<Short, OFPhysicalPort> portsByNumber;
protected ConcurrentHashMap<Short, OFPhysicalPort> portsByNumber;
// Map port names to the appropriate OFPhyiscalPort
// XXX: The OF spec doesn't specify if port names need to be unique but
// according it's always the case in practice.
......
......@@ -19,7 +19,6 @@ package net.floodlightcontroller.linkdiscovery;
import java.util.Map;
import java.util.Set;
import net.floodlightcontroller.core.module.IFloodlightService;
import net.floodlightcontroller.routing.Link;
import net.floodlightcontroller.topology.NodePortTuple;
......@@ -87,4 +86,10 @@ public interface ILinkDiscoveryService extends IFloodlightService {
* @param autoPortFastFeature
*/
public void setAutoPortFastFeature(boolean autoPortFastFeature);
/**
* Get the map of node-port tuples from link DB
*/
public Map<NodePortTuple, Set<Link>> getPortLinks();
}
......@@ -349,7 +349,7 @@ public class LinkDiscoveryManager implements IOFMessageListener,
} while (updates.peek() != null);
}
private boolean isLinkDiscoverySuppressed(long sw, short portNumber) {
protected boolean isLinkDiscoverySuppressed(long sw, short portNumber) {
return this.suppressLinkDiscovery.contains(new NodePortTuple(sw,
portNumber));
}
......@@ -599,10 +599,10 @@ public class LinkDiscoveryManager implements IOFMessageListener,
* @param port
* @return
*/
protected List<OFAction> getDiscoveryActions (short port){
protected List<OFAction> getDiscoveryActions (IOFSwitch sw, OFPhysicalPort port){
// set actions
List<OFAction> actions = new ArrayList<OFAction>();
actions.add(new OFActionOutput(port, (short) 0));
actions.add(new OFActionOutput(port.getPortNumber(), (short) 0));
return actions;
}
......@@ -731,9 +731,9 @@ public class LinkDiscoveryManager implements IOFMessageListener,
po.setBufferId(OFPacketOut.BUFFER_ID_NONE);
po.setInPort(OFPort.OFPP_NONE);
List<OFAction> actions = getDiscoveryActions(port);
List<OFAction> actions = getDiscoveryActions(iofSwitch, ofpPort);
po.setActions(actions);
po.setActionsLength((short) OFActionOutput.MINIMUM_LENGTH);
po.setActionsLength(getDiscoveryActionsLength(iofSwitch, ofpPort));
// set data
po.setLengthU(OFPacketOut.MINIMUM_LENGTH + po.getActionsLength()
......@@ -751,7 +751,12 @@ public class LinkDiscoveryManager implements IOFMessageListener,
}
/**
protected short getDiscoveryActionsLength(IOFSwitch iofSwitch,
OFPhysicalPort ofpPort) {
return (short) OFActionOutput.MINIMUM_LENGTH;
}
/**
* Send LLDPs to all switch-ports
*/
protected void discoverOnAllPorts() {
......
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