Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 1 | package net.onrc.onos.api.flowmanager; |
| 2 | |
| 3 | import java.util.Set; |
| 4 | |
Ray Milkey | 42ae1b5 | 2014-08-15 16:37:06 -0700 | [diff] [blame^] | 5 | import net.onrc.onos.core.matchaction.MatchActionOperations; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 6 | import net.onrc.onos.core.matchaction.action.OutputAction; |
| 7 | import net.onrc.onos.core.matchaction.match.PacketMatch; |
| 8 | import net.onrc.onos.core.util.Dpid; |
| 9 | import net.onrc.onos.core.util.Pair; |
| 10 | import net.onrc.onos.core.util.SwitchPort; |
| 11 | |
| 12 | /** |
| 13 | * An IFlow object expressing the point-to-multipoints tree flow for the packet |
| 14 | * layer. |
| 15 | */ |
Toshio Koide | fad1cd5 | 2014-08-07 17:10:07 -0700 | [diff] [blame] | 16 | public class SingleSrcTreeFlow implements Flow { |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 17 | protected final FlowId id; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 18 | protected PacketMatch match; |
| 19 | protected SwitchPort ingressPort; |
| 20 | protected Tree tree; |
| 21 | protected Set<Pair<Dpid, OutputAction>> outputActions; |
| 22 | |
| 23 | /** |
| 24 | * Creates new instance using Tree object. |
| 25 | * |
| 26 | * @param id ID for this object. |
| 27 | * @param match Traffic filter for the tree. |
| 28 | * @param ingressPort A ingress port of the tree. |
| 29 | * @param tree Tree object specifying tree topology for this object. |
| 30 | * @param outputActions The set of the pairs of the switch DPID and |
| 31 | * OutputAction object at the egress edge switchs. |
| 32 | */ |
| 33 | public SingleSrcTreeFlow(String id, PacketMatch match, |
| 34 | SwitchPort ingressPort, Tree tree, Set<Pair<Dpid, OutputAction>> outputActions) { |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 35 | this.id = new FlowId(id); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 36 | this.match = match; |
| 37 | this.ingressPort = ingressPort; |
| 38 | this.tree = tree; |
| 39 | this.outputActions = outputActions; |
| 40 | |
| 41 | // TODO: check if the tree is a P2MP tree. |
| 42 | // TODO: check consistency among rootPort, tree, and actions. |
| 43 | } |
| 44 | |
| 45 | @Override |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 46 | public FlowId getId() { |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 47 | return id; |
| 48 | } |
| 49 | |
| 50 | @Override |
| 51 | public PacketMatch getMatch() { |
| 52 | return match; |
| 53 | } |
| 54 | |
| 55 | @Override |
Ray Milkey | 42ae1b5 | 2014-08-15 16:37:06 -0700 | [diff] [blame^] | 56 | public MatchActionOperations compile() { |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 57 | // TODO Auto-generated method stub |
| 58 | return null; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Gets the ingress port (the root) of the tree. |
| 63 | * |
| 64 | * @return The ingress port of the tree. |
| 65 | */ |
| 66 | public SwitchPort getIngressPort() { |
| 67 | return ingressPort; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Gets the tree. |
| 72 | * |
| 73 | * @return The tree object. |
| 74 | */ |
| 75 | public Tree getTree() { |
| 76 | return tree; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Gets the output actions for the tree. |
| 81 | * |
| 82 | * @return The set of the pairs of Dpid and OutputAction object. |
| 83 | */ |
Toshio Koide | c963a8d | 2014-07-21 17:47:48 -0700 | [diff] [blame] | 84 | public Set<Pair<Dpid, OutputAction>> getOutputActions() { |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 85 | return outputActions; |
| 86 | } |
| 87 | } |