Skip to content
Snippets Groups Projects
Commit 49ebd8c0 authored by Srinivasan Ramasubramanian's avatar Srinivasan Ramasubramanian
Browse files

Introduce a convenience method inSameIsland, which is the same as...

Introduce a convenience method inSameIsland, which is the same as inSameCluster.  In future, they may have different functionalities.
parent adae3441
No related branches found
No related tags found
No related merge requests found
...@@ -89,7 +89,15 @@ public abstract class ForwardingBase implements IOFMessageListener, IDeviceManag ...@@ -89,7 +89,15 @@ public abstract class ForwardingBase implements IOFMessageListener, IDeviceManag
return d1ClusterId.compareTo(d2ClusterId); return d1ClusterId.compareTo(d2ClusterId);
} }
}; };
// Comparator for sorting the attachment points by last seen.
public Comparator<DeviceAttachmentPoint> lastSeenComparator = new Comparator<DeviceAttachmentPoint>() {
@Override
public int compare(DeviceAttachmentPoint d1, DeviceAttachmentPoint d2) {
return d1.getLastSeen().compareTo(d2.getLastSeen());
}
};
/** /**
* All subclasses must define this function if they want any specific forwarding action * All subclasses must define this function if they want any specific forwarding action
* @param sw Switch that the packet came in from * @param sw Switch that the packet came in from
......
...@@ -36,6 +36,15 @@ public interface ITopologyService extends IFloodlightService { ...@@ -36,6 +36,15 @@ public interface ITopologyService extends IFloodlightService {
*/ */
public boolean inSameCluster(long switch1, long switch2); public boolean inSameCluster(long switch1, long switch2);
/**
* Queries whether two switches are in the same island.
* Currently, island and cluster are the same. In future,
* islands could be different than clusters.
* @param switch1
* @param switch2
* @return
*/
public boolean inSameIsland(long switch1, long switch2);
public void addListener(ITopologyListener listener); public void addListener(ITopologyListener listener);
...@@ -56,7 +65,7 @@ public interface ITopologyService extends IFloodlightService { ...@@ -56,7 +65,7 @@ public interface ITopologyService extends IFloodlightService {
short srcPort, short srcPort,
long dst, long dst,
short dstPort); short dstPort);
public boolean isIncomingBroadcastAllowed(long sw, short portId); public boolean isIncomingBroadcastAllowed(long sw, short portId);
public boolean isInSameBroadcastDomain(long s1, short p1, long s2, short p2); public boolean isInSameBroadcastDomain(long s1, short p1, long s2, short p2);
......
...@@ -540,6 +540,10 @@ public class TopologyInstance { ...@@ -540,6 +540,10 @@ public class TopologyInstance {
return false; return false;
} }
public boolean inSameIsland(long switch1, long switch2) {
return inSameCluster(switch1, switch2);
}
public NodePortTuple getOutgoingSwitchPort(long src, short srcPort, public NodePortTuple getOutgoingSwitchPort(long src, short srcPort,
long dst, short dstPort) { long dst, short dstPort) {
// Use this function to redirect traffic if needed. // Use this function to redirect traffic if needed.
......
...@@ -441,5 +441,10 @@ IRoutingService, ILinkDiscoveryListener { ...@@ -441,5 +441,10 @@ IRoutingService, ILinkDiscoveryListener {
short newPort) { short newPort) {
return currentInstance.isConsistent(oldSw, oldPort, newSw, newPort); return currentInstance.isConsistent(oldSw, oldPort, newSw, newPort);
} }
@Override
public boolean inSameIsland(long switch1, long switch2) {
return currentInstance.inSameIsland(switch1, switch2);
}
} }
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