blob: d163760b318b9cbd0702265f20ee3aa125dc19e0 [file] [log] [blame]
Pankaj Berded0ae0ff2013-03-26 15:37:12 -07001package net.onrc.onos.flow;
2
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -07003import java.util.Map;
4
5import net.floodlightcontroller.core.IOFSwitch;
Pankaj Berded0ae0ff2013-03-26 15:37:12 -07006import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject;
7import net.floodlightcontroller.util.FlowEntry;
8import net.floodlightcontroller.util.FlowPath;
9
10public interface IFlowManager {
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070011 /**
12 * Create a Flow from port to port.
13 *
14 * TODO: We don't need it for now.
15 *
16 * @param src_port the source port.
17 * @param dest_port the destination port.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -070018 */
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070019 public void createFlow(IPortObject src_port, IPortObject dest_port);
20
21 /**
22 * Get all Flows matching a source and a destination port.
23 *
24 * TODO: Pankaj might be implementing it later.
25 *
26 * @param src_port the source port to match.
27 * @param dest_port the destination port to match.
28 * @return all flows matching the source and the destination port.
29 */
30 public Iterable<FlowPath> getFlows(IPortObject src_port,
31 IPortObject dest_port);
32
33 /**
34 * Get all Flows going out from a port.
35 *
36 * TODO: We need it now: Pankaj
37 *
38 * @param port the port to match.
39 * @return the list of flows that are going out from the port.
40 */
Pankaj Berde6a97eb82013-03-28 12:12:43 -070041 public Iterable<FlowPath> getOutFlows(IPortObject port);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070042
43 /**
Pavlin Radoslavove0575292013-03-28 05:35:25 -070044 * Reconcile all flows on inactive switch port.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070045 *
Pavlin Radoslavove0575292013-03-28 05:35:25 -070046 * @param portObject the port that has become inactive.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070047 */
Pavlin Radoslavove0575292013-03-28 05:35:25 -070048 public void reconcileFlows(IPortObject portObject);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070049
50 /**
51 * Reconcile all flows between a source and a destination port.
52 *
53 * TODO: We don't need it for now.
54 *
55 * @param src_port the source port.
56 * @param dest_port the destination port.
57 */
58 public void reconcileFlow(IPortObject src_port, IPortObject dest_port);
59
60 /**
61 * Compute the shortest path between a source and a destination ports.
62 *
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070063 * @param src_port the source port.
64 * @param dest_port the destination port.
65 * @return the computed shortest path between the source and the
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -070066 * destination ports. The flow entries in the path itself would
67 * contain the incoming port matching and the outgoing port output
68 * actions set. However, the path itself will NOT have the Flow ID,
69 * Installer ID, and any additional matching conditions for the
70 * flow entries (e.g., source or destination MAC address, etc).
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070071 */
72 public FlowPath computeFlowPath(IPortObject src_port,
73 IPortObject dest_port);
74
75 /**
76 * Get all Flow Entries of a Flow.
77 *
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070078 * @param flow the flow whose flow entries should be returned.
79 * @return the flow entries of the flow.
80 */
81 public Iterable<FlowEntry> getFlowEntries(FlowPath flow);
82
83 /**
84 * Install a Flow Entry on a switch.
85 *
Pavlin Radoslavov2b858f82013-03-28 11:37:37 -070086 * @param mySwitch the switch to install the Flow Entry into.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070087 * @param flowEntry the flow entry to install.
88 * @return true on success, otherwise false.
89 */
Pavlin Radoslavov2b858f82013-03-28 11:37:37 -070090 public boolean installFlowEntry(IOFSwitch mySwitch, FlowEntry flowEntry);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070091
92 /**
93 * Remove a Flow Entry from a switch.
94 *
Pavlin Radoslavov2b858f82013-03-28 11:37:37 -070095 * @param mySwitch the switch to remove the Flow Entry from.
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -070096 * @param flowEntry the flow entry to remove.
97 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -070098 */
Pavlin Radoslavov2b858f82013-03-28 11:37:37 -070099 public boolean removeFlowEntry(IOFSwitch mySwitch, FlowEntry flowEntry);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700100
101 /**
102 * Install a Flow Entry on a remote controller.
103 *
104 * TODO: We need it now: Jono
105 * - For now it will make a REST call to the remote controller.
106 * - Internally, it needs to know the name of the remote controller.
107 *
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700108 * @param flowEntry the flow entry to install.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700109 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700110 */
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700111 public boolean installRemoteFlowEntry(FlowEntry flowEntry);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700112
113 /**
114 * Remove a flow entry on a remote controller.
115 *
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700116 * @param flowEntry the flow entry to remove.
117 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700118 */
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700119 public boolean removeRemoteFlowEntry(FlowEntry flowEntry);
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700120}