Merge onos-app-proxyarp with onos-app-proxyndp.

Change-Id: I6e25c4575544e159ac9f7749fe07a742bfd6f748
diff --git a/apps/pom.xml b/apps/pom.xml
index 2746e65..1f6bac8 100644
--- a/apps/pom.xml
+++ b/apps/pom.xml
@@ -37,7 +37,6 @@
         <module>ifwd</module>
         <module>mobility</module>
         <module>proxyarp</module>
-        <module>proxyndp</module>
         <module>config</module>
         <module>sdnip</module>
         <module>calendar</module>
diff --git a/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java b/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java
index f0dce52..93bbd5d 100644
--- a/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java
+++ b/apps/proxyarp/src/main/java/org/onosproject/proxyarp/ProxyArp.java
@@ -23,6 +23,8 @@
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.ReferenceCardinality;
 import org.onlab.packet.Ethernet;
+import org.onlab.packet.IPv6;
+import org.onlab.packet.ICMP6;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
 import org.onosproject.net.flow.DefaultTrafficSelector;
@@ -66,6 +68,22 @@
         packetService.requestPackets(selectorBuilder.build(),
                                      PacketPriority.CONTROL, appId);
 
+        // IPv6 Neighbor Solicitation packet.
+        selectorBuilder = DefaultTrafficSelector.builder();
+        selectorBuilder.matchEthType(Ethernet.TYPE_IPV6);
+        selectorBuilder.matchIPProtocol(IPv6.PROTOCOL_ICMP6);
+        selectorBuilder.matchIcmpv6Type(ICMP6.NEIGHBOR_SOLICITATION);
+        packetService.requestPackets(selectorBuilder.build(),
+                                     PacketPriority.CONTROL, appId);
+
+        // IPv6 Neighbor Advertisement packet.
+        selectorBuilder = DefaultTrafficSelector.builder();
+        selectorBuilder.matchEthType(Ethernet.TYPE_IPV6);
+        selectorBuilder.matchIPProtocol(IPv6.PROTOCOL_ICMP6);
+        selectorBuilder.matchIcmpv6Type(ICMP6.NEIGHBOR_ADVERTISEMENT);
+        packetService.requestPackets(selectorBuilder.build(),
+                                     PacketPriority.CONTROL, appId);
+
         log.info("Started with Application ID {}", appId.id());
     }
 
diff --git a/apps/proxyndp/pom.xml b/apps/proxyndp/pom.xml
deleted file mode 100644
index 688710e..0000000
--- a/apps/proxyndp/pom.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright 2014 Open Networking Laboratory
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.onosproject</groupId>
-        <artifactId>onos-apps</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>onos-app-proxyndp</artifactId>
-    <packaging>bundle</packaging>
-
-    <description>ONOS simple proxy neighbor discovery for IPv6 module</description>
-
-</project>
diff --git a/apps/proxyndp/src/main/java/org/onosproject/proxyndp/ProxyNdp.java b/apps/proxyndp/src/main/java/org/onosproject/proxyndp/ProxyNdp.java
deleted file mode 100644
index 5a1c240..0000000
--- a/apps/proxyndp/src/main/java/org/onosproject/proxyndp/ProxyNdp.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright 2014 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.proxyndp;
-
-import static org.slf4j.LoggerFactory.getLogger;
-
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.onlab.packet.Ethernet;
-import org.onlab.packet.IPv6;
-import org.onlab.packet.ICMP6;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.core.CoreService;
-import org.onosproject.net.flow.DefaultTrafficSelector;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.packet.PacketContext;
-import org.onosproject.net.packet.PacketPriority;
-import org.onosproject.net.packet.PacketProcessor;
-import org.onosproject.net.packet.PacketService;
-import org.onosproject.net.proxyarp.ProxyArpService;
-import org.slf4j.Logger;
-
-/**
- * Sample reactive proxy ndp application.
- */
-@Component(immediate = true)
-public class ProxyNdp {
-
-    private final Logger log = getLogger(getClass());
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected PacketService packetService;
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected ProxyArpService proxyArpService;
-
-    private ProxyNdpProcessor processor = new ProxyNdpProcessor();
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected CoreService coreService;
-
-    private ApplicationId appId;
-
-    @Activate
-    public void activate() {
-        appId = coreService.registerApplication("org.onosproject.proxyndp");
-        packetService.addProcessor(processor, PacketProcessor.ADVISOR_MAX + 1);
-
-        TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder();
-        selectorBuilder.matchEthType(Ethernet.TYPE_IPV6);
-        selectorBuilder.matchIPProtocol(IPv6.PROTOCOL_ICMP6);
-        selectorBuilder.matchIcmpv6Type(ICMP6.NEIGHBOR_SOLICITATION);
-        packetService.requestPackets(selectorBuilder.build(),
-                                     PacketPriority.CONTROL, appId);
-
-        selectorBuilder = DefaultTrafficSelector.builder();
-        selectorBuilder.matchEthType(Ethernet.TYPE_IPV6);
-        selectorBuilder.matchIPProtocol(IPv6.PROTOCOL_ICMP6);
-        selectorBuilder.matchIcmpv6Type(ICMP6.NEIGHBOR_ADVERTISEMENT);
-        packetService.requestPackets(selectorBuilder.build(),
-                                     PacketPriority.CONTROL, appId);
-
-        log.info("Started with Application ID {}", appId.id());
-    }
-
-    @Deactivate
-    public void deactivate() {
-        packetService.removeProcessor(processor);
-        processor = null;
-        log.info("Stopped");
-    }
-
-
-    /**
-     * Packet processor responsible for forwarding packets along their paths.
-     */
-    private class ProxyNdpProcessor implements PacketProcessor {
-
-        @Override
-        public void process(PacketContext context) {
-            // Stop processing if the packet has been handled, since we
-            // can't do any more to it.
-            if (context.isHandled()) {
-                return;
-            }
-
-            // Handle the neighbor discovery packet.
-            proxyArpService.handlePacket(context);
-        }
-    }
-}
-
-
diff --git a/apps/proxyndp/src/main/java/org/onosproject/proxyndp/package-info.java b/apps/proxyndp/src/main/java/org/onosproject/proxyndp/package-info.java
deleted file mode 100644
index 10c6134..0000000
--- a/apps/proxyndp/src/main/java/org/onosproject/proxyndp/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2014 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Proxy Ndp  application that handles IPv6 neighbor resolution for you.
- */
-package org.onosproject.proxyndp;