Interface OpenFlowSwitchDriver

  • All Superinterfaces:
    org.onosproject.net.driver.Behaviour, org.onosproject.net.driver.HandlerBehaviour, OpenFlowSwitch
    All Known Implementing Classes:
    AbstractOpenFlowSwitch

    public interface OpenFlowSwitchDriver
    extends OpenFlowSwitch, org.onosproject.net.driver.HandlerBehaviour
    Represents the driver side of an OpenFlow switch. This interface should never be exposed to consumers.
    • Method Detail

      • setAgent

        void setAgent​(OpenFlowAgent agent)
        Sets the OpenFlow agent to be used. This method can only be called once.
        Parameters:
        agent - the agent to set.
      • setRoleHandler

        void setRoleHandler​(RoleHandler roleHandler)
        Sets the Role handler object. This method can only be called once.
        Parameters:
        roleHandler - the roleHandler class
      • reassertRole

        void reassertRole()
        Reasserts this controllers role to the switch. Useful in cases where the switch no longer agrees that this controller has the role it claims.
      • handleRoleError

        boolean handleRoleError​(org.projectfloodlight.openflow.protocol.OFErrorMsg error)
        Handle the situation where the role request triggers an error.
        Parameters:
        error - the error to handle.
        Returns:
        true if handled, false if not.
      • handleNiciraRole

        void handleNiciraRole​(org.projectfloodlight.openflow.protocol.OFMessage m)
                       throws SwitchStateException
        If this driver know of Nicira style role messages, these should be handled here.
        Parameters:
        m - the role message to handle.
        Throws:
        SwitchStateException - if the message received was not a nicira role or was malformed.
      • handleRole

        void handleRole​(org.projectfloodlight.openflow.protocol.OFMessage m)
                 throws SwitchStateException
        Handle OF 1.x (where x > 0) role messages.
        Parameters:
        m - the role message to handle
        Throws:
        SwitchStateException - if the message received was not a nicira role or was malformed.
      • connectSwitch

        boolean connectSwitch()
        Announce to the OpenFlow agent that this switch has connected.
        Returns:
        true if successful, false if duplicate switch.
      • activateMasterSwitch

        boolean activateMasterSwitch()
        Activate this MASTER switch-controller relationship in the OF agent.
        Returns:
        true is successful, false is switch has not connected or is unknown to the system.
      • activateEqualSwitch

        boolean activateEqualSwitch()
        Activate this EQUAL switch-controller relationship in the OF agent.
        Returns:
        true is successful, false is switch has not connected or is unknown to the system.
      • transitionToEqualSwitch

        void transitionToEqualSwitch()
        Transition this switch-controller relationship to an EQUAL state.
      • transitionToMasterSwitch

        void transitionToMasterSwitch()
        Transition this switch-controller relationship to an Master state.
      • removeConnectedSwitch

        void removeConnectedSwitch()
        Remove this switch from the openflow agent.
      • setPortDescReply

        void setPortDescReply​(org.projectfloodlight.openflow.protocol.OFPortDescStatsReply portDescReply)
        Sets the ports on this switch.
        Parameters:
        portDescReply - the port set and descriptions
      • setPortDescReplies

        void setPortDescReplies​(java.util.List<org.projectfloodlight.openflow.protocol.OFPortDescStatsReply> portDescReplies)
        Sets the ports on this switch.
        Parameters:
        portDescReplies - list of port set and descriptions
      • setFeaturesReply

        void setFeaturesReply​(org.projectfloodlight.openflow.protocol.OFFeaturesReply featuresReply)
        Sets the features reply for this switch.
        Parameters:
        featuresReply - the features to set.
      • setMeterFeaturesReply

        void setMeterFeaturesReply​(org.projectfloodlight.openflow.protocol.OFMeterFeaturesStatsReply meterFeaturesReply)
        Sets the meter features reply for this switch.
        Parameters:
        meterFeaturesReply - the meter features to set.
      • setSwitchDescription

        void setSwitchDescription​(org.projectfloodlight.openflow.protocol.OFDescStatsReply desc)
        Sets the switch description.
        Parameters:
        desc - the descriptions
      • getNextTransactionId

        int getNextTransactionId()
        Gets the next transaction id to use.
        Returns:
        the xid
      • setOFVersion

        void setOFVersion​(org.projectfloodlight.openflow.protocol.OFVersion ofV)
        Sets the OF version for this switch.
        Parameters:
        ofV - the version to set.
      • setTableFull

        void setTableFull​(boolean full)
        Sets this switch has having a full flowtable.
        Parameters:
        full - true if full, false otherswise.
      • setChannel

        void setChannel​(OpenFlowSession session)
        Sets the associated OpenFlow session for this switch.
        Parameters:
        session - the OpenFlow session
      • setConnected

        void setConnected​(boolean connected)
        Sets whether the switch is connected.
        Parameters:
        connected - whether the switch is connected
      • init

        void init​(Dpid dpid,
                  org.projectfloodlight.openflow.protocol.OFDescStatsReply desc,
                  org.projectfloodlight.openflow.protocol.OFVersion ofv)
        Initialises the behaviour.
        Parameters:
        dpid - a dpid
        desc - a switch description
        ofv - OpenFlow version
      • supportNxRole

        java.lang.Boolean supportNxRole()
        Does this switch support Nicira Role messages.

        Only relevant if this Device is OpenFlow 1.0.

        Returns:
        true if supports, false otherwise.
      • startDriverHandshake

        void startDriverHandshake()
        Starts the driver specific handshake process.
      • isDriverHandshakeComplete

        boolean isDriverHandshakeComplete()
        Checks whether the driver specific handshake is complete.
        Returns:
        true is finished, false if not.
      • processDriverHandshakeMessage

        void processDriverHandshakeMessage​(org.projectfloodlight.openflow.protocol.OFMessage m)
        Process a message during the driver specific handshake.
        Parameters:
        m - the message to process.
      • sendRoleRequest

        void sendRoleRequest​(org.projectfloodlight.openflow.protocol.OFMessage message)
        Sends only role request messages.
        Parameters:
        message - a role request message.
      • sendHandshakeMessage

        void sendHandshakeMessage​(org.projectfloodlight.openflow.protocol.OFMessage message)
        Allows the handshaker behaviour to send messages during the handshake phase only.
        Parameters:
        message - an OpenFlow message