2017-03-02 09:52:55 -05:00
|
|
|
(* Copyright (C) 2015, Thomas Leonard <thomas.leonard@unikernel.com>
|
|
|
|
See the README file for details. *)
|
|
|
|
|
|
|
|
(* Abstract over NAT interface (todo: remove this) *)
|
|
|
|
|
2022-10-08 04:50:29 -04:00
|
|
|
type t
|
2020-04-29 10:06:48 -04:00
|
|
|
|
2017-03-02 09:52:55 -05:00
|
|
|
type action = [
|
2017-03-10 11:09:36 -05:00
|
|
|
| `NAT
|
|
|
|
| `Redirect of Mirage_nat.endpoint
|
2017-03-02 09:52:55 -05:00
|
|
|
]
|
|
|
|
|
2022-10-08 04:50:29 -04:00
|
|
|
val free_udp_port : t -> src:Ipaddr.V4.t -> dst:Ipaddr.V4.t -> dst_port:int ->
|
|
|
|
int * (unit -> unit)
|
|
|
|
val dns_port : t -> int -> bool
|
2022-10-07 12:49:03 -04:00
|
|
|
val create : max_entries:int -> t
|
2022-10-07 14:54:49 -04:00
|
|
|
val remove_connections : t -> Ipaddr.V4.t -> unit
|
2022-10-07 12:49:03 -04:00
|
|
|
val translate : t -> Nat_packet.t -> Nat_packet.t option
|
2022-10-07 14:54:49 -04:00
|
|
|
val add_nat_rule_and_translate : t ->
|
2022-10-07 12:49:03 -04:00
|
|
|
xl_host:Ipaddr.V4.t -> action -> Nat_packet.t -> (Nat_packet.t, string) result
|