From c6f7c917a1b494d4455800823472227463f87438 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Fri, 21 Mar 2014 21:38:14 +0100 Subject: [PATCH] libsystemd-network: move network-utils from src/shared This does not belong in shared as it is mostly a detail of our networking subsystem. Moreover, now we can use libudev here, which will simplify things. --- Makefile.am | 7 ++++--- src/{shared/net-util.c => libsystemd-network/network-internal.c} | 2 +- src/{shared/net-util.h => libsystemd-network/network-internal.h} | 1 + src/network/network-util.h | 1 + src/network/networkd-address.c | 2 +- src/network/networkd-link.c | 2 +- src/network/networkd-netdev-gperf.gperf | 2 +- src/network/networkd-netdev.c | 2 +- src/network/networkd-network-gperf.gperf | 2 +- src/network/networkd-network.c | 2 +- src/network/networkd-route.c | 2 +- src/udev/net/link-config-gperf.gperf | 2 +- src/udev/net/link-config.c | 2 +- 13 files changed, 16 insertions(+), 13 deletions(-) rename src/{shared/net-util.c => libsystemd-network/network-internal.c} (99%) rename src/{shared/net-util.h => libsystemd-network/network-internal.h} (99%) diff --git a/Makefile.am b/Makefile.am index 65a7ffe..54cd1c6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -779,8 +779,6 @@ libsystemd_shared_la_SOURCES = \ src/shared/ima-util.h \ src/shared/ptyfwd.c \ src/shared/ptyfwd.h \ - src/shared/net-util.c \ - src/shared/net-util.h \ src/shared/errno-list.c \ src/shared/errno-list.h \ src/shared/af-list.c \ @@ -2460,7 +2458,9 @@ libsystemd_network_la_SOURCES = \ src/libsystemd-network/sd-ipv4ll.c \ src/libsystemd-network/ipv4ll-network.c \ src/libsystemd-network/ipv4ll-packet.c \ - src/libsystemd-network/ipv4ll-internal.h + src/libsystemd-network/ipv4ll-internal.h \ + src/libsystemd-network/network-internal.c \ + src/libsystemd-network/network-internal.h libsystemd_network_la_LIBADD = \ libsystemd-label.la \ @@ -2720,6 +2720,7 @@ libudev_core_la_LIBADD = \ libudev-internal.la \ libsystemd-label.la \ libsystemd-internal.la \ + libsystemd-network.la \ libsystemd-shared.la \ $(BLKID_LIBS) \ $(KMOD_LIBS) diff --git a/src/shared/net-util.c b/src/libsystemd-network/network-internal.c similarity index 99% rename from src/shared/net-util.c rename to src/libsystemd-network/network-internal.c index 1c22311..eed0fda 100644 --- a/src/shared/net-util.c +++ b/src/libsystemd-network/network-internal.c @@ -27,7 +27,7 @@ #include "strv.h" #include "siphash24.h" #include "libudev-private.h" -#include "net-util.h" +#include "network-internal.h" #include "log.h" #include "utf8.h" #include "util.h" diff --git a/src/shared/net-util.h b/src/libsystemd-network/network-internal.h similarity index 99% rename from src/shared/net-util.h rename to src/libsystemd-network/network-internal.h index 4a8d3f9..65cd0d7 100644 --- a/src/shared/net-util.h +++ b/src/libsystemd-network/network-internal.h @@ -25,6 +25,7 @@ #include #include +#include "udev.h" #include "condition-util.h" bool net_match_config(const struct ether_addr *match_mac, diff --git a/src/network/network-util.h b/src/network/network-util.h index 9979e6d..139efc7 100644 --- a/src/network/network-util.h +++ b/src/network/network-util.h @@ -22,6 +22,7 @@ ***/ #include "util.h" +#include "sd-network.h" DEFINE_TRIVIAL_CLEANUP_FUNC(sd_network_monitor*, sd_network_monitor_unref); diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 414b3bc..dd4c822 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -26,7 +26,7 @@ #include "utf8.h" #include "util.h" #include "conf-parser.h" -#include "net-util.h" +#include "network-internal.h" int address_new_static(Network *network, unsigned section, Address **ret) { _cleanup_address_free_ Address *address = NULL; diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 4044f0b..aa59dd7 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -26,7 +26,7 @@ #include "libudev-private.h" #include "util.h" #include "bus-util.h" -#include "net-util.h" +#include "network-internal.h" #include "dhcp-lease-internal.h" diff --git a/src/network/networkd-netdev-gperf.gperf b/src/network/networkd-netdev-gperf.gperf index 2793d77..ea7ba57 100644 --- a/src/network/networkd-netdev-gperf.gperf +++ b/src/network/networkd-netdev-gperf.gperf @@ -2,7 +2,7 @@ #include #include "conf-parser.h" #include "networkd.h" -#include "net-util.h" +#include "network-internal.h" %} struct ConfigPerfItem; %null_strings diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c index 298bf27..3a670b3 100644 --- a/src/network/networkd-netdev.c +++ b/src/network/networkd-netdev.c @@ -20,7 +20,7 @@ ***/ #include "networkd.h" -#include "net-util.h" +#include "network-internal.h" #include "path-util.h" #include "conf-files.h" #include "conf-parser.h" diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 7e3829a..6ba890f 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -2,7 +2,7 @@ #include #include "conf-parser.h" #include "networkd.h" -#include "net-util.h" +#include "network-internal.h" %} struct ConfigPerfItem; %null_strings diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 6e9915b..776a9d3 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -20,7 +20,7 @@ ***/ #include "networkd.h" -#include "net-util.h" +#include "network-internal.h" #include "path-util.h" #include "conf-files.h" #include "conf-parser.h" diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 0cb7239..8b020ad 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -26,7 +26,7 @@ #include "utf8.h" #include "util.h" #include "conf-parser.h" -#include "net-util.h" +#include "network-internal.h" int route_new_static(Network *network, unsigned section, Route **ret) { _cleanup_route_free_ Route *route = NULL; diff --git a/src/udev/net/link-config-gperf.gperf b/src/udev/net/link-config-gperf.gperf index 819e93c..f562498 100644 --- a/src/udev/net/link-config-gperf.gperf +++ b/src/udev/net/link-config-gperf.gperf @@ -1,7 +1,7 @@ %{ #include #include "conf-parser.h" -#include "net-util.h" +#include "network-internal.h" #include "link-config.h" #include "ethtool-util.h" %} diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 472a415..5bb6b02 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -38,7 +38,7 @@ #include "fileio.h" #include "hashmap.h" #include "rtnl-util.h" -#include "net-util.h" +#include "network-internal.h" #include "siphash24.h" struct link_config_ctx { -- 2.7.4