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 java.util.Map; |
| 4 | |
| 5 | import net.floodlightcontroller.core.IOFSwitch; |
HIGUCHI Yuta | 2051490 | 2013-06-12 11:24:16 -0700 | [diff] [blame] | 6 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject; |
HIGUCHI Yuta | 356086e | 2013-06-12 15:21:19 -0700 | [diff] [blame^] | 7 | import net.onrc.onos.ofcontroller.util.FlowEntry; |
| 8 | import net.onrc.onos.ofcontroller.util.FlowPath; |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 9 | |
| 10 | public interface IFlowManager { |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 11 | /** |
| 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 Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 18 | */ |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 19 | 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 | */ |
Pankaj Berde | 6a97eb8 | 2013-03-28 12:12:43 -0700 | [diff] [blame] | 41 | public Iterable<FlowPath> getOutFlows(IPortObject port); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 42 | |
| 43 | /** |
Pavlin Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 44 | * Reconcile all flows on inactive switch port. |
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 | * @param portObject the port that has become inactive. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 47 | */ |
Pavlin Radoslavov | e057529 | 2013-03-28 05:35:25 -0700 | [diff] [blame] | 48 | public void reconcileFlows(IPortObject portObject); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 49 | |
| 50 | /** |
| 51 | * Reconcile all flows between a source and a destination port. |
| 52 | * |
| 53 | * TODO: We don't need it for now. |
| 54 | * |
| 55 | * @param src_port the source port. |
| 56 | * @param dest_port the destination port. |
| 57 | */ |
| 58 | public void reconcileFlow(IPortObject src_port, IPortObject dest_port); |
| 59 | |
| 60 | /** |
| 61 | * Compute the shortest path between a source and a destination ports. |
| 62 | * |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 63 | * @param src_port the source port. |
| 64 | * @param dest_port the destination port. |
| 65 | * @return the computed shortest path between the source and the |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 66 | * destination ports. The flow entries in the path itself would |
| 67 | * contain the incoming port matching and the outgoing port output |
| 68 | * actions set. However, the path itself will NOT have the Flow ID, |
| 69 | * Installer ID, and any additional matching conditions for the |
| 70 | * flow entries (e.g., source or destination MAC address, etc). |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 71 | */ |
| 72 | public FlowPath computeFlowPath(IPortObject src_port, |
| 73 | IPortObject dest_port); |
| 74 | |
| 75 | /** |
| 76 | * Get all Flow Entries of a Flow. |
| 77 | * |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 78 | * @param flow the flow whose flow entries should be returned. |
| 79 | * @return the flow entries of the flow. |
| 80 | */ |
| 81 | public Iterable<FlowEntry> getFlowEntries(FlowPath flow); |
| 82 | |
| 83 | /** |
| 84 | * Install a Flow Entry on a switch. |
| 85 | * |
Pavlin Radoslavov | 2b858f8 | 2013-03-28 11:37:37 -0700 | [diff] [blame] | 86 | * @param mySwitch the switch to install the Flow Entry into. |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 87 | * @param flowPath the flow path for the flow entry to install. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 88 | * @param flowEntry the flow entry to install. |
| 89 | * @return true on success, otherwise false. |
| 90 | */ |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 91 | public boolean installFlowEntry(IOFSwitch mySwitch, FlowPath flowPath, |
| 92 | FlowEntry flowEntry); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 93 | |
| 94 | /** |
| 95 | * Remove a Flow Entry from a switch. |
| 96 | * |
Pavlin Radoslavov | 2b858f8 | 2013-03-28 11:37:37 -0700 | [diff] [blame] | 97 | * @param mySwitch the switch to remove the Flow Entry from. |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 98 | * @param flowPath the flow path for the flow entry to remove. |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 99 | * @param flowEntry the flow entry to remove. |
| 100 | * @return true on success, otherwise false. |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 101 | */ |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 102 | public boolean removeFlowEntry(IOFSwitch mySwitch, FlowPath flowPath, |
| 103 | FlowEntry flowEntry); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 104 | |
| 105 | /** |
| 106 | * Install a Flow Entry on a remote controller. |
| 107 | * |
| 108 | * TODO: We need it now: Jono |
| 109 | * - For now it will make a REST call to the remote controller. |
| 110 | * - Internally, it needs to know the name of the remote controller. |
| 111 | * |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 112 | * @param flowPath the flow path for the flow entry to install. |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 113 | * @param flowEntry the flow entry to install. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 114 | * @return true on success, otherwise false. |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 115 | */ |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 116 | public boolean installRemoteFlowEntry(FlowPath flowPath, |
| 117 | FlowEntry flowEntry); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 118 | |
| 119 | /** |
| 120 | * Remove a flow entry on a remote controller. |
| 121 | * |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 122 | * @param flowPath the flow path for the flow entry to remove. |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 123 | * @param flowEntry the flow entry to remove. |
| 124 | * @return true on success, otherwise false. |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 125 | */ |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 126 | public boolean removeRemoteFlowEntry(FlowPath flowPath, |
| 127 | FlowEntry flowEntry); |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 128 | } |