Interface OpenFlowSwitch

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.lang.String channelId()
      Identifies the channel used to communicate with the switch.
      java.lang.String datapathDescription()
      fetch the datapath description.
      org.onosproject.net.Device.Type deviceType()
      Returns the switch device type.
      void disconnectSwitch()
      Disconnects the switch by closing the TCP connection.
      org.projectfloodlight.openflow.protocol.OFFactory factory()
      Provides the factory for this OF version.
      default org.projectfloodlight.openflow.protocol.OFFeaturesReply features()
      Fetches the features of this switch.
      default Dpid getDpid()
      Gets the datapathId of the switch.
      long getId()
      Gets the datapathId of the switch.
      org.projectfloodlight.openflow.protocol.OFMeterFeatures getMeterFeatures()
      Fetches the meter features of this switch.
      java.util.List<org.projectfloodlight.openflow.protocol.OFPortDesc> getPorts()
      Fetches the ports of this switch.
      RoleState getRole()
      Fetch the role for this switch.
      java.lang.String getStringId()
      Gets a string version of the ID for this switch.
      void handleMessage​(org.projectfloodlight.openflow.protocol.OFMessage fromSwitch)
      Handle a message from the switch.
      java.lang.String hardwareDescription()
      fetch the hardware description.
      boolean isConnected()
      Checks if the switch is still connected.
      java.lang.String manufacturerDescription()
      fetch the manufacturer description.
      void returnRoleReply​(RoleState requested, RoleState response)
      Notifies the controller that the device has responded to a set-role request.
      void sendMsg​(java.util.List<org.projectfloodlight.openflow.protocol.OFMessage> msgs)
      Writes the OFMessage list to the driver.
      void sendMsg​(org.projectfloodlight.openflow.protocol.OFMessage msg)
      Writes the message to the driver.
      java.lang.String serialNumber()
      fetch the serial number.
      void setRole​(RoleState role)
      Sets the role for this switch.
      java.lang.String softwareDescription()
      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 controller
        response - 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