blob: 743f8fbcae769d12f9906fb22ebcadc0d4107b62 [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 Radoslavov67b3ef32013-04-03 02:44:48 -070087 * @param flowPath the flow path for the flow entry to install.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070088 * @param flowEntry the flow entry to install.
89 * @return true on success, otherwise false.
90 */
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -070091 public boolean installFlowEntry(IOFSwitch mySwitch, FlowPath flowPath,
92 FlowEntry flowEntry);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070093
94 /**
95 * Remove a Flow Entry from a switch.
96 *
Pavlin Radoslavov2b858f82013-03-28 11:37:37 -070097 * @param mySwitch the switch to remove the Flow Entry from.
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -070098 * @param flowPath the flow path for the flow entry to remove.
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -070099 * @param flowEntry the flow entry to remove.
100 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700101 */
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700102 public boolean removeFlowEntry(IOFSwitch mySwitch, FlowPath flowPath,
103 FlowEntry flowEntry);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700104
105 /**
106 * Install a Flow Entry on a remote controller.
107 *
108 * TODO: We need it now: Jono
109 * - For now it will make a REST call to the remote controller.
110 * - Internally, it needs to know the name of the remote controller.
111 *
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700112 * @param flowPath the flow path for the flow entry to install.
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700113 * @param flowEntry the flow entry to install.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700114 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700115 */
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700116 public boolean installRemoteFlowEntry(FlowPath flowPath,
117 FlowEntry flowEntry);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700118
119 /**
120 * Remove a flow entry on a remote controller.
121 *
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700122 * @param flowPath the flow path for the flow entry to remove.
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700123 * @param flowEntry the flow entry to remove.
124 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700125 */
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700126 public boolean removeRemoteFlowEntry(FlowPath flowPath,
127 FlowEntry flowEntry);
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700128}