You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
firewall/firewall.ml

26 lines
499 B
OCaml

open Nftables
let nftables = [
Flush FlushRuleset;
Add (AddRule {
family = Inet;
table = "filter";
chain = "forward";
expr =
[
Log { prefix = Some "test"; group = None };
Match {
left = Payload (Udp UdpSport);
right = Set [Number 53];
op = NotEq };
Verdict Accept
]
})
]
let json = json_of_nftables nftables
let () =
print_string (Yojson.Basic.to_string json);
print_newline ()