Skip to content

Commit 2b5a029

Browse files
committed
CP-27898 remove dead code
Signed-off-by: Christian Lindig <[email protected]>
1 parent b404061 commit 2b5a029

File tree

3 files changed

+0
-86
lines changed

3 files changed

+0
-86
lines changed

lib/network_utils.ml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,6 @@ module Ip = struct
416416
let get_mtu dev =
417417
int_of_string (List.hd (link dev "mtu"))
418418

419-
let get_state dev =
420-
match addr dev "state" with
421-
| "UP" :: _ -> true
422-
| _ -> false
423-
424419
let get_mac dev =
425420
List.hd (link dev "link/ether")
426421

@@ -897,10 +892,6 @@ module Proc = struct
897892
error "Error: could not read /proc/net/vlan/config";
898893
[]
899894

900-
let get_bond_links_up name =
901-
let statusses = get_bond_slave_info name "MII Status" in
902-
List.fold_left (fun x (_, y) -> x + (if y = "up" then 1 else 0)) 0 statusses
903-
904895
let get_ipv6_disabled () =
905896
try
906897
Unixext.string_of_file "/proc/sys/net/ipv6/conf/all/disable_ipv6"
@@ -1025,11 +1016,6 @@ module Ovs = struct
10251016
) ([], None) lines
10261017
with _ -> [], None
10271018

1028-
let get_bond_links_up name =
1029-
let slaves, _ = get_bond_link_status name in
1030-
let links_up = List.filter snd slaves in
1031-
List.length (links_up)
1032-
10331019
let get_bond_mode name =
10341020
try
10351021
let output = String.trim (vsctl ~log:false ["get"; "port"; name; "bond_mode"]) in
@@ -1209,9 +1195,6 @@ module Ovs = struct
12091195
let destroy_port name =
12101196
vsctl ["--"; "--with-iface"; "--if-exists"; "del-port"; name]
12111197

1212-
let port_to_bridge name =
1213-
vsctl ~log:false ["port-to-br"; name]
1214-
12151198
let make_bond_properties name properties =
12161199
let known_props = ["mode"; "hashing-algorithm"; "updelay"; "downdelay";
12171200
"miimon"; "use_carrier"; "rebalance-interval";

networkd/network_server.ml

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -376,16 +376,6 @@ module Interface = struct
376376
end
377377
) ()
378378

379-
let get_ipv6_gateway _ dbg ~name =
380-
Debug.with_thread_associated dbg (fun () ->
381-
let output = Ip.route_show ~version:Ip.V6 name in
382-
try
383-
let line = List.find (fun s -> Astring.String.is_prefix ~affix:"default via" s) (Astring.String.cuts ~empty:false ~sep:"\n" output) in
384-
let addr = List.nth (Astring.String.cuts ~empty:false ~sep:" " line) 2 in
385-
Some (Unix.inet_addr_of_string addr)
386-
with Not_found -> None
387-
) ()
388-
389379
let set_ipv6_gateway _ dbg ~name ~address =
390380
Debug.with_thread_associated dbg (fun () ->
391381
if Proc.get_ipv6_disabled () then
@@ -511,11 +501,6 @@ module Interface = struct
511501
Ip.link_set_down name
512502
) ()
513503

514-
let is_persistent _ dbg ~name =
515-
Debug.with_thread_associated dbg (fun () ->
516-
(get_config name).persistent_i
517-
) ()
518-
519504
let set_persistent dbg name value =
520505
Debug.with_thread_associated dbg (fun () ->
521506
debug "Making interface %s %spersistent" name (if value then "" else "non-");
@@ -598,13 +583,6 @@ module Bridge = struct
598583
warn "Network-conf file not found. Falling back to Open vSwitch.";
599584
backend_kind := Openvswitch
600585

601-
let get_bond_links_up _ dbg ~name =
602-
Debug.with_thread_associated dbg (fun () ->
603-
match !backend_kind with
604-
| Openvswitch -> Ovs.get_bond_links_up name
605-
| Bridge -> Proc.get_bond_links_up name
606-
) ()
607-
608586
let get_all dbg () =
609587
Debug.with_thread_associated dbg (fun () ->
610588
match !backend_kind with
@@ -820,13 +798,6 @@ module Bridge = struct
820798
!backend_kind
821799
) ()
822800

823-
let get_ports _ dbg ~name =
824-
Debug.with_thread_associated dbg (fun () ->
825-
match !backend_kind with
826-
| Openvswitch -> Ovs.bridge_to_ports name
827-
| Bridge -> raise (Network_error Not_implemented)
828-
) ()
829-
830801
let get_all_ports dbg from_cache =
831802
Debug.with_thread_associated dbg (fun () ->
832803
if from_cache then
@@ -838,13 +809,6 @@ module Bridge = struct
838809
| Bridge -> raise (Network_error Not_implemented)
839810
) ()
840811

841-
let get_bonds _ dbg ~name =
842-
Debug.with_thread_associated dbg (fun () ->
843-
match !backend_kind with
844-
| Openvswitch -> Ovs.bridge_to_ports name
845-
| Bridge -> raise (Network_error Not_implemented)
846-
) ()
847-
848812
let get_all_bonds dbg from_cache =
849813
Debug.with_thread_associated dbg (fun () ->
850814
if from_cache then
@@ -895,13 +859,6 @@ module Bridge = struct
895859
) slaves
896860
) ()
897861

898-
let get_vlan _ dbg ~name =
899-
Debug.with_thread_associated dbg (fun () ->
900-
match !backend_kind with
901-
| Openvswitch -> Ovs.bridge_to_vlan name
902-
| Bridge -> raise (Network_error Not_implemented)
903-
) ()
904-
905862
let add_default_flows _ dbg bridge mac interfaces =
906863
Debug.with_thread_associated dbg (fun () ->
907864
match !backend_kind with
@@ -1051,23 +1008,6 @@ module Bridge = struct
10511008
physical_ifaces
10521009
) ()
10531010

1054-
let get_fail_mode _ dbg ~name =
1055-
Debug.with_thread_associated dbg (fun () ->
1056-
match !backend_kind with
1057-
| Openvswitch ->
1058-
begin match Ovs.get_fail_mode name with
1059-
| "standalone" -> Some Standalone
1060-
| "secure" -> Some Secure
1061-
| _ -> None
1062-
end
1063-
| Bridge -> raise (Network_error Not_implemented)
1064-
) ()
1065-
1066-
let is_persistent _ dbg ~name =
1067-
Debug.with_thread_associated dbg (fun () ->
1068-
(get_config name).persistent_b
1069-
) ()
1070-
10711011
let set_persistent dbg name value =
10721012
Debug.with_thread_associated dbg (fun () ->
10731013
debug "Making bridge %s %spersistent" name (if value then "" else "non-");

networkd_db/networkd_db.ml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ open Network_interface
1616

1717
let name = "networkd_db"
1818

19-
(* catch signals for clean shutdown *)
20-
let stop _signal =
21-
exit 0
22-
23-
let handle_shutdown () =
24-
Sys.set_signal Sys.sigterm (Sys.Signal_handle stop);
25-
Sys.set_signal Sys.sigint (Sys.Signal_handle stop);
26-
Sys.set_signal Sys.sigpipe Sys.Signal_ignore
27-
2819
let _ =
2920
let bridge = ref "" in
3021
let iface = ref "" in

0 commit comments

Comments
 (0)