ONOS-509: Match IPV6_SRC, IPV6_DST criteria

* Following classes have been extended to match IPV6_SRC and IPV6_DST criteria:
    - Criteria
    - DefaultTrafficSelector
    - FlowEntryBuilder
    - FlowModBuilder

* Not included in this submission
    - Match of other IPv6-related criteria
    - Set of all IPv6-related criteria (action)

Change-Id: I115829a480356d2037e0fc809595f7a5eec25874
diff --git a/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficSelector.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficSelector.java
index 1caed8e..756fdd7 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficSelector.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficSelector.java
@@ -184,6 +184,16 @@
         }
 
         @Override
+        public Builder matchIPv6Src(IpPrefix ip) {
+            return add(Criteria.matchIPv6Src(ip));
+        }
+
+        @Override
+        public Builder matchIPv6Dst(IpPrefix ip) {
+            return add(Criteria.matchIPv6Dst(ip));
+        }
+
+        @Override
         public Builder matchMplsLabel(Integer mplsLabel) {
             return add(Criteria.matchMplsLabel(mplsLabel));
         }
diff --git a/core/api/src/main/java/org/onosproject/net/flow/TrafficSelector.java b/core/api/src/main/java/org/onosproject/net/flow/TrafficSelector.java
index d9b91f6..267fb51 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/TrafficSelector.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/TrafficSelector.java
@@ -115,7 +115,7 @@
         public Builder matchIPProtocol(Byte proto);
 
         /**
-         * Matches a l3 address.
+         * Matches a l3 IPv4 address.
          *
          * @param ip a l3 address
          * @return a selection builder
@@ -123,7 +123,7 @@
         public Builder matchIPSrc(IpPrefix ip);
 
         /**
-         * Matches a l3 address.
+         * Matches a l3 IPv4 address.
          *
          * @param ip a l3 address
          * @return a selection builder
@@ -146,6 +146,21 @@
          */
         public Builder matchTcpDst(Short tcpPort);
 
+        /**
+         * Matches a l3 IPv6 address.
+         *
+         * @param ip a l3 IPv6 address
+         * @return a selection builder
+         */
+        public Builder matchIPv6Src(IpPrefix ip);
+
+        /**
+         * Matches a l3 IPv6 address.
+         *
+         * @param ip a l3 IPv6 address
+         * @return a selection builder
+         */
+        public Builder matchIPv6Dst(IpPrefix ip);
 
         /**
          * Matches on a MPLS label .
diff --git a/core/api/src/main/java/org/onosproject/net/flow/criteria/Criteria.java b/core/api/src/main/java/org/onosproject/net/flow/criteria/Criteria.java
index dcc7edc..e725143 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/criteria/Criteria.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/criteria/Criteria.java
@@ -18,7 +18,6 @@
 import static com.google.common.base.MoreObjects.toStringHelper;
 
 import java.util.Objects;
-
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.flow.criteria.Criterion.Type;
 import org.onlab.packet.IpPrefix;
@@ -109,9 +108,9 @@
     }
 
     /**
-     * Creates a match on IP source field using the specified value.
+     * Creates a match on IPv4 source field using the specified value.
      *
-     * @param ip ip source value
+     * @param ip ipv4 source value
      * @return match criterion
      */
     public static Criterion matchIPSrc(IpPrefix ip) {
@@ -119,9 +118,9 @@
     }
 
     /**
-     * Creates a match on IP destination field using the specified value.
+     * Creates a match on IPv4 destination field using the specified value.
      *
-     * @param ip ip source value
+     * @param ip ipv4 source value
      * @return match criterion
      */
     public static Criterion matchIPDst(IpPrefix ip) {
@@ -149,6 +148,26 @@
     }
 
     /**
+     * Creates a match on IPv6 source field using the specified value.
+     *
+     * @param ip ipv6 source value
+     * @return match criterion
+     */
+    public static Criterion matchIPv6Src(IpPrefix ip) {
+        return new IPCriterion(ip, Type.IPV6_SRC);
+    }
+
+    /**
+     * Creates a match on IPv6 destination field using the specified value.
+     *
+     * @param ip ipv6 source value
+     * @return match criterion
+     */
+    public static Criterion matchIPv6Dst(IpPrefix ip) {
+        return new IPCriterion(ip, Type.IPV6_DST);
+    }
+
+    /**
      * Creates a match on MPLS label.
      * @param mplsLabel MPLS label
      * @return match criterion