package mirage-nat

  1. Overview
  2. Docs
type t
module TCP : SUBTABLE with type t := t and type transport_channel = port * port

A TCP channel is identified by the source and destination ports.

module UDP : SUBTABLE with type t := t and type transport_channel = port * port

A UDP channel is identified by the source and destination ports.

module ICMP : SUBTABLE with type t := t and type transport_channel = Cstruct.uint16

An ICMP query is identified by the ICMP ID.

val reset : t -> unit

Remove all entries from the table.

val remove_connections : t -> Ipaddr.V4.t -> ports

Remove all connections from and to the given IP address.

val is_port_free : t -> [ `Udp | `Tcp | `Icmp ] -> src:Ipaddr.V4.t -> dst:Ipaddr.V4.t -> src_port:int -> dst_port:int -> bool

is_port_free t protocol ~src ~dst ~src_port ~dst_port is true if it is not taken yet.