Class DestinationSet


  • public final class DestinationSet
    extends Object
    Representation of a set of destination switch dpids along with their edge-node labels. Meant to be used as a lookup-key in a hash-map to retrieve an ECMP-group that hashes packets towards a specific destination switch, or paired-destination switches. May also be used to represent cases where the forwarding does not use ECMP groups (ie SIMPLE next objectives)
    • Method Detail

      • getEdgeLabel

        public int getEdgeLabel​(org.onosproject.net.DeviceId dstSw)
        Gets the label associated with given destination switch.
        Parameters:
        dstSw - the destination switch
        Returns:
        integer the label associated with the destination switch
      • getDestinationSwitches

        public Set<org.onosproject.net.DeviceId> getDestinationSwitches()
        Gets all the destination switches in this destination set.
        Returns:
        a set of destination switch ids
      • notBos

        public boolean notBos()
        Returns true if the next objective represented by this destination set is of type SWAP_NOT_BOS or POP_NOT_BOS.
        Returns:
        the value of notBos
      • swap

        public boolean swap()
        Returns true if the next objective represented by this destination set is of type SWAP_NOT_BOS or SWAP_BOS.
        Returns:
        the value of swap
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • createTypePushNone

        public static DestinationSet createTypePushNone​(org.onosproject.net.DeviceId destSw)
        Returns a DestinationSet with type PUSH_NONE.
        Parameters:
        destSw - The deviceId for this next objective.
        Returns:
        The DestinationSet of this type.
      • createTypePushBos

        public static DestinationSet createTypePushBos​(int edgeLabel1,
                                                       org.onosproject.net.DeviceId destSw1)
        Returns a DestinationSet with type PUSH_BOS.
        Parameters:
        edgeLabel1 - The mpls label to push.
        destSw1 - The device on which the label is assigned.
        Returns:
        The DestinationSet of this type.
      • createTypePushBos

        public static DestinationSet createTypePushBos​(int edgeLabel1,
                                                       org.onosproject.net.DeviceId destSw1,
                                                       int edgeLabel2,
                                                       org.onosproject.net.DeviceId destSw2)
        Returns a DestinationSet with type PUSH_BOS used for paired leafs.
        Parameters:
        edgeLabel1 - The label of first paired leaf.
        destSw1 - The device id of first paired leaf.
        edgeLabel2 - The label of the second leaf.
        destSw2 - The device id of the second leaf.
        Returns:
        The DestinationSet of this type.
      • createTypePopBos

        public static DestinationSet createTypePopBos​(org.onosproject.net.DeviceId deviceId)
        Returns a DestinationSet with type POP_BOS.
        Parameters:
        deviceId - The deviceId for this next objective.
        Returns:
        The DestinationSet of this type.
      • createTypeSwapBos

        public static DestinationSet createTypeSwapBos​(int edgeLabel,
                                                       org.onosproject.net.DeviceId deviceId)
        Returns a DestinationSet with type SWAP_BOS.
        Parameters:
        edgeLabel - The edge label to swap with.
        deviceId - The deviceId for this next objective.
        Returns:
        The DestinationSet of this type.
      • createTypePopNotBos

        public static DestinationSet createTypePopNotBos​(org.onosproject.net.DeviceId deviceId)
        Returns a DestinationSet with type POP_NOT_BOS.
        Parameters:
        deviceId - The device-id this next objective should be installed.
        Returns:
        The DestinationSet of this type.
      • createTypeSwapNotBos

        public static DestinationSet createTypeSwapNotBos​(int edgeLabel,
                                                          org.onosproject.net.DeviceId deviceId)
        Returns a DestinationSet with type SWAP_NOT_BOS.
        Parameters:
        edgeLabel - The edge label to swap with.
        deviceId - The deviceId for this next objective.
        Returns:
        The DestinationSet of this type.