diff --git a/config.ml b/config.ml index 9eaa695..21cc483 100644 --- a/config.ml +++ b/config.ml @@ -16,7 +16,13 @@ module Zone = struct let rec of_json = function | `String str -> str |> V6.Prefix.of_string |> Result.map ipv6 + &?> (str |> V6.of_string + |> Result.map V6.Prefix.of_addr + |> Result.map ipv6) &?> (str |> V4.Prefix.of_string |> Result.map ipv4) + &?> (str |> V4.of_string + |> Result.map V4.Prefix.of_addr + |> Result.map ipv4) &> (str |> name) | `Assoc [ ("not", json) ] -> Not (of_json json) | `List list -> List (List.map of_json list) @@ -34,7 +40,9 @@ module Addrs = struct let open Yojson.Basic.Util in let str = json |> to_string in str |> V6.Prefix.of_string |> Result.map ipv6 + &?> (str |> V6.of_string |> Result.map V6.Prefix.of_addr |> Result.map ipv6) &?> (str |> V4.Prefix.of_string |> Result.map ipv4) + &?> (str |> V4.of_string |> Result.map V4.Prefix.of_addr |> Result.map ipv4) &> (str |> name) end