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