X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fopenflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugin%2Fopenflow%2Finternal%2FDiscoveryService.java;h=394be07dee2968b838377d8424ad8c70d49f4bce;hp=012807eee9ff622e5469a035b2a0e0e7b3294496;hb=4142ab5dce3021e6f6551aada26c7523cd134844;hpb=5466b63d3ad41fadf0aa4d5bf69b77c32f5d6638 diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java index 012807eee9..394be07dee 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java @@ -125,7 +125,7 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa 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 { @@ -217,6 +217,11 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa 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); @@ -233,7 +238,8 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa // 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 { @@ -406,7 +412,7 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa List 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; } @@ -1462,6 +1468,10 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa 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());