seq.h File Reference

Serial Number Arithmetic (RFC 1982) More...

Detailed Description

#include <stdint.h>
#include <errno.h>
+ Include dependency graph for seq.h:

Go to the source code of this file.

Macros

#define SEQ_LIMIT(X)   (X >> 1)
 Maximum for the addition of a positive integer. More...
 

Typedefs

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.
 

Functions

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. More...
 
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. More...
 
static seq8_t seq8_incs (seq8_t s, uint8_t space)
 Increment a sequence number s by 1 in the serial number space. More...
 
static seq8_t seq8_inc (seq8_t s)
 Increment a sequence number s by 1 in the serial number space UINT8_MAX. More...
 
int seq8_compares (seq8_t s1, seq8_t s2, uint8_t space)
 Compare sequence numbers s1, s2 in the serial number space. More...
 
static int seq8_compare (seq8_t s1, seq8_t s2)
 Compare sequence numbers s1, s2 in the serial number space UINT8_MAX. More...
 
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. More...
 
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. More...
 
static seq16_t seq16_incs (seq16_t s, uint16_t space)
 Increment a sequence number s by 1 in the serial number space. More...
 
static seq16_t seq16_inc (seq16_t s)
 Increment a sequence number s by 1 in the serial number space UINT16_MAX. More...
 
int seq16_compares (seq16_t s1, seq16_t s2, uint16_t space)
 Compare sequence numbers s1, s2 in the serial number space. More...
 
static int seq16_compare (seq16_t s1, seq16_t s2)
 Compare sequence numbers s1, s2 in the serial number space UINT16_MAX. More...
 
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. More...
 
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. More...
 
static seq32_t seq32_incs (seq32_t s, uint32_t space)
 Increment a sequence number s by 1 in the serial number space. More...
 
static seq32_t seq32_inc (seq32_t s)
 Increment a sequence number s by 1 in the serial number space UINT32_MAX. More...
 
int seq32_compares (seq32_t s1, seq32_t s2, uint32_t space)
 Compare sequence numbers s1, s2 in the serial number space. More...
 
static int seq32_compare (seq32_t s1, seq32_t s2)
 Compare sequence numbers s1, s2 in the serial number space UINT32_MAX. More...
 
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. More...
 
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. More...
 
static seq64_t seq64_incs (seq64_t s, uint64_t space)
 Increment a sequence number s by 1 in the serial number space. More...
 
static seq64_t seq64_inc (seq64_t s)
 Increment a sequence number s by 1 in the serial number space UINT64_MAX. More...
 
int seq64_compares (seq64_t s1, seq64_t s2, uint64_t space)
 Compare sequence numbers s1, s2 in the serial number space. More...
 
static int seq64_compare (seq64_t s1, seq64_t s2)
 Compare sequence numbers s1, s2 in the serial number space UINT64_MAX. More...