mirror of
https://github.com/mirage/qubes-mirage-firewall.git
synced 2024-10-01 01:05:39 -04:00
2d78d47591
Co-Authored-By: Mindy Preston <yomimono@users.noreply.github.com> Co-Authored-By: Olle Jonsson <olle.jonsson@gmail.com> Co-Authored-By: hannes <hannes@mehnert.org> Co-Authored-By: cfcs <cfcs@users.noreply.github.com>
28 lines
730 B
OCaml
28 lines
730 B
OCaml
(* Copyright (C) 2015, Thomas Leonard <thomas.leonard@unikernel.com>
|
|
See the README file for details. *)
|
|
|
|
(* Abstract over NAT interface (todo: remove this) *)
|
|
|
|
type ports = private {
|
|
nat_tcp : Ports.t ref;
|
|
nat_udp : Ports.t ref;
|
|
nat_icmp : Ports.t ref;
|
|
dns_udp : Ports.t ref;
|
|
}
|
|
|
|
val empty_ports : unit -> ports
|
|
|
|
type t
|
|
|
|
type action = [
|
|
| `NAT
|
|
| `Redirect of Mirage_nat.endpoint
|
|
]
|
|
|
|
val create : max_entries:int -> t Lwt.t
|
|
val reset : t -> ports -> unit Lwt.t
|
|
val remove_connections : t -> ports -> Ipaddr.V4.t -> unit
|
|
val translate : t -> Nat_packet.t -> Nat_packet.t option Lwt.t
|
|
val add_nat_rule_and_translate : t -> ports ->
|
|
xl_host:Ipaddr.V4.t -> action -> Nat_packet.t -> (Nat_packet.t, string) result Lwt.t
|