User-facing object representing a bitmap of ports that can be matched on.
This is implemented by the custom BSN OXM type of_oxm_bsn_in_ports_182.
You can call set() on the builder for all the Ports you want to match on
and unset to exclude the port.
Implementation note: to comply with the matching semantics of OXM (which is a logical "AND" not "OR")
the underlying match uses a data format which is very unintuitive. The value is always
0, and the mask has the bits set for the ports that should
NOT be included in the
range.
For the curious: We transformed the bitmap (a logical OR) problem into a logical
AND NOT problem.
We logically mean: Inport is 1 OR 3
We technically say: Inport IS NOT 2 AND IS NOT 4 AND IS NOT 5 AND IS NOT ....
The second term cannot be represented in OXM, the second can.
That said, all that craziness is hidden from the user of this object.
Usage
OFPortBitmap is meant to be used with MatchField
BSN_IN_PORTS_128 in place
of the raw type Masked<OFBitMask128>.
Example:
:
OFPortBitMap portBitMap;
Match.Builder matchBuilder;
// initialize
matchBuilder.setMasked(MatchField.BSN_IN_PORTS_128, portBitmap);