blob: 9bd3bea9ef7530a32d354616e25a1649dd282057 [file] [log] [blame]
package net.floodlightcontroller.util;
import net.floodlightcontroller.util.MACAddress;
import net.floodlightcontroller.util.IPv4Net;
import org.codehaus.jackson.annotate.JsonProperty;
/**
* The class representing the Flow Entry Matching filter.
*
* The Flow Entry matching filter that is used to specify
* the network data that would be forwarded on the data path from
* the source to the destination. Examples: MAC address (of the
* sender), IP prefix that includes the destination's IP address, etc.
*
* NOTE: The FlowEntryMatch specification below is incomplete: we need
* more matching fields, we need to indicate which fields need to be
* matched, etc.
*/
public class FlowEntryMatch {
private MACAddress srcMac; // Matching source MAC address
private MACAddress dstMac; // Matching destination MAC address
private IPv4Net srcIPv4Net; // Matching source IPv4 prefix
private IPv4Net dstIPv4Net; // Matching destination IPv4 prefix
/**
* Default constructor.
*/
public FlowEntryMatch() {
}
/**
* Get the matching source MAC address.
*
* @return the matching source MAC address.
*/
@JsonProperty("srcMac")
public MACAddress srcMac() { return srcMac; }
/**
* Set the matching source MAC address.
*
* @param srcMac the matching source MAC address to set.
*/
@JsonProperty("srcMac")
public void setSrcMac(MACAddress srcMac) {
this.srcMac = srcMac;
}
/**
* Get the matching destination MAC address.
*
* @return the matching destination MAC address.
*/
@JsonProperty("dstMac")
public MACAddress dstMac() { return dstMac; }
/**
* Set the matching destination MAC address.
*
* @param dstMac the matching destination MAC address to set.
*/
@JsonProperty("dstMac")
public void setDstMac(MACAddress dstMac) {
this.dstMac = dstMac;
}
/**
* Get the matching source IPv4 prefix.
*
* @return the matching source IPv4 prefix.
*/
@JsonProperty("srcIPv4Net")
public IPv4Net srcIPv4Net() { return srcIPv4Net; }
/**
* Set the matching source IPv4 prefix.
*
* @param srcIPv4Net the matching source IPv4 prefix to set.
*/
@JsonProperty("srcIPv4Net")
public void setSrcIPv4Net(IPv4Net srcIPv4Net) {
this.srcIPv4Net = srcIPv4Net;
}
/**
* Get the matching destination IPv4 prefix.
*
* @return the matching destination IPv4 prefix.
*/
@JsonProperty("dstIPv4Net")
public IPv4Net dstIPv4Net() { return dstIPv4Net; }
/**
* Set the matching destination IPv4 prefix.
*
* @param srcIPv4Net the matching destination IPv4 prefix to set.
*/
@JsonProperty("dstIPv4Net")
public void setDstIPv4Net(IPv4Net dstIPv4Net) {
this.dstIPv4Net = dstIPv4Net;
}
/**
* Convert the matching filter to a string.
*
* The string has the following form:
* [srcMac=XXX dstMac=XXX srcIPv4Net=XXX dstIPv4Net=XXX]
*
* @return the matching filter as a string.
*/
@Override
public String toString() {
String ret = "[srcMac=" + this.srcMac.toString();
ret += " dstMac=" + this.dstMac.toString();
ret += " srcIPv4Net=" + this.srcIPv4Net.toString();
ret += " dstIPv4Net=" + this.dstIPv4Net.toString();
ret += "]";
return ret;
}
}