BITNCMP(3)

NAME
bitncmp - compare bit masks

SYNOPSIS
int
bitncmp(const void *l, const void *r, int n);

DESCRIPTION
The function bitncmp() compares the “n” most-significant bits of the two masks pointed to by “l” and “r”, and returns an integer less than, equal to, or greater than 0, according to whether or not “l” is lexicographically less than, equal to, or greater than “r” when taken to be unsigned characters (this behaviour is just like that of memcmp(3)).

NOTE: Bitncmp() assumes network byte order; this means that the fourth octet of 192.5.5.240/28 0x11110000.

RETURN VALUES
Bitncmp() returns values in the manner of memcmp(3):

+1 if “1” is greater than “r”;

-1 if “l” is less than “r”; and

0 if “l” is equal to “r”,

where “l” and “r” are both interpreted as strings of unsigned characters (through bit “n”.)

SEE ALSO
memcmp(3).

AUTHOR
Paul Vixie (ISC).