]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: split out DBus related prototypes to networkd-link-bus.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 26 May 2019 20:35:02 +0000 (05:35 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 16 Jun 2019 00:13:12 +0000 (09:13 +0900)
src/network/meson.build
src/network/networkd-link-bus.c
src/network/networkd-link-bus.h [new file with mode: 0644]
src/network/networkd-link.c
src/network/networkd-link.h
src/network/networkd-manager.c
src/network/networkd-speed-meter.c

index 959421fc5c4455c5cbb042c70fab651c6c6c80bc..4eda3abef12e68bac12fa188a728142c93301d68 100644 (file)
@@ -63,6 +63,7 @@ sources = files('''
         networkd-ipv6-proxy-ndp.c
         networkd-ipv6-proxy-ndp.h
         networkd-link-bus.c
+        networkd-link-bus.h
         networkd-link.c
         networkd-link.h
         networkd-lldp-rx.c
index 2f414cb11652d124e93ab7283d1b265c3a07f555..0f2ffd4e8645ddf2b4e06368ba6da5699b1476f6 100644 (file)
@@ -3,6 +3,7 @@
 #include "alloc-util.h"
 #include "bus-common-errors.h"
 #include "bus-util.h"
+#include "networkd-link-bus.h"
 #include "networkd-link.h"
 #include "networkd-manager.h"
 #include "parse-util.h"
@@ -65,7 +66,7 @@ const sd_bus_vtable link_vtable[] = {
         SD_BUS_VTABLE_END
 };
 
-static char *link_bus_path(Link *link) {
+char *link_bus_path(Link *link) {
         _cleanup_free_ char *ifindex = NULL;
         char *p;
         int r;
diff --git a/src/network/networkd-link-bus.h b/src/network/networkd-link-bus.h
new file mode 100644 (file)
index 0000000..3cc3de4
--- /dev/null
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+#pragma once
+
+#include "sd-bus.h"
+
+#include "macro.h"
+
+typedef struct Link Link;
+
+extern const sd_bus_vtable link_vtable[];
+
+char *link_bus_path(Link *link);
+int link_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error);
+int link_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error);
+int link_send_changed(Link *link, const char *property, ...) _sentinel_;
index 67c0903fa69b834b4344652a0c5939ee80ce497c..56e36b7d6b5eba6aac1ed4b069a1cf14caa6667c 100644 (file)
@@ -20,6 +20,8 @@
 #include "network-internal.h"
 #include "networkd-can.h"
 #include "networkd-ipv6-proxy-ndp.h"
+#include "networkd-link-bus.h"
+#include "networkd-link.h"
 #include "networkd-lldp-tx.h"
 #include "networkd-manager.h"
 #include "networkd-ndisc.h"
index 80fc4baee600812d639bbc1a9f5ba8a3ad35294d..05b88356cfde78899b3289c2472617019ab95227 100644 (file)
@@ -183,12 +183,6 @@ int link_stop_clients(Link *link, bool may_keep_dhcp);
 const char* link_state_to_string(LinkState s) _const_;
 LinkState link_state_from_string(const char *s) _pure_;
 
-extern const sd_bus_vtable link_vtable[];
-
-int link_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error);
-int link_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error);
-int link_send_changed(Link *link, const char *property, ...) _sentinel_;
-
 uint32_t link_get_vrf_table(Link *link);
 uint32_t link_get_dhcp_route_table(Link *link);
 uint32_t link_get_ipv6_accept_ra_route_table(Link *link);
index 92e3b0a0f12cd3182c94ac4d6aaf348818cd8efb..d2e5b5de596a2e7042fe53fdb5c84e9f1153fbd7 100644 (file)
@@ -21,6 +21,7 @@
 #include "local-addresses.h"
 #include "netlink-util.h"
 #include "network-internal.h"
+#include "networkd-link-bus.h"
 #include "networkd-manager.h"
 #include "networkd-speed-meter.h"
 #include "ordered-set.h"
index 5fd30f3df889c987f5306ca06216573c8bfe4b86..c4fc56b019f9afd363ee9efc819dc7ce856a7909 100644 (file)
@@ -5,6 +5,7 @@
 #include "sd-event.h"
 #include "sd-netlink.h"
 
+#include "networkd-link-bus.h"
 #include "networkd-link.h"
 #include "networkd-manager.h"
 #include "networkd-speed-meter.h"