private Boolean throttling = false; // if true, no more batching.
private volatile Boolean shuttingDown = false;
- private LLDPTLV chassisIdTlv, portIdTlv, ttlTlv, customTlv;
+ private LLDPTLV chassisIdTlv, systemNameTlv, portIdTlv, ttlTlv, customTlv;
private IPluginOutConnectionService connectionOutService;
class DiscoveryTransmit implements Runnable {
chassisIdTlv.setType(LLDPTLV.TLVType.ChassisID.getValue()).setLength((short) cidValue.length)
.setValue(cidValue);
+ // Create LLDP SystemName TLV
+ byte[] snValue = LLDPTLV.createSystemNameTLVValue(nodeConnector.getNode().toString());
+ systemNameTlv.setType(LLDPTLV.TLVType.SystemName.getValue()).setLength((short) snValue.length)
+ .setValue(snValue);
+
// Create LLDP PortID TLV
String portId = nodeConnector.getNodeConnectorIDString();
byte[] pidValue = LLDPTLV.createPortIDTLVValue(portId);
// Create discovery pkt
LLDP discoveryPkt = new LLDP();
- discoveryPkt.setChassisId(chassisIdTlv).setPortId(portIdTlv).setTtl(ttlTlv).setOptionalTLVList(customList);
+ discoveryPkt.setChassisId(chassisIdTlv).setPortId(portIdTlv).setTtl(ttlTlv).setSystemNameId(systemNameTlv)
+ .setOptionalTLVList(customList);
RawPacket rawPkt = null;
try {
List<LLDPTLV> optionalTLVList = lldp.getOptionalTLVList();
if (optionalTLVList == null) {
- logger.info("The discovery packet with null custom option from {}", dstNodeConnector);
+ logger.warn("The discovery packet with null custom option from {}", dstNodeConnector);
return false;
}
private void addDiscovery(Node node) {
Map<Long, ISwitch> switches = controller.getSwitches();
ISwitch sw = switches.get(node.getID());
- List<OFPhysicalPort> ports = sw.getEnabledPorts();
- if (ports == null) {
+ if (sw == null) {
+ //switch could be removed by now, stop propagation
return;
}
+ List<OFPhysicalPort> ports = sw.getEnabledPorts();
for (OFPhysicalPort port : ports) {
NodeConnector nodeConnector = NodeConnectorCreator.createOFNodeConnector(port.getPortNumber(), node);
if (!readyListHi.contains(nodeConnector)) {
chassisIdTlv = new LLDPTLV();
chassisIdTlv.setType(LLDPTLV.TLVType.ChassisID.getValue());
+ // Create LLDP SystemName TLV
+ systemNameTlv = new LLDPTLV();
+ systemNameTlv.setType(LLDPTLV.TLVType.SystemName.getValue());
+
// Create LLDP PortID TLV
portIdTlv = new LLDPTLV();
portIdTlv.setType(LLDPTLV.TLVType.PortID.getValue());