package org.opendaylight.controller.sal.match;
+import java.io.Serializable;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class Match implements Cloneable {
- private static final Map<MatchType, MatchType> reversableMatches;
+public class Match implements Cloneable, Serializable {
+ private static final long serialVersionUID = 1L;
+ private static final Map<MatchType, MatchType> reversableMatches;
static {
Map<MatchType, MatchType> map = new HashMap<MatchType, MatchType>();
map.put(MatchType.DL_SRC, MatchType.DL_DST);
*
* @return the 32 bit long mask (Refer to {@code}org.opendaylight.controller.sal.match.MatchElement)
*/
- @XmlElement
public int getMatches() {
return matches;
}
return new ArrayList<MatchType>(fields.keySet());
}
+ /**
+ * Returns the list of MatchFields the match is set for
+ *
+ * @return List of individual MatchField values.
+ */
+ @XmlElement(name="matchField")
+ public List<MatchField> getMatchFields() {
+ return new ArrayList<MatchField>(fields.values());
+ }
+
/**
* Returns whether this match is for an IPv6 flow
*/
&& filterAddress instanceof Inet4Address) {
return true;
}
- InetAddress thisMask = (InetAddress) filter.getField(type)
- .getMask();
- InetAddress filterMask = (InetAddress) filter.getField(type)
- .getMask();
+ InetAddress thisMask = (InetAddress) thisField.getMask();
+ InetAddress filterMask = (InetAddress) filterField.getMask();
// thisAddress has to be in same subnet of filterAddress
if (NetUtils.inetAddressConflict(thisAddress, filterAddress,
thisMask, filterMask)) {