Interface OpenFlowSwitch
-
- All Known Subinterfaces:
OpenFlowOpticalSwitch,OpenFlowSwitchDriver
- All Known Implementing Classes:
AbstractOpenFlowSwitch
public interface OpenFlowSwitchRepresents to provider facing side of a switch.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.StringchannelId()Identifies the channel used to communicate with the switch.java.lang.StringdatapathDescription()fetch the datapath description.org.onosproject.net.Device.TypedeviceType()Returns the switch device type.voiddisconnectSwitch()Disconnects the switch by closing the TCP connection.org.projectfloodlight.openflow.protocol.OFFactoryfactory()Provides the factory for this OF version.default org.projectfloodlight.openflow.protocol.OFFeaturesReplyfeatures()Fetches the features of this switch.default DpidgetDpid()Gets the datapathId of the switch.longgetId()Gets the datapathId of the switch.org.projectfloodlight.openflow.protocol.OFMeterFeaturesgetMeterFeatures()Fetches the meter features of this switch.java.util.List<org.projectfloodlight.openflow.protocol.OFPortDesc>getPorts()Fetches the ports of this switch.RoleStategetRole()Fetch the role for this switch.java.lang.StringgetStringId()Gets a string version of the ID for this switch.voidhandleMessage(org.projectfloodlight.openflow.protocol.OFMessage fromSwitch)Handle a message from the switch.java.lang.StringhardwareDescription()fetch the hardware description.booleanisConnected()Checks if the switch is still connected.java.lang.StringmanufacturerDescription()fetch the manufacturer description.voidreturnRoleReply(RoleState requested, RoleState response)Notifies the controller that the device has responded to a set-role request.voidsendMsg(java.util.List<org.projectfloodlight.openflow.protocol.OFMessage> msgs)Writes the OFMessage list to the driver.voidsendMsg(org.projectfloodlight.openflow.protocol.OFMessage msg)Writes the message to the driver.java.lang.StringserialNumber()fetch the serial number.voidsetRole(RoleState role)Sets the role for this switch.java.lang.StringsoftwareDescription()fetch the software description.
-
-
-
Method Detail
-
sendMsg
void sendMsg(org.projectfloodlight.openflow.protocol.OFMessage msg)
Writes the message to the driver.Note: Messages may be silently dropped/lost due to IOExceptions or role. If this is a concern, then a caller should use barriers.
- Parameters:
msg- the message to write
-
sendMsg
void sendMsg(java.util.List<org.projectfloodlight.openflow.protocol.OFMessage> msgs)
Writes the OFMessage list to the driver.Note: Messages may be silently dropped/lost due to IOExceptions or role. If this is a concern, then a caller should use barriers.
- Parameters:
msgs- the messages to be written
-
handleMessage
void handleMessage(org.projectfloodlight.openflow.protocol.OFMessage fromSwitch)
Handle a message from the switch.- Parameters:
fromSwitch- the message to handle
-
setRole
void setRole(RoleState role)
Sets the role for this switch.- Parameters:
role- the role to set.
-
getRole
RoleState getRole()
Fetch the role for this switch.- Returns:
- the role.
-
getPorts
java.util.List<org.projectfloodlight.openflow.protocol.OFPortDesc> getPorts()
Fetches the ports of this switch.- Returns:
- unmodifiable list of the ports.
-
getMeterFeatures
org.projectfloodlight.openflow.protocol.OFMeterFeatures getMeterFeatures()
Fetches the meter features of this switch.- Returns:
- unmodifiable meter features
-
features
default org.projectfloodlight.openflow.protocol.OFFeaturesReply features()
Fetches the features of this switch.- Returns:
- unmodifiable features
-
factory
org.projectfloodlight.openflow.protocol.OFFactory factory()
Provides the factory for this OF version.- Returns:
- OF version specific factory.
-
getStringId
java.lang.String getStringId()
Gets a string version of the ID for this switch.- Returns:
- string version of the ID
-
getId
long getId()
Gets the datapathId of the switch.- Returns:
- the switch dpid in long format
-
getDpid
default Dpid getDpid()
Gets the datapathId of the switch.- Returns:
- the switch dpid
-
manufacturerDescription
java.lang.String manufacturerDescription()
fetch the manufacturer description.- Returns:
- the description
-
datapathDescription
java.lang.String datapathDescription()
fetch the datapath description.- Returns:
- the description
-
hardwareDescription
java.lang.String hardwareDescription()
fetch the hardware description.- Returns:
- the description
-
softwareDescription
java.lang.String softwareDescription()
fetch the software description.- Returns:
- the description
-
serialNumber
java.lang.String serialNumber()
fetch the serial number.- Returns:
- the serial
-
isConnected
boolean isConnected()
Checks if the switch is still connected.- Returns:
- whether the switch is still connected
-
disconnectSwitch
void disconnectSwitch()
Disconnects the switch by closing the TCP connection. Results in a call to the channel handler's channelDisconnected method for cleanup
-
returnRoleReply
void returnRoleReply(RoleState requested, RoleState response)
Notifies the controller that the device has responded to a set-role request.- Parameters:
requested- the role requested by the controllerresponse- the role set at the device
-
deviceType
org.onosproject.net.Device.Type deviceType()
Returns the switch device type.- Returns:
- device type
-
channelId
java.lang.String channelId()
Identifies the channel used to communicate with the switch.- Returns:
- string representation of the connection to the device
-
-