I do know of a technique of taking every range, and creating one or more
value/mask expressions out of it, that together match all of the same values
that the range does, and nothing outside of the range. As a short example,
with an 8-bit field and the range 16 .. 25, the two value/masks 0x10 &&&
0xf8 (matching values in the range 16 through 23, inclusive) and 0x18 &&&
0xfe (matching values in the range 24 through 25, inclusive), match the same
range.

However, for another range, 1000-2000, the value/mask pairs are:

3e8 fff8
3f0 fff0
400 fe00
600 ff00
700 ff80
780 ffc0
7c0 fff0
7d0 ffff

You see, the pairs of (value,mask) grows for larger ranges.

Thanks,

Hemant

-----Original Message-----
From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Benoit Ganne
(bganne) via lists.fd.io
Sent: Friday, March 05, 2021 7:58 AM
To: hem...@mnkcg.com; vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] IP subnet and port range match?

> Am I correct that VPP classifier does not support matching both an IP 
> subnet and layer-4 port range?  The classifier matches IP subnet and 
> then another function matches range.

The VPP classifier matches bitmasks, so technically you can match ranges as
long as they can be expressed as bitmasks.
If your port range does not (usual case) you can use VPP ACL plugin which
does support this kind of match.

ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#18864): https://lists.fd.io/g/vpp-dev/message/18864
Mute This Topic: https://lists.fd.io/mt/81084196/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to