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

Adding getPorts() and getBroadcastPorts() methods to ITopologyService interface.

parent c9e553f3
No related branches found
No related tags found
No related merge requests found
......@@ -42,4 +42,8 @@ public interface ITopologyService extends IFloodlightService {
public boolean isIncomingBroadcastAllowedOnSwitchPort(long sw, short portId);
public boolean isInSameBroadcastDomain(long s1, short p1, long s2, short p2);
public Set<Short> getPorts(long sw);
public Set<Short> getBroadcastPorts(long targetSw, long src, short srcPort);
}
......@@ -536,4 +536,18 @@ public class TopologyInstance {
return switches;
}
public Set<Short> getPorts(long sw) {
return switchPorts.get(sw);
}
public Set<Short> getBroadcastPorts(long targetSw, long src, short srcPort) {
Set<Short> result = new HashSet<Short>();
long clusterId = getSwitchClusterId(targetSw);
for(NodePortTuple npt: clusterBroadcastNodePorts.get(clusterId)) {
if (npt.getNodeId() == targetSw) {
result.add(npt.getPortId());
}
}
return result;
}
}
......@@ -369,6 +369,15 @@ IRoutingService, ILinkDiscoveryListener {
return currentInstance.isIncomingBroadcastAllowedOnSwitchPort(sw, portId);
}
@Override
public Set<Short> getPorts(long sw) {
return currentInstance.getPorts(sw);
}
public Set<Short> getBroadcastPorts(long targetSw, long src, short srcPort) {
return currentInstance.getBroadcastPorts(targetSw, src, srcPort);
}
//
// IRoutingService interface methods
//
......
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