RFC 1892 - serial arithmetic

Aniruddha Bohra bohra at cs.rutgers.edu
Sat Jan 24 19:37:51 PST 2004


Hello,
	I was wondering if there is a standard
header file that implements the RFC 1982 ?
It basically defines serial numbers and the
arithmetic operations on them.

All it does is :
         s' = (s + n) modulo (2 ^ SERIAL_BITS)
i1 is the arithmetic integer whose value is
the same as s1, and i2 has the same value as i2
s1 is said to be less than s2 if, and only if, s1 is not equal to s2,
    and
         (i1 < i2 and i2 - i1 < 2^(SERIAL_BITS - 1)) or
         (i1 > i2 and i1 - i2 > 2^(SERIAL_BITS - 1))

s1 is said to be greater than s2 if, and only if, s1 is not equal to
s2, and

         (i1 < i2 and i2 - i1 > 2^(SERIAL_BITS - 1)) or
         (i1 > i2 and i1 - i2 < 2^(SERIAL_BITS - 1))


I am currently using these as my local defns but would like
to use a standard header if possible.

Thanks

Aniruddha





More information about the freebsd-hackers mailing list