Class Criteria


  • public final class Criteria
    extends Object
    Factory class to create various traffic selection criteria.
    • Method Detail

      • matchInPort

        public static Criterion matchInPort​(PortNumber port)
        Creates a match on IN_PORT field using the specified value.
        Parameters:
        port - inport value
        Returns:
        match criterion
      • matchInPhyPort

        public static Criterion matchInPhyPort​(PortNumber port)
        Creates a match on IN_PHY_PORT field using the specified value.
        Parameters:
        port - inport value
        Returns:
        match criterion
      • matchMetadata

        public static Criterion matchMetadata​(long metadata)
        Creates a match on METADATA field using the specified value.
        Parameters:
        metadata - metadata value (64 bits data)
        Returns:
        match criterion
      • matchEthDst

        public static Criterion matchEthDst​(MacAddress mac)
        Creates a match on ETH_DST field using the specified value. This value may be a wildcard mask.
        Parameters:
        mac - MAC address value or wildcard mask
        Returns:
        match criterion
      • matchEthDstMasked

        public static Criterion matchEthDstMasked​(MacAddress mac,
                                                  MacAddress mask)
        Creates a masked match on ETH_DST field using the specified value and mask.
        Parameters:
        mac - MAC address value
        mask - MAC address masking
        Returns:
        match criterion
      • matchEthSrc

        public static Criterion matchEthSrc​(MacAddress mac)
        Creates a match on ETH_SRC field using the specified value. This value may be a wildcard mask.
        Parameters:
        mac - MAC address value or wildcard mask
        Returns:
        match criterion
      • matchEthSrcMasked

        public static Criterion matchEthSrcMasked​(MacAddress mac,
                                                  MacAddress mask)
        Creates a masked match on ETH_SRC field using the specified value and mask.
        Parameters:
        mac - MAC address value
        mask - MAC address masking
        Returns:
        match criterion
      • matchEthType

        public static Criterion matchEthType​(int ethType)
        Creates a match on ETH_TYPE field using the specified value.
        Parameters:
        ethType - eth type value (16 bits unsigned integer)
        Returns:
        match criterion
      • matchEthType

        public static Criterion matchEthType​(EthType ethType)
        Creates a match on ETH_TYPE field using the specified value.
        Parameters:
        ethType - eth type value
        Returns:
        match criterion
      • matchVlanId

        public static Criterion matchVlanId​(VlanId vlanId)
        Creates a match on VLAN ID field using the specified value.
        Parameters:
        vlanId - vlan id value
        Returns:
        match criterion
      • matchInnerVlanId

        public static Criterion matchInnerVlanId​(VlanId vlanId)
        Creates a match on the inner VLAN ID field using the specified value.
        Parameters:
        vlanId - vlan id value
        Returns:
        match criterion
      • matchVlanPcp

        public static Criterion matchVlanPcp​(byte vlanPcp)
        Creates a match on VLAN PCP field using the specified value.
        Parameters:
        vlanPcp - vlan pcp value (3 bits)
        Returns:
        match criterion
      • matchInnerVlanPcp

        public static Criterion matchInnerVlanPcp​(byte vlanPcp)
        Creates a match on the inner VLAN PCP field using the specified value.
        Parameters:
        vlanPcp - vlan pcp value (3 bits)
        Returns:
        match criterion
      • matchIPDscp

        public static Criterion matchIPDscp​(byte ipDscp)
        Creates a match on IP DSCP field using the specified value.
        Parameters:
        ipDscp - ip dscp value (6 bits)
        Returns:
        match criterion
      • matchIPEcn

        public static Criterion matchIPEcn​(byte ipEcn)
        Creates a match on IP ECN field using the specified value.
        Parameters:
        ipEcn - ip ecn value (2 bits)
        Returns:
        match criterion
      • matchIPProtocol

        public static Criterion matchIPProtocol​(short proto)
        Creates a match on IP proto field using the specified value.
        Parameters:
        proto - ip protocol value (8 bits unsigned integer)
        Returns:
        match criterion
      • matchIPSrc

        public static Criterion matchIPSrc​(IpPrefix ip)
        Creates a match on IPv4 source field using the specified value.
        Parameters:
        ip - ipv4 source value
        Returns:
        match criterion
      • matchIPDst

        public static Criterion matchIPDst​(IpPrefix ip)
        Creates a match on IPv4 destination field using the specified value.
        Parameters:
        ip - ipv4 source value
        Returns:
        match criterion
      • matchTcpSrc

        public static Criterion matchTcpSrc​(TpPort tcpPort)
        Creates a match on TCP source port field using the specified value.
        Parameters:
        tcpPort - TCP source port
        Returns:
        match criterion
      • matchTcpSrcMasked

        public static Criterion matchTcpSrcMasked​(TpPort tcpPort,
                                                  TpPort mask)
        Creates a masked match on TCP source port field using the specified value and mask.
        Parameters:
        tcpPort - TCP source port
        mask - TCP source port masking
        Returns:
        match criterion
      • matchTcpDst

        public static Criterion matchTcpDst​(TpPort tcpPort)
        Creates a match on TCP destination port field using the specified value.
        Parameters:
        tcpPort - TCP destination port
        Returns:
        match criterion
      • matchTcpDstMasked

        public static Criterion matchTcpDstMasked​(TpPort tcpPort,
                                                  TpPort mask)
        Creates a masked match on TCP destination port field using the specified value and mask.
        Parameters:
        tcpPort - TCP destination port
        mask - TCP destination port masking
        Returns:
        match criterion
      • matchTcpFlags

        public static Criterion matchTcpFlags​(int flags)
        Creates a match on TCP flags using the specified value.
        Parameters:
        flags - TCP flags
        Returns:
        match criterion
      • matchUdpSrc

        public static Criterion matchUdpSrc​(TpPort udpPort)
        Creates a match on UDP source port field using the specified value.
        Parameters:
        udpPort - UDP source port
        Returns:
        match criterion
      • matchUdpSrcMasked

        public static Criterion matchUdpSrcMasked​(TpPort udpPort,
                                                  TpPort mask)
        Creates a masked match on UDP source port field using the specified value and mask.
        Parameters:
        udpPort - UDP source port
        mask - UDP source port masking
        Returns:
        match criterion
      • matchUdpDst

        public static Criterion matchUdpDst​(TpPort udpPort)
        Creates a match on UDP destination port field using the specified value.
        Parameters:
        udpPort - UDP destination port
        Returns:
        match criterion
      • matchUdpDstMasked

        public static Criterion matchUdpDstMasked​(TpPort udpPort,
                                                  TpPort mask)
        Creates a masked match on UDP destination port field using the specified value and mask.
        Parameters:
        udpPort - UDP destination port
        mask - UDP destination port masking
        Returns:
        match criterion
      • matchSctpSrc

        public static Criterion matchSctpSrc​(TpPort sctpPort)
        Creates a match on SCTP source port field using the specified value.
        Parameters:
        sctpPort - SCTP source port
        Returns:
        match criterion
      • matchSctpSrcMasked

        public static Criterion matchSctpSrcMasked​(TpPort sctpPort,
                                                   TpPort mask)
        Creates a masked match on SCTP source port field using the specified value and mask.
        Parameters:
        sctpPort - SCTP source port
        mask - SCTP source port masking
        Returns:
        match criterion
      • matchSctpDst

        public static Criterion matchSctpDst​(TpPort sctpPort)
        Creates a match on SCTP destination port field using the specified value.
        Parameters:
        sctpPort - SCTP destination port
        Returns:
        match criterion
      • matchSctpDstMasked

        public static Criterion matchSctpDstMasked​(TpPort sctpPort,
                                                   TpPort mask)
        Creates a masked match on SCTP destination port field using the specified value and mask.
        Parameters:
        sctpPort - SCTP destination port
        mask - SCTP destination port masking
        Returns:
        match criterion
      • matchIcmpType

        public static Criterion matchIcmpType​(short icmpType)
        Creates a match on ICMP type field using the specified value.
        Parameters:
        icmpType - ICMP type (8 bits unsigned integer)
        Returns:
        match criterion
      • matchIcmpCode

        public static Criterion matchIcmpCode​(short icmpCode)
        Creates a match on ICMP code field using the specified value.
        Parameters:
        icmpCode - ICMP code (8 bits unsigned integer)
        Returns:
        match criterion
      • matchIPv6Src

        public static Criterion matchIPv6Src​(IpPrefix ip)
        Creates a match on IPv6 source field using the specified value.
        Parameters:
        ip - ipv6 source value
        Returns:
        match criterion
      • matchIPv6Dst

        public static Criterion matchIPv6Dst​(IpPrefix ip)
        Creates a match on IPv6 destination field using the specified value.
        Parameters:
        ip - ipv6 destination value
        Returns:
        match criterion
      • matchIPv6FlowLabel

        public static Criterion matchIPv6FlowLabel​(int flowLabel)
        Creates a match on IPv6 flow label field using the specified value.
        Parameters:
        flowLabel - IPv6 flow label (20 bits)
        Returns:
        match criterion
      • matchIcmpv6Type

        public static Criterion matchIcmpv6Type​(short icmpv6Type)
        Creates a match on ICMPv6 type field using the specified value.
        Parameters:
        icmpv6Type - ICMPv6 type (8 bits unsigned integer)
        Returns:
        match criterion
      • matchIcmpv6Code

        public static Criterion matchIcmpv6Code​(short icmpv6Code)
        Creates a match on ICMPv6 code field using the specified value.
        Parameters:
        icmpv6Code - ICMPv6 code (8 bits unsigned integer)
        Returns:
        match criterion
      • matchIPv6NDTargetAddress

        public static Criterion matchIPv6NDTargetAddress​(Ip6Address targetAddress)
        Creates a match on IPv6 Neighbor Discovery target address using the specified value.
        Parameters:
        targetAddress - IPv6 Neighbor Discovery target address
        Returns:
        match criterion
      • matchIPv6NDSourceLinkLayerAddress

        public static Criterion matchIPv6NDSourceLinkLayerAddress​(MacAddress mac)
        Creates a match on IPv6 Neighbor Discovery source link-layer address using the specified value.
        Parameters:
        mac - IPv6 Neighbor Discovery source link-layer address
        Returns:
        match criterion
      • matchIPv6NDTargetLinkLayerAddress

        public static Criterion matchIPv6NDTargetLinkLayerAddress​(MacAddress mac)
        Creates a match on IPv6 Neighbor Discovery target link-layer address using the specified value.
        Parameters:
        mac - IPv6 Neighbor Discovery target link-layer address
        Returns:
        match criterion
      • matchMplsLabel

        public static Criterion matchMplsLabel​(MplsLabel mplsLabel)
        Creates a match on MPLS label.
        Parameters:
        mplsLabel - MPLS label (20 bits)
        Returns:
        match criterion
      • matchMplsBos

        public static Criterion matchMplsBos​(boolean mplsBos)
        Creates a match on MPLS Bottom-of-Stack indicator bit.
        Parameters:
        mplsBos - boolean value indicating true (BOS=1) or false (BOS=0)
        Returns:
        match criterion
      • matchMplsTc

        public static Criterion matchMplsTc​(byte mplsTc)
        Creates a match on MPLS TC.
        Parameters:
        mplsTc - MPLS TC (3 bits)
        Returns:
        match criterion
      • matchTunnelId

        public static Criterion matchTunnelId​(long tunnelId)
        Creates a match on Tunnel ID.
        Parameters:
        tunnelId - Tunnel ID (64 bits)
        Returns:
        match criterion
      • matchIPv6ExthdrFlags

        public static Criterion matchIPv6ExthdrFlags​(int exthdrFlags)
        Creates a match on IPv6 Extension Header pseudo-field fiags. Those are defined in Criterion.IPv6ExthdrFlags.
        Parameters:
        exthdrFlags - IPv6 Extension Header pseudo-field flags (16 bits)
        Returns:
        match criterion
      • matchLambda

        public static Criterion matchLambda​(Lambda lambda)
        Creates a match on lambda using the specified value.
        Parameters:
        lambda - lambda
        Returns:
        match criterion
      • matchOchSignalType

        public static Criterion matchOchSignalType​(OchSignalType signalType)
        Create a match on OCh (Optical Channel) signal type.
        Parameters:
        signalType - OCh signal type
        Returns:
        match criterion
      • matchOduSignalId

        public static Criterion matchOduSignalId​(OduSignalId oduSignalId)
        Creates a match on ODU (Optical channel Data Unit) signal ID using the specified value.
        Parameters:
        oduSignalId - ODU Signal Id
        Returns:
        match criterion
      • matchOduSignalType

        public static Criterion matchOduSignalType​(OduSignalType signalType)
        Creates a match on ODU (Optical channel Data Unit) signal Type using the specified value.
        Parameters:
        signalType - ODU Signal Type
        Returns:
        match criterion
      • matchArpTpa

        public static Criterion matchArpTpa​(Ip4Address ip)
        Creates a match on IPv4 destination field using the specified value.
        Parameters:
        ip - ipv4 destination value
        Returns:
        match criterion
      • matchArpSpa

        public static Criterion matchArpSpa​(Ip4Address ip)
        Creates a match on IPv4 source field using the specified value.
        Parameters:
        ip - ipv4 source value
        Returns:
        match criterion
      • matchArpTha

        public static Criterion matchArpTha​(MacAddress mac)
        Creates a match on MAC destination field using the specified value.
        Parameters:
        mac - MAC destination value
        Returns:
        match criterion
      • matchArpSha

        public static Criterion matchArpSha​(MacAddress mac)
        Creates a match on MAC source field using the specified value.
        Parameters:
        mac - MAC source value
        Returns:
        match criterion
      • matchArpOp

        public static Criterion matchArpOp​(int arpOp)
        Creates a match on arp operation type field using the specified value.
        Parameters:
        arpOp - arp operation type value
        Returns:
        match criterion
      • matchPbbIsid

        public static Criterion matchPbbIsid​(int pbbIsid)
        Creates a match on PBB I-SID field using the specific value.
        Parameters:
        pbbIsid - PBB I-SID
        Returns:
        match criterion
      • extension

        public static ExtensionCriterion extension​(ExtensionSelector extensionSelector,
                                                   DeviceId deviceId)
        Creates an extension criterion for the specified extension selector.
        Parameters:
        extensionSelector - extension selector
        deviceId - device ID
        Returns:
        match extension criterion
      • dummy

        public static Criterion dummy()
        Creates a dummy criterion.
        Returns:
        match criterion