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

Introduce a method called isConsistent(..) that compares an old attachment and...

Introduce a method called isConsistent(..) that compares an old attachment and a new attachment point. If the new attachment point is not consistent with the old one, then it has to be learnt by the device manager.
parent 914fd821
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,8 @@ public interface ITopologyService extends IFloodlightService { ...@@ -43,6 +43,8 @@ public interface ITopologyService extends IFloodlightService {
public boolean isAllowed(long sw, short portId); public boolean isAllowed(long sw, short portId);
public boolean isConsistent(long oldSw, short oldPort, long newSw,
short newPort);
/** /**
* If the dst is not allowed by the higher-level topology, this method provides * If the dst is not allowed by the higher-level topology, this method provides
* the topologically equivalent broadcast port. * the topologically equivalent broadcast port.
......
...@@ -524,6 +524,12 @@ public class TopologyInstance { ...@@ -524,6 +524,12 @@ public class TopologyInstance {
return true; return true;
} }
public boolean isConsistent(long oldSw, short oldPort, long newSw,
short newPort) {
if (isInternal(newSw, newPort)) return true;
return (oldSw == newSw && oldPort == newPort);
}
protected Set<NodePortTuple> protected Set<NodePortTuple>
getBroadcastNodePortsInCluster(long sw) { getBroadcastNodePortsInCluster(long sw) {
long clusterId = getSwitchClusterId(sw); long clusterId = getSwitchClusterId(sw);
......
...@@ -435,5 +435,11 @@ IRoutingService, ILinkDiscoveryListener { ...@@ -435,5 +435,11 @@ IRoutingService, ILinkDiscoveryListener {
public boolean isBroadcastDomainPort(long sw, short port) { public boolean isBroadcastDomainPort(long sw, short port) {
return currentInstance.isBroadcastDomainPort(new NodePortTuple(sw, port)); return currentInstance.isBroadcastDomainPort(new NodePortTuple(sw, port));
} }
@Override
public boolean isConsistent(long oldSw, short oldPort, long newSw,
short newPort) {
return currentInstance.isConsistent(oldSw, oldPort, newSw, newPort);
}
} }
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