]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkctl: drop unused functions
authornoxiouz <atiurin@proton.me>
Tue, 24 Feb 2026 14:04:09 +0000 (23:04 +0900)
committernoxiouz <atiurin@proton.me>
Wed, 18 Mar 2026 22:55:52 +0000 (22:55 +0000)
Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
src/network/networkctl-util.c
src/network/networkctl-util.h

index 6c1db351aef9ee86662fdac5b011f3a2f06dc398..590c8a6abc2fbc7b52bbd8710333ca83a1ed8a61 100644 (file)
@@ -3,16 +3,12 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include "sd-bus.h"
-
-#include "alloc-util.h"
 #include "ansi-color.h"
 #include "bus-util.h"
 #include "log.h"
 #include "networkctl.h"
 #include "networkctl-util.h"
 #include "polkit-agent.h"
-#include "stdio-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "varlink-util.h"
@@ -117,59 +113,6 @@ bool networkd_is_running(void) {
         return cached;
 }
 
-int acquire_bus(sd_bus **ret) {
-        _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
-        int r;
-
-        assert(ret);
-
-        r = sd_bus_open_system(&bus);
-        if (r < 0)
-                return log_error_errno(r, "Failed to connect to system bus: %m");
-
-        (void) sd_bus_set_allow_interactive_authorization(bus, arg_ask_password);
-
-        if (networkd_is_running()) {
-                r = varlink_connect_networkd(/* ret_varlink= */ NULL);
-                if (r < 0)
-                        return r;
-        } else
-                log_warning("systemd-networkd is not running, output might be incomplete.");
-
-        *ret = TAKE_PTR(bus);
-        return 0;
-}
-
-int link_get_property(
-                sd_bus *bus,
-                int ifindex,
-                sd_bus_error *error,
-                sd_bus_message **reply,
-                const char *iface,
-                const char *propname,
-                const char *type) {
-
-        _cleanup_free_ char *path = NULL;
-        char ifindex_str[DECIMAL_STR_MAX(int)];
-        int r;
-
-        assert(bus);
-        assert(ifindex >= 0);
-        assert(error);
-        assert(reply);
-        assert(iface);
-        assert(propname);
-        assert(type);
-
-        xsprintf(ifindex_str, "%i", ifindex);
-
-        r = sd_bus_path_encode("/org/freedesktop/network1/link", ifindex_str, &path);
-        if (r < 0)
-                return r;
-
-        return sd_bus_get_property(bus, "org.freedesktop.network1", path, iface, propname, error, reply, type);
-}
-
 void operational_state_to_color(const char *name, const char *state, const char **on, const char **off) {
         if (STRPTR_IN_SET(state, "routable", "enslaved") ||
             (streq_ptr(name, "lo") && streq_ptr(state, "carrier"))) {
index df4ef403472fb28768fd21162527e2538c001b20..6067602d1a0f58f394af359afb75253c632e9805 100644 (file)
@@ -7,15 +7,6 @@ int varlink_connect_networkd(sd_varlink **ret_varlink);
 int reload_networkd(void);
 int reload_udevd(void);
 bool networkd_is_running(void);
-int acquire_bus(sd_bus **ret);
-int link_get_property(
-                sd_bus *bus,
-                int ifindex,
-                sd_bus_error *error,
-                sd_bus_message **reply,
-                const char *iface,
-                const char *propname,
-                const char *type);
 
 void operational_state_to_color(const char *name, const char *state, const char **on, const char **off);
 void setup_state_to_color(const char *state, const char **on, const char **off);