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

Add a method to allow re-directing flows if needed.

parent e8a43bf4
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ public interface ITopologyService extends IFloodlightService { ...@@ -16,7 +16,7 @@ public interface ITopologyService extends IFloodlightService {
public boolean isInternal(long switchid, short port); public boolean isInternal(long switchid, short port);
public long getSwitchClusterId(long switchId); public long getSwitchClusterId(long switchId);
/** /**
* Retrieves a set of all the switches in the same cluster as sw. * Retrieves a set of all the switches in the same cluster as sw.
* A cluster is a set of switches that are directly or indirectly * A cluster is a set of switches that are directly or indirectly
...@@ -27,7 +27,7 @@ public interface ITopologyService extends IFloodlightService { ...@@ -27,7 +27,7 @@ public interface ITopologyService extends IFloodlightService {
* @return Set of switches in the cluster * @return Set of switches in the cluster
*/ */
public Set<Long> getSwitchesInCluster(long switchId); public Set<Long> getSwitchesInCluster(long switchId);
/** /**
* Queries whether two switches are in the same cluster. * Queries whether two switches are in the same cluster.
* @param switch1 * @param switch1
...@@ -36,9 +36,9 @@ public interface ITopologyService extends IFloodlightService { ...@@ -36,9 +36,9 @@ public interface ITopologyService extends IFloodlightService {
*/ */
public boolean inSameCluster(long switch1, long switch2); public boolean inSameCluster(long switch1, long switch2);
public void addListener(ITopologyListener listener); public void addListener(ITopologyListener listener);
public boolean isIncomingBroadcastAllowedOnSwitchPort(long sw, short portId); public boolean isIncomingBroadcastAllowedOnSwitchPort(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);
...@@ -46,4 +46,7 @@ public interface ITopologyService extends IFloodlightService { ...@@ -46,4 +46,7 @@ public interface ITopologyService extends IFloodlightService {
public Set<Short> getPorts(long sw); public Set<Short> getPorts(long sw);
public Set<Short> getBroadcastPorts(long targetSw, long src, short srcPort); public Set<Short> getBroadcastPorts(long targetSw, long src, short srcPort);
public NodePortTuple getOutgoingSwitchPort(long src, short srcPort,
long dst, short dstPort);
} }
...@@ -532,6 +532,16 @@ public class TopologyInstance { ...@@ -532,6 +532,16 @@ public class TopologyInstance {
return clusterBroadcastNodePorts.get(clusterId); return clusterBroadcastNodePorts.get(clusterId);
} }
public boolean isInSameBroadcastDomain(long s1, short p1, long s2, short p2) {
return false;
}
public NodePortTuple getOutgoingSwitchPort(long src, short srcPort,
long dst, short dstPort) {
// Use this function to redirect traffic if needed.
return new NodePortTuple(dst, dstPort);
}
public Set<Long> getSwitches() { public Set<Long> getSwitches() {
return switches; return switches;
} }
......
...@@ -399,8 +399,15 @@ IRoutingService, ILinkDiscoveryListener { ...@@ -399,8 +399,15 @@ IRoutingService, ILinkDiscoveryListener {
@Override @Override
public boolean isInSameBroadcastDomain(long s1, short p1, long s2, short p2) { public boolean isInSameBroadcastDomain(long s1, short p1, long s2, short p2) {
// TODO Auto-generated method stub return currentInstance.isInSameBroadcastDomain(s1, p1, s2, p2);
return false;
}
@Override
public NodePortTuple getOutgoingSwitchPort(long src, short srcPort,
long dst, short dstPort) {
// Use this function to redirect traffic if needed.
return currentInstance.getOutgoingSwitchPort(src, srcPort, dst, dstPort);
} }
} }
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