blob: 570120f8c569c0a3eb7ae5e242642f37150c2029 [file] [log] [blame]
Naoki Shiotaaea88582013-11-12 17:58:34 -08001package net.onrc.onos.ofcontroller.flowprogrammer;
Naoki Shiota8ee48d52013-11-11 15:51:17 -08002
Naoki Shiotac1601d32013-11-20 10:47:34 -08003import org.openflow.protocol.OFBarrierReply;
4import org.openflow.protocol.OFMessage;
5
Naoki Shiota8ee48d52013-11-11 15:51:17 -08006import net.floodlightcontroller.core.IOFSwitch;
Naoki Shiotac1601d32013-11-20 10:47:34 -08007import net.floodlightcontroller.core.internal.OFMessageFuture;
Naoki Shiota8ee48d52013-11-11 15:51:17 -08008import net.floodlightcontroller.core.module.IFloodlightService;
Brian O'Connor8c166a72013-11-14 18:41:48 -08009import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
10import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
11import net.onrc.onos.ofcontroller.util.FlowEntry;
12import net.onrc.onos.ofcontroller.util.FlowPath;
Naoki Shiota8ee48d52013-11-11 15:51:17 -080013
Naoki Shiota8ee48d52013-11-11 15:51:17 -080014public interface IFlowPusherService extends IFloodlightService {
15 /**
Naoki Shiota2e36d802013-11-25 16:14:43 -080016 * Create a queue correspondent to the switch.
17 * @param sw Switch to which new queue is attached.
18 * @return true if new queue is successfully created.
19 */
20 boolean createQueue(IOFSwitch sw);
21
22 /**
23 * Delete a queue correspondent to the switch.
24 * Messages remains in queue will be all sent before queue is deleted.
25 * @param sw Switch of which queue is deleted.
26 * @return true if queue is successfully deleted.
27 */
28 boolean deleteQueue(IOFSwitch sw);
29
30 /**
31 * Delete a queue correspondent to the switch.
32 * By setting force flag on, queue will be deleted immediately.
33 * @param sw Switch of which queue is deleted.
34 * @param force If this flag is on, queue will be deleted immediately
35 * regardless of any messages in the queue.
36 * @return true if queue is successfully deleted.
37 */
38 boolean deleteQueue(IOFSwitch sw, boolean force);
39
40 /**
Naoki Shiotac1601d32013-11-20 10:47:34 -080041 * Add a message to the queue of the switch.
42 * @param sw Switch to which message is pushed.
43 * @param msg Message object to be added.
44 * @return true if message is successfully added to a queue.
Naoki Shiota8ee48d52013-11-11 15:51:17 -080045 */
Brian O'Connor8c166a72013-11-14 18:41:48 -080046 boolean add(IOFSwitch sw, OFMessage msg);
Naoki Shiotac1601d32013-11-20 10:47:34 -080047
48 /**
49 * Create a message from FlowEntry and add it to the queue of the switch.
50 * @param sw Switch to which message is pushed.
51 * @param flowPath FlowPath object used for creating message.
52 * @param flowEntry FlowEntry object used for creating message.
53 * @return true if message is successfully added to a queue.
54 */
Brian O'Connor8c166a72013-11-14 18:41:48 -080055 boolean add(IOFSwitch sw, FlowPath flowPath, FlowEntry flowEntry);
Naoki Shiotac1601d32013-11-20 10:47:34 -080056
57 /**
58 * Create a message from IFlowEntry and add it to the queue of the switch.
59 * @param sw Switch to which message is pushed.
60 * @param flowObj IFlowPath object used for creating message.
61 * @param flowEntryObj IFlowEntry object used for creating message.
62 * @return true if message is successfully added to a queue.
63 */
Brian O'Connor8c166a72013-11-14 18:41:48 -080064 boolean add(IOFSwitch sw, IFlowPath flowObj, IFlowEntry flowEntryObj);
Naoki Shiotac1601d32013-11-20 10:47:34 -080065
66 /**
Naoki Shiota2e36d802013-11-25 16:14:43 -080067 * Set sending rate to a switch.
68 * @param sw Switch.
69 * @param rate Rate in bytes/ms.
70 */
71 public void setRate(IOFSwitch sw, long rate);
72
73 /**
Naoki Shiotac1601d32013-11-20 10:47:34 -080074 * Add BARRIER message to queue and wait for reply.
75 * @param sw Switch to which barrier message is pushed.
76 * @return BARRIER_REPLY message sent from switch.
77 */
78 OFBarrierReply barrier(IOFSwitch sw);
79
80 /**
81 * Add BARRIER message to queue asynchronously.
82 * @param sw Switch to which barrier message is pushed.
83 * @return Future object of BARRIER_REPLY message which will be sent from switch.
84 */
85 OFMessageFuture<OFBarrierReply> barrierAsync(IOFSwitch sw);
Naoki Shiota8ee48d52013-11-11 15:51:17 -080086
87 /**
88 * Suspend pushing message to a switch.
Naoki Shiotac1601d32013-11-20 10:47:34 -080089 * @param sw Switch to be suspended pushing message.
Naoki Shiota8ee48d52013-11-11 15:51:17 -080090 * @return true if success
91 */
Brian O'Connor8c166a72013-11-14 18:41:48 -080092 boolean suspend(IOFSwitch sw);
Naoki Shiota8ee48d52013-11-11 15:51:17 -080093
94 /**
95 * Resume pushing message to a switch.
Naoki Shiotac1601d32013-11-20 10:47:34 -080096 * @param sw Switch to be resumed pushing message.
Naoki Shiota8ee48d52013-11-11 15:51:17 -080097 * @return true if success
98 */
Brian O'Connor8c166a72013-11-14 18:41:48 -080099 boolean resume(IOFSwitch sw);
Naoki Shiota8ee48d52013-11-11 15:51:17 -0800100
101 /**
102 * Get whether pushing of message is suspended or not.
Naoki Shiotac1601d32013-11-20 10:47:34 -0800103 * @param sw Switch to be checked.
104 * @return true if suspended.
Naoki Shiota8ee48d52013-11-11 15:51:17 -0800105 */
Brian O'Connor8c166a72013-11-14 18:41:48 -0800106 boolean isSuspended(IOFSwitch sw);
Naoki Shiota8ee48d52013-11-11 15:51:17 -0800107}