Module Pcap

PCAP encoding and encoding

0.5.2 - homepage

val major_version : int

Major version of the pcap format which we understand

val minor_version : int

Minor version of the pcap format which we understand

type endian =
| Big

Big endian (pcap headers)

| Little

Little endian (pcap headers)

val string_of_endian : endian -> string
val sizeof_pcap_header : int

The size of the initial pcap header in bytes

val sizeof_pcap_packet : int

The size of the per-packet pcap headers in bytes

val magic_number : int32

The magic number which identifies a pcap file (and endian-ness)

module Network : sig ... end
module LE : sig ... end
module BE : sig ... end
module type HDR = sig ... end
val detect : Cstruct.t -> (module HDR) option

detect buf returns a module capable of reading the pcap header fields, or None if the buffer doesn't contain pcap data.

val packets : (module HDR) -> Cstruct.t -> (Cstruct.t * Cstruct.t) Cstruct.iter

packets hdr buf returns a Cstruct.iter (sequence) containing (pcap header, pcap body) pairs.