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