package mirage-nat

  1. Overview
  2. Docs
Mirage-nat is a library for network address translation to be used with MirageOS

Install

Dune Dependency

Authors

Maintainers

Sources

mirage-nat-3.0.2.tbz
sha256=675837a9bdbac7f4ba6ac62feaba135bbeebe35487cbb38637b328649fc4f08b
sha512=dc951a1ad3b832c60d9dfdece8d42cd8b19d62d8f412eb58e21384d68100cfa993b5542af451e6d18619c0e9a38d0677f4d346382d7881edf35dc3816faf9945

doc/mirage-nat/Nat_packet/index.html

Module Nat_packetSource

Sourcetype 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 * Cstruct.t ]
]
Sourcetype error
Sourceval icmp_type : Icmpv4_packet.t -> [ `Query | `Error ]
Sourceval pp_error : error Fmt.t
Sourceval of_ethernet_frame : Fragments.Cache.t -> now:int64 -> Cstruct.t -> Fragments.Cache.t * (t option, error) result
Sourceval of_ipv4_packet : Fragments.Cache.t -> now:int64 -> Cstruct.t -> Fragments.Cache.t * (t option, error) result
Sourceval to_cstruct : ?mtu:int -> t -> (Cstruct.t list, error) result

to_cstruct packet is the list of cstructs representing packet. It returns a list of fragments to be sent, or an error if fragmentation was needed, but disallowed by the provided ip header.

Sourceval into_cstruct : t -> Cstruct.t -> (int * Cstruct.t list, error) result

into_cstruct packet buf attempts to serialize packet into buf. On success, it will return the number of bytes written and a list of further fragments to be written.

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

Innovation. Community. Security.