15
15
open Network_utils
16
16
open Network_interface
17
17
18
- open Fun
19
- open Xstringext
20
- open Listext
18
+ (* open Fun*)
19
+ open Stdext. Xstringext
20
+ open Stdext. Listext
21
21
22
22
module D = Debug. Make (struct let name = " network_server" end )
23
23
open D
@@ -141,7 +141,7 @@ module Interface = struct
141
141
Ip. flush_ip_addr name
142
142
end
143
143
| DHCP4 ->
144
- let gateway = Opt. default [] (Opt. map (fun n -> [`gateway n]) ! config.gateway_interface) in
144
+ let gateway = Stdext. Opt. default [] (Stdext. Opt. map (fun n -> [`gateway n]) ! config.gateway_interface) in
145
145
let dns =
146
146
if ! config.dns_interface = None || ! config.dns_interface = Some name then begin
147
147
debug " %s is the DNS interface" name;
@@ -260,7 +260,7 @@ module Interface = struct
260
260
261
261
let get_dns _ dbg ~name =
262
262
Debug. with_thread_associated dbg (fun () ->
263
- let nameservers, domains = Unixext. file_lines_fold (fun (nameservers , domains ) line ->
263
+ let nameservers, domains = Stdext. Unixext. file_lines_fold (fun (nameservers , domains ) line ->
264
264
if String. startswith " nameserver" line then
265
265
let server = List. nth (String. split_f String. isspace line) 1 in
266
266
(Unix. inet_addr_of_string server) :: nameservers, domains
@@ -284,7 +284,7 @@ module Interface = struct
284
284
let domains' = if domains <> [] then [" search " ^ (String. concat " " domains)] else [] in
285
285
let nameservers' = List. map (fun ip -> " nameserver " ^ (Unix. string_of_inet_addr ip)) nameservers in
286
286
let lines = domains' @ nameservers' in
287
- Unixext. write_string_to_file resolv_conf ((String. concat " \n " lines) ^ " \n " )
287
+ Stdext. Unixext. write_string_to_file resolv_conf ((String. concat " \n " lines) ^ " \n " )
288
288
end else
289
289
debug " %s is NOT the DNS interface" name
290
290
) ()
@@ -424,7 +424,7 @@ module Bridge = struct
424
424
425
425
let determine_backend () =
426
426
try
427
- let backend = String. strip String. isspace (Unixext. string_of_file ! network_conf) in
427
+ let backend = String. strip String. isspace (Stdext. Unixext. string_of_file ! network_conf) in
428
428
match backend with
429
429
| "openvswitch" | "vswitch" -> backend_kind := Openvswitch
430
430
| "bridge" -> backend_kind := Bridge
@@ -503,7 +503,7 @@ module Bridge = struct
503
503
ignore (Brctl. create_bridge name);
504
504
Brctl. set_forwarding_delay name 0 ;
505
505
Sysfs. set_multicast_snooping name false ;
506
- Opt. iter (Ip. set_mac name) mac;
506
+ Stdext. Opt. iter (Ip. set_mac name) mac;
507
507
match vlan with
508
508
| None -> ()
509
509
| Some (parent , vlan ) ->
@@ -852,12 +852,12 @@ let on_startup () =
852
852
(* Remove DNSDEV and GATEWAYDEV from Centos networking file, because the interfere
853
853
* with this daemon. *)
854
854
try
855
- let file = String. rtrim (Unixext. string_of_file " /etc/sysconfig/network" ) in
855
+ let file = String. rtrim (Stdext. Unixext. string_of_file " /etc/sysconfig/network" ) in
856
856
let args = String. split '\n' file in
857
857
let args = List. map (fun s -> match (String. split '=' s) with k :: [v] -> k, v | _ -> " " , " " ) args in
858
858
let args = List. filter (fun (k , v ) -> k <> " DNSDEV" && k <> " GATEWAYDEV" ) args in
859
859
let s = String. concat " \n " (List. map (fun (k , v ) -> k ^ " =" ^ v) args) ^ " \n " in
860
- Unixext. write_string_to_file " /etc/sysconfig/network" s
860
+ Stdext. Unixext. write_string_to_file " /etc/sysconfig/network" s
861
861
with _ -> ()
862
862
in
863
863
try
0 commit comments