Make a link depends on packet-in LLDP packet.

The ONOS does not process the incoming LLDP packet from switches.
The ONOS only process LLDP packets if LLDP packet has "ONOS Discovery" optional TLV.

So, this changes process incoming LLDP packet from switch and make a link information and onos can utilize it.

Also, this patch changes the requested appId of DefaultForwardingObjective generated by PacketManager.
So, AppId in result of flows cli will be printed to actual requested appId.

ONOS-7748

Change-Id: I2611b34655bec2369b8817ce0cd29fb2edbed845
diff --git a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/FlowRuleJuniperImpl.java b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/FlowRuleJuniperImpl.java
index cb07843..3f4adb6 100644
--- a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/FlowRuleJuniperImpl.java
+++ b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/FlowRuleJuniperImpl.java
@@ -381,7 +381,7 @@
         DeviceService deviceService = this.handler().get(DeviceService.class);
         //Using only links with adjacency discovered by the LLDP protocol (see LinkDiscoveryJuniperImpl)
         Map<DeviceId, Port> dstPorts = links.stream().filter(l ->
-                IP_STRING.toUpperCase().equals(l.annotations().value("layer")))
+                IP_STRING.toUpperCase().equals(l.annotations().value(AnnotationKeys.LAYER)))
                 .collect(Collectors.toMap(
                         l -> l.dst().deviceId(),
                         l -> deviceService.getPort(l.dst().deviceId(), l.dst().port())));
diff --git a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/JuniperUtils.java b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/JuniperUtils.java
index fca4697..d6a6f65 100644
--- a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/JuniperUtils.java
+++ b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/JuniperUtils.java
@@ -502,12 +502,37 @@
         ConnectPoint local = new ConnectPoint(localDevId, localPort.number());
         ConnectPoint remote = new ConnectPoint(remoteDevId, remotePort.number());
         DefaultAnnotations annotations = DefaultAnnotations.builder()
-                .set("layer", "IP")
+                .set(AnnotationKeys.LAYER, "ETHERNET")
                 .build();
         descs.add(new DefaultLinkDescription(
-                local, remote, Link.Type.INDIRECT, false, annotations));
+                local, remote, Link.Type.DIRECT, true, annotations));
         descs.add(new DefaultLinkDescription(
-                remote, local, Link.Type.INDIRECT, false, annotations));
+                remote, local, Link.Type.DIRECT, true, annotations));
+    }
+
+    /**
+     * Create one way LinkDescriptions.
+     *
+     * @param localDevId  the identity of the local device
+     * @param localPort   the port of the local device
+     * @param remoteDevId the identity of the remote device
+     * @param remotePort  the port of the remote device
+     * @param descs       the collection to which the link descriptions
+     *                    should be added
+     */
+    public static void createOneWayLinkDescription(DeviceId localDevId,
+                                                   Port localPort,
+                                                   DeviceId remoteDevId,
+                                                   Port remotePort,
+                                                   Set<LinkDescription> descs) {
+
+        ConnectPoint local = new ConnectPoint(localDevId, localPort.number());
+        ConnectPoint remote = new ConnectPoint(remoteDevId, remotePort.number());
+        DefaultAnnotations annotations = DefaultAnnotations.builder()
+                .set(AnnotationKeys.LAYER, "ETHERNET")
+                .build();
+        descs.add(new DefaultLinkDescription(
+                remote, local, Link.Type.DIRECT, true, annotations));
     }
 
     /**
diff --git a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/LinkDiscoveryJuniperImpl.java b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/LinkDiscoveryJuniperImpl.java
index 37e655a..e78779e 100644
--- a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/LinkDiscoveryJuniperImpl.java
+++ b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/LinkDiscoveryJuniperImpl.java
@@ -136,12 +136,11 @@
                 continue;
             }
 
-            JuniperUtils.createBiDirLinkDescription(localDeviceId,
-                                                    localPort.get(),
-                                                    remoteDevice.id(),
-                                                    remotePort.get(),
-                                                    descriptions);
-
+            JuniperUtils.createOneWayLinkDescription(localDeviceId,
+                                                     localPort.get(),
+                                                     remoteDevice.id(),
+                                                     remotePort.get(),
+                                                     descriptions);
         }
         return descriptions;
     }