blob: 598da85ecb42c3677ae8733da328661a63e983d8 [file] [log] [blame]
Pankaj Berded0ae0ff2013-03-26 15:37:12 -07001package net.onrc.onos.flow;
2
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -07003import net.floodlightcontroller.core.IOFSwitch;
HIGUCHI Yuta20514902013-06-12 11:24:16 -07004import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
HIGUCHI Yuta356086e2013-06-12 15:21:19 -07005import net.onrc.onos.ofcontroller.util.FlowEntry;
6import net.onrc.onos.ofcontroller.util.FlowPath;
Pankaj Berded0ae0ff2013-03-26 15:37:12 -07007
8public interface IFlowManager {
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -07009 /**
10 * Create a Flow from port to port.
11 *
12 * TODO: We don't need it for now.
13 *
14 * @param src_port the source port.
15 * @param dest_port the destination port.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -070016 */
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070017 public void createFlow(IPortObject src_port, IPortObject dest_port);
18
19 /**
20 * Get all Flows matching a source and a destination port.
21 *
22 * TODO: Pankaj might be implementing it later.
23 *
24 * @param src_port the source port to match.
25 * @param dest_port the destination port to match.
26 * @return all flows matching the source and the destination port.
27 */
28 public Iterable<FlowPath> getFlows(IPortObject src_port,
29 IPortObject dest_port);
30
31 /**
32 * Get all Flows going out from a port.
33 *
34 * TODO: We need it now: Pankaj
35 *
36 * @param port the port to match.
37 * @return the list of flows that are going out from the port.
38 */
Pankaj Berde6a97eb82013-03-28 12:12:43 -070039 public Iterable<FlowPath> getOutFlows(IPortObject port);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070040
41 /**
Pavlin Radoslavove0575292013-03-28 05:35:25 -070042 * Reconcile all flows on inactive switch port.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070043 *
Pavlin Radoslavove0575292013-03-28 05:35:25 -070044 * @param portObject the port that has become inactive.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070045 */
Pavlin Radoslavove0575292013-03-28 05:35:25 -070046 public void reconcileFlows(IPortObject portObject);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070047
48 /**
49 * Reconcile all flows between a source and a destination port.
50 *
51 * TODO: We don't need it for now.
52 *
53 * @param src_port the source port.
54 * @param dest_port the destination port.
55 */
56 public void reconcileFlow(IPortObject src_port, IPortObject dest_port);
57
58 /**
59 * Compute the shortest path between a source and a destination ports.
60 *
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070061 * @param src_port the source port.
62 * @param dest_port the destination port.
63 * @return the computed shortest path between the source and the
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -070064 * destination ports. The flow entries in the path itself would
65 * contain the incoming port matching and the outgoing port output
66 * actions set. However, the path itself will NOT have the Flow ID,
67 * Installer ID, and any additional matching conditions for the
68 * flow entries (e.g., source or destination MAC address, etc).
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070069 */
70 public FlowPath computeFlowPath(IPortObject src_port,
71 IPortObject dest_port);
72
73 /**
74 * Get all Flow Entries of a Flow.
75 *
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070076 * @param flow the flow whose flow entries should be returned.
77 * @return the flow entries of the flow.
78 */
79 public Iterable<FlowEntry> getFlowEntries(FlowPath flow);
80
81 /**
82 * Install a Flow Entry on a switch.
83 *
Pavlin Radoslavov2b858f82013-03-28 11:37:37 -070084 * @param mySwitch the switch to install the Flow Entry into.
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -070085 * @param flowPath the flow path for the flow entry to install.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070086 * @param flowEntry the flow entry to install.
87 * @return true on success, otherwise false.
88 */
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -070089 public boolean installFlowEntry(IOFSwitch mySwitch, FlowPath flowPath,
90 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 Radoslavov67b3ef32013-04-03 02:44:48 -070096 * @param flowPath the flow path for the flow entry to remove.
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -070097 * @param flowEntry the flow entry to remove.
98 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -070099 */
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700100 public boolean removeFlowEntry(IOFSwitch mySwitch, FlowPath flowPath,
101 FlowEntry flowEntry);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700102
103 /**
104 * Install a Flow Entry on a remote controller.
105 *
106 * TODO: We need it now: Jono
107 * - For now it will make a REST call to the remote controller.
108 * - Internally, it needs to know the name of the remote controller.
109 *
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700110 * @param flowPath the flow path for the flow entry to install.
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700111 * @param flowEntry the flow entry to install.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700112 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700113 */
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700114 public boolean installRemoteFlowEntry(FlowPath flowPath,
115 FlowEntry flowEntry);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700116
117 /**
118 * Remove a flow entry on a remote controller.
119 *
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700120 * @param flowPath the flow path for the flow entry to remove.
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700121 * @param flowEntry the flow entry to remove.
122 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700123 */
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700124 public boolean removeRemoteFlowEntry(FlowPath flowPath,
125 FlowEntry flowEntry);
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700126}