Skip to content
Snippets Groups Projects
Commit 623c14fe authored by abat's avatar abat
Browse files

Merge into master from pull request #162:

Send LLDPs for all the switches first; then followed by BDDPs. (https://github.com/floodlight/floodlight/pull/162)
parents d97bcb3b 1bc28ca2
No related branches found
No related tags found
No related merge requests found
...@@ -346,24 +346,22 @@ public class LinkDiscoveryManager ...@@ -346,24 +346,22 @@ public class LinkDiscoveryManager
} }
protected void sendLLDPs(SwitchPortTuple swt) { protected void sendLLDPs(SwitchPortTuple swt, boolean isStandard) {
IOFSwitch sw = swt.getSw(); IOFSwitch sw = swt.getSw();
if (sw == null) return; if (sw == null) return;
OFPhysicalPort port = sw.getPort(swt.getPort()); OFPhysicalPort port = sw.getPort(swt.getPort());
if (port != null) { if (port != null) {
sendLLDPs(sw, port, true); sendLLDPs(sw, port, isStandard);
sendLLDPs(sw, port, false);
} }
} }
protected void sendLLDPs(IOFSwitch sw) { protected void sendLLDPs(IOFSwitch sw, boolean isStandard) {
if (sw.getEnabledPorts() != null) { if (sw.getEnabledPorts() != null) {
for (OFPhysicalPort port : sw.getEnabledPorts()) { for (OFPhysicalPort port : sw.getEnabledPorts()) {
sendLLDPs(sw, port, true); sendLLDPs(sw, port, isStandard);
sendLLDPs(sw, port, false);
} }
} }
sw.flush(); sw.flush();
...@@ -377,7 +375,11 @@ public class LinkDiscoveryManager ...@@ -377,7 +375,11 @@ public class LinkDiscoveryManager
Map<Long, IOFSwitch> switches = floodlightProvider.getSwitches(); Map<Long, IOFSwitch> switches = floodlightProvider.getSwitches();
for (Entry<Long, IOFSwitch> entry : switches.entrySet()) { for (Entry<Long, IOFSwitch> entry : switches.entrySet()) {
IOFSwitch sw = entry.getValue(); IOFSwitch sw = entry.getValue();
sendLLDPs(sw); sendLLDPs(sw, true);
}
for (Entry<Long, IOFSwitch> entry : switches.entrySet()) {
IOFSwitch sw = entry.getValue();
sendLLDPs(sw, false);
} }
} }
......
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