+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
package org.opendaylight.md.controller.topology.lldp.utils;
import java.nio.charset.Charset;
-import org.opendaylight.controller.sal.packet.Ethernet;
-import org.opendaylight.controller.sal.packet.LLDP;
-import org.opendaylight.controller.sal.packet.LLDPTLV;
-import org.opendaylight.controller.sal.utils.NetUtils;
+import org.opendaylight.controller.liblldp.Ethernet;
+import org.opendaylight.controller.liblldp.LLDP;
+import org.opendaylight.controller.liblldp.LLDPTLV;
+import org.opendaylight.controller.liblldp.NetUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
public class LLDPDiscoveryUtils {
static Logger LOG = LoggerFactory.getLogger(LLDPDiscoveryUtils.class);
-
+
public static final Long LLDP_INTERVAL = (long) (1000*5); // Send LLDP every five seconds
public static final Long LLDP_EXPIRATION_TIME = LLDP_INTERVAL*3; // Let up to three intervals pass before we decide we are expired.
-
+
public static String macToString(byte[] mac) {
StringBuilder b = new StringBuilder();
for (int i = 0; i < mac.length; i++) {
return b.toString();
}
-
+
public static NodeConnectorRef lldpToNodeConnectorRef(byte[] payload) {
Ethernet ethPkt = new Ethernet();
try {
if (ethPkt.getPayload() instanceof LLDP) {
LLDP lldp = (LLDP) ethPkt.getPayload();
-
+
try {
NodeId srcNodeId = null;
NodeConnectorId srcNodeConnectorId = null;