Use ON.Lab OUI for LLDP packets.
Change-Id: Ie285a47c5abd10a9ac37b3ca8f6ddf16ad867b2d
diff --git a/providers/lldp/src/test/java/org/onosproject/provider/lldp/impl/LldpLinkProviderTest.java b/providers/lldp/src/test/java/org/onosproject/provider/lldp/impl/LldpLinkProviderTest.java
index b911879..fb1bf67 100644
--- a/providers/lldp/src/test/java/org/onosproject/provider/lldp/impl/LldpLinkProviderTest.java
+++ b/providers/lldp/src/test/java/org/onosproject/provider/lldp/impl/LldpLinkProviderTest.java
@@ -15,15 +15,11 @@
*/
package org.onosproject.provider.lldp.impl;
-import java.nio.ByteBuffer;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.CompletableFuture;
-
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -70,11 +66,14 @@
import org.onosproject.net.provider.ProviderId;
import org.onosproject.provider.lldpcommon.LinkDiscovery;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
+import java.nio.ByteBuffer;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
@@ -655,7 +654,7 @@
Ethernet ethPacket = new Ethernet();
ethPacket.setEtherType(Ethernet.TYPE_LLDP);
- ethPacket.setDestinationMACAddress(ONOSLLDP.LLDP_NICIRA);
+ ethPacket.setDestinationMACAddress(ONOSLLDP.LLDP_ONLAB);
ethPacket.setPayload(lldp);
ethPacket.setPad(true);
diff --git a/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java b/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java
index 9d021e4..f108cd4 100644
--- a/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java
+++ b/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java
@@ -81,7 +81,7 @@
ethPacket = new Ethernet();
ethPacket.setEtherType(Ethernet.TYPE_LLDP);
- ethPacket.setDestinationMACAddress(ONOSLLDP.LLDP_NICIRA);
+ ethPacket.setDestinationMACAddress(ONOSLLDP.LLDP_ONLAB);
ethPacket.setPad(true);
bddpEth = new Ethernet();
diff --git a/providers/netcfglinks/src/test/java/org/onosproject/provider/netcfglinks/NetworkConfigLinksProviderTest.java b/providers/netcfglinks/src/test/java/org/onosproject/provider/netcfglinks/NetworkConfigLinksProviderTest.java
index 7356ebe..ce33f22 100644
--- a/providers/netcfglinks/src/test/java/org/onosproject/provider/netcfglinks/NetworkConfigLinksProviderTest.java
+++ b/providers/netcfglinks/src/test/java/org/onosproject/provider/netcfglinks/NetworkConfigLinksProviderTest.java
@@ -15,9 +15,7 @@
*/
package org.onosproject.provider.netcfglinks;
-import java.nio.ByteBuffer;
-import java.util.List;
-
+import com.google.common.collect.ImmutableList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -53,7 +51,8 @@
import org.onosproject.net.packet.PacketProcessor;
import org.onosproject.net.packet.PacketServiceAdapter;
-import com.google.common.collect.ImmutableList;
+import java.nio.ByteBuffer;
+import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
@@ -153,7 +152,7 @@
Ethernet ethPacket = new Ethernet();
ethPacket.setEtherType(Ethernet.TYPE_LLDP);
- ethPacket.setDestinationMACAddress(ONOSLLDP.LLDP_NICIRA);
+ ethPacket.setDestinationMACAddress(ONOSLLDP.LLDP_ONLAB);
ethPacket.setPayload(lldp);
ethPacket.setPad(true);
diff --git a/utils/misc/src/main/java/org/onlab/packet/ONOSLLDP.java b/utils/misc/src/main/java/org/onlab/packet/ONOSLLDP.java
index 0245e66..f20de98 100644
--- a/utils/misc/src/main/java/org/onlab/packet/ONOSLLDP.java
+++ b/utils/misc/src/main/java/org/onlab/packet/ONOSLLDP.java
@@ -15,15 +15,13 @@
*/
package org.onlab.packet;
-import java.util.HashMap;
-
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-
import org.apache.commons.lang.ArrayUtils;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
import static org.onlab.packet.LLDPOrganizationalTLV.OUI_LENGTH;
import static org.onlab.packet.LLDPOrganizationalTLV.SUBTYPE_LENGTH;
@@ -37,10 +35,8 @@
public static final String DEFAULT_DEVICE = "INVALID";
public static final String DEFAULT_NAME = "ONOS Discovery";
- public static final byte[] LLDP_NICIRA = {0x01, 0x23, 0x20, 0x00, 0x00,
- 0x01};
- public static final byte[] LLDP_MULTICAST = {0x01, (byte) 0x80,
- (byte) 0xc2, 0x00, 0x00, 0x0e};
+ // ON.Lab OUI (a42305) with multicast bit set
+ public static final byte[] LLDP_ONLAB = {(byte) 0xa5, 0x23, 0x05, 0x00, 0x00, 0x01};
public static final byte[] BDDP_MULTICAST = {(byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff};
@@ -52,8 +48,7 @@
private static final short DEVICE_LENGTH = OUI_LENGTH + SUBTYPE_LENGTH;
private static final short DOMAIN_LENGTH = OUI_LENGTH + SUBTYPE_LENGTH;
- private final HashMap<Byte, LLDPOrganizationalTLV> opttlvs =
- Maps.<Byte, LLDPOrganizationalTLV>newHashMap();
+ private final HashMap<Byte, LLDPOrganizationalTLV> opttlvs = Maps.newHashMap();
// TLV constants: type, size and subtype
// Organizationally specific TLV also have packet offset and contents of TLV
@@ -82,7 +77,7 @@
setName(DEFAULT_NAME);
setDevice(DEFAULT_DEVICE);
- setOptionalTLVList(Lists.<LLDPTLV>newArrayList(opttlvs.values()));
+ setOptionalTLVList(Lists.newArrayList(opttlvs.values()));
setTtl(new LLDPTLV().setType(TTL_TLV_TYPE)
.setLength((short) ttlValue.length)
.setValue(ttlValue));
@@ -227,7 +222,7 @@
public static ONOSLLDP parseONOSLLDP(Ethernet eth) {
if (eth.getEtherType() == Ethernet.TYPE_LLDP ||
eth.getEtherType() == Ethernet.TYPE_BSN) {
- ONOSLLDP onosLldp = new ONOSLLDP((LLDP) eth.getPayload()); //(ONOSLLDP) eth.getPayload();
+ ONOSLLDP onosLldp = new ONOSLLDP((LLDP) eth.getPayload());
if (ONOSLLDP.DEFAULT_NAME.equals(onosLldp.getNameString())) {
return onosLldp;
}