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