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/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