Brian O'Connor | 7f8e301 | 2014-02-15 23:59:29 -0800 | [diff] [blame^] | 1 | package net.onrc.onos.intent; |
| 2 | |
| 3 | import java.util.HashSet; |
| 4 | import java.util.Set; |
| 5 | |
| 6 | import net.floodlightcontroller.util.MACAddress; |
| 7 | import net.onrc.onos.ofcontroller.networkgraph.Port; |
| 8 | import net.onrc.onos.ofcontroller.networkgraph.Switch; |
| 9 | |
| 10 | /** |
| 11 | * |
| 12 | * @author Brian O'Connor <bocon@onlab.us> |
| 13 | * |
| 14 | */ |
| 15 | |
| 16 | public 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 | } |