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