Module Tcp.Pdu

module Pdu: sig .. end

type flags = {
   urg : bool;
   ack : bool;
   psh : bool;
   rst : bool;
   syn : bool;
   fin : bool;
}
val string_of_flags : flags -> string
val print_flags : Batteries.Format.formatter -> flags -> unit
type t = {
   src_port : Tcp.Port.t;
   dst_port : Tcp.Port.t;
   seq_num : Tcp.SeqNum.t;
   ack_num : Tcp.SeqNum.t;
   win_size : int;
   flags : flags;
   urg_ptr : int;
   options : Bitstring.bitstring;
   payload : Tools.Payload.t;
}
An unpacked TCP segment. Notice the absence of the checksum, which will be set to 0 by Tcp.Pdu.pack, and filled in by Ip.Pdu.pack, since it's computed over some IP fields.
val make : ?src_port:Tcp.Port.t ->
?dst_port:Tcp.Port.t ->
?seq_num:Tcp.SeqNum.t ->
?ack_num:Tcp.SeqNum.t ->
?urg:bool ->
?ack:bool ->
?psh:bool ->
?rst:bool ->
?syn:bool ->
?fin:bool ->
?win_size:int ->
?urg_ptr:int ->
?options:Bitstring.bitstring -> Tools.Payload.outer_t -> t
val random : unit -> t
val make_reset_of : t -> t
val pack : t -> Bitstring.bitstring
val unpack : string * int * int -> t option