blob: a8f43f529143268f527f889c4a117888abfceeae [file] [log] [blame]
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -08001package net.floodlightcontroller.util;
2
3import net.floodlightcontroller.util.MACAddress;
4import net.floodlightcontroller.util.IPv4Net;
5
6/**
7 * The class representing the Flow Entry Matching filter.
8 *
9 * The Flow Entry matching filter that is used to specify
10 * the network data that would be forwarded on the data path from
11 * the source to the destination. Examples: MAC address (of the
12 * sender), IP prefix that includes the destination's IP address, etc.
13 *
14 * NOTE: The FlowEntryMatch specification below is incomplete: we need
15 * more matching fields, we need to indicate which fields need to be
16 * matched, etc.
17 */
18public class FlowEntryMatch {
19 private MACAddress srcMac; // Matching source MAC address
20 private MACAddress dstMac; // Matching destination MAC address
21 private IPv4Net srcIPv4Net; // Matching source IPv4 prefix
22 private IPv4Net dstIPv4Net; // Matching destination IPv4 prefix
23
24 /**
25 * Default constructor.
26 */
27 public FlowEntryMatch() {
28 }
29
30 /**
31 * Get the matching source MAC address.
32 *
33 * @return the matching source MAC address.
34 */
35 public MACAddress srcMac() { return srcMac; }
36
37 /**
38 * Set the matching source MAC address.
39 *
40 * @param srcMac the matching source MAC address to set.
41 */
42 public void setSrcMac(MACAddress srcMac) {
43 this.srcMac = srcMac;
44 }
45
46 /**
47 * Get the matching destination MAC address.
48 *
49 * @return the matching destination MAC address.
50 */
51 public MACAddress dstMac() { return dstMac; }
52
53 /**
54 * Set the matching destination MAC address.
55 *
56 * @param dstMac the matching destination MAC address to set.
57 */
58 public void setDstMac(MACAddress dstMac) {
59 this.dstMac = dstMac;
60 }
61
62 /**
63 * Get the matching source IPv4 prefix.
64 *
65 * @return the matching source IPv4 prefix.
66 */
67 public IPv4Net srcIPv4Net() { return srcIPv4Net; }
68
69 /**
70 * Set the matching source IPv4 prefix.
71 *
72 * @param srcIPv4Net the matching source IPv4 prefix to set.
73 */
74 public void setSrcIPv4Net(IPv4Net srcIPv4Net) {
75 this.srcIPv4Net = srcIPv4Net;
76 }
77
78 /**
79 * Get the matching destination IPv4 prefix.
80 *
81 * @return the matching destination IPv4 prefix.
82 */
83 public IPv4Net dstIPv4Net() { return dstIPv4Net; }
84
85 /**
86 * Set the matching destination IPv4 prefix.
87 *
88 * @param srcIPv4Net the matching destination IPv4 prefix to set.
89 */
90 public void setDstIPv4Net(IPv4Net dstIPv4Net) {
91 this.dstIPv4Net = dstIPv4Net;
92 }
93
94 /**
95 * Convert the matching filter to a string.
96 *
97 * @return the matching filter as a string.
98 */
99 @Override
100 public String toString() {
101 String ret = "";
102 // TODO: Implement it!
103 return ret;
104 }
105}