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

Merge pull request #152 from sriniram/master

Added method to get blocked ports as part of ITopologyService.
parents 437ccd2c 8a678cbe
No related branches found
No related tags found
No related merge requests found
...@@ -174,4 +174,12 @@ public interface ITopologyService extends IFloodlightService { ...@@ -174,4 +174,12 @@ public interface ITopologyService extends IFloodlightService {
* destination pair. * destination pair.
*/ */
public boolean isTunnelEnabled(long srcMac, long dstMac); public boolean isTunnelEnabled(long srcMac, long dstMac);
/**
* Returns a set of blocked ports. The set of blocked
* ports is the union of all the blocked ports across all
* instances.
* @return
*/
public Set<NodePortTuple> getBlockedPorts();
} }
...@@ -409,6 +409,25 @@ public class TopologyManager implements ...@@ -409,6 +409,25 @@ public class TopologyManager implements
return tunnelLinks.keySet(); return tunnelLinks.keySet();
} }
@Override
public Set<NodePortTuple> getBlockedPorts() {
Set<NodePortTuple> bp;
Set<NodePortTuple> blockedPorts =
new HashSet<NodePortTuple>();
// As we might have two topologies, simply get the union of
// both of them and send it.
bp = currentInstance.getBlockedPorts();
if (bp != null)
blockedPorts.addAll(bp);
bp = currentInstanceWithoutTunnels.getBlockedPorts();
if (bp != null)
blockedPorts.addAll(bp);
return blockedPorts;
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
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