blob: 94d6e357c4130531b9e54db914e17c551fd9b020 [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 Shiotac1601d32013-11-20 10:47:34 -080016 * Add a message to the queue of the switch.
17 * @param sw Switch to which message is pushed.
18 * @param msg Message object to be added.
19 * @return true if message is successfully added to a queue.
Naoki Shiota8ee48d52013-11-11 15:51:17 -080020 */
Brian O'Connor8c166a72013-11-14 18:41:48 -080021 boolean add(IOFSwitch sw, OFMessage msg);
Naoki Shiotac1601d32013-11-20 10:47:34 -080022
23 /**
24 * Create a message from FlowEntry and add it to the queue of the switch.
25 * @param sw Switch to which message is pushed.
26 * @param flowPath FlowPath object used for creating message.
27 * @param flowEntry FlowEntry object used for creating message.
28 * @return true if message is successfully added to a queue.
29 */
Brian O'Connor8c166a72013-11-14 18:41:48 -080030 boolean add(IOFSwitch sw, FlowPath flowPath, FlowEntry flowEntry);
Naoki Shiotac1601d32013-11-20 10:47:34 -080031
32 /**
33 * Create a message from IFlowEntry and add it to the queue of the switch.
34 * @param sw Switch to which message is pushed.
35 * @param flowObj IFlowPath object used for creating message.
36 * @param flowEntryObj IFlowEntry object used for creating message.
37 * @return true if message is successfully added to a queue.
38 */
Brian O'Connor8c166a72013-11-14 18:41:48 -080039 boolean add(IOFSwitch sw, IFlowPath flowObj, IFlowEntry flowEntryObj);
Naoki Shiotac1601d32013-11-20 10:47:34 -080040
41 /**
42 * Add BARRIER message to queue and wait for reply.
43 * @param sw Switch to which barrier message is pushed.
44 * @return BARRIER_REPLY message sent from switch.
45 */
46 OFBarrierReply barrier(IOFSwitch sw);
47
48 /**
49 * Add BARRIER message to queue asynchronously.
50 * @param sw Switch to which barrier message is pushed.
51 * @return Future object of BARRIER_REPLY message which will be sent from switch.
52 */
53 OFMessageFuture<OFBarrierReply> barrierAsync(IOFSwitch sw);
Naoki Shiota8ee48d52013-11-11 15:51:17 -080054
55 /**
56 * Suspend pushing message to a switch.
Naoki Shiotac1601d32013-11-20 10:47:34 -080057 * @param sw Switch to be suspended pushing message.
Naoki Shiota8ee48d52013-11-11 15:51:17 -080058 * @return true if success
59 */
Brian O'Connor8c166a72013-11-14 18:41:48 -080060 boolean suspend(IOFSwitch sw);
Naoki Shiota8ee48d52013-11-11 15:51:17 -080061
62 /**
63 * Resume pushing message to a switch.
Naoki Shiotac1601d32013-11-20 10:47:34 -080064 * @param sw Switch to be resumed pushing message.
Naoki Shiota8ee48d52013-11-11 15:51:17 -080065 * @return true if success
66 */
Brian O'Connor8c166a72013-11-14 18:41:48 -080067 boolean resume(IOFSwitch sw);
Naoki Shiota8ee48d52013-11-11 15:51:17 -080068
69 /**
70 * Get whether pushing of message is suspended or not.
Naoki Shiotac1601d32013-11-20 10:47:34 -080071 * @param sw Switch to be checked.
72 * @return true if suspended.
Naoki Shiota8ee48d52013-11-11 15:51:17 -080073 */
Brian O'Connor8c166a72013-11-14 18:41:48 -080074 boolean isSuspended(IOFSwitch sw);
Naoki Shiota8ee48d52013-11-11 15:51:17 -080075}