Interface TrafficTreatment.Builder

    • Method Detail

      • setEthSrc

        TrafficTreatment.Builder setEthSrc​(org.onlab.packet.MacAddress addr)
        Sets the src l2 address.
        Parameters:
        addr - a macaddress
        Returns:
        a treatment builder
      • setEthDst

        TrafficTreatment.Builder setEthDst​(org.onlab.packet.MacAddress addr)
        Sets the dst l2 address.
        Parameters:
        addr - a macaddress
        Returns:
        a treatment builder
      • setVlanId

        TrafficTreatment.Builder setVlanId​(org.onlab.packet.VlanId id)
        Sets the vlan id.
        Parameters:
        id - a vlanid
        Returns:
        a treatment builder
      • setVlanPcp

        TrafficTreatment.Builder setVlanPcp​(Byte pcp)
        Sets the vlan priority.
        Parameters:
        pcp - a vlan priority
        Returns:
        a treatment builder
      • setIpSrc

        TrafficTreatment.Builder setIpSrc​(org.onlab.packet.IpAddress addr)
        Sets the src l3 address.
        Parameters:
        addr - an ip
        Returns:
        a treatment builder
      • setIpDst

        TrafficTreatment.Builder setIpDst​(org.onlab.packet.IpAddress addr)
        Sets the dst l3 address.
        Parameters:
        addr - an ip
        Returns:
        a treatment builder
      • popMpls

        TrafficTreatment.Builder popMpls​(org.onlab.packet.EthType etherType)
        Pops MPLS ether type and set the new ethertype.
        Parameters:
        etherType - an ether type
        Returns:
        a treatment builder
      • setMpls

        TrafficTreatment.Builder setMpls​(org.onlab.packet.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.
      • 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 ID
        port - 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​(Integer tableId)
        Sets the next table id to transition to.
        Parameters:
        tableId - the table table
        Returns:
        a treatement builder
      • pushVlan

        TrafficTreatment.Builder pushVlan​(org.onlab.packet.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 write
        mask - 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​(org.onlab.packet.TpPort port)
        Sets the src TCP port.
        Parameters:
        port - a port number
        Returns:
        a treatment builder
      • setTcpDst

        TrafficTreatment.Builder setTcpDst​(org.onlab.packet.TpPort port)
        Sets the dst TCP port.
        Parameters:
        port - a port number
        Returns:
        a treatment builder
      • setUdpSrc

        TrafficTreatment.Builder setUdpSrc​(org.onlab.packet.TpPort port)
        Sets the src UDP port.
        Parameters:
        port - a port number
        Returns:
        a treatment builder
      • setUdpDst

        TrafficTreatment.Builder setUdpDst​(org.onlab.packet.TpPort port)
        Sets the dst UDP port.
        Parameters:
        port - a port number
        Returns:
        a treatment builder
      • setArpSpa

        TrafficTreatment.Builder setArpSpa​(org.onlab.packet.IpAddress addr)
        Sets the arp src ip address.
        Parameters:
        addr - an ip
        Returns:
        a treatment builder
      • setArpSha

        TrafficTreatment.Builder setArpSha​(org.onlab.packet.MacAddress addr)
        Sets the arp src mac address.
        Parameters:
        addr - a macaddress
        Returns:
        a treatment builder
      • setArpTpa

        TrafficTreatment.Builder setArpTpa​(org.onlab.packet.IpAddress addr)
        Sets the arp dst ip address.
        Parameters:
        addr - an ip
        Returns:
        a treatment builder
      • setArpTha

        TrafficTreatment.Builder setArpTha​(org.onlab.packet.MacAddress addr)
        Sets the arp dst 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.
      • statTrigger

        TrafficTreatment.Builder statTrigger​(Map<StatTriggerField,​Long> statTriggerFieldMap,
                                             StatTriggerFlag statTriggerFlag)
        Add stat trigger instruction.
        Parameters:
        statTriggerFieldMap - defines stat trigger constraints
        statTriggerFlag - 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