blob: 7430b7ffccce5cc5abfccb00b3a04240bc78fa4f [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.api.flowmanager;
2
3import java.util.Set;
4
Ray Milkey42ae1b52014-08-15 16:37:06 -07005import net.onrc.onos.core.matchaction.MatchActionOperations;
Toshio Koidea03915e2014-07-01 18:39:52 -07006import net.onrc.onos.core.matchaction.action.OutputAction;
7import net.onrc.onos.core.matchaction.match.PacketMatch;
8import net.onrc.onos.core.util.Dpid;
9import net.onrc.onos.core.util.Pair;
10import net.onrc.onos.core.util.SwitchPort;
11
12/**
Toshio Koide7894ca02014-08-15 14:30:13 -070013 * A Flow object expressing the point-to-multipoints tree flow for the packet
Toshio Koidea03915e2014-07-01 18:39:52 -070014 * layer.
15 */
Toshio Koidefad1cd52014-08-07 17:10:07 -070016public class SingleSrcTreeFlow implements Flow {
Toshio Koide025a9152014-07-21 11:00:34 -070017 protected final FlowId id;
Toshio Koidea03915e2014-07-01 18:39:52 -070018 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 Koide025a9152014-07-21 11:00:34 -070035 this.id = new FlowId(id);
Toshio Koidea03915e2014-07-01 18:39:52 -070036 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 Koide025a9152014-07-21 11:00:34 -070046 public FlowId getId() {
Toshio Koidea03915e2014-07-01 18:39:52 -070047 return id;
48 }
49
50 @Override
51 public PacketMatch getMatch() {
52 return match;
53 }
54
55 @Override
Ray Milkey42ae1b52014-08-15 16:37:06 -070056 public MatchActionOperations compile() {
Toshio Koidea03915e2014-07-01 18:39:52 -070057 // 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 Koidec963a8d2014-07-21 17:47:48 -070084 public Set<Pair<Dpid, OutputAction>> getOutputActions() {
Toshio Koidea03915e2014-07-01 18:39:52 -070085 return outputActions;
86 }
87}