WIP: Initial implementation of runtime #2: take PathIntents and build a plan
Change-Id: I33acebecb76bd693f01a7440cee60c0fcfb49623
diff --git a/src/main/java/net/onrc/onos/intent/Match.java b/src/main/java/net/onrc/onos/intent/Match.java
new file mode 100644
index 0000000..c81fe00
--- /dev/null
+++ b/src/main/java/net/onrc/onos/intent/Match.java
@@ -0,0 +1,44 @@
+package net.onrc.onos.intent;
+
+import net.floodlightcontroller.util.MACAddress;
+import net.onrc.onos.ofcontroller.networkgraph.Port;
+import net.onrc.onos.ofcontroller.networkgraph.Switch;
+
+/**
+ *
+ * @author Brian O'Connor <bocon@onlab.us>
+ *
+ */
+
+public class Match {
+ protected Switch sw;
+ protected MACAddress srcMac;
+ protected MACAddress dstMac;
+ protected Port srcPort;
+
+ public Match(Switch sw, Port srcPort,
+ MACAddress srcMac, MACAddress dstMac) {
+ this.sw = sw;
+ this.srcPort = srcPort;
+ this.srcMac = srcMac;
+ this.dstMac = dstMac;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof Match) {
+ Match other = (Match) obj;
+ return this.sw == other.sw &&
+ this.srcMac == other.srcMac &&
+ this.dstMac == other.dstMac &&
+ this.srcPort == other.srcPort;
+ }
+ else {
+ return false;
+ }
+ }
+
+ public String toString() {
+ return "(" + srcPort + "," + srcMac + "," + dstMac + ")";
+ }
+}