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 | */ |
| 41 | public Iterable<FlowPath> getFlows(IPortObject port); |
| 42 | |
| 43 | /** |
| 44 | * Reconcile all flows on inactive port (src port of link which might be |
| 45 | * broken). |
| 46 | * |
| 47 | * TODO: We need it now: Pavlin |
| 48 | * |
| 49 | * @param src_port the port that has become inactive. |
| 50 | */ |
| 51 | public void reconcileFlows(IPortObject src_port); |
| 52 | |
| 53 | /** |
| 54 | * Reconcile all flows between a source and a destination port. |
| 55 | * |
| 56 | * TODO: We don't need it for now. |
| 57 | * |
| 58 | * @param src_port the source port. |
| 59 | * @param dest_port the destination port. |
| 60 | */ |
| 61 | public void reconcileFlow(IPortObject src_port, IPortObject dest_port); |
| 62 | |
| 63 | /** |
| 64 | * Compute the shortest path between a source and a destination ports. |
| 65 | * |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 66 | * @param src_port the source port. |
| 67 | * @param dest_port the destination port. |
| 68 | * @return the computed shortest path between the source and the |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 69 | * destination ports. The flow entries in the path itself would |
| 70 | * contain the incoming port matching and the outgoing port output |
| 71 | * actions set. However, the path itself will NOT have the Flow ID, |
| 72 | * Installer ID, and any additional matching conditions for the |
| 73 | * flow entries (e.g., source or destination MAC address, etc). |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 74 | */ |
| 75 | public FlowPath computeFlowPath(IPortObject src_port, |
| 76 | IPortObject dest_port); |
| 77 | |
| 78 | /** |
| 79 | * Get all Flow Entries of a Flow. |
| 80 | * |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 81 | * @param flow the flow whose flow entries should be returned. |
| 82 | * @return the flow entries of the flow. |
| 83 | */ |
| 84 | public Iterable<FlowEntry> getFlowEntries(FlowPath flow); |
| 85 | |
| 86 | /** |
| 87 | * Install a Flow Entry on a switch. |
| 88 | * |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 89 | * @param mySwitches the DPID-to-Switch mapping for the switches |
| 90 | * controlled by this controller. |
| 91 | * @param flowEntry the flow entry to install. |
| 92 | * @return true on success, otherwise false. |
| 93 | */ |
| 94 | public boolean installFlowEntry(Map<Long, IOFSwitch> mySwitches, |
| 95 | FlowEntry flowEntry); |
| 96 | |
| 97 | /** |
| 98 | * Remove a Flow Entry from a switch. |
| 99 | * |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 100 | * @param mySwitches the DPID-to-Switch mapping for the switches |
| 101 | * controlled by this controller. |
| 102 | * @param flowEntry the flow entry to remove. |
| 103 | * @return true on success, otherwise false. |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 104 | */ |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 105 | public boolean removeFlowEntry(Map<Long, IOFSwitch> mySwitches, |
| 106 | FlowEntry flowEntry); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 107 | |
| 108 | /** |
| 109 | * Install a Flow Entry on a remote controller. |
| 110 | * |
| 111 | * TODO: We need it now: Jono |
| 112 | * - For now it will make a REST call to the remote controller. |
| 113 | * - Internally, it needs to know the name of the remote controller. |
| 114 | * |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 115 | * @param flowEntry the flow entry to install. |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 116 | * @return true on success, otherwise false. |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 117 | */ |
Pavlin Radoslavov | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 118 | public boolean installRemoteFlowEntry(FlowEntry flowEntry); |
Pavlin Radoslavov | b9fe6b4 | 2013-03-27 16:25:05 -0700 | [diff] [blame] | 119 | |
| 120 | /** |
| 121 | * Remove a flow entry on a remote controller. |
| 122 | * |
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 | 6b6f4a8 | 2013-03-28 03:30:00 -0700 | [diff] [blame] | 126 | public boolean removeRemoteFlowEntry(FlowEntry flowEntry); |
Pankaj Berde | d0ae0ff | 2013-03-26 15:37:12 -0700 | [diff] [blame] | 127 | } |