Interface TrafficSelector.Builder

    • Method Detail

      • add

        TrafficSelector.Builder add​(Criterion criterion)
        Adds a traffic selection criterion. If a same type criterion has already been added, it will be replaced by this one.
        Parameters:
        criterion - new criterion
        Returns:
        self
      • matchInPhyPort

        TrafficSelector.Builder matchInPhyPort​(PortNumber port)
        Matches a physical inport.
        Parameters:
        port - the physical inport
        Returns:
        a selection builder
      • matchMetadata

        TrafficSelector.Builder matchMetadata​(long metadata)
        Matches a metadata.
        Parameters:
        metadata - the metadata
        Returns:
        a selection builder
      • matchEthDstMasked

        TrafficSelector.Builder matchEthDstMasked​(MacAddress addr,
                                                  MacAddress mask)
        Matches a l2 dst address with mask.
        Parameters:
        addr - a l2 address
        mask - a mask for an l2 address
        Returns:
        a selection builder
      • matchEthSrcMasked

        TrafficSelector.Builder matchEthSrcMasked​(MacAddress addr,
                                                  MacAddress mask)
        Matches a l2 src address with mask.
        Parameters:
        addr - a l2 address
        mask - a mask for an l2 address
        Returns:
        a selection builder
      • matchEthType

        TrafficSelector.Builder matchEthType​(short ethType)
        Matches the ethernet type.
        Parameters:
        ethType - an ethernet type
        Returns:
        a selection builder
      • matchVlanId

        TrafficSelector.Builder matchVlanId​(VlanId vlanId)
        Matches the vlan id.
        Parameters:
        vlanId - a vlan id
        Returns:
        a selection builder
      • matchVlanPcp

        TrafficSelector.Builder matchVlanPcp​(byte vlanPcp)
        Matches a vlan priority.
        Parameters:
        vlanPcp - a vlan priority
        Returns:
        a selection builder
      • matchInnerVlanId

        TrafficSelector.Builder matchInnerVlanId​(VlanId vlanId)
        Matches the inner vlan id.
        Parameters:
        vlanId - a vlan id
        Returns:
        a selection builder
      • matchInnerVlanPcp

        TrafficSelector.Builder matchInnerVlanPcp​(byte vlanPcp)
        Matches a vlan priority.
        Parameters:
        vlanPcp - a vlan priority
        Returns:
        a selection builder
      • matchIPDscp

        TrafficSelector.Builder matchIPDscp​(byte ipDscp)
        Matches an IP DSCP (6 bits in ToS field).
        Parameters:
        ipDscp - an IP DSCP value
        Returns:
        a selection builder
      • matchIPEcn

        TrafficSelector.Builder matchIPEcn​(byte ipEcn)
        Matches an IP ECN (2 bits in ToS field).
        Parameters:
        ipEcn - an IP ECN value
        Returns:
        a selection builder
      • matchIPProtocol

        TrafficSelector.Builder matchIPProtocol​(byte proto)
        Matches the l3 protocol.
        Parameters:
        proto - a l3 protocol
        Returns:
        a selection builder
      • matchTcpSrc

        TrafficSelector.Builder matchTcpSrc​(TpPort tcpPort)
        Matches a TCP source port number.
        Parameters:
        tcpPort - a TCP source port number
        Returns:
        a selection builder
      • matchTcpSrcMasked

        TrafficSelector.Builder matchTcpSrcMasked​(TpPort tcpPort,
                                                  TpPort mask)
        Matches a TCP source port number with mask.
        Parameters:
        tcpPort - a TCP source port number
        mask - a mask for a TCP source port number
        Returns:
        a selection builder
      • matchTcpDst

        TrafficSelector.Builder matchTcpDst​(TpPort tcpPort)
        Matches a TCP destination port number.
        Parameters:
        tcpPort - a TCP destination port number
        Returns:
        a selection builder
      • matchTcpDstMasked

        TrafficSelector.Builder matchTcpDstMasked​(TpPort tcpPort,
                                                  TpPort mask)
        Matches a TCP destination port number with mask.
        Parameters:
        tcpPort - a TCP destination port number
        mask - a mask for a TCP destination port number
        Returns:
        a selection builder
      • matchUdpSrc

        TrafficSelector.Builder matchUdpSrc​(TpPort udpPort)
        Matches an UDP source port number.
        Parameters:
        udpPort - an UDP source port number
        Returns:
        a selection builder
      • matchUdpSrcMasked

        TrafficSelector.Builder matchUdpSrcMasked​(TpPort udpPort,
                                                  TpPort mask)
        Matches a UDP source port number with mask.
        Parameters:
        udpPort - a UDP source port number
        mask - a mask for a UDP source port number
        Returns:
        a selection builder
      • matchUdpDst

        TrafficSelector.Builder matchUdpDst​(TpPort udpPort)
        Matches an UDP destination port number.
        Parameters:
        udpPort - an UDP destination port number
        Returns:
        a selection builder
      • matchUdpDstMasked

        TrafficSelector.Builder matchUdpDstMasked​(TpPort udpPort,
                                                  TpPort mask)
        Matches a UDP destination port number with mask.
        Parameters:
        udpPort - a UDP destination port number
        mask - a mask for a UDP destination port number
        Returns:
        a selection builder
      • matchSctpSrc

        TrafficSelector.Builder matchSctpSrc​(TpPort sctpPort)
        Matches a SCTP source port number.
        Parameters:
        sctpPort - a SCTP source port number
        Returns:
        a selection builder
      • matchSctpSrcMasked

        TrafficSelector.Builder matchSctpSrcMasked​(TpPort sctpPort,
                                                   TpPort mask)
        Matches a SCTP source port number with mask.
        Parameters:
        sctpPort - a SCTP source port number
        mask - a mask for a SCTP source port number
        Returns:
        a selection builder
      • matchSctpDst

        TrafficSelector.Builder matchSctpDst​(TpPort sctpPort)
        Matches a SCTP destination port number.
        Parameters:
        sctpPort - a SCTP destination port number
        Returns:
        a selection builder
      • matchSctpDstMasked

        TrafficSelector.Builder matchSctpDstMasked​(TpPort sctpPort,
                                                   TpPort mask)
        Matches a SCTP destination port number with mask.
        Parameters:
        sctpPort - a SCTP destination port number
        mask - a mask for a SCTP destination port number
        Returns:
        a selection builder
      • matchIcmpType

        TrafficSelector.Builder matchIcmpType​(byte icmpType)
        Matches an ICMP type.
        Parameters:
        icmpType - an ICMP type
        Returns:
        a selection builder
      • matchIcmpCode

        TrafficSelector.Builder matchIcmpCode​(byte icmpCode)
        Matches an ICMP code.
        Parameters:
        icmpCode - an ICMP code
        Returns:
        a selection builder
      • matchIPv6Src

        TrafficSelector.Builder matchIPv6Src​(IpPrefix ip)
        Matches a l3 IPv6 address.
        Parameters:
        ip - a l3 IPv6 address
        Returns:
        a selection builder
      • matchIPv6Dst

        TrafficSelector.Builder matchIPv6Dst​(IpPrefix ip)
        Matches a l3 IPv6 address.
        Parameters:
        ip - a l3 IPv6 address
        Returns:
        a selection builder
      • matchIPv6FlowLabel

        TrafficSelector.Builder matchIPv6FlowLabel​(int flowLabel)
        Matches an IPv6 flow label.
        Parameters:
        flowLabel - an IPv6 flow label
        Returns:
        a selection builder
      • matchIcmpv6Type

        TrafficSelector.Builder matchIcmpv6Type​(byte icmpv6Type)
        Matches an ICMPv6 type.
        Parameters:
        icmpv6Type - an ICMPv6 type
        Returns:
        a selection builder
      • matchIcmpv6Code

        TrafficSelector.Builder matchIcmpv6Code​(byte icmpv6Code)
        Matches an ICMPv6 code.
        Parameters:
        icmpv6Code - an ICMPv6 code
        Returns:
        a selection builder
      • matchIPv6NDTargetAddress

        TrafficSelector.Builder matchIPv6NDTargetAddress​(Ip6Address targetAddress)
        Matches an IPv6 Neighbor Discovery target address.
        Parameters:
        targetAddress - an IPv6 Neighbor Discovery target address
        Returns:
        a selection builder
      • matchIPv6NDSourceLinkLayerAddress

        TrafficSelector.Builder matchIPv6NDSourceLinkLayerAddress​(MacAddress mac)
        Matches an IPv6 Neighbor Discovery source link-layer address.
        Parameters:
        mac - an IPv6 Neighbor Discovery source link-layer address
        Returns:
        a selection builder
      • matchIPv6NDTargetLinkLayerAddress

        TrafficSelector.Builder matchIPv6NDTargetLinkLayerAddress​(MacAddress mac)
        Matches an IPv6 Neighbor Discovery target link-layer address.
        Parameters:
        mac - an IPv6 Neighbor Discovery target link-layer address
        Returns:
        a selection builder
      • matchMplsLabel

        TrafficSelector.Builder matchMplsLabel​(MplsLabel mplsLabel)
        Matches on a MPLS label.
        Parameters:
        mplsLabel - a MPLS label.
        Returns:
        a selection builder
      • matchMplsBos

        TrafficSelector.Builder matchMplsBos​(boolean mplsBos)
        Matches on a MPLS Bottom-of-Stack indicator bit.
        Parameters:
        mplsBos - boolean value indicating BOS=1 (true) or BOS=0 (false).
        Returns:
        a selection builder
      • matchTunnelId

        TrafficSelector.Builder matchTunnelId​(long tunnelId)
        Matches a tunnel id.
        Parameters:
        tunnelId - a tunnel id
        Returns:
        a selection builder
      • matchIPv6ExthdrFlags

        TrafficSelector.Builder matchIPv6ExthdrFlags​(short exthdrFlags)
        Matches on IPv6 Extension Header pseudo-field flags.
        Parameters:
        exthdrFlags - the IPv6 Extension Header pseudo-field flags
        Returns:
        a selection builder
      • matchArpTpa

        TrafficSelector.Builder matchArpTpa​(Ip4Address addr)
        Matches a arp IPv4 destination address.
        Parameters:
        addr - a arp IPv4 destination address
        Returns:
        a selection builder
      • matchArpSpa

        TrafficSelector.Builder matchArpSpa​(Ip4Address addr)
        Matches a arp IPv4 source address.
        Parameters:
        addr - a arp IPv4 source address
        Returns:
        a selection builder
      • matchArpTha

        TrafficSelector.Builder matchArpTha​(MacAddress addr)
        Matches a arp_eth_dst address.
        Parameters:
        addr - a arp_eth_dst address
        Returns:
        a selection builder
      • matchArpSha

        TrafficSelector.Builder matchArpSha​(MacAddress addr)
        Matches a arp_eth_src address.
        Parameters:
        addr - a arp_eth_src address
        Returns:
        a selection builder
      • matchArpOp

        TrafficSelector.Builder matchArpOp​(int arpOp)
        Matches a arp operation type.
        Parameters:
        arpOp - a arp operation type
        Returns:
        a selection builder
      • matchPi

        @Beta
        TrafficSelector.Builder matchPi​(PiCriterion piCriterion)
        Matches protocol independent fields.
        Parameters:
        piCriterion - protocol-independent criterion
        Returns:
        a selection builder
      • build

        TrafficSelector build()
        Builds an immutable traffic selector.
        Returns:
        traffic selector