blob: f2f9d494a0aa387d1b867991a4905795ad4b557e [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 *
66 * TODO: We need it now: Pavlin
67 *
68 * @param src_port the source port.
69 * @param dest_port the destination port.
70 * @return the computed shortest path between the source and the
71 * destination ports.
72 */
73 public FlowPath computeFlowPath(IPortObject src_port,
74 IPortObject dest_port);
75
76 /**
77 * Get all Flow Entries of a Flow.
78 *
79 * TODO: We need it now: Pavlin
80 *
81 * @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 *
89 * TODO: We need it now: Pavlin
90 * - Install only for local switches
91 * - It will call the installRemoteFlowEntry() for remote switches.
92 * - To be called by reconcileFlow()
93 *
94 * @param mySwitches the DPID-to-Switch mapping for the switches
95 * controlled by this controller.
96 * @param flowEntry the flow entry to install.
97 * @return true on success, otherwise false.
98 */
99 public boolean installFlowEntry(Map<Long, IOFSwitch> mySwitches,
100 FlowEntry flowEntry);
101
102 /**
103 * Remove a Flow Entry from a switch.
104 *
105 * TODO: We need it now: Pavlin
106 * - Remove only for local switches
107 * - It will call the removeRemoteFlowEntry() for remote switches.
108 * - To be called by reconcileFlow()
109 *
110 * @param entry the flow entry to remove.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700111 */
112 public void removeFlowEntry(FlowEntry entry);
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700113
114 /**
115 * Install a Flow Entry on a remote controller.
116 *
117 * TODO: We need it now: Jono
118 * - For now it will make a REST call to the remote controller.
119 * - Internally, it needs to know the name of the remote controller.
120 *
121 * @param entry the flow entry to install.
122 * @return true on success, otherwise false.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700123 */
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700124 public boolean installRemoteFlowEntry(FlowEntry entry);
125
126 /**
127 * Remove a flow entry on a remote controller.
128 *
129 * TODO: We need it now: Jono
130 * - For now it will make a REST call to the remote controller.
131 * - Internally, it needs to know the name of the remote controller.
132 *
133 * @param entry the flow entry to remove.
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700134 */
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -0700135 public void removeRemoteFlowEntry(FlowEntry entry);
Pankaj Berded0ae0ff2013-03-26 15:37:12 -0700136}