Serial Number Arithmetic (RFC 1982) More...
Serial Number Arithmetic (RFC 1982)
Definition in file seq.h.
Go to the source code of this file.
#define | SEQ_LIMIT(X) (X >> 1) |
Maximum for the addition of a positive integer. | |
typedef uint8_t | seq8_t |
A 8 bit sequence number. | |
typedef uint16_t | seq16_t |
A 16 bit sequence number. | |
typedef uint32_t | seq32_t |
A 32 bit sequence number. | |
typedef uint64_t | seq64_t |
A 64 bit sequence number. | |
seq8_t | seq8_adds (seq8_t s, uint8_t n, uint8_t space) |
Addition of a 8 bit sequence number s and a positive integer n in the serial number space . | |
static seq8_t | seq8_add (seq8_t s, uint8_t n) |
Addition of a 8 bit sequence number s and a positive integer n in the serial number space UINT8_MAX. | |
static seq8_t | seq8_incs (seq8_t s, uint8_t space) |
Increment a sequence number s by 1 in the serial number space . | |
static seq8_t | seq8_inc (seq8_t s) |
Increment a sequence number s by 1 in the serial number space UINT8_MAX. | |
int | seq8_compares (seq8_t s1, seq8_t s2, uint8_t space) |
Compare sequence numbers s1 , s2 in the serial number space . | |
static int | seq8_compare (seq8_t s1, seq8_t s2) |
Compare sequence numbers s1 , s2 in the serial number space UINT8_MAX. | |
seq16_t | seq16_adds (seq16_t s, uint16_t n, uint16_t space) |
Addition of a 16 bit sequence number s and a positive integer n in the serial number space . | |
static seq16_t | seq16_add (seq16_t s, uint16_t n) |
Addition of a 16 bit sequence number s and a positive integer n in the serial number space UINT16_MAX. | |
static seq16_t | seq16_incs (seq16_t s, uint16_t space) |
Increment a sequence number s by 1 in the serial number space . | |
static seq16_t | seq16_inc (seq16_t s) |
Increment a sequence number s by 1 in the serial number space UINT16_MAX. | |
int | seq16_compares (seq16_t s1, seq16_t s2, uint16_t space) |
Compare sequence numbers s1 , s2 in the serial number space . | |
static int | seq16_compare (seq16_t s1, seq16_t s2) |
Compare sequence numbers s1 , s2 in the serial number space UINT16_MAX. | |
seq32_t | seq32_adds (seq32_t s, uint32_t n, uint32_t space) |
Addition of a 32 bit sequence number s and a positive integer n in the serial number space . | |
static seq32_t | seq32_add (seq32_t s, uint32_t n) |
Addition of a 32 bit sequence number s and a positive integer n in the serial number space UINT32_MAX. | |
static seq32_t | seq32_incs (seq32_t s, uint32_t space) |
Increment a sequence number s by 1 in the serial number space . | |
static seq32_t | seq32_inc (seq32_t s) |
Increment a sequence number s by 1 in the serial number space UINT32_MAX. | |
int | seq32_compares (seq32_t s1, seq32_t s2, uint32_t space) |
Compare sequence numbers s1 , s2 in the serial number space . | |
static int | seq32_compare (seq32_t s1, seq32_t s2) |
Compare sequence numbers s1 , s2 in the serial number space UINT32_MAX. | |
seq64_t | seq64_adds (seq64_t s, uint64_t n, uint64_t space) |
Addition of a 64 bit sequence number s and a positive integer n in the serial number space . | |
static seq64_t | seq64_add (seq64_t s, uint64_t n) |
Addition of a 64 bit sequence number s and a positive integer n in the serial number space UINT64_MAX. | |
static seq64_t | seq64_incs (seq64_t s, uint64_t space) |
Increment a sequence number s by 1 in the serial number space . | |
static seq64_t | seq64_inc (seq64_t s) |
Increment a sequence number s by 1 in the serial number space UINT64_MAX. | |
int | seq64_compares (seq64_t s1, seq64_t s2, uint64_t space) |
Compare sequence numbers s1 , s2 in the serial number space . | |
static int | seq64_compare (seq64_t s1, seq64_t s2) |
Compare sequence numbers s1 , s2 in the serial number space UINT64_MAX. | |
#define SEQ_LIMIT | ( | X | ) | (X >> 1) |
Addition of a 16 bit sequence number s
and a positive integer n
in the serial number space UINT16_MAX.
[in] | s | sequence number |
[in] | n | positive integer in the range of [0 .. 127] |
Addition of a 16 bit sequence number s
and a positive integer n
in the serial number space
.
[in] | s | sequence number |
[in] | n | positive integer in the range of [0 .. ((space / 2) - 1)] |
[in] | space | serial number space must be a power of 2 minus 1 |
Compare sequence numbers s1
, s2
in the serial number space UINT16_MAX.
[in] | s1 | first sequence number |
[in] | s2 | second sequence number |
Compare sequence numbers s1
, s2
in the serial number space
.
[in] | s1 | first sequence number |
[in] | s2 | second sequence number |
[in] | space | serial number space must be a power of 2 minus 1 |
Addition of a 32 bit sequence number s
and a positive integer n
in the serial number space UINT32_MAX.
[in] | s | sequence number |
[in] | n | positive integer in the range of [0 .. 127] |
Addition of a 32 bit sequence number s
and a positive integer n
in the serial number space
.
[in] | s | sequence number |
[in] | n | positive integer in the range of [0 .. ((space / 2) - 1)] |
[in] | space | serial number space must be a power of 2 minus 1 |
Compare sequence numbers s1
, s2
in the serial number space UINT32_MAX.
[in] | s1 | first sequence number |
[in] | s2 | second sequence number |
Compare sequence numbers s1
, s2
in the serial number space
.
[in] | s1 | first sequence number |
[in] | s2 | second sequence number |
[in] | space | serial number space must be a power of 2 minus 1 |
Addition of a 64 bit sequence number s
and a positive integer n
in the serial number space UINT64_MAX.
[in] | s | sequence number |
[in] | n | positive integer in the range of [0 .. 127] |
Addition of a 64 bit sequence number s
and a positive integer n
in the serial number space
.
[in] | s | sequence number |
[in] | n | positive integer in the range of [0 .. ((space / 2) - 1)] |
[in] | space | serial number space must be a power of 2 minus 1 |
Compare sequence numbers s1
, s2
in the serial number space UINT64_MAX.
[in] | s1 | first sequence number |
[in] | s2 | second sequence number |
Compare sequence numbers s1
, s2
in the serial number space
.
[in] | s1 | first sequence number |
[in] | s2 | second sequence number |
[in] | space | serial number space must be a power of 2 minus 1 |
Addition of a 8 bit sequence number s
and a positive integer n
in the serial number space UINT8_MAX.
[in] | s | sequence number |
[in] | n | positive integer in the range of [0 .. 127] |
Addition of a 8 bit sequence number s
and a positive integer n
in the serial number space
.
[in] | s | sequence number |
[in] | n | positive integer in the range of [0 .. ((space / 2) - 1)] |
[in] | space | serial number space must be a power of 2 minus 1 |
Compare sequence numbers s1
, s2
in the serial number space UINT8_MAX.
[in] | s1 | first sequence number |
[in] | s2 | second sequence number |
Compare sequence numbers s1
, s2
in the serial number space
.
[in] | s1 | first sequence number |
[in] | s2 | second sequence number |
[in] | space | serial number space must be a power of 2 minus 1 |