]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: intops: add a pair of functions to check multi-byte ranges
authorWilly Tarreau <w@1wt.eu>
Wed, 24 Apr 2024 13:23:28 +0000 (15:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Apr 2024 13:54:55 +0000 (15:54 +0200)
commit13515d9fbe9abe7525f00edfc1612146d1fca2ec
treeca0f117c673645c6a12a40923a840cb91979aeec
parentb9bf16b3827c58e61bf4cf27b30e14484fd2b6e5
MINOR: intops: add a pair of functions to check multi-byte ranges

These new functions is_char4_outside() and is_char8_outside() are meant
to be used to verify if any of the 4 or 8 chars represented respectively
by a uint32_t or a uint64_t is outside of the min,max byte range passed
in argument. This is the simplified, fast version of the function so it
is restricted to less than 0x80 distance between min and max (sufficient
to validate chars). Extra functions are also provided to check for min
or max alone as well, with the same restriction.

The use case typically is to check that the output of read_u32() or
read_u64() contains exclusively certain bytes.
include/haproxy/intops.h