package packet

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type bytes = Cstruct.t
type int8 = int
type int16 = int
type int48 = int64
type dlAddr = int48
type dlTyp = int16
type dlVlan = int16 option
type dlVlanPcp = int8
type nwAddr = int32
type nwProto = int8
type nwTos = int8
type tpPort = int16
module Tcp : sig ... end
module Icmp : sig ... end
module Ip : sig ... end
module Arp : sig ... end
type nw =
  1. | Ip of Ip.t
  2. | Arp of Arp.t
  3. | Unparsable of dlTyp * bytes
type packet = {
  1. dlSrc : dlAddr;
  2. dlDst : dlAddr;
  3. dlVlan : dlVlan;
  4. dlVlanPcp : dlVlanPcp;
  5. nw : nw;
}
val dlTyp : packet -> dlTyp
val nwSrc : packet -> nwAddr
val nwDst : packet -> nwAddr
val nwTos : packet -> nwTos
val nwProto : packet -> nwProto
val tpSrc : packet -> tpPort
val tpDst : packet -> tpPort
val setDlSrc : packet -> dlAddr -> packet
val setDlDst : packet -> dlAddr -> packet
val setDlVlan : packet -> dlVlan -> packet
val setDlVlanPcp : packet -> dlVlanPcp -> packet
val setNwSrc : packet -> nwAddr -> packet
val setNwDst : packet -> nwAddr -> packet
val setNwTos : packet -> nwTos -> packet
val setTpSrc : packet -> tpPort -> packet
val setTpDst : packet -> tpPort -> packet
val string_of_mac : dlAddr -> string
val string_of_dlAddr : dlAddr -> string
val string_of_dlTyp : dlTyp -> string
val string_of_dlVlan : dlVlan -> string
val string_of_dlVlanPcp : dlVlanPcp -> string
val string_of_ip : nwAddr -> string
val string_of_nwAddr : nwAddr -> string
val string_of_nwProto : nwProto -> string
val string_of_nwTos : nwTos -> string
val string_of_tpPort : tpPort -> string
val bytes_of_mac : dlAddr -> string
val mac_of_bytes : string -> int48
val parse : Cstruct.t -> packet
val len : packet -> int
val marshal : packet -> Cstruct.t
val to_string : packet -> string
val format_packet : Format.formatter -> packet -> unit
OCaml

Innovation. Community. Security.