public static final class DefaultTrafficTreatment.Builder extends java.lang.Object implements TrafficTreatment.Builder
Modifier and Type | Method and Description |
---|---|
DefaultTrafficTreatment.Builder |
add(Instruction instruction)
Adds an instruction to the builder.
|
TrafficTreatment.Builder |
addTreatment(TrafficTreatment treatment)
Add all instructions from another treatment.
|
TrafficTreatment |
build()
Builds an immutable traffic treatment descriptor.
|
DefaultTrafficTreatment.Builder |
copyTtlIn()
Copy the TTL to inner protocol layer.
|
DefaultTrafficTreatment.Builder |
copyTtlOut()
Copy the TTL to outer protocol layer.
|
DefaultTrafficTreatment.Builder |
decMplsTtl()
Decrement MPLS TTL.
|
DefaultTrafficTreatment.Builder |
decNwTtl()
Decrement the TTL in IP header by one.
|
DefaultTrafficTreatment.Builder |
deferred()
Any instructions preceded by this method call will be deferred.
|
DefaultTrafficTreatment.Builder |
drop()
Add a NOACTION when DROP instruction is explicitly specified.
|
TrafficTreatment.Builder |
extension(ExtensionTreatment extension,
DeviceId deviceId)
Uses an extension treatment.
|
DefaultTrafficTreatment.Builder |
group(GroupId groupId)
Sets the group ID.
|
DefaultTrafficTreatment.Builder |
immediate()
Any instructions preceded by this method call will be immediate.
|
TrafficTreatment.Builder |
meter(MeterId meterId)
Sets a meter to be used by this flow.
|
DefaultTrafficTreatment.Builder |
notWipeDeferred()
the instruction to clear not wipe the deferred instructions set.
|
DefaultTrafficTreatment.Builder |
piTableAction(PiTableAction piTableAction)
Sets the protocol independent table action.
|
DefaultTrafficTreatment.Builder |
popMpls()
Pops MPLS ether type.
|
DefaultTrafficTreatment.Builder |
popMpls(EthType etherType)
Pops MPLS ether type and set the new ethertype.
|
DefaultTrafficTreatment.Builder |
popVlan()
Pops outermost VLAN tag.
|
DefaultTrafficTreatment.Builder |
punt()
Adds a punt-to-controller instruction.
|
DefaultTrafficTreatment.Builder |
pushMpls()
Push MPLS ether type.
|
DefaultTrafficTreatment.Builder |
pushVlan()
Pushes a new VLAN tag.
|
DefaultTrafficTreatment.Builder |
pushVlan(EthType ethType)
Pushes a new VLAN tag using the supplied Ethernet type.
|
DefaultTrafficTreatment.Builder |
setArpOp(short op)
Sets the arp operation.
|
DefaultTrafficTreatment.Builder |
setArpSha(MacAddress addr)
Sets the arp src mac address.
|
DefaultTrafficTreatment.Builder |
setArpSpa(IpAddress addr)
Sets the arp src ip address.
|
DefaultTrafficTreatment.Builder |
setEthDst(MacAddress addr)
Sets the dst l2 address.
|
DefaultTrafficTreatment.Builder |
setEthSrc(MacAddress addr)
Sets the src l2 address.
|
DefaultTrafficTreatment.Builder |
setIpDst(IpAddress addr)
Sets the dst l3 address.
|
DefaultTrafficTreatment.Builder |
setIpSrc(IpAddress addr)
Sets the src l3 address.
|
DefaultTrafficTreatment.Builder |
setMpls(MplsLabel mplsLabel)
Sets the mpls label.
|
DefaultTrafficTreatment.Builder |
setMplsBos(boolean mplsBos)
Sets the mpls bottom-of-stack indicator bit.
|
DefaultTrafficTreatment.Builder |
setOutput(PortNumber number)
Set the output port.
|
DefaultTrafficTreatment.Builder |
setQueue(long queueId)
Sets the Queue ID.
|
DefaultTrafficTreatment.Builder |
setQueue(long queueId,
PortNumber port)
Sets the Queue ID for a specific port.
|
TrafficTreatment.Builder |
setTcpDst(TpPort port)
Sets the dst TCP port.
|
TrafficTreatment.Builder |
setTcpSrc(TpPort port)
Sets the src TCP port.
|
DefaultTrafficTreatment.Builder |
setTunnelId(long tunnelId)
Sets the tunnel id.
|
TrafficTreatment.Builder |
setUdpDst(TpPort port)
Sets the dst UDP port.
|
TrafficTreatment.Builder |
setUdpSrc(TpPort port)
Sets the src UDP port.
|
DefaultTrafficTreatment.Builder |
setVlanId(VlanId id)
Sets the vlan id.
|
DefaultTrafficTreatment.Builder |
setVlanPcp(java.lang.Byte pcp)
Sets the vlan priority.
|
TrafficTreatment.Builder |
statTrigger(java.util.Map<StatTriggerField,java.lang.Long> statTriggerFieldMap,
StatTriggerFlag statTriggerFlag)
Add stat trigger instruction.
|
DefaultTrafficTreatment.Builder |
transition(java.lang.Integer tableId)
Sets the next table id to transition to.
|
DefaultTrafficTreatment.Builder |
wipeDeferred()
Instructs the device to clear the deferred instructions set.
|
DefaultTrafficTreatment.Builder |
writeMetadata(long metadata,
long metadataMask)
Writes metadata to associate with a packet.
|
public DefaultTrafficTreatment.Builder add(Instruction instruction)
TrafficTreatment.Builder
add
in interface TrafficTreatment.Builder
instruction
- an instructionpublic DefaultTrafficTreatment.Builder drop()
drop
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder punt()
TrafficTreatment.Builder
punt
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder setOutput(PortNumber number)
TrafficTreatment.Builder
setOutput
in interface TrafficTreatment.Builder
number
- the out portpublic DefaultTrafficTreatment.Builder setEthSrc(MacAddress addr)
TrafficTreatment.Builder
setEthSrc
in interface TrafficTreatment.Builder
addr
- a macaddresspublic DefaultTrafficTreatment.Builder setEthDst(MacAddress addr)
TrafficTreatment.Builder
setEthDst
in interface TrafficTreatment.Builder
addr
- a macaddresspublic DefaultTrafficTreatment.Builder setVlanId(VlanId id)
TrafficTreatment.Builder
setVlanId
in interface TrafficTreatment.Builder
id
- a vlanidpublic DefaultTrafficTreatment.Builder setVlanPcp(java.lang.Byte pcp)
TrafficTreatment.Builder
setVlanPcp
in interface TrafficTreatment.Builder
pcp
- a vlan prioritypublic DefaultTrafficTreatment.Builder setIpSrc(IpAddress addr)
TrafficTreatment.Builder
setIpSrc
in interface TrafficTreatment.Builder
addr
- an ippublic DefaultTrafficTreatment.Builder setIpDst(IpAddress addr)
TrafficTreatment.Builder
setIpDst
in interface TrafficTreatment.Builder
addr
- an ippublic DefaultTrafficTreatment.Builder decNwTtl()
TrafficTreatment.Builder
decNwTtl
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder copyTtlIn()
TrafficTreatment.Builder
copyTtlIn
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder copyTtlOut()
TrafficTreatment.Builder
copyTtlOut
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder pushMpls()
TrafficTreatment.Builder
pushMpls
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder popMpls()
TrafficTreatment.Builder
popMpls
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder popMpls(EthType etherType)
TrafficTreatment.Builder
popMpls
in interface TrafficTreatment.Builder
etherType
- an ether typepublic DefaultTrafficTreatment.Builder setMpls(MplsLabel mplsLabel)
TrafficTreatment.Builder
setMpls
in interface TrafficTreatment.Builder
mplsLabel
- MPLS labelpublic DefaultTrafficTreatment.Builder setMplsBos(boolean mplsBos)
TrafficTreatment.Builder
setMplsBos
in interface TrafficTreatment.Builder
mplsBos
- boolean to set BOS=1 (true) or BOS=0 (false)public DefaultTrafficTreatment.Builder decMplsTtl()
TrafficTreatment.Builder
decMplsTtl
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder group(GroupId groupId)
TrafficTreatment.Builder
group
in interface TrafficTreatment.Builder
groupId
- group IDpublic DefaultTrafficTreatment.Builder setQueue(long queueId)
TrafficTreatment.Builder
setQueue
in interface TrafficTreatment.Builder
queueId
- a queue IDpublic DefaultTrafficTreatment.Builder setQueue(long queueId, PortNumber port)
TrafficTreatment.Builder
setQueue
in interface TrafficTreatment.Builder
queueId
- a queue IDport
- a port numberpublic TrafficTreatment.Builder meter(MeterId meterId)
TrafficTreatment.Builder
meter
in interface TrafficTreatment.Builder
meterId
- a meter idpublic DefaultTrafficTreatment.Builder popVlan()
TrafficTreatment.Builder
popVlan
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder pushVlan()
TrafficTreatment.Builder
pushVlan
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder pushVlan(EthType ethType)
TrafficTreatment.Builder
pushVlan
in interface TrafficTreatment.Builder
ethType
- ethernet typepublic DefaultTrafficTreatment.Builder transition(java.lang.Integer tableId)
TrafficTreatment.Builder
transition
in interface TrafficTreatment.Builder
tableId
- the table tablepublic DefaultTrafficTreatment.Builder immediate()
TrafficTreatment.Builder
immediate
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder deferred()
TrafficTreatment.Builder
deferred
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder wipeDeferred()
TrafficTreatment.Builder
wipeDeferred
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder notWipeDeferred()
TrafficTreatment.Builder
notWipeDeferred
in interface TrafficTreatment.Builder
public DefaultTrafficTreatment.Builder writeMetadata(long metadata, long metadataMask)
TrafficTreatment.Builder
new_metadata = (old_metadata & ̃mask) | (value & mask)
writeMetadata
in interface TrafficTreatment.Builder
metadata
- the metadata to writemetadataMask
- the masked bits for the valuepublic DefaultTrafficTreatment.Builder setTunnelId(long tunnelId)
TrafficTreatment.Builder
setTunnelId
in interface TrafficTreatment.Builder
tunnelId
- a tunnel idpublic TrafficTreatment.Builder setTcpSrc(TpPort port)
TrafficTreatment.Builder
setTcpSrc
in interface TrafficTreatment.Builder
port
- a port numberpublic TrafficTreatment.Builder setTcpDst(TpPort port)
TrafficTreatment.Builder
setTcpDst
in interface TrafficTreatment.Builder
port
- a port numberpublic TrafficTreatment.Builder setUdpSrc(TpPort port)
TrafficTreatment.Builder
setUdpSrc
in interface TrafficTreatment.Builder
port
- a port numberpublic TrafficTreatment.Builder setUdpDst(TpPort port)
TrafficTreatment.Builder
setUdpDst
in interface TrafficTreatment.Builder
port
- a port numberpublic DefaultTrafficTreatment.Builder setArpSpa(IpAddress addr)
TrafficTreatment.Builder
setArpSpa
in interface TrafficTreatment.Builder
addr
- an ippublic DefaultTrafficTreatment.Builder setArpSha(MacAddress addr)
TrafficTreatment.Builder
setArpSha
in interface TrafficTreatment.Builder
addr
- a macaddresspublic DefaultTrafficTreatment.Builder setArpOp(short op)
TrafficTreatment.Builder
setArpOp
in interface TrafficTreatment.Builder
op
- the value of arp operation.public DefaultTrafficTreatment.Builder piTableAction(PiTableAction piTableAction)
TrafficTreatment.Builder
piTableAction
in interface TrafficTreatment.Builder
piTableAction
- protocol-independent table actionpublic TrafficTreatment.Builder extension(ExtensionTreatment extension, DeviceId deviceId)
TrafficTreatment.Builder
extension
in interface TrafficTreatment.Builder
extension
- extension treatmentdeviceId
- device IDpublic TrafficTreatment.Builder statTrigger(java.util.Map<StatTriggerField,java.lang.Long> statTriggerFieldMap, StatTriggerFlag statTriggerFlag)
TrafficTreatment.Builder
statTrigger
in interface TrafficTreatment.Builder
statTriggerFieldMap
- defines stat trigger constraintsstatTriggerFlag
- describes which circumstances that start will be triggeredpublic TrafficTreatment.Builder addTreatment(TrafficTreatment treatment)
TrafficTreatment.Builder
addTreatment
in interface TrafficTreatment.Builder
treatment
- another treatmentpublic TrafficTreatment build()
TrafficTreatment.Builder
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()
.
build
in interface TrafficTreatment.Builder