blob: 4c52324fac504d7212b957c81ffc29e92ef4a3c5 [file] [log] [blame]
Brian O'Connor7f8e3012014-02-15 23:59:29 -08001package net.onrc.onos.intent;
2
3import java.util.HashSet;
4import java.util.Set;
5
6import net.floodlightcontroller.util.MACAddress;
7import net.onrc.onos.ofcontroller.networkgraph.Port;
8import net.onrc.onos.ofcontroller.networkgraph.Switch;
9
10/**
11 *
12 * @author Brian O'Connor <bocon@onlab.us>
13 *
14 */
15
16public class FlowEntry {
17 protected Switch sw;
18 protected Match match;
19 protected Set<Action> actions;
20
21 public FlowEntry(Switch sw, Port srcPort, Port dstPort,
22 MACAddress srcMac, MACAddress dstMac) {
23 this.sw = sw;
24 this.match = new Match(sw, srcPort, srcMac, dstMac);
25 this.actions = new HashSet<Action>();
26 this.actions.add(new ForwardAction(dstPort));
27 }
28
29 public String toString() {
30 return match + "->" + actions;
31 }
32}