@@ -41,21 +41,22 @@ type t = {
41
41
domain : string option ;
42
42
allowed_bind_addresses : Ipaddr.V4 .t list ;
43
43
gateway_ip : Ipaddr.V4 .t ;
44
+ host_ip : Ipaddr.V4 .t ;
44
45
(* TODO: remove this from the record since it is not constant across all clients *)
45
46
lowest_ip : Ipaddr.V4 .t ;
46
47
highest_ip : Ipaddr.V4 .t ;
47
- extra_dns : Ipaddr.V4 .t list ;
48
48
dhcp_json_path : string option ;
49
49
dhcp_configuration : Dhcp_configuration .t option ;
50
50
mtu : int ;
51
51
http_intercept : Ezjsonm .value option ;
52
52
http_intercept_path : string option ;
53
53
port_max_idle_time : int ;
54
54
host_names : Dns.Name .t list ;
55
+ gateway_names : Dns.Name .t list ;
55
56
}
56
57
57
58
let to_string t =
58
- Printf. sprintf " server_macaddr = %s; max_connection = %s; dns_path = %s; dns = %s; resolver = %s; domain = %s; allowed_bind_addresses = %s; gateway_ip = %s; lowest_ip = %s; highest_ip = %s; extra_dns = %s; dhcp_json_path = %s; dhcp_configuration = %s; mtu = %d; http_intercept = %s; http_intercept_path = %s; port_max_idle_time = %s; host_names = %s"
59
+ Printf. sprintf " server_macaddr = %s; max_connection = %s; dns_path = %s; dns = %s; resolver = %s; domain = %s; allowed_bind_addresses = %s; gateway_ip = %s; host_ip = %s; lowest_ip = %s; highest_ip = %s; dhcp_json_path = %s; dhcp_configuration = %s; mtu = %d; http_intercept = %s; http_intercept_path = %s; port_max_idle_time = %s; host_names = %s; gateway_name = %s"
59
60
(Macaddr. to_string t.server_macaddr)
60
61
(match t.max_connections with None -> " None" | Some x -> string_of_int x)
61
62
(match t.dns_path with None -> " None" | Some x -> x)
@@ -64,24 +65,25 @@ let to_string t =
64
65
(match t.domain with None -> " None" | Some x -> x)
65
66
(String. concat " , " (List. map Ipaddr.V4. to_string t.allowed_bind_addresses))
66
67
(Ipaddr.V4. to_string t.gateway_ip)
68
+ (Ipaddr.V4. to_string t.host_ip)
67
69
(Ipaddr.V4. to_string t.lowest_ip)
68
70
(Ipaddr.V4. to_string t.highest_ip)
69
- (String. concat " , " (List. map Ipaddr.V4. to_string t.extra_dns))
70
71
(match t.dhcp_json_path with None -> " None" | Some x -> x)
71
72
(match t.dhcp_configuration with None -> " None" | Some x -> Dhcp_configuration. to_string x)
72
73
t.mtu
73
74
(match t.http_intercept with None -> " None" | Some x -> Ezjsonm. (to_string @@ wrap x))
74
75
(match t.http_intercept_path with None -> " None" | Some x -> x)
75
76
(string_of_int t.port_max_idle_time)
76
77
(String. concat " , " (List. map Dns.Name. to_string t.host_names))
78
+ (String. concat " , " (List. map Dns.Name. to_string t.gateway_names))
77
79
78
80
let no_dns_servers =
79
81
Dns_forward.Config. ({ servers = Server.Set. empty; search = [] ; assume_offline_after_drops = None })
80
82
81
- let default_lowest_ip = Ipaddr.V4. of_string_exn " 192.168.65.2 "
83
+ let default_lowest_ip = Ipaddr.V4. of_string_exn " 192.168.65.3 "
82
84
let default_gateway_ip = Ipaddr.V4. of_string_exn " 192.168.65.1"
85
+ let default_host_ip = Ipaddr.V4. of_string_exn " 192.168.65.2"
83
86
let default_highest_ip = Ipaddr.V4. of_string_exn " 192.168.65.254"
84
- let default_extra_dns = []
85
87
(* The default MTU is limited by the maximum message size on a Hyper-V
86
88
socket. On currently available windows versions, we need to stay
87
89
below 8192 bytes *)
@@ -90,6 +92,8 @@ let default_port_max_idle_time = 300
90
92
(* random MAC from https://www.hellion.org.uk/cgi-bin/randmac.pl *)
91
93
let default_server_macaddr = Macaddr. of_string_exn " F6:16:36:BC:F9:C6"
92
94
let default_host_names = [ Dns.Name. of_string " vpnkit.host" ]
95
+ let default_gateway_names = [ Dns.Name. of_string " gateway.internal" ]
96
+
93
97
let default_resolver = `Host
94
98
95
99
let default = {
@@ -101,16 +105,17 @@ let default = {
101
105
domain = None ;
102
106
allowed_bind_addresses = [] ;
103
107
gateway_ip = default_gateway_ip;
108
+ host_ip = default_host_ip;
104
109
lowest_ip = default_lowest_ip;
105
110
highest_ip = default_highest_ip;
106
- extra_dns = default_extra_dns;
107
111
dhcp_json_path = None ;
108
112
dhcp_configuration = None ;
109
113
mtu = default_mtu;
110
114
http_intercept = None ;
111
115
http_intercept_path = None ;
112
116
port_max_idle_time = default_port_max_idle_time;
113
117
host_names = default_host_names;
118
+ gateway_names = default_gateway_names;
114
119
}
115
120
116
121
module Parse = struct
0 commit comments