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; |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 6 | import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject; |
| 7 | import net.floodlightcontroller.util.FlowEntry; |
| 8 | import net.floodlightcontroller.util.FlowPath; |
| 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 | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 87 | * @param flowEntry the flow entry to install. |
| 88 | * @return true on success, otherwise false. |
| 89 | */ |
Pavlin Radoslavov | 2b858f8 | 2013-03-28 11:37:37 -0700 | [diff] [blame] | 90 | public boolean installFlowEntry(IOFSwitch mySwitch, 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 | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 96 | * @param flowEntry the flow entry to remove. |
| 97 | * @return true on success, otherwise false. |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 98 | */ |
Pavlin Radoslavov | 2b858f8 | 2013-03-28 11:37:37 -0700 | [diff] [blame] | 99 | public boolean removeFlowEntry(IOFSwitch mySwitch, FlowEntry flowEntry); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 100 | |
| 101 | /** |
| 102 | * Install a Flow Entry on a remote controller. |
| 103 | * |
| 104 | * TODO: We need it now: Jono |
| 105 | * - For now it will make a REST call to the remote controller. |
| 106 | * - Internally, it needs to know the name of the remote controller. |
| 107 | * |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 108 | * @param flowEntry the flow entry to install. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 109 | * @return true on success, otherwise false. |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 110 | */ |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 111 | public boolean installRemoteFlowEntry(FlowEntry flowEntry); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 112 | |
| 113 | /** |
| 114 | * Remove a flow entry on a remote controller. |
| 115 | * |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 116 | * @param flowEntry the flow entry to remove. |
| 117 | * @return true on success, otherwise false. |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 118 | */ |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 119 | public boolean removeRemoteFlowEntry(FlowEntry flowEntry); |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 120 | } |