Interface OpenFlowController
-
public interface OpenFlowControllerAbstraction of an OpenFlow controller. Serves as a one stop shop for obtaining OpenFlow devices and (un)register listeners on OpenFlow events
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddClassifierListener(OpenFlowClassifierListener listener)Add OpenFlow classifier listener to runtime store of classifiers listener.voidaddEventListener(OpenFlowEventListener listener)Register a listener for OF msg events.voidaddListener(OpenFlowSwitchListener listener)Register a listener for meta events that occur to OF devices.voidaddMessageListener(OpenFlowMessageListener listener)Register a listener for all OF msg types.voidaddPacketListener(int priority, PacketListener listener)Register a listener for packet events.OpenFlowSwitchgetEqualSwitch(Dpid dpid)Returns the actual equal switch for the given Dpid, if one exists.java.lang.Iterable<OpenFlowSwitch>getEqualSwitches()Returns all equal switches known to this OF controller.OpenFlowSwitchgetMasterSwitch(Dpid dpid)Returns the actual master switch for the given Dpid, if one exists.java.lang.Iterable<OpenFlowSwitch>getMasterSwitches()Returns all master switches known to this OF controller.OpenFlowSwitchgetSwitch(Dpid dpid)Returns the actual switch for the given Dpid.java.lang.Iterable<OpenFlowSwitch>getSwitches()Returns all switches known to this OF controller.voidprocessPacket(Dpid dpid, org.projectfloodlight.openflow.protocol.OFMessage msg)Process a message and notify the appropriate listeners.voidremoveClassifierListener(OpenFlowClassifierListener listener)Remove OpenFlow classifier listener from runtime store of classifiers listener.voidremoveEventListener(OpenFlowEventListener listener)Unregister a listener.voidremoveListener(OpenFlowSwitchListener listener)Unregister a listener.voidremoveMessageListener(OpenFlowMessageListener listener)Unregister a listener for all OF msg types.voidremovePacketListener(PacketListener listener)Unregister a listener.voidsetRole(Dpid dpid, RoleState role)Sets the role for a given switch.voidwrite(Dpid dpid, org.projectfloodlight.openflow.protocol.OFMessage msg)Send a message to a particular switch.java.util.concurrent.CompletableFuture<org.projectfloodlight.openflow.protocol.OFMessage>writeResponse(Dpid dpid, org.projectfloodlight.openflow.protocol.OFMessage msg)Send a message to a particular switch and return the future response.
-
-
-
Method Detail
-
getSwitches
java.lang.Iterable<OpenFlowSwitch> getSwitches()
Returns all switches known to this OF controller.- Returns:
- Iterable of dpid elements
-
getMasterSwitches
java.lang.Iterable<OpenFlowSwitch> getMasterSwitches()
Returns all master switches known to this OF controller.- Returns:
- Iterable of dpid elements
-
getEqualSwitches
java.lang.Iterable<OpenFlowSwitch> getEqualSwitches()
Returns all equal switches known to this OF controller.- Returns:
- Iterable of dpid elements
-
getSwitch
OpenFlowSwitch getSwitch(Dpid dpid)
Returns the actual switch for the given Dpid.- Parameters:
dpid- the switch to fetch- Returns:
- the interface to this switch
-
getMasterSwitch
OpenFlowSwitch getMasterSwitch(Dpid dpid)
Returns the actual master switch for the given Dpid, if one exists.- Parameters:
dpid- the switch to fetch- Returns:
- the interface to this switch
-
getEqualSwitch
OpenFlowSwitch getEqualSwitch(Dpid dpid)
Returns the actual equal switch for the given Dpid, if one exists.- Parameters:
dpid- the switch to fetch- Returns:
- the interface to this switch
-
addListener
void addListener(OpenFlowSwitchListener listener)
Register a listener for meta events that occur to OF devices.- Parameters:
listener- the listener to notify
-
removeListener
void removeListener(OpenFlowSwitchListener listener)
Unregister a listener.- Parameters:
listener- the listener to unregister
-
addMessageListener
void addMessageListener(OpenFlowMessageListener listener)
Register a listener for all OF msg types.- Parameters:
listener- the listener to notify
-
removeMessageListener
void removeMessageListener(OpenFlowMessageListener listener)
Unregister a listener for all OF msg types.- Parameters:
listener- the listener to notify
-
addPacketListener
void addPacketListener(int priority, PacketListener listener)Register a listener for packet events.- Parameters:
priority- the importance of this listener, lower values are more importantlistener- the listener to notify
-
removePacketListener
void removePacketListener(PacketListener listener)
Unregister a listener.- Parameters:
listener- the listener to unregister
-
addEventListener
void addEventListener(OpenFlowEventListener listener)
Register a listener for OF msg events.- Parameters:
listener- the listener to notify
-
removeEventListener
void removeEventListener(OpenFlowEventListener listener)
Unregister a listener.- Parameters:
listener- the listener to unregister
-
write
void write(Dpid dpid, org.projectfloodlight.openflow.protocol.OFMessage msg)
Send a message to a particular switch.- Parameters:
dpid- the switch to send to.msg- the message to send
-
writeResponse
java.util.concurrent.CompletableFuture<org.projectfloodlight.openflow.protocol.OFMessage> writeResponse(Dpid dpid, org.projectfloodlight.openflow.protocol.OFMessage msg)
Send a message to a particular switch and return the future response.- Parameters:
dpid- the switch to send tomsg- the message to send- Returns:
- future for response message
-
processPacket
void processPacket(Dpid dpid, org.projectfloodlight.openflow.protocol.OFMessage msg)
Process a message and notify the appropriate listeners.- Parameters:
dpid- the dpid the message arrived onmsg- the message to process.
-
setRole
void setRole(Dpid dpid, RoleState role)
Sets the role for a given switch.- Parameters:
role- the desired roledpid- the switch to set the role for.
-
removeClassifierListener
void removeClassifierListener(OpenFlowClassifierListener listener)
Remove OpenFlow classifier listener from runtime store of classifiers listener.- Parameters:
listener- the OpenFlow classifier to remove
-
addClassifierListener
void addClassifierListener(OpenFlowClassifierListener listener)
Add OpenFlow classifier listener to runtime store of classifiers listener.- Parameters:
listener- the OpenFlow classifier listener
-
-