Module Utcp.Sequence

The module of TCP sequence numbers (unsigned 32 bit values, arithmetic operations may wrap)

type t

The abstract type of a sequence number.

val of_int32 : int32 -> t

of_int32 i converts i to a sequence number.

val to_int32 : t -> int32

to_int32 t converts t to an int32.

val zero : t

zero is the 0 as sequence number.

val add : t -> t -> t

add s1 s2 adds sequence number s1 to s2.

val incr : t -> t

incr s increments the sequence number s by 1.

val addi : t -> int -> t

addi s i adds i to the sequence number s.

val window : t -> t -> int

window s1 s2 computes the window (amount of bytes) between s1 and s2.

val less : t -> t -> bool

less s1 s2 checks whether s1 is smaller than s2.

val less_equal : t -> t -> bool

less_equal s1 s2 checks whether s1 is smaller than s2 or equal to s2.

val greater : t -> t -> bool

greater s1 s2 checks whether s1 is greater than s2.

val greater_equal : t -> t -> bool

greater_equal s1 s2 checks whether s1 is greater than s2 or equal to s2.

val equal : t -> t -> bool

equal s1 s2 checks whether s1 is equal to s2.

val min : t -> t -> t

min s1 s2 returns the minimum of s1 and s2.

val max : t -> t -> t

max s1 s2 returns the maximum of s1 and s2.

val pp : t Fmt.t

pp s pretty-prints the sequence number s.