import org.opendaylight.controller.protocol_plugin.openflow.IInventoryShimExternalListener;
import org.opendaylight.controller.protocol_plugin.openflow.core.IController;
import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitch;
import org.opendaylight.controller.protocol_plugin.openflow.IInventoryShimExternalListener;
import org.opendaylight.controller.protocol_plugin.openflow.core.IController;
import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitch;
-import org.openflow.protocol.OFPhysicalPort;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import org.opendaylight.controller.sal.connection.IPluginOutConnectionService;
import org.opendaylight.controller.sal.core.Config;
import org.opendaylight.controller.sal.core.ConstructionException;
import org.opendaylight.controller.sal.connection.IPluginOutConnectionService;
import org.opendaylight.controller.sal.core.Config;
import org.opendaylight.controller.sal.core.ConstructionException;
import org.opendaylight.controller.sal.core.IContainerListener;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.core.IContainerListener;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.utils.NetUtils;
import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
import org.opendaylight.controller.sal.utils.NodeCreator;
import org.opendaylight.controller.sal.utils.NetUtils;
import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
import org.opendaylight.controller.sal.utils.NodeCreator;
+import org.openflow.protocol.OFPhysicalPort;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
private Boolean throttling = false; // if true, no more batching.
private volatile Boolean shuttingDown = false;
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 {
private IPluginOutConnectionService connectionOutService;
class DiscoveryTransmit implements Runnable {
// Create LLDP PortID TLV
String portId = nodeConnector.getNodeConnectorIDString();
byte[] pidValue = LLDPTLV.createPortIDTLVValue(portId);
// Create LLDP PortID TLV
String portId = nodeConnector.getNodeConnectorIDString();
byte[] pidValue = LLDPTLV.createPortIDTLVValue(portId);
- logger.warn("Caught exception ", e);
+ if (logger.isDebugEnabled()) {
+ logger.debug(
+ "Caught exception while attempting to snoop non controller generated or malformed LLDP frame sent by {} and received on {}: {}",
+ HexEncode.bytesToHexStringFormat(ethPkt.getSourceMACAddress()), dstNodeConnector,
+ e.getMessage());
+ }
private void addDiscovery(Node node) {
Map<Long, ISwitch> switches = controller.getSwitches();
ISwitch sw = switches.get(node.getID());
private void addDiscovery(Node node) {
Map<Long, ISwitch> switches = controller.getSwitches();
ISwitch sw = switches.get(node.getID());
for (OFPhysicalPort port : ports) {
NodeConnector nodeConnector = NodeConnectorCreator.createOFNodeConnector(port.getPortNumber(), node);
if (!readyListHi.contains(nodeConnector)) {
for (OFPhysicalPort port : ports) {
NodeConnector nodeConnector = NodeConnectorCreator.createOFNodeConnector(port.getPortNumber(), node);
if (!readyListHi.contains(nodeConnector)) {
this.discoveryListener.notifyEdge(edge, type, props);
NodeConnector src = edge.getTailNodeConnector(), dst = edge.getHeadNodeConnector();
if (!src.getType().equals(NodeConnector.NodeConnectorIDType.PRODUCTION)) {
if (type == UpdateType.ADDED) {
edgeMap.put(dst, edge);
this.discoveryListener.notifyEdge(edge, type, props);
NodeConnector src = edge.getTailNodeConnector(), dst = edge.getHeadNodeConnector();
if (!src.getType().equals(NodeConnector.NodeConnectorIDType.PRODUCTION)) {
if (type == UpdateType.ADDED) {
edgeMap.put(dst, edge);
// Create LLDP PortID TLV
portIdTlv = new LLDPTLV();
portIdTlv.setType(LLDPTLV.TLVType.PortID.getValue());
// Create LLDP PortID TLV
portIdTlv = new LLDPTLV();
portIdTlv.setType(LLDPTLV.TLVType.PortID.getValue());