Package org.onosproject.net.flow
Interface TrafficTreatment.Builder
-
- All Known Implementing Classes:
DefaultTrafficTreatment.Builder
- Enclosing interface:
- TrafficTreatment
public static interface TrafficTreatment.BuilderBuilder of traffic treatment entities.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TrafficTreatment.Builderadd(Instruction instruction)Adds an instruction to the builder.TrafficTreatment.BuilderaddTreatment(TrafficTreatment treatment)Add all instructions from another treatment.TrafficTreatmentbuild()Builds an immutable traffic treatment descriptor.TrafficTreatment.BuildercopyTtlIn()Copy the TTL to inner protocol layer.TrafficTreatment.BuildercopyTtlOut()Copy the TTL to outer protocol layer.TrafficTreatment.BuilderdecMplsTtl()Decrement MPLS TTL.TrafficTreatment.BuilderdecNwTtl()Decrement the TTL in IP header by one.TrafficTreatment.Builderdeferred()Any instructions followed by this method call will be deferred.TrafficTreatment.Builderdrop()Adds a drop instruction.TrafficTreatment.Builderextension(ExtensionTreatment extension, DeviceId deviceId)Uses an extension treatment.TrafficTreatment.Buildergroup(GroupId groupId)Sets the group ID.TrafficTreatment.Builderimmediate()Any instructions followed by this method call will be immediate.TrafficTreatment.Buildermeter(MeterId meterId)Sets a meter to be used by this flow.TrafficTreatment.BuildernotWipeDeferred()the instruction to clear not wipe the deferred instructions set.TrafficTreatment.BuilderpiTableAction(PiTableAction piTableAction)Sets the protocol independent table action.TrafficTreatment.BuilderpopMpls()Pops MPLS ether type.TrafficTreatment.BuilderpopMpls(EthType etherType)Pops MPLS ether type and set the new ethertype.TrafficTreatment.BuilderpopVlan()Pops outermost VLAN tag.TrafficTreatment.Builderpunt()Adds a punt-to-controller instruction.TrafficTreatment.BuilderpushMpls()Push MPLS ether type.TrafficTreatment.BuilderpushVlan()Pushes a new VLAN tag.TrafficTreatment.BuilderpushVlan(EthType ethType)Pushes a new VLAN tag using the supplied Ethernet type.TrafficTreatment.BuildersetArpOp(short op)Sets the arp operation.TrafficTreatment.BuildersetArpSha(MacAddress addr)Sets the arp src mac address.TrafficTreatment.BuildersetArpSpa(IpAddress addr)Sets the arp src ip address.TrafficTreatment.BuildersetEthDst(MacAddress addr)Sets the dst l2 address.TrafficTreatment.BuildersetEthSrc(MacAddress addr)Sets the src l2 address.TrafficTreatment.BuildersetIpDscp(byte dscpValue)Sets the IP DSCP field.TrafficTreatment.BuildersetIpDst(IpAddress addr)Sets the dst l3 address.TrafficTreatment.BuildersetIpSrc(IpAddress addr)Sets the src l3 address.TrafficTreatment.BuildersetMpls(MplsLabel mplsLabel)Sets the mpls label.TrafficTreatment.BuildersetMplsBos(boolean mplsBos)Sets the mpls bottom-of-stack indicator bit.TrafficTreatment.BuildersetOutput(PortNumber number)Set the output port.TrafficTreatment.BuildersetQueue(long queueId)Sets the Queue ID.TrafficTreatment.BuildersetQueue(long queueId, PortNumber port)Sets the Queue ID for a specific port.TrafficTreatment.BuildersetTcpDst(TpPort port)Sets the dst TCP port.TrafficTreatment.BuildersetTcpSrc(TpPort port)Sets the src TCP port.TrafficTreatment.BuildersetTunnelId(long tunnelId)Sets the tunnel id.TrafficTreatment.BuildersetUdpDst(TpPort port)Sets the dst UDP port.TrafficTreatment.BuildersetUdpSrc(TpPort port)Sets the src UDP port.TrafficTreatment.BuildersetVlanId(VlanId id)Sets the vlan id.TrafficTreatment.BuildersetVlanPcp(java.lang.Byte pcp)Sets the vlan priority.TrafficTreatment.BuilderstatTrigger(java.util.Map<StatTriggerField,java.lang.Long> statTriggerFieldMap, StatTriggerFlag statTriggerFlag)Add stat trigger instruction.TrafficTreatment.Buildertransition(java.lang.Integer tableId)Sets the next table id to transition to.TrafficTreatment.BuilderwipeDeferred()Instructs the device to clear the deferred instructions set.TrafficTreatment.BuilderwriteMetadata(long value, long mask)Writes metadata to associate with a packet.
-
-
-
Method Detail
-
add
TrafficTreatment.Builder add(Instruction instruction)
Adds an instruction to the builder.- Parameters:
instruction- an instruction- Returns:
- a treatment builder
-
drop
TrafficTreatment.Builder drop()
Adds a drop instruction.- Returns:
- a treatment builder
-
punt
TrafficTreatment.Builder punt()
Adds a punt-to-controller instruction.- Returns:
- a treatment builder
-
setOutput
TrafficTreatment.Builder setOutput(PortNumber number)
Set the output port.- Parameters:
number- the out port- Returns:
- a treatment builder
-
setEthSrc
TrafficTreatment.Builder setEthSrc(MacAddress addr)
Sets the src l2 address.- Parameters:
addr- a macaddress- Returns:
- a treatment builder
-
setEthDst
TrafficTreatment.Builder setEthDst(MacAddress addr)
Sets the dst l2 address.- Parameters:
addr- a macaddress- Returns:
- a treatment builder
-
setVlanId
TrafficTreatment.Builder setVlanId(VlanId id)
Sets the vlan id.- Parameters:
id- a vlanid- Returns:
- a treatment builder
-
setVlanPcp
TrafficTreatment.Builder setVlanPcp(java.lang.Byte pcp)
Sets the vlan priority.- Parameters:
pcp- a vlan priority- Returns:
- a treatment builder
-
setIpSrc
TrafficTreatment.Builder setIpSrc(IpAddress addr)
Sets the src l3 address.- Parameters:
addr- an ip- Returns:
- a treatment builder
-
setIpDst
TrafficTreatment.Builder setIpDst(IpAddress addr)
Sets the dst l3 address.- Parameters:
addr- an ip- Returns:
- a treatment builder
-
decNwTtl
TrafficTreatment.Builder decNwTtl()
Decrement the TTL in IP header by one.- Returns:
- a treatment builder
-
copyTtlOut
TrafficTreatment.Builder copyTtlOut()
Copy the TTL to outer protocol layer.- Returns:
- a treatment builder
-
copyTtlIn
TrafficTreatment.Builder copyTtlIn()
Copy the TTL to inner protocol layer.- Returns:
- a treatment builder
-
pushMpls
TrafficTreatment.Builder pushMpls()
Push MPLS ether type.- Returns:
- a treatment builder
-
popMpls
TrafficTreatment.Builder popMpls()
Pops MPLS ether type.- Returns:
- a treatment builder
-
popMpls
TrafficTreatment.Builder popMpls(EthType etherType)
Pops MPLS ether type and set the new ethertype.- Parameters:
etherType- an ether type- Returns:
- a treatment builder
-
setMpls
TrafficTreatment.Builder setMpls(MplsLabel mplsLabel)
Sets the mpls label.- Parameters:
mplsLabel- MPLS label- Returns:
- a treatment builder
-
setMplsBos
TrafficTreatment.Builder setMplsBos(boolean mplsBos)
Sets the mpls bottom-of-stack indicator bit.- Parameters:
mplsBos- boolean to set BOS=1 (true) or BOS=0 (false)- Returns:
- a treatment builder.
-
decMplsTtl
TrafficTreatment.Builder decMplsTtl()
Decrement MPLS TTL.- Returns:
- a treatment builder
-
group
TrafficTreatment.Builder group(GroupId groupId)
Sets the group ID.- Parameters:
groupId- group ID- Returns:
- a treatment builder
-
setQueue
TrafficTreatment.Builder setQueue(long queueId)
Sets the Queue ID.- Parameters:
queueId- a queue ID- Returns:
- a treatment builder
-
setQueue
TrafficTreatment.Builder setQueue(long queueId, PortNumber port)
Sets the Queue ID for a specific port.- Parameters:
queueId- a queue IDport- a port number- Returns:
- a treatment builder
-
meter
TrafficTreatment.Builder meter(MeterId meterId)
Sets a meter to be used by this flow.- Parameters:
meterId- a meter id- Returns:
- a treatment builder
-
transition
TrafficTreatment.Builder transition(java.lang.Integer tableId)
Sets the next table id to transition to.- Parameters:
tableId- the table table- Returns:
- a treatement builder
-
popVlan
TrafficTreatment.Builder popVlan()
Pops outermost VLAN tag.- Returns:
- a treatment builder
-
pushVlan
TrafficTreatment.Builder pushVlan()
Pushes a new VLAN tag.- Returns:
- a treatment builder
-
pushVlan
TrafficTreatment.Builder pushVlan(EthType ethType)
Pushes a new VLAN tag using the supplied Ethernet type.- Parameters:
ethType- ethernet type- Returns:
- a treatment builder
-
deferred
TrafficTreatment.Builder deferred()
Any instructions followed by this method call will be deferred.- Returns:
- a treatment builder
-
immediate
TrafficTreatment.Builder immediate()
Any instructions followed by this method call will be immediate.- Returns:
- a treatment builder
-
wipeDeferred
TrafficTreatment.Builder wipeDeferred()
Instructs the device to clear the deferred instructions set.- Returns:
- a treatment builder
-
notWipeDeferred
TrafficTreatment.Builder notWipeDeferred()
the instruction to clear not wipe the deferred instructions set.- Returns:
- a treatment builder
-
writeMetadata
TrafficTreatment.Builder writeMetadata(long value, long mask)
Writes metadata to associate with a packet.new_metadata = (old_metadata & ̃mask) | (value & mask)- Parameters:
value- the metadata to writemask- the masked bits for the value- Returns:
- a treatment builder
-
setTunnelId
TrafficTreatment.Builder setTunnelId(long tunnelId)
Sets the tunnel id.- Parameters:
tunnelId- a tunnel id- Returns:
- a treatment builder
-
setTcpSrc
TrafficTreatment.Builder setTcpSrc(TpPort port)
Sets the src TCP port.- Parameters:
port- a port number- Returns:
- a treatment builder
-
setTcpDst
TrafficTreatment.Builder setTcpDst(TpPort port)
Sets the dst TCP port.- Parameters:
port- a port number- Returns:
- a treatment builder
-
setUdpSrc
TrafficTreatment.Builder setUdpSrc(TpPort port)
Sets the src UDP port.- Parameters:
port- a port number- Returns:
- a treatment builder
-
setUdpDst
TrafficTreatment.Builder setUdpDst(TpPort port)
Sets the dst UDP port.- Parameters:
port- a port number- Returns:
- a treatment builder
-
setArpSpa
TrafficTreatment.Builder setArpSpa(IpAddress addr)
Sets the arp src ip address.- Parameters:
addr- an ip- Returns:
- a treatment builder
-
setArpSha
TrafficTreatment.Builder setArpSha(MacAddress addr)
Sets the arp src mac address.- Parameters:
addr- a macaddress- Returns:
- a treatment builder
-
setArpOp
TrafficTreatment.Builder setArpOp(short op)
Sets the arp operation.- Parameters:
op- the value of arp operation.- Returns:
- a treatment builder.
-
piTableAction
@Beta TrafficTreatment.Builder piTableAction(PiTableAction piTableAction)
Sets the protocol independent table action.- Parameters:
piTableAction- protocol-independent table action- Returns:
- a treatment builder.
-
setIpDscp
TrafficTreatment.Builder setIpDscp(byte dscpValue)
Sets the IP DSCP field.- Parameters:
dscpValue- the DSCP value- Returns:
- a treatment builder.
-
extension
TrafficTreatment.Builder extension(ExtensionTreatment extension, DeviceId deviceId)
Uses an extension treatment.- Parameters:
extension- extension treatmentdeviceId- device ID- Returns:
- a treatment builder
-
statTrigger
TrafficTreatment.Builder statTrigger(java.util.Map<StatTriggerField,java.lang.Long> statTriggerFieldMap, StatTriggerFlag statTriggerFlag)
Add stat trigger instruction.- Parameters:
statTriggerFieldMap- defines stat trigger constraintsstatTriggerFlag- describes which circumstances that start will be triggered- Returns:
- a treatment builder
-
addTreatment
TrafficTreatment.Builder addTreatment(TrafficTreatment treatment)
Add all instructions from another treatment.- Parameters:
treatment- another treatment- Returns:
- a treatment builder
-
build
TrafficTreatment build()
Builds an immutable traffic treatment descriptor.If the treatment is empty when build() is called, it will add a default drop rule automatically. For a treatment that is actually empty, use
DefaultTrafficTreatment.emptyTreatment().- Returns:
- traffic treatment
-
-