blob: d7ac371b5753aa2805e988f089b0557073c55523 [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 */
41 public Iterable<FlowPath> getFlows(IPortObject port);
42
43 /**
44 * Reconcile all flows on inactive port (src port of link which might be
45 * broken).
46 *
47 * TODO: We need it now: Pavlin
48 *
49 * @param src_port the port that has become inactive.
50 */
51 public void reconcileFlows(IPortObject src_port);
52
53 /**
54 * Reconcile all flows between a source and a destination port.
55 *
56 * TODO: We don't need it for now.
57 *
58 * @param src_port the source port.
59 * @param dest_port the destination port.
60 */
61 public void reconcileFlow(IPortObject src_port, IPortObject dest_port);
62
63 /**
64 * Compute the shortest path between a source and a destination ports.
65 *
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070066 * @param src_port the source port.
67 * @param dest_port the destination port.
68 * @return the computed shortest path between the source and the
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -070069 * destination ports. The flow entries in the path itself would
70 * contain the incoming port matching and the outgoing port output
71 * actions set. However, the path itself will NOT have the Flow ID,
72 * Installer ID, and any additional matching conditions for the
73 * flow entries (e.g., source or destination MAC address, etc).
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070074 */
75 public FlowPath computeFlowPath(IPortObject src_port,
76 IPortObject dest_port);
77
78 /**
79 * Get all Flow Entries of a Flow.
80 *
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070081 * @param flow the flow whose flow entries should be returned.
82 * @return the flow entries of the flow.
83 */
84 public Iterable<FlowEntry> getFlowEntries(FlowPath flow);
85
86 /**
87 * Install a Flow Entry on a switch.
88 *
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070089 * @param mySwitches the DPID-to-Switch mapping for the switches
90 * controlled by this controller.
91 * @param flowEntry the flow entry to install.
92 * @return true on success, otherwise false.
93 */
94 public boolean installFlowEntry(Map<Long, IOFSwitch> mySwitches,
95 FlowEntry flowEntry);
96
97 /**
98 * Remove a Flow Entry from a switch.
99 *
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700100 * @param mySwitches the DPID-to-Switch mapping for the switches
101 * controlled by this controller.
102 * @param flowEntry the flow entry to remove.
103 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700104 */
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700105 public boolean removeFlowEntry(Map<Long, IOFSwitch> mySwitches,
106 FlowEntry flowEntry);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700107
108 /**
109 * Install a Flow Entry on a remote controller.
110 *
111 * TODO: We need it now: Jono
112 * - For now it will make a REST call to the remote controller.
113 * - Internally, it needs to know the name of the remote controller.
114 *
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700115 * @param flowEntry the flow entry to install.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700116 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700117 */
Pavlin Radoslavov6b6f4a82013-03-28 03:30:00 -0700118 public boolean installRemoteFlowEntry(FlowEntry flowEntry);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700119
120 /**
121 * Remove a flow entry on a remote controller.
122 *
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 Radoslavov6b6f4a82013-03-28 03:30:00 -0700126 public boolean removeRemoteFlowEntry(FlowEntry flowEntry);
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700127}