Class DestinationSet
- java.lang.Object
-
- org.onosproject.segmentrouting.grouphandler.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)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDestinationSet.DestinationSetType
-
Field Summary
Fields Modifier and Type Field Description static intNO_EDGE_LABEL
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DestinationSetcreateTypePopBos(org.onosproject.net.DeviceId deviceId)Returns a DestinationSet with type POP_BOS.static DestinationSetcreateTypePopNotBos(org.onosproject.net.DeviceId deviceId)Returns a DestinationSet with type POP_NOT_BOS.static DestinationSetcreateTypePushBos(int edgeLabel1, org.onosproject.net.DeviceId destSw1)Returns a DestinationSet with type PUSH_BOS.static DestinationSetcreateTypePushBos(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.static DestinationSetcreateTypePushNone(org.onosproject.net.DeviceId destSw)Returns a DestinationSet with type PUSH_NONE.static DestinationSetcreateTypeSwapBos(int edgeLabel, org.onosproject.net.DeviceId deviceId)Returns a DestinationSet with type SWAP_BOS.static DestinationSetcreateTypeSwapNotBos(int edgeLabel, org.onosproject.net.DeviceId deviceId)Returns a DestinationSet with type SWAP_NOT_BOS.booleanequals(Object o)Set<org.onosproject.net.DeviceId>getDestinationSwitches()Gets all the destination switches in this destination set.intgetEdgeLabel(org.onosproject.net.DeviceId dstSw)Gets the label associated with given destination switch.DestinationSet.DestinationSetTypegetTypeOfDstSet()Returns the type of this ds.inthashCode()booleannotBos()Returns true if the next objective represented by this destination set is of type SWAP_NOT_BOS or POP_NOT_BOS.booleanswap()Returns true if the next objective represented by this destination set is of type SWAP_NOT_BOS or SWAP_BOS.StringtoString()
-
-
-
Field Detail
-
NO_EDGE_LABEL
public static final int NO_EDGE_LABEL
- See Also:
- Constant Field Values
-
-
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
-
getTypeOfDstSet
public DestinationSet.DestinationSetType getTypeOfDstSet()
Returns the type of this ds.- Returns:
- the type of the destination set
-
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
-
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.
-
-