package mirage-nat

  1. Overview
  2. Docs
type icmp = [
  1. | `Query of Cstruct.t
  2. | `Error of Ipv4_packet.t * Cstruct.t * int
]
val equal_icmp : icmp -> icmp -> Ppx_deriving_runtime.bool
type t = [
  1. | `IPv4 of Ipv4_packet.t * [ `TCP of Tcp.Tcp_packet.t * Cstruct.t | `UDP of Udp_packet.t * Cstruct.t | `ICMP of Icmpv4_packet.t * icmp ]
]
type error
val pp_error : error Fmt.t
val of_ethernet_frame : Cstruct.t -> (t, error) Stdlib.result
val of_ipv4_packet : Cstruct.t -> (t, error) Stdlib.result
val to_cstruct : t -> Cstruct.t list

to_cstruct packet is the list of cstructs representing packet. It currently returns (ip_header, transport_header, payload)

val pp : [< t ] Fmt.t
val equal : t -> t -> bool
OCaml

Innovation. Community. Security.