package packet

  1. Overview
  2. Docs
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 dlVlanDei = bool
type nwAddr = int32
type nwProto = int8
type nwTos = int8
type tpPort = int16
module Tcp : sig ... end
module Udp : sig ... end
module Icmp : sig ... end
module Dns : sig ... end
module Igmp1and2 : sig ... end
module Igmp3 : sig ... end
module Igmp : 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. dlVlanDei : dlVlanDei;
  5. dlVlanPcp : dlVlanPcp;
  6. 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 arpOperation : packet -> int
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 mac_of_string : string -> dlAddr
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_dlVlanDei : dlVlanDei -> string
val string_of_ip : nwAddr -> string
val ip_of_string : string -> nwAddr
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.