package pcap-format

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

PCAP encoding and encoding

0.5.0 - 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 =
  1. | Big
    (*

    Big endian (pcap headers)

    *)
  2. | 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

Type of outermost network protocol within the captured frames

module LE : sig ... end
module BE : sig ... end
module type HDR = sig ... end

Functions to read/write pcap header fields of a particular endian-ness

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.

OCaml

Innovation. Community. Security.