HIGUCHI Yuta | 60a1014 | 2013-06-14 15:50:10 -0700 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.flowmanager; |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 2 | |
| 3 | import java.util.ArrayList; |
| 4 | |
| 5 | import net.floodlightcontroller.core.module.IFloodlightService; |
Pavlin Radoslavov | ed0f4a8 | 2013-11-04 16:38:36 -0800 | [diff] [blame] | 6 | import net.onrc.onos.ofcontroller.topology.Topology; |
HIGUCHI Yuta | 356086e | 2013-06-12 15:21:19 -0700 | [diff] [blame] | 7 | import net.onrc.onos.ofcontroller.util.CallerId; |
| 8 | import net.onrc.onos.ofcontroller.util.DataPathEndpoints; |
Pavlin Radoslavov | 4df85ae | 2013-11-26 14:48:32 -0800 | [diff] [blame] | 9 | import net.onrc.onos.ofcontroller.util.FlowEntryId; |
HIGUCHI Yuta | 356086e | 2013-06-12 15:21:19 -0700 | [diff] [blame] | 10 | import net.onrc.onos.ofcontroller.util.FlowId; |
| 11 | import net.onrc.onos.ofcontroller.util.FlowPath; |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 12 | |
| 13 | /** |
HIGUCHI Yuta | eb567aa | 2013-10-08 19:27:35 -0700 | [diff] [blame] | 14 | * Interface for providing Flow Service to other modules. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 15 | */ |
| 16 | public 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 Radoslavov | bcc86ef | 2013-10-26 12:06:25 -0700 | [diff] [blame] | 27 | boolean addFlow(FlowPath flowPath, FlowId flowId); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 28 | |
| 29 | /** |
Pavlin Radoslavov | baea924 | 2013-05-08 00:20:09 +0000 | [diff] [blame] | 30 | * Delete all previously added flows. |
| 31 | * |
| 32 | * @return true on success, otherwise false. |
| 33 | */ |
| 34 | boolean deleteAllFlows(); |
| 35 | |
| 36 | /** |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 37 | * 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 Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 48 | * @return the Flow Path if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 49 | */ |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 50 | FlowPath getFlow(FlowId flowId); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 51 | |
| 52 | /** |
Pavlin Radoslavov | 661c86f | 2013-10-21 12:40:40 -0700 | [diff] [blame] | 53 | * 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 Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 60 | * Get all previously added flows by a specific installer for a given |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 61 | * 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 Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 65 | * @return the Flow Paths if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 66 | */ |
Pavlin Radoslavov | 706df05 | 2013-03-06 10:49:07 -0800 | [diff] [blame] | 67 | ArrayList<FlowPath> getAllFlows(CallerId installerId, |
| 68 | DataPathEndpoints dataPathEndpoints); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 69 | |
| 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 Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 74 | * @return the Flow Paths if found, otherwise null. |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 75 | */ |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 76 | ArrayList<FlowPath> getAllFlows(DataPathEndpoints dataPathEndpoints); |
Pavlin Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 77 | |
| 78 | /** |
Umesh Krishnaswamy | 57a32a9 | 2013-03-21 14:21:15 -0700 | [diff] [blame] | 79 | * Get summary of all installed flows by all installers. |
| 80 | * |
HIGUCHI Yuta | eb567aa | 2013-10-08 19:27:35 -0700 | [diff] [blame] | 81 | * @param flowId starting flow Id of the range |
| 82 | * @param maxFlows number of flows to return |
Umesh Krishnaswamy | 57a32a9 | 2013-03-21 14:21:15 -0700 | [diff] [blame] | 83 | * @return the Flow Paths if found, otherwise null. |
| 84 | */ |
Pavlin Radoslavov | 4ef6ba2 | 2013-11-22 19:32:58 -0800 | [diff] [blame] | 85 | ArrayList<FlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows); |
Umesh Krishnaswamy | 57a32a9 | 2013-03-21 14:21:15 -0700 | [diff] [blame] | 86 | |
| 87 | /** |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 88 | * Add and maintain a shortest-path flow. |
| 89 | * |
Pavlin Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 90 | * NOTE: The Flow Path argument does NOT contain all flow entries. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 91 | * 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 Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 98 | * @return the added shortest-path flow on success, otherwise null. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 99 | */ |
Pavlin Radoslavov | 1308dc6 | 2013-10-25 15:54:31 -0700 | [diff] [blame] | 100 | FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath); |
Pavlin Radoslavov | ed0f4a8 | 2013-11-04 16:38:36 -0800 | [diff] [blame] | 101 | |
| 102 | /** |
| 103 | * Get the network topology. |
| 104 | * |
| 105 | * @return the network topology. |
| 106 | */ |
| 107 | Topology getTopology(); |
Jonathan Hart | 9709991 | 2013-11-14 13:40:16 -0800 | [diff] [blame] | 108 | |
| 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 Radoslavov | 4df85ae | 2013-11-26 14:48:32 -0800 | [diff] [blame] | 116 | |
| 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 Radoslavov | 9e5344c | 2013-02-18 09:58:30 -0800 | [diff] [blame] | 123 | } |