blob: ed7f7bd13beb2a06ee5ec8d80af9c1bcd4ce0586 [file] [log] [blame]
HIGUCHI Yuta60a10142013-06-14 15:50:10 -07001package net.onrc.onos.ofcontroller.flowmanager;
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -08002
3import java.util.ArrayList;
4
5import net.floodlightcontroller.core.module.IFloodlightService;
Pavlin Radoslavoved0f4a82013-11-04 16:38:36 -08006import net.onrc.onos.ofcontroller.topology.Topology;
HIGUCHI Yuta356086e2013-06-12 15:21:19 -07007import net.onrc.onos.ofcontroller.util.CallerId;
8import net.onrc.onos.ofcontroller.util.DataPathEndpoints;
Pavlin Radoslavov4df85ae2013-11-26 14:48:32 -08009import net.onrc.onos.ofcontroller.util.FlowEntryId;
HIGUCHI Yuta356086e2013-06-12 15:21:19 -070010import net.onrc.onos.ofcontroller.util.FlowId;
11import net.onrc.onos.ofcontroller.util.FlowPath;
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080012
13/**
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070014 * Interface for providing Flow Service to other modules.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080015 */
16public interface IFlowService extends IFloodlightService {
17 /**
18 * Add a flow.
19 *
20 * Internally, ONOS will automatically register the installer for
21 * receiving Flow Path Notifications for that path.
22 *
23 * @param flowPath the Flow Path to install.
24 * @param flowId the return-by-reference Flow ID as assigned internally.
25 * @return true on success, otherwise false.
26 */
Pavlin Radoslavovbcc86ef2013-10-26 12:06:25 -070027 boolean addFlow(FlowPath flowPath, FlowId flowId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080028
29 /**
Pavlin Radoslavovbaea9242013-05-08 00:20:09 +000030 * Delete all previously added flows.
31 *
32 * @return true on success, otherwise false.
33 */
34 boolean deleteAllFlows();
35
36 /**
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080037 * Delete a previously added flow.
38 *
39 * @param flowId the Flow ID of the flow to delete.
40 * @return true on success, otherwise false.
41 */
42 boolean deleteFlow(FlowId flowId);
43
44 /**
45 * Get a previously added flow.
46 *
47 * @param flowId the Flow ID of the flow to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080048 * @return the Flow Path if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080049 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080050 FlowPath getFlow(FlowId flowId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080051
52 /**
Pavlin Radoslavov661c86f2013-10-21 12:40:40 -070053 * Get all installed flows by all installers.
54 *
55 * @return the Flow Paths if found, otherwise null.
56 */
57 ArrayList<FlowPath> getAllFlows();
58
59 /**
Pavlin Radoslavov706df052013-03-06 10:49:07 -080060 * Get all previously added flows by a specific installer for a given
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080061 * data path endpoints.
62 *
63 * @param installerId the Caller ID of the installer of the flow to get.
64 * @param dataPathEndpoints the data path endpoints of the flow to get.
Pavlin Radoslavov706df052013-03-06 10:49:07 -080065 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080066 */
Pavlin Radoslavov706df052013-03-06 10:49:07 -080067 ArrayList<FlowPath> getAllFlows(CallerId installerId,
68 DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080069
70 /**
71 * Get all installed flows by all installers for given data path endpoints.
72 *
73 * @param dataPathEndpoints the data path endpoints of the flows to get.
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080074 * @return the Flow Paths if found, otherwise null.
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080075 */
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080076 ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -080077
78 /**
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070079 * Get summary of all installed flows by all installers.
80 *
HIGUCHI Yutaeb567aa2013-10-08 19:27:35 -070081 * @param flowId starting flow Id of the range
82 * @param maxFlows number of flows to return
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070083 * @return the Flow Paths if found, otherwise null.
84 */
Pavlin Radoslavov4ef6ba22013-11-22 19:32:58 -080085 ArrayList<FlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows);
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070086
87 /**
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070088 * Add and maintain a shortest-path flow.
89 *
Pavlin Radoslavove0575292013-03-28 05:35:25 -070090 * NOTE: The Flow Path argument does NOT contain all flow entries.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070091 * Instead, it contains a single dummy flow entry that is used to
92 * store the matching condition(s).
93 * That entry is replaced by the appropriate entries from the
94 * internally performed shortest-path computation.
95 *
96 * @param flowPath the Flow Path with the endpoints and the match
97 * conditions to install.
Pavlin Radoslavove0575292013-03-28 05:35:25 -070098 * @return the added shortest-path flow on success, otherwise null.
Pavlin Radoslavovb9fe6b42013-03-27 16:25:05 -070099 */
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -0700100 FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath);
Pavlin Radoslavoved0f4a82013-11-04 16:38:36 -0800101
102 /**
103 * Get the network topology.
104 *
105 * @return the network topology.
106 */
107 Topology getTopology();
Jonathan Hart97099912013-11-14 13:40:16 -0800108
109 /**
110 * Get a globally unique flow ID from the flow service.
111 * NOTE: Not currently guaranteed to be globally unique.
112 *
113 * @return unique flow ID
114 */
115 public long getNextFlowEntryId();
Pavlin Radoslavov4df85ae2013-11-26 14:48:32 -0800116
117 /**
118 * Inform the Flow Manager that a Flow Entry on switch expired.
119 *
120 * @param flowEntryId the Flow Entry ID of the expired Flow Entry.
121 */
122 public void flowEntryOnSwitchExpired(FlowEntryId flowEntryId);
Pavlin Radoslavov9e5344c2013-02-18 09:58:30 -0800123}