Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 1 | package net.onrc.onos.flow; |
| 2 | |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 3 | import net.floodlightcontroller.core.IOFSwitch; |
HIGUCHI Yuta | 2051490 | 2013-06-12 11:24:16 -0700 | [diff] [blame] | 4 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject; |
HIGUCHI Yuta | 356086e | 2013-06-12 15:21:19 -0700 | [diff] [blame] | 5 | import net.onrc.onos.ofcontroller.util.FlowEntry; |
| 6 | import net.onrc.onos.ofcontroller.util.FlowPath; |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 7 | |
| 8 | public interface IFlowManager { |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 9 | /** |
| 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 Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 16 | */ |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 17 | 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 Berde | 6a97eb8 | 2013-03-28 12:12:43 -0700 | [diff] [blame] | 39 | public Iterable<FlowPath> getOutFlows(IPortObject port); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 40 | |
| 41 | /** |
Pavlin Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 42 | * Reconcile all flows on inactive switch port. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 43 | * |
Pavlin Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 44 | * @param portObject the port that has become inactive. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 45 | */ |
Pavlin Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 46 | public void reconcileFlows(IPortObject portObject); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 47 | |
| 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 Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 61 | * @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 Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 64 | * 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 Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 69 | */ |
| 70 | public FlowPath computeFlowPath(IPortObject src_port, |
| 71 | IPortObject dest_port); |
| 72 | |
| 73 | /** |
| 74 | * Get all Flow Entries of a Flow. |
| 75 | * |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 76 | * @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 Radoslavov | 2b858f8 | 2013-03-28 11:37:37 -0700 | [diff] [blame] | 84 | * @param mySwitch the switch to install the Flow Entry into. |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 85 | * @param flowPath the flow path for the flow entry to install. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 86 | * @param flowEntry the flow entry to install. |
| 87 | * @return true on success, otherwise false. |
| 88 | */ |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 89 | public boolean installFlowEntry(IOFSwitch mySwitch, FlowPath flowPath, |
| 90 | FlowEntry flowEntry); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 91 | |
| 92 | /** |
| 93 | * Remove a Flow Entry from a switch. |
| 94 | * |
Pavlin Radoslavov | 2b858f8 | 2013-03-28 11:37:37 -0700 | [diff] [blame] | 95 | * @param mySwitch the switch to remove the Flow Entry from. |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 96 | * @param flowPath the flow path for the flow entry to remove. |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 97 | * @param flowEntry the flow entry to remove. |
| 98 | * @return true on success, otherwise false. |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 99 | */ |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 100 | public boolean removeFlowEntry(IOFSwitch mySwitch, FlowPath flowPath, |
| 101 | FlowEntry flowEntry); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 102 | |
| 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 Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 110 | * @param flowPath the flow path for the flow entry to install. |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 111 | * @param flowEntry the flow entry to install. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 112 | * @return true on success, otherwise false. |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 113 | */ |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 114 | public boolean installRemoteFlowEntry(FlowPath flowPath, |
| 115 | FlowEntry flowEntry); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 116 | |
| 117 | /** |
| 118 | * Remove a flow entry on a remote controller. |
| 119 | * |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 120 | * @param flowPath the flow path for the flow entry to remove. |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 121 | * @param flowEntry the flow entry to remove. |
| 122 | * @return true on success, otherwise false. |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 123 | */ |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 124 | public boolean removeRemoteFlowEntry(FlowPath flowPath, |
| 125 | FlowEntry flowEntry); |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 126 | } |