From 1ed649627c5dbf9254f325c8254bfa69c31466c9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 28 Jul 2016 17:26:59 -0400 Subject: headerssss --- src/grp-network/libnetworkd-core/networkd-link.h | 8 +- .../libnetworkd-core/networkd-manager.c | 19 +-- .../libnetworkd-core/networkd-netdev-bond.c | 8 +- .../libnetworkd-core/networkd-netdev-tunnel.c | 10 +- src/grp-network/libnetworkd-core/networkd-netdev.h | 3 +- src/grp-network/networkctl/networkctl.c | 13 +- src/grp-resolve/systemd-resolved/resolved-link.c | 6 +- .../systemd-resolved/resolved-manager.h | 4 +- src/grp-udev/libudev-core/net/link-config.c | 16 +- src/grp-udev/libudev-core/udev-builtin-hwdb.c | 6 +- src/libcore/loopback-setup.c | 4 +- src/libsystemd-network/test/test-acd.c | 6 +- src/libsystemd-network/test/test-ipv4ll-manual.c | 6 +- src/libsystemd/include/systemd/sd-device.h | 101 ------------ src/libsystemd/include/systemd/sd-hwdb.h | 49 ------ src/libsystemd/include/systemd/sd-netlink.h | 163 ------------------- src/libsystemd/include/systemd/sd-network.h | 176 --------------------- src/libsystemd/include/systemd/sd-resolve.h | 117 -------------- src/libsystemd/src/sd-device/Makefile | 32 +++- .../src/sd-device/device-enumerator-private.h | 2 +- src/libsystemd/src/sd-device/device-enumerator.c | 2 +- src/libsystemd/src/sd-device/device-private.c | 2 +- src/libsystemd/src/sd-device/device-private.h | 2 +- src/libsystemd/src/sd-device/sd-device.c | 2 +- src/libsystemd/src/sd-device/sd-device.h | 101 ++++++++++++ src/libsystemd/src/sd-hwdb/Makefile | 32 +++- src/libsystemd/src/sd-hwdb/hwdb-util.h | 2 +- src/libsystemd/src/sd-hwdb/sd-hwdb.c | 2 +- src/libsystemd/src/sd-hwdb/sd-hwdb.h | 49 ++++++ src/libsystemd/src/sd-netlink/local-addresses.c | 2 +- src/libsystemd/src/sd-netlink/local-addresses.h | 2 +- src/libsystemd/src/sd-netlink/netlink-internal.h | 2 +- src/libsystemd/src/sd-netlink/netlink-message.c | 2 +- src/libsystemd/src/sd-netlink/netlink-socket.c | 2 +- src/libsystemd/src/sd-netlink/netlink-util.c | 2 +- src/libsystemd/src/sd-netlink/netlink-util.h | 2 +- src/libsystemd/src/sd-netlink/rtnl-message.c | 2 +- src/libsystemd/src/sd-netlink/sd-netlink.c | 2 +- src/libsystemd/src/sd-netlink/sd-netlink.h | 163 +++++++++++++++++++ src/libsystemd/src/sd-netlink/test-netlink.c | 2 +- src/libsystemd/src/sd-network/Makefile | 32 +++- src/libsystemd/src/sd-network/network-util.h | 2 +- src/libsystemd/src/sd-network/sd-network.c | 2 +- src/libsystemd/src/sd-network/sd-network.h | 176 +++++++++++++++++++++ src/libsystemd/src/sd-resolve/Makefile | 33 +++- src/libsystemd/src/sd-resolve/sd-resolve.c | 2 +- src/libsystemd/src/sd-resolve/sd-resolve.h | 117 ++++++++++++++ src/libsystemd/src/sd-resolve/test-resolve.c | 2 +- src/libudev/src/libudev-device-internal.h | 3 +- src/libudev/src/libudev-device-private.c | 1 + src/libudev/src/libudev-device.c | 7 +- src/libudev/src/libudev-enumerate.c | 3 +- src/libudev/src/libudev-hwdb.c | 4 +- src/libudev/src/udev.h | 2 +- src/systemd-cryptsetup/cryptsetup.c | 7 +- src/systemd-fsck/fsck.c | 10 +- src/systemd-hwdb/hwdb.c | 4 +- src/systemd-nspawn/nspawn-expose-ports.c | 10 +- src/systemd-nspawn/nspawn-expose-ports.h | 2 +- src/systemd-nspawn/nspawn-network.c | 7 +- src/systemd-nspawn/nspawn-register.c | 7 +- src/systemd-socket-proxyd/socket-proxyd.c | 2 +- src/systemd-timesyncd/timesyncd-manager.h | 4 +- src/test/test-netlink-manual.c | 3 +- 64 files changed, 847 insertions(+), 721 deletions(-) delete mode 100644 src/libsystemd/include/systemd/sd-device.h delete mode 100644 src/libsystemd/include/systemd/sd-hwdb.h delete mode 100644 src/libsystemd/include/systemd/sd-netlink.h delete mode 100644 src/libsystemd/include/systemd/sd-network.h delete mode 100644 src/libsystemd/include/systemd/sd-resolve.h mode change 120000 => 100644 src/libsystemd/src/sd-device/Makefile create mode 100644 src/libsystemd/src/sd-device/sd-device.h mode change 120000 => 100644 src/libsystemd/src/sd-hwdb/Makefile create mode 100644 src/libsystemd/src/sd-hwdb/sd-hwdb.h create mode 100644 src/libsystemd/src/sd-netlink/sd-netlink.h mode change 120000 => 100644 src/libsystemd/src/sd-network/Makefile create mode 100644 src/libsystemd/src/sd-network/sd-network.h mode change 120000 => 100644 src/libsystemd/src/sd-resolve/Makefile create mode 100644 src/libsystemd/src/sd-resolve/sd-resolve.h diff --git a/src/grp-network/libnetworkd-core/networkd-link.h b/src/grp-network/libnetworkd-core/networkd-link.h index 76cdd7e42d..ac10bd41b7 100644 --- a/src/grp-network/libnetworkd-core/networkd-link.h +++ b/src/grp-network/libnetworkd-core/networkd-link.h @@ -22,16 +22,16 @@ #include #include + +#include "basic/list.h" +#include "basic/set.h" +#include "sd-netlink/sd-netlink.h" #include "systemd-network/sd-dhcp-client.h" #include "systemd-network/sd-dhcp-server.h" #include "systemd-network/sd-dhcp6-client.h" #include "systemd-network/sd-ipv4ll.h" #include "systemd-network/sd-lldp.h" #include "systemd-network/sd-ndisc.h" -#include - -#include "basic/list.h" -#include "basic/set.h" typedef enum LinkState { LINK_STATE_PENDING, diff --git a/src/grp-network/libnetworkd-core/networkd-manager.c b/src/grp-network/libnetworkd-core/networkd-manager.c index 6226c24b01..8f57e890ae 100644 --- a/src/grp-network/libnetworkd-core/networkd-manager.c +++ b/src/grp-network/libnetworkd-core/networkd-manager.c @@ -21,24 +21,25 @@ #include #include -#include #include "basic/alloc-util.h" -#include "shared/bus-util.h" -#include "shared/conf-parser.h" #include "basic/def.h" -#include "shared/dns-domain.h" #include "basic/fd-util.h" #include "basic/fileio.h" -#include "libudev-private.h" -#include "local-addresses.h" -#include "netlink-util.h" -#include "networkd.h" #include "basic/ordered-set.h" #include "basic/path-util.h" #include "basic/set.h" -#include "shared/udev-util.h" #include "basic/virt.h" +#include "sd-netlink/sd-netlink.h" +#include "shared/bus-util.h" +#include "shared/conf-parser.h" +#include "shared/dns-domain.h" +#include "shared/udev-util.h" + +#include "libudev-private.h" +#include "local-addresses.h" +#include "netlink-util.h" +#include "networkd.h" /* use 8 MB for receive socket kernel queue. */ #define RCVBUF_SIZE (8*1024*1024) diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-bond.c b/src/grp-network/libnetworkd-core/networkd-netdev-bond.c index fc1d4eb12f..6f55c3ee06 100644 --- a/src/grp-network/libnetworkd-core/networkd-netdev-bond.c +++ b/src/grp-network/libnetworkd-core/networkd-netdev-bond.c @@ -21,15 +21,15 @@ #include #include -#include - #include "basic/alloc-util.h" -#include "shared/conf-parser.h" #include "basic/extract-word.h" #include "basic/missing.h" -#include "networkd-netdev-bond.h" #include "basic/string-table.h" #include "basic/string-util.h" +#include "sd-netlink/sd-netlink.h" +#include "shared/conf-parser.h" + +#include "networkd-netdev-bond.h" /* * Number of seconds between instances where the bonding diff --git a/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.c b/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.c index 16bb8a56e8..1ede86737f 100644 --- a/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.c +++ b/src/grp-network/libnetworkd-core/networkd-netdev-tunnel.c @@ -23,16 +23,16 @@ #include #include -#include - -#include "shared/conf-parser.h" #include "basic/missing.h" -#include "networkd-link.h" -#include "networkd-netdev-tunnel.h" #include "basic/parse-util.h" #include "basic/string-table.h" #include "basic/string-util.h" #include "basic/util.h" +#include "sd-netlink/sd-netlink.h" +#include "shared/conf-parser.h" + +#include "networkd-link.h" +#include "networkd-netdev-tunnel.h" #define DEFAULT_TNL_HOP_LIMIT 64 #define IP6_FLOWINFO_FLOWLABEL htonl(0x000FFFFF) diff --git a/src/grp-network/libnetworkd-core/networkd-netdev.h b/src/grp-network/libnetworkd-core/networkd-netdev.h index fcfee9e234..43311852b2 100644 --- a/src/grp-network/libnetworkd-core/networkd-netdev.h +++ b/src/grp-network/libnetworkd-core/networkd-netdev.h @@ -19,10 +19,9 @@ along with systemd; If not, see . ***/ -#include - #include "basic/list.h" #include "basic/time-util.h" +#include "sd-netlink/sd-netlink.h" typedef struct netdev_join_callback netdev_join_callback; typedef struct Link Link; diff --git a/src/grp-network/networkctl/networkctl.c b/src/grp-network/networkctl/networkctl.c index 8d443aef3d..205b051f9a 100644 --- a/src/grp-network/networkctl/networkctl.c +++ b/src/grp-network/networkctl/networkctl.c @@ -23,20 +23,14 @@ #include #include -#include "systemd-network/sd-lldp.h" #include #include #include "basic/alloc-util.h" #include "basic/arphrd-list.h" -#include "device-util.h" #include "basic/ether-addr-util.h" #include "basic/fd-util.h" -#include "hwdb-util.h" -#include "local-addresses.h" #include "basic/locale-util.h" -#include "netlink-util.h" -#include "shared/pager.h" #include "basic/parse-util.h" #include "basic/socket-util.h" #include "basic/sparse-endian.h" @@ -48,6 +42,13 @@ #include "basic/terminal-util.h" #include "basic/util.h" #include "basic/verbs.h" +#include "shared/pager.h" +#include "systemd-network/sd-lldp.h" + +#include "device-util.h" +#include "hwdb-util.h" +#include "local-addresses.h" +#include "netlink-util.h" static bool arg_no_pager = false; static bool arg_legend = true; diff --git a/src/grp-resolve/systemd-resolved/resolved-link.c b/src/grp-resolve/systemd-resolved/resolved-link.c index 6172a763dc..1d23e49172 100644 --- a/src/grp-resolve/systemd-resolved/resolved-link.c +++ b/src/grp-resolve/systemd-resolved/resolved-link.c @@ -19,14 +19,14 @@ #include -#include - #include "basic/alloc-util.h" #include "basic/missing.h" #include "basic/parse-util.h" -#include "resolved-link.h" #include "basic/string-util.h" #include "basic/strv.h" +#include "sd-network/sd-network.h" + +#include "resolved-link.h" int link_new(Manager *m, Link **ret, int ifindex) { _cleanup_(link_freep) Link *l = NULL; diff --git a/src/grp-resolve/systemd-resolved/resolved-manager.h b/src/grp-resolve/systemd-resolved/resolved-manager.h index 1860994463..dd2a534213 100644 --- a/src/grp-resolve/systemd-resolved/resolved-manager.h +++ b/src/grp-resolve/systemd-resolved/resolved-manager.h @@ -20,12 +20,12 @@ ***/ #include -#include -#include #include "basic/hashmap.h" #include "basic/list.h" #include "basic/ordered-set.h" +#include "sd-netlink/sd-netlink.h" +#include "sd-network/sd-network.h" #include "shared/resolve-util.h" typedef struct Manager Manager; diff --git a/src/grp-udev/libudev-core/net/link-config.c b/src/grp-udev/libudev-core/net/link-config.c index 7c93c561b3..c2cd3dcc3c 100644 --- a/src/grp-udev/libudev-core/net/link-config.c +++ b/src/grp-udev/libudev-core/net/link-config.c @@ -19,19 +19,11 @@ #include -#include - #include "basic/alloc-util.h" #include "basic/conf-files.h" -#include "shared/conf-parser.h" -#include "ethtool-util.h" #include "basic/fd-util.h" -#include "libudev-private.h" -#include "link-config.h" #include "basic/log.h" #include "basic/missing.h" -#include "sd-netlink/netlink-util.h" -#include "systemd-network/network-internal.h" #include "basic/parse-util.h" #include "basic/path-util.h" #include "basic/proc-cmdline.h" @@ -41,6 +33,14 @@ #include "basic/string-util.h" #include "basic/strv.h" #include "basic/util.h" +#include "sd-netlink/netlink-util.h" +#include "sd-netlink/sd-netlink.h" +#include "shared/conf-parser.h" +#include "systemd-network/network-internal.h" +#include "libudev-private.h" + +#include "ethtool-util.h" +#include "link-config.h" struct link_config_ctx { LIST_HEAD(link_config, links); diff --git a/src/grp-udev/libudev-core/udev-builtin-hwdb.c b/src/grp-udev/libudev-core/udev-builtin-hwdb.c index 24f4ba0744..a5290ebf2b 100644 --- a/src/grp-udev/libudev-core/udev-builtin-hwdb.c +++ b/src/grp-udev/libudev-core/udev-builtin-hwdb.c @@ -22,13 +22,13 @@ #include #include -#include +#include "udev.h" #include "basic/alloc-util.h" -#include "sd-hwdb/hwdb-util.h" #include "basic/string-util.h" +#include "sd-hwdb/hwdb-util.h" +#include "sd-hwdb/sd-hwdb.h" #include "shared/udev-util.h" -#include "udev.h" static sd_hwdb *hwdb; diff --git a/src/libcore/loopback-setup.c b/src/libcore/loopback-setup.c index 8affda895c..f92e346f8c 100644 --- a/src/libcore/loopback-setup.c +++ b/src/libcore/loopback-setup.c @@ -20,10 +20,10 @@ #include #include -#include +#include "basic/missing.h" +#include "sd-netlink/sd-netlink.h" #include "loopback-setup.h" -#include "basic/missing.h" static int start_loopback(sd_netlink *rtnl) { _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL; diff --git a/src/libsystemd-network/test/test-acd.c b/src/libsystemd-network/test/test-acd.c index 922185bc7a..bf3f401ade 100644 --- a/src/libsystemd-network/test/test-acd.c +++ b/src/libsystemd-network/test/test-acd.c @@ -25,12 +25,12 @@ #include #include -#include "systemd-network/sd-ipv4acd.h" -#include #include "basic/in-addr-util.h" -#include "netlink-util.h" #include "basic/util.h" +#include "sd-netlink/netlink-util.h" +#include "sd-netlink/sd-netlink.h" +#include "systemd-network/sd-ipv4acd.h" static void acd_handler(sd_ipv4acd *acd, int event, void *userdata) { assert_se(acd); diff --git a/src/libsystemd-network/test/test-ipv4ll-manual.c b/src/libsystemd-network/test/test-ipv4ll-manual.c index 7dd669131d..aba41f4af9 100644 --- a/src/libsystemd-network/test/test-ipv4ll-manual.c +++ b/src/libsystemd-network/test/test-ipv4ll-manual.c @@ -24,15 +24,15 @@ #include #include -#include "systemd-network/sd-ipv4ll.h" -#include #include "basic/alloc-util.h" #include "basic/in-addr-util.h" -#include "netlink-util.h" #include "basic/parse-util.h" #include "basic/string-util.h" #include "basic/util.h" +#include "sd-netlink/netlink-util.h" +#include "sd-netlink/sd-netlink.h" +#include "systemd-network/sd-ipv4ll.h" static void ll_handler(sd_ipv4ll *ll, int event, void *userdata) { _cleanup_free_ char *address = NULL; diff --git a/src/libsystemd/include/systemd/sd-device.h b/src/libsystemd/include/systemd/sd-device.h deleted file mode 100644 index c1d07561d7..0000000000 --- a/src/libsystemd/include/systemd/sd-device.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef foosddevicehfoo -#define foosddevicehfoo - -/*** - This file is part of systemd. - - Copyright 2008-2012 Kay Sievers - Copyright 2014-2015 Tom Gundersen - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include - -#include "_sd-common.h" - -_SD_BEGIN_DECLARATIONS; - -typedef struct sd_device sd_device; -typedef struct sd_device_enumerator sd_device_enumerator; - -/* device */ - -sd_device *sd_device_ref(sd_device *device); -sd_device *sd_device_unref(sd_device *device); - -int sd_device_new_from_syspath(sd_device **ret, const char *syspath); -int sd_device_new_from_devnum(sd_device **ret, char type, dev_t devnum); -int sd_device_new_from_subsystem_sysname(sd_device **ret, const char *subsystem, const char *sysname); -int sd_device_new_from_device_id(sd_device **ret, const char *id); - -int sd_device_get_parent(sd_device *child, sd_device **ret); -int sd_device_get_parent_with_subsystem_devtype(sd_device *child, const char *subsystem, const char *devtype, sd_device **ret); - -int sd_device_get_syspath(sd_device *device, const char **ret); -int sd_device_get_subsystem(sd_device *device, const char **ret); -int sd_device_get_devtype(sd_device *device, const char **ret); -int sd_device_get_devnum(sd_device *device, dev_t *devnum); -int sd_device_get_ifindex(sd_device *device, int *ifindex); -int sd_device_get_driver(sd_device *device, const char **ret); -int sd_device_get_devpath(sd_device *device, const char **ret); -int sd_device_get_devname(sd_device *device, const char **ret); -int sd_device_get_sysname(sd_device *device, const char **ret); -int sd_device_get_sysnum(sd_device *device, const char **ret); - -int sd_device_get_is_initialized(sd_device *device, int *initialized); -int sd_device_get_usec_since_initialized(sd_device *device, uint64_t *usec); - -const char *sd_device_get_tag_first(sd_device *device); -const char *sd_device_get_tag_next(sd_device *device); -const char *sd_device_get_devlink_first(sd_device *device); -const char *sd_device_get_devlink_next(sd_device *device); -const char *sd_device_get_property_first(sd_device *device, const char **value); -const char *sd_device_get_property_next(sd_device *device, const char **value); -const char *sd_device_get_sysattr_first(sd_device *device); -const char *sd_device_get_sysattr_next(sd_device *device); - -int sd_device_has_tag(sd_device *device, const char *tag); -int sd_device_get_property_value(sd_device *device, const char *key, const char **value); -int sd_device_get_sysattr_value(sd_device *device, const char *sysattr, const char **_value); - -int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, char *value); - -/* device enumerator */ - -int sd_device_enumerator_new(sd_device_enumerator **ret); -sd_device_enumerator *sd_device_enumerator_ref(sd_device_enumerator *enumerator); -sd_device_enumerator *sd_device_enumerator_unref(sd_device_enumerator *enumerator); - -sd_device *sd_device_enumerator_get_device_first(sd_device_enumerator *enumerator); -sd_device *sd_device_enumerator_get_device_next(sd_device_enumerator *enumerator); -sd_device *sd_device_enumerator_get_subsystem_first(sd_device_enumerator *enumerator); -sd_device *sd_device_enumerator_get_subsystem_next(sd_device_enumerator *enumerator); - -int sd_device_enumerator_add_match_subsystem(sd_device_enumerator *enumerator, const char *subsystem, int match); -int sd_device_enumerator_add_match_sysattr(sd_device_enumerator *enumerator, const char *sysattr, const char *value, int match); -int sd_device_enumerator_add_match_property(sd_device_enumerator *enumerator, const char *property, const char *value); -int sd_device_enumerator_add_match_sysname(sd_device_enumerator *enumerator, const char *sysname); -int sd_device_enumerator_add_match_tag(sd_device_enumerator *enumerator, const char *tag); -int sd_device_enumerator_add_match_parent(sd_device_enumerator *enumerator, sd_device *parent); -int sd_device_enumerator_allow_uninitialized(sd_device_enumerator *enumerator); - -_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_device, sd_device_unref); -_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_device_enumerator, sd_device_enumerator_unref); - -_SD_END_DECLARATIONS; - -#endif diff --git a/src/libsystemd/include/systemd/sd-hwdb.h b/src/libsystemd/include/systemd/sd-hwdb.h deleted file mode 100644 index 7105920492..0000000000 --- a/src/libsystemd/include/systemd/sd-hwdb.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef foosdhwdbhfoo -#define foosdhwdbhfoo - -/*** - This file is part of systemd. - - Copyright 2008-2012 Kay Sievers - Copyright 2014 Tom Gundersen - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "_sd-common.h" - -_SD_BEGIN_DECLARATIONS; - -typedef struct sd_hwdb sd_hwdb; - -sd_hwdb *sd_hwdb_ref(sd_hwdb *hwdb); -sd_hwdb *sd_hwdb_unref(sd_hwdb *hwdb); - -int sd_hwdb_new(sd_hwdb **ret); - -int sd_hwdb_get(sd_hwdb *hwdb, const char *modalias, const char *key, const char **value); - -int sd_hwdb_seek(sd_hwdb *hwdb, const char *modalias); -int sd_hwdb_enumerate(sd_hwdb *hwdb, const char **key, const char **value); - -/* the inverse condition avoids ambiguity of dangling 'else' after the macro */ -#define SD_HWDB_FOREACH_PROPERTY(hwdb, modalias, key, value) \ - if (sd_hwdb_seek(hwdb, modalias) < 0) { } \ - else while (sd_hwdb_enumerate(hwdb, &(key), &(value)) > 0) - -_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_hwdb, sd_hwdb_unref); - -_SD_END_DECLARATIONS; - -#endif diff --git a/src/libsystemd/include/systemd/sd-netlink.h b/src/libsystemd/include/systemd/sd-netlink.h deleted file mode 100644 index c4cefe4e30..0000000000 --- a/src/libsystemd/include/systemd/sd-netlink.h +++ /dev/null @@ -1,163 +0,0 @@ -#ifndef foosdnetlinkhfoo -#define foosdnetlinkhfoo - -/*** - This file is part of systemd. - - Copyright 2013 Tom Gundersen - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include -#include -#include - -#include - -#include "_sd-common.h" - -_SD_BEGIN_DECLARATIONS; - -typedef struct sd_netlink sd_netlink; -typedef struct sd_netlink_message sd_netlink_message; - -/* callback */ - -typedef int (*sd_netlink_message_handler_t)(sd_netlink *nl, sd_netlink_message *m, void *userdata); - -/* bus */ -int sd_netlink_new_from_netlink(sd_netlink **nl, int fd); -int sd_netlink_open(sd_netlink **nl); -int sd_netlink_open_fd(sd_netlink **nl, int fd); -int sd_netlink_inc_rcvbuf(const sd_netlink *const rtnl, const int size); - -sd_netlink *sd_netlink_ref(sd_netlink *nl); -sd_netlink *sd_netlink_unref(sd_netlink *nl); - -int sd_netlink_send(sd_netlink *nl, sd_netlink_message *message, uint32_t *serial); -int sd_netlink_call_async(sd_netlink *nl, sd_netlink_message *message, - sd_netlink_message_handler_t callback, - void *userdata, uint64_t usec, uint32_t *serial); -int sd_netlink_call_async_cancel(sd_netlink *nl, uint32_t serial); -int sd_netlink_call(sd_netlink *nl, sd_netlink_message *message, uint64_t timeout, - sd_netlink_message **reply); - -int sd_netlink_get_events(sd_netlink *nl); -int sd_netlink_get_timeout(sd_netlink *nl, uint64_t *timeout); -int sd_netlink_process(sd_netlink *nl, sd_netlink_message **ret); -int sd_netlink_wait(sd_netlink *nl, uint64_t timeout); - -int sd_netlink_add_match(sd_netlink *nl, uint16_t match, sd_netlink_message_handler_t c, void *userdata); -int sd_netlink_remove_match(sd_netlink *nl, uint16_t match, sd_netlink_message_handler_t c, void *userdata); - -int sd_netlink_attach_event(sd_netlink *nl, sd_event *e, int64_t priority); -int sd_netlink_detach_event(sd_netlink *nl); - -int sd_netlink_message_append_string(sd_netlink_message *m, unsigned short type, const char *data); -int sd_netlink_message_append_flag(sd_netlink_message *m, unsigned short type); -int sd_netlink_message_append_u8(sd_netlink_message *m, unsigned short type, uint8_t data); -int sd_netlink_message_append_u16(sd_netlink_message *m, unsigned short type, uint16_t data); -int sd_netlink_message_append_u32(sd_netlink_message *m, unsigned short type, uint32_t data); -int sd_netlink_message_append_data(sd_netlink_message *m, unsigned short type, const void *data, size_t len); -int sd_netlink_message_append_in_addr(sd_netlink_message *m, unsigned short type, const struct in_addr *data); -int sd_netlink_message_append_in6_addr(sd_netlink_message *m, unsigned short type, const struct in6_addr *data); -int sd_netlink_message_append_ether_addr(sd_netlink_message *m, unsigned short type, const struct ether_addr *data); -int sd_netlink_message_append_cache_info(sd_netlink_message *m, unsigned short type, const struct ifa_cacheinfo *info); - -int sd_netlink_message_open_container(sd_netlink_message *m, unsigned short type); -int sd_netlink_message_open_container_union(sd_netlink_message *m, unsigned short type, const char *key); -int sd_netlink_message_close_container(sd_netlink_message *m); - -int sd_netlink_message_read_string(sd_netlink_message *m, unsigned short type, const char **data); -int sd_netlink_message_read_u8(sd_netlink_message *m, unsigned short type, uint8_t *data); -int sd_netlink_message_read_u16(sd_netlink_message *m, unsigned short type, uint16_t *data); -int sd_netlink_message_read_u32(sd_netlink_message *m, unsigned short type, uint32_t *data); -int sd_netlink_message_read_ether_addr(sd_netlink_message *m, unsigned short type, struct ether_addr *data); -int sd_netlink_message_read_cache_info(sd_netlink_message *m, unsigned short type, struct ifa_cacheinfo *info); -int sd_netlink_message_read_in_addr(sd_netlink_message *m, unsigned short type, struct in_addr *data); -int sd_netlink_message_read_in6_addr(sd_netlink_message *m, unsigned short type, struct in6_addr *data); -int sd_netlink_message_enter_container(sd_netlink_message *m, unsigned short type); -int sd_netlink_message_exit_container(sd_netlink_message *m); - -int sd_netlink_message_rewind(sd_netlink_message *m); - -sd_netlink_message *sd_netlink_message_next(sd_netlink_message *m); - -sd_netlink_message *sd_netlink_message_ref(sd_netlink_message *m); -sd_netlink_message *sd_netlink_message_unref(sd_netlink_message *m); - -int sd_netlink_message_request_dump(sd_netlink_message *m, int dump); -int sd_netlink_message_is_error(sd_netlink_message *m); -int sd_netlink_message_get_errno(sd_netlink_message *m); -int sd_netlink_message_get_type(sd_netlink_message *m, uint16_t *type); -int sd_netlink_message_set_flags(sd_netlink_message *m, uint16_t flags); -int sd_netlink_message_is_broadcast(sd_netlink_message *m); - -/* rtnl */ - -int sd_rtnl_message_new_link(sd_netlink *nl, sd_netlink_message **ret, uint16_t msg_type, int index); -int sd_rtnl_message_new_addr_update(sd_netlink *nl, sd_netlink_message **ret, int index, int family); -int sd_rtnl_message_new_addr(sd_netlink *nl, sd_netlink_message **ret, uint16_t msg_type, int index, int family); -int sd_rtnl_message_new_route(sd_netlink *nl, sd_netlink_message **ret, uint16_t nlmsg_type, int rtm_family, unsigned char rtm_protocol); -int sd_rtnl_message_new_neigh(sd_netlink *nl, sd_netlink_message **ret, uint16_t msg_type, int index, int nda_family); - -int sd_rtnl_message_get_family(sd_netlink_message *m, int *family); - -int sd_rtnl_message_addr_set_prefixlen(sd_netlink_message *m, unsigned char prefixlen); -int sd_rtnl_message_addr_set_scope(sd_netlink_message *m, unsigned char scope); -int sd_rtnl_message_addr_set_flags(sd_netlink_message *m, unsigned char flags); -int sd_rtnl_message_addr_get_family(sd_netlink_message *m, int *family); -int sd_rtnl_message_addr_get_prefixlen(sd_netlink_message *m, unsigned char *prefixlen); -int sd_rtnl_message_addr_get_scope(sd_netlink_message *m, unsigned char *scope); -int sd_rtnl_message_addr_get_flags(sd_netlink_message *m, unsigned char *flags); -int sd_rtnl_message_addr_get_ifindex(sd_netlink_message *m, int *ifindex); - -int sd_rtnl_message_link_set_flags(sd_netlink_message *m, unsigned flags, unsigned change); -int sd_rtnl_message_link_set_type(sd_netlink_message *m, unsigned type); -int sd_rtnl_message_link_set_family(sd_netlink_message *m, unsigned family); -int sd_rtnl_message_link_get_ifindex(sd_netlink_message *m, int *ifindex); -int sd_rtnl_message_link_get_flags(sd_netlink_message *m, unsigned *flags); -int sd_rtnl_message_link_get_type(sd_netlink_message *m, unsigned short *type); - -int sd_rtnl_message_route_set_dst_prefixlen(sd_netlink_message *m, unsigned char prefixlen); -int sd_rtnl_message_route_set_src_prefixlen(sd_netlink_message *m, unsigned char prefixlen); -int sd_rtnl_message_route_set_scope(sd_netlink_message *m, unsigned char scope); -int sd_rtnl_message_route_set_flags(sd_netlink_message *m, unsigned flags); -int sd_rtnl_message_route_set_table(sd_netlink_message *m, unsigned char table); -int sd_rtnl_message_route_get_flags(sd_netlink_message *m, unsigned *flags); -int sd_rtnl_message_route_get_family(sd_netlink_message *m, int *family); -int sd_rtnl_message_route_set_family(sd_netlink_message *m, int family); -int sd_rtnl_message_route_get_protocol(sd_netlink_message *m, unsigned char *protocol); -int sd_rtnl_message_route_get_scope(sd_netlink_message *m, unsigned char *scope); -int sd_rtnl_message_route_get_tos(sd_netlink_message *m, unsigned char *tos); -int sd_rtnl_message_route_get_table(sd_netlink_message *m, unsigned char *table); -int sd_rtnl_message_route_get_dst_prefixlen(sd_netlink_message *m, unsigned char *dst_len); -int sd_rtnl_message_route_get_src_prefixlen(sd_netlink_message *m, unsigned char *src_len); - -int sd_rtnl_message_neigh_set_flags(sd_netlink_message *m, uint8_t flags); -int sd_rtnl_message_neigh_set_state(sd_netlink_message *m, uint16_t state); -int sd_rtnl_message_neigh_get_family(sd_netlink_message *m, int *family); -int sd_rtnl_message_neigh_get_ifindex(sd_netlink_message *m, int *family); -int sd_rtnl_message_neigh_get_state(sd_netlink_message *m, uint16_t *state); -int sd_rtnl_message_neigh_get_flags(sd_netlink_message *m, uint8_t *flags); - -_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_netlink, sd_netlink_unref); -_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_netlink_message, sd_netlink_message_unref); - -_SD_END_DECLARATIONS; - -#endif diff --git a/src/libsystemd/include/systemd/sd-network.h b/src/libsystemd/include/systemd/sd-network.h deleted file mode 100644 index 0f13e2bae7..0000000000 --- a/src/libsystemd/include/systemd/sd-network.h +++ /dev/null @@ -1,176 +0,0 @@ -#ifndef foosdnetworkhfoo -#define foosdnetworkhfoo - -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - Copyright 2014 Tom Gundersen - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include - -#include "_sd-common.h" - -/* - * A few points: - * - * Instead of returning an empty string array or empty integer array, we - * may return NULL. - * - * Free the data the library returns with libc free(). String arrays - * are NULL terminated, and you need to free the array itself in - * addition to the strings contained. - * - * We return error codes as negative errno, kernel-style. On success, we - * return 0 or positive. - * - * These functions access data in /run. This is a virtual file system; - * therefore, accesses are relatively cheap. - * - * See sd-network(3) for more information. - */ - -_SD_BEGIN_DECLARATIONS; - -/* Get overall operational state - * Possible states: down, up, dormant, carrier, degraded, routable - * Possible return codes: - * -ENODATA: networkd is not aware of any links - */ -int sd_network_get_operational_state(char **state); - -/* Get DNS entries for all links. These are string representations of - * IP addresses */ -int sd_network_get_dns(char ***dns); - -/* Get NTP entries for all links. These are domain names or string - * representations of IP addresses */ -int sd_network_get_ntp(char ***ntp); - -/* Get the search domains for all links. */ -int sd_network_get_search_domains(char ***domains); - -/* Get the search domains for all links. */ -int sd_network_get_route_domains(char ***domains); - -/* Get setup state from ifindex. - * Possible states: - * pending: udev is still processing the link, we don't yet know if we will manage it - * failed: networkd failed to manage the link - * configuring: in the process of retrieving configuration or configuring the link - * configured: link configured successfully - * unmanaged: networkd is not handling the link - * linger: the link is gone, but has not yet been dropped by networkd - * Possible return codes: - * -ENODATA: networkd is not aware of the link - */ -int sd_network_link_get_setup_state(int ifindex, char **state); - -/* Get operational state from ifindex. - * Possible states: - * off: the device is powered down - * no-carrier: the device is powered up, but it does not yet have a carrier - * dormant: the device has a carrier, but is not yet ready for normal traffic - * carrier: the link has a carrier - * degraded: the link has carrier and addresses valid on the local link configured - * routable: the link has carrier and routable address configured - * Possible return codes: - * -ENODATA: networkd is not aware of the link - */ -int sd_network_link_get_operational_state(int ifindex, char **state); - -/* Get path to .network file applied to link */ -int sd_network_link_get_network_file(int ifindex, char **filename); - -/* Get DNS entries for a given link. These are string representations of - * IP addresses */ -int sd_network_link_get_dns(int ifindex, char ***ret); - -/* Get NTP entries for a given link. These are domain names or string - * representations of IP addresses */ -int sd_network_link_get_ntp(int ifindex, char ***ret); - -/* Indicates whether or not LLMNR should be enabled for the link - * Possible levels of support: yes, no, resolve - * Possible return codes: - * -ENODATA: networkd is not aware of the link - */ -int sd_network_link_get_llmnr(int ifindex, char **llmnr); - -/* Indicates whether or not MulticastDNS should be enabled for the - * link. - * Possible levels of support: yes, no, resolve - * Possible return codes: - * -ENODATA: networkd is not aware of the link - */ -int sd_network_link_get_mdns(int ifindex, char **mdns); - -/* Indicates whether or not DNSSEC should be enabled for the link - * Possible levels of support: yes, no, allow-downgrade - * Possible return codes: - * -ENODATA: networkd is not aware of the link - */ -int sd_network_link_get_dnssec(int ifindex, char **dnssec); - -/* Returns the list of per-interface DNSSEC negative trust anchors - * Possible return codes: - * -ENODATA: networkd is not aware of the link, or has no such data - */ -int sd_network_link_get_dnssec_negative_trust_anchors(int ifindex, char ***nta); - -/* Get the search DNS domain names for a given link. */ -int sd_network_link_get_search_domains(int ifindex, char ***domains); - -/* Get the route DNS domain names for a given link. */ -int sd_network_link_get_route_domains(int ifindex, char ***domains); - -/* Get the carrier interface indexes to which current link is bound to. */ -int sd_network_link_get_carrier_bound_to(int ifindex, int **ifindexes); - -/* Get the CARRIERS that are bound to current link. */ -int sd_network_link_get_carrier_bound_by(int ifindex, int **ifindexes); - -/* Get the timezone that was learnt on a specific link. */ -int sd_network_link_get_timezone(int ifindex, char **timezone); - -/* Monitor object */ -typedef struct sd_network_monitor sd_network_monitor; - -/* Create a new monitor. Category must be NULL, "links" or "leases". */ -int sd_network_monitor_new(sd_network_monitor **ret, const char *category); - -/* Destroys the passed monitor. Returns NULL. */ -sd_network_monitor* sd_network_monitor_unref(sd_network_monitor *m); - -/* Flushes the monitor */ -int sd_network_monitor_flush(sd_network_monitor *m); - -/* Get FD from monitor */ -int sd_network_monitor_get_fd(sd_network_monitor *m); - -/* Get poll() mask to monitor */ -int sd_network_monitor_get_events(sd_network_monitor *m); - -/* Get timeout for poll(), as usec value relative to CLOCK_MONOTONIC's epoch */ -int sd_network_monitor_get_timeout(sd_network_monitor *m, uint64_t *timeout_usec); - -_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_network_monitor, sd_network_monitor_unref); - -_SD_END_DECLARATIONS; - -#endif diff --git a/src/libsystemd/include/systemd/sd-resolve.h b/src/libsystemd/include/systemd/sd-resolve.h deleted file mode 100644 index fe3b910671..0000000000 --- a/src/libsystemd/include/systemd/sd-resolve.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef foosdresolvehfoo -#define foosdresolvehfoo - -/*** - This file is part of systemd. - - Copyright 2005-2014 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include -#include - -#include - -#include "_sd-common.h" - -_SD_BEGIN_DECLARATIONS; - -/* An opaque sd-resolve session structure */ -typedef struct sd_resolve sd_resolve; - -/* An opaque sd-resolve query structure */ -typedef struct sd_resolve_query sd_resolve_query; - -/* A callback on completion */ -typedef int (*sd_resolve_getaddrinfo_handler_t)(sd_resolve_query *q, int ret, const struct addrinfo *ai, void *userdata); -typedef int (*sd_resolve_getnameinfo_handler_t)(sd_resolve_query *q, int ret, const char *host, const char *serv, void *userdata); - -enum { - SD_RESOLVE_GET_HOST = UINT64_C(1), - SD_RESOLVE_GET_SERVICE = UINT64_C(2), - SD_RESOLVE_GET_BOTH = UINT64_C(3), -}; - -int sd_resolve_default(sd_resolve **ret); - -/* Allocate a new sd-resolve session. */ -int sd_resolve_new(sd_resolve **ret); - -/* Free a sd-resolve session. This destroys all attached - * sd_resolve_query objects automatically. */ -sd_resolve* sd_resolve_unref(sd_resolve *resolve); -sd_resolve* sd_resolve_ref(sd_resolve *resolve); - -/* Return the UNIX file descriptor to poll() for events on. Use this - * function to integrate sd-resolve with your custom main loop. */ -int sd_resolve_get_fd(sd_resolve *resolve); - -/* Return the poll() events (a combination of flags like POLLIN, - * POLLOUT, ...) to check for. */ -int sd_resolve_get_events(sd_resolve *resolve); - -/* Return the poll() timeout to pass. Returns (uint64_t) -1 as - * timeout if no timeout is needed. */ -int sd_resolve_get_timeout(sd_resolve *resolve, uint64_t *timeout_usec); - -/* Process pending responses. After this function is called, you can - * get the next completed query object(s) using - * sd_resolve_get_next(). */ -int sd_resolve_process(sd_resolve *resolve); - -/* Wait for a resolve event to complete. */ -int sd_resolve_wait(sd_resolve *resolve, uint64_t timeout_usec); - -int sd_resolve_get_tid(sd_resolve *resolve, pid_t *tid); - -int sd_resolve_attach_event(sd_resolve *resolve, sd_event *e, int64_t priority); -int sd_resolve_detach_event(sd_resolve *resolve); -sd_event *sd_resolve_get_event(sd_resolve *resolve); - -/* Issue a name-to-address query on the specified session. The - * arguments are compatible with those of libc's - * getaddrinfo(3). The function returns a new query object. When the - * query is completed, you may retrieve the results using - * sd_resolve_getaddrinfo_done(). */ -int sd_resolve_getaddrinfo(sd_resolve *resolve, sd_resolve_query **q, const char *node, const char *service, const struct addrinfo *hints, sd_resolve_getaddrinfo_handler_t callback, void *userdata); - -/* Issue an address-to-name query on the specified session. The - * arguments are compatible with those of libc's - * getnameinfo(3). The function returns a new query object. When the - * query is completed, you may retrieve the results using - * sd_resolve_getnameinfo_done(). Set gethost (resp. getserv) to non-zero - * if you want to query the hostname (resp. the service name). */ -int sd_resolve_getnameinfo(sd_resolve *resolve, sd_resolve_query **q, const struct sockaddr *sa, socklen_t salen, int flags, uint64_t get, sd_resolve_getnameinfo_handler_t callback, void *userdata); - -sd_resolve_query *sd_resolve_query_ref(sd_resolve_query* q); -sd_resolve_query *sd_resolve_query_unref(sd_resolve_query* q); - -/* Returns non-zero when the query operation specified by q has been completed. */ -int sd_resolve_query_is_done(sd_resolve_query*q); - -void *sd_resolve_query_get_userdata(sd_resolve_query *q); -void *sd_resolve_query_set_userdata(sd_resolve_query *q, void *userdata); - -sd_resolve *sd_resolve_query_get_resolve(sd_resolve_query *q); - -_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_resolve, sd_resolve_unref); -_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_resolve_query, sd_resolve_query_unref); - -_SD_END_DECLARATIONS; - -#endif diff --git a/src/libsystemd/src/sd-device/Makefile b/src/libsystemd/src/sd-device/Makefile deleted file mode 120000 index 71a1159ce0..0000000000 --- a/src/libsystemd/src/sd-device/Makefile +++ /dev/null @@ -1 +0,0 @@ -../subdir.mk \ No newline at end of file diff --git a/src/libsystemd/src/sd-device/Makefile b/src/libsystemd/src/sd-device/Makefile new file mode 100644 index 0000000000..821bb70dfc --- /dev/null +++ b/src/libsystemd/src/sd-device/Makefile @@ -0,0 +1,31 @@ +# -*- Mode: makefile; indent-tabs-mode: t -*- +# +# This file is part of systemd. +# +# Copyright 2010-2012 Lennart Poettering +# Copyright 2010-2012 Kay Sievers +# Copyright 2013 Zbigniew Jędrzejewski-Szmek +# Copyright 2013 David Strauss +# Copyright 2016 Luke Shumaker +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk + +systemd.CPPFLAGS += $(libsystemd.CPPFLAGS) +systemd.CPPFLAGS += $(libbasic.CPPFLAGS) +systemd.CPPFLAGS += $(libshared.CPPFLAGS) + +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libsystemd/src/sd-device/device-enumerator-private.h b/src/libsystemd/src/sd-device/device-enumerator-private.h index d46e26b56e..eb06f9542d 100644 --- a/src/libsystemd/src/sd-device/device-enumerator-private.h +++ b/src/libsystemd/src/sd-device/device-enumerator-private.h @@ -19,7 +19,7 @@ along with systemd; If not, see . ***/ -#include +#include "sd-device.h" int device_enumerator_scan_devices(sd_device_enumerator *enumeartor); int device_enumerator_scan_subsystems(sd_device_enumerator *enumeartor); diff --git a/src/libsystemd/src/sd-device/device-enumerator.c b/src/libsystemd/src/sd-device/device-enumerator.c index db3228d707..97f3453898 100644 --- a/src/libsystemd/src/sd-device/device-enumerator.c +++ b/src/libsystemd/src/sd-device/device-enumerator.c @@ -18,7 +18,7 @@ along with systemd; If not, see . ***/ -#include +#include "sd-device.h" #include "basic/alloc-util.h" #include "device-enumerator-private.h" diff --git a/src/libsystemd/src/sd-device/device-private.c b/src/libsystemd/src/sd-device/device-private.c index f1c2ada066..dce2ba091a 100644 --- a/src/libsystemd/src/sd-device/device-private.c +++ b/src/libsystemd/src/sd-device/device-private.c @@ -22,7 +22,7 @@ #include #include -#include +#include "sd-device.h" #include "basic/alloc-util.h" #include "device-internal.h" diff --git a/src/libsystemd/src/sd-device/device-private.h b/src/libsystemd/src/sd-device/device-private.h index d6add2f7b2..29b3e155fb 100644 --- a/src/libsystemd/src/sd-device/device-private.h +++ b/src/libsystemd/src/sd-device/device-private.h @@ -23,7 +23,7 @@ #include #include -#include +#include "sd-device.h" int device_new_from_nulstr(sd_device **ret, uint8_t *nulstr, size_t len); int device_new_from_strv(sd_device **ret, char **strv); diff --git a/src/libsystemd/src/sd-device/sd-device.c b/src/libsystemd/src/sd-device/sd-device.c index 5a7e34a77b..20c7684b97 100644 --- a/src/libsystemd/src/sd-device/sd-device.c +++ b/src/libsystemd/src/sd-device/sd-device.c @@ -22,7 +22,7 @@ #include #include -#include +#include "sd-device.h" #include "basic/alloc-util.h" #include "device-internal.h" diff --git a/src/libsystemd/src/sd-device/sd-device.h b/src/libsystemd/src/sd-device/sd-device.h new file mode 100644 index 0000000000..5e32fc6110 --- /dev/null +++ b/src/libsystemd/src/sd-device/sd-device.h @@ -0,0 +1,101 @@ +#ifndef foosddevicehfoo +#define foosddevicehfoo + +/*** + This file is part of systemd. + + Copyright 2008-2012 Kay Sievers + Copyright 2014-2015 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include +#include + +#include + +_SD_BEGIN_DECLARATIONS; + +typedef struct sd_device sd_device; +typedef struct sd_device_enumerator sd_device_enumerator; + +/* device */ + +sd_device *sd_device_ref(sd_device *device); +sd_device *sd_device_unref(sd_device *device); + +int sd_device_new_from_syspath(sd_device **ret, const char *syspath); +int sd_device_new_from_devnum(sd_device **ret, char type, dev_t devnum); +int sd_device_new_from_subsystem_sysname(sd_device **ret, const char *subsystem, const char *sysname); +int sd_device_new_from_device_id(sd_device **ret, const char *id); + +int sd_device_get_parent(sd_device *child, sd_device **ret); +int sd_device_get_parent_with_subsystem_devtype(sd_device *child, const char *subsystem, const char *devtype, sd_device **ret); + +int sd_device_get_syspath(sd_device *device, const char **ret); +int sd_device_get_subsystem(sd_device *device, const char **ret); +int sd_device_get_devtype(sd_device *device, const char **ret); +int sd_device_get_devnum(sd_device *device, dev_t *devnum); +int sd_device_get_ifindex(sd_device *device, int *ifindex); +int sd_device_get_driver(sd_device *device, const char **ret); +int sd_device_get_devpath(sd_device *device, const char **ret); +int sd_device_get_devname(sd_device *device, const char **ret); +int sd_device_get_sysname(sd_device *device, const char **ret); +int sd_device_get_sysnum(sd_device *device, const char **ret); + +int sd_device_get_is_initialized(sd_device *device, int *initialized); +int sd_device_get_usec_since_initialized(sd_device *device, uint64_t *usec); + +const char *sd_device_get_tag_first(sd_device *device); +const char *sd_device_get_tag_next(sd_device *device); +const char *sd_device_get_devlink_first(sd_device *device); +const char *sd_device_get_devlink_next(sd_device *device); +const char *sd_device_get_property_first(sd_device *device, const char **value); +const char *sd_device_get_property_next(sd_device *device, const char **value); +const char *sd_device_get_sysattr_first(sd_device *device); +const char *sd_device_get_sysattr_next(sd_device *device); + +int sd_device_has_tag(sd_device *device, const char *tag); +int sd_device_get_property_value(sd_device *device, const char *key, const char **value); +int sd_device_get_sysattr_value(sd_device *device, const char *sysattr, const char **_value); + +int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, char *value); + +/* device enumerator */ + +int sd_device_enumerator_new(sd_device_enumerator **ret); +sd_device_enumerator *sd_device_enumerator_ref(sd_device_enumerator *enumerator); +sd_device_enumerator *sd_device_enumerator_unref(sd_device_enumerator *enumerator); + +sd_device *sd_device_enumerator_get_device_first(sd_device_enumerator *enumerator); +sd_device *sd_device_enumerator_get_device_next(sd_device_enumerator *enumerator); +sd_device *sd_device_enumerator_get_subsystem_first(sd_device_enumerator *enumerator); +sd_device *sd_device_enumerator_get_subsystem_next(sd_device_enumerator *enumerator); + +int sd_device_enumerator_add_match_subsystem(sd_device_enumerator *enumerator, const char *subsystem, int match); +int sd_device_enumerator_add_match_sysattr(sd_device_enumerator *enumerator, const char *sysattr, const char *value, int match); +int sd_device_enumerator_add_match_property(sd_device_enumerator *enumerator, const char *property, const char *value); +int sd_device_enumerator_add_match_sysname(sd_device_enumerator *enumerator, const char *sysname); +int sd_device_enumerator_add_match_tag(sd_device_enumerator *enumerator, const char *tag); +int sd_device_enumerator_add_match_parent(sd_device_enumerator *enumerator, sd_device *parent); +int sd_device_enumerator_allow_uninitialized(sd_device_enumerator *enumerator); + +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_device, sd_device_unref); +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_device_enumerator, sd_device_enumerator_unref); + +_SD_END_DECLARATIONS; + +#endif diff --git a/src/libsystemd/src/sd-hwdb/Makefile b/src/libsystemd/src/sd-hwdb/Makefile deleted file mode 120000 index 71a1159ce0..0000000000 --- a/src/libsystemd/src/sd-hwdb/Makefile +++ /dev/null @@ -1 +0,0 @@ -../subdir.mk \ No newline at end of file diff --git a/src/libsystemd/src/sd-hwdb/Makefile b/src/libsystemd/src/sd-hwdb/Makefile new file mode 100644 index 0000000000..821bb70dfc --- /dev/null +++ b/src/libsystemd/src/sd-hwdb/Makefile @@ -0,0 +1,31 @@ +# -*- Mode: makefile; indent-tabs-mode: t -*- +# +# This file is part of systemd. +# +# Copyright 2010-2012 Lennart Poettering +# Copyright 2010-2012 Kay Sievers +# Copyright 2013 Zbigniew Jędrzejewski-Szmek +# Copyright 2013 David Strauss +# Copyright 2016 Luke Shumaker +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk + +systemd.CPPFLAGS += $(libsystemd.CPPFLAGS) +systemd.CPPFLAGS += $(libbasic.CPPFLAGS) +systemd.CPPFLAGS += $(libshared.CPPFLAGS) + +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libsystemd/src/sd-hwdb/hwdb-util.h b/src/libsystemd/src/sd-hwdb/hwdb-util.h index c3cba2e9a0..63c154d34e 100644 --- a/src/libsystemd/src/sd-hwdb/hwdb-util.h +++ b/src/libsystemd/src/sd-hwdb/hwdb-util.h @@ -19,7 +19,7 @@ along with systemd; If not, see . ***/ -#include +#include "sd-hwdb.h" #include "basic/util.h" diff --git a/src/libsystemd/src/sd-hwdb/sd-hwdb.c b/src/libsystemd/src/sd-hwdb/sd-hwdb.c index 8127b7c5c6..9964599c99 100644 --- a/src/libsystemd/src/sd-hwdb/sd-hwdb.c +++ b/src/libsystemd/src/sd-hwdb/sd-hwdb.c @@ -27,7 +27,7 @@ #include #include -#include +#include "sd-hwdb.h" #include "basic/alloc-util.h" #include "basic/fd-util.h" diff --git a/src/libsystemd/src/sd-hwdb/sd-hwdb.h b/src/libsystemd/src/sd-hwdb/sd-hwdb.h new file mode 100644 index 0000000000..f46d7ad561 --- /dev/null +++ b/src/libsystemd/src/sd-hwdb/sd-hwdb.h @@ -0,0 +1,49 @@ +#ifndef foosdhwdbhfoo +#define foosdhwdbhfoo + +/*** + This file is part of systemd. + + Copyright 2008-2012 Kay Sievers + Copyright 2014 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include + +_SD_BEGIN_DECLARATIONS; + +typedef struct sd_hwdb sd_hwdb; + +sd_hwdb *sd_hwdb_ref(sd_hwdb *hwdb); +sd_hwdb *sd_hwdb_unref(sd_hwdb *hwdb); + +int sd_hwdb_new(sd_hwdb **ret); + +int sd_hwdb_get(sd_hwdb *hwdb, const char *modalias, const char *key, const char **value); + +int sd_hwdb_seek(sd_hwdb *hwdb, const char *modalias); +int sd_hwdb_enumerate(sd_hwdb *hwdb, const char **key, const char **value); + +/* the inverse condition avoids ambiguity of dangling 'else' after the macro */ +#define SD_HWDB_FOREACH_PROPERTY(hwdb, modalias, key, value) \ + if (sd_hwdb_seek(hwdb, modalias) < 0) { } \ + else while (sd_hwdb_enumerate(hwdb, &(key), &(value)) > 0) + +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_hwdb, sd_hwdb_unref); + +_SD_END_DECLARATIONS; + +#endif diff --git a/src/libsystemd/src/sd-netlink/local-addresses.c b/src/libsystemd/src/sd-netlink/local-addresses.c index 5ab5ba6ea6..f2382847dd 100644 --- a/src/libsystemd/src/sd-netlink/local-addresses.c +++ b/src/libsystemd/src/sd-netlink/local-addresses.c @@ -18,7 +18,7 @@ along with systemd; If not, see . ***/ -#include +#include "sd-netlink.h" #include "basic/alloc-util.h" #include "local-addresses.h" diff --git a/src/libsystemd/src/sd-netlink/local-addresses.h b/src/libsystemd/src/sd-netlink/local-addresses.h index 7267940520..498797f515 100644 --- a/src/libsystemd/src/sd-netlink/local-addresses.h +++ b/src/libsystemd/src/sd-netlink/local-addresses.h @@ -20,7 +20,7 @@ ***/ -#include +#include "sd-netlink.h" #include "basic/in-addr-util.h" diff --git a/src/libsystemd/src/sd-netlink/netlink-internal.h b/src/libsystemd/src/sd-netlink/netlink-internal.h index ecb3a5eda7..d989789fe5 100644 --- a/src/libsystemd/src/sd-netlink/netlink-internal.h +++ b/src/libsystemd/src/sd-netlink/netlink-internal.h @@ -21,7 +21,7 @@ #include -#include +#include "sd-netlink.h" #include "basic/list.h" #include "netlink-types.h" diff --git a/src/libsystemd/src/sd-netlink/netlink-message.c b/src/libsystemd/src/sd-netlink/netlink-message.c index 115c6416ab..c885b97117 100644 --- a/src/libsystemd/src/sd-netlink/netlink-message.c +++ b/src/libsystemd/src/sd-netlink/netlink-message.c @@ -21,7 +21,7 @@ #include #include -#include +#include "sd-netlink.h" #include "basic/alloc-util.h" #include "basic/formats-util.h" diff --git a/src/libsystemd/src/sd-netlink/netlink-socket.c b/src/libsystemd/src/sd-netlink/netlink-socket.c index 4b7037720d..8e0e5d2b04 100644 --- a/src/libsystemd/src/sd-netlink/netlink-socket.c +++ b/src/libsystemd/src/sd-netlink/netlink-socket.c @@ -21,7 +21,7 @@ #include #include -#include +#include "sd-netlink.h" #include "basic/alloc-util.h" #include "basic/formats-util.h" diff --git a/src/libsystemd/src/sd-netlink/netlink-util.c b/src/libsystemd/src/sd-netlink/netlink-util.c index 828ae7db7f..73b9ac0258 100644 --- a/src/libsystemd/src/sd-netlink/netlink-util.c +++ b/src/libsystemd/src/sd-netlink/netlink-util.c @@ -17,7 +17,7 @@ along with systemd; If not, see . ***/ -#include +#include "sd-netlink.h" #include "netlink-internal.h" #include "netlink-util.h" diff --git a/src/libsystemd/src/sd-netlink/netlink-util.h b/src/libsystemd/src/sd-netlink/netlink-util.h index ad723b0f67..ddd25e36be 100644 --- a/src/libsystemd/src/sd-netlink/netlink-util.h +++ b/src/libsystemd/src/sd-netlink/netlink-util.h @@ -19,7 +19,7 @@ along with systemd; If not, see . ***/ -#include +#include "sd-netlink.h" #include "basic/util.h" diff --git a/src/libsystemd/src/sd-netlink/rtnl-message.c b/src/libsystemd/src/sd-netlink/rtnl-message.c index 18c2ad4945..0c1b7b3218 100644 --- a/src/libsystemd/src/sd-netlink/rtnl-message.c +++ b/src/libsystemd/src/sd-netlink/rtnl-message.c @@ -21,7 +21,7 @@ #include #include -#include +#include "sd-netlink.h" #include "basic/formats-util.h" #include "basic/missing.h" diff --git a/src/libsystemd/src/sd-netlink/sd-netlink.c b/src/libsystemd/src/sd-netlink/sd-netlink.c index 90745ec0c9..2314dfabe8 100644 --- a/src/libsystemd/src/sd-netlink/sd-netlink.c +++ b/src/libsystemd/src/sd-netlink/sd-netlink.c @@ -20,7 +20,7 @@ #include #include -#include +#include "sd-netlink.h" #include "basic/alloc-util.h" #include "basic/fd-util.h" diff --git a/src/libsystemd/src/sd-netlink/sd-netlink.h b/src/libsystemd/src/sd-netlink/sd-netlink.h new file mode 100644 index 0000000000..1faca07ce8 --- /dev/null +++ b/src/libsystemd/src/sd-netlink/sd-netlink.h @@ -0,0 +1,163 @@ +#ifndef foosdnetlinkhfoo +#define foosdnetlinkhfoo + +/*** + This file is part of systemd. + + Copyright 2013 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include +#include +#include +#include + +#include + +#include + +_SD_BEGIN_DECLARATIONS; + +typedef struct sd_netlink sd_netlink; +typedef struct sd_netlink_message sd_netlink_message; + +/* callback */ + +typedef int (*sd_netlink_message_handler_t)(sd_netlink *nl, sd_netlink_message *m, void *userdata); + +/* bus */ +int sd_netlink_new_from_netlink(sd_netlink **nl, int fd); +int sd_netlink_open(sd_netlink **nl); +int sd_netlink_open_fd(sd_netlink **nl, int fd); +int sd_netlink_inc_rcvbuf(const sd_netlink *const rtnl, const int size); + +sd_netlink *sd_netlink_ref(sd_netlink *nl); +sd_netlink *sd_netlink_unref(sd_netlink *nl); + +int sd_netlink_send(sd_netlink *nl, sd_netlink_message *message, uint32_t *serial); +int sd_netlink_call_async(sd_netlink *nl, sd_netlink_message *message, + sd_netlink_message_handler_t callback, + void *userdata, uint64_t usec, uint32_t *serial); +int sd_netlink_call_async_cancel(sd_netlink *nl, uint32_t serial); +int sd_netlink_call(sd_netlink *nl, sd_netlink_message *message, uint64_t timeout, + sd_netlink_message **reply); + +int sd_netlink_get_events(sd_netlink *nl); +int sd_netlink_get_timeout(sd_netlink *nl, uint64_t *timeout); +int sd_netlink_process(sd_netlink *nl, sd_netlink_message **ret); +int sd_netlink_wait(sd_netlink *nl, uint64_t timeout); + +int sd_netlink_add_match(sd_netlink *nl, uint16_t match, sd_netlink_message_handler_t c, void *userdata); +int sd_netlink_remove_match(sd_netlink *nl, uint16_t match, sd_netlink_message_handler_t c, void *userdata); + +int sd_netlink_attach_event(sd_netlink *nl, sd_event *e, int64_t priority); +int sd_netlink_detach_event(sd_netlink *nl); + +int sd_netlink_message_append_string(sd_netlink_message *m, unsigned short type, const char *data); +int sd_netlink_message_append_flag(sd_netlink_message *m, unsigned short type); +int sd_netlink_message_append_u8(sd_netlink_message *m, unsigned short type, uint8_t data); +int sd_netlink_message_append_u16(sd_netlink_message *m, unsigned short type, uint16_t data); +int sd_netlink_message_append_u32(sd_netlink_message *m, unsigned short type, uint32_t data); +int sd_netlink_message_append_data(sd_netlink_message *m, unsigned short type, const void *data, size_t len); +int sd_netlink_message_append_in_addr(sd_netlink_message *m, unsigned short type, const struct in_addr *data); +int sd_netlink_message_append_in6_addr(sd_netlink_message *m, unsigned short type, const struct in6_addr *data); +int sd_netlink_message_append_ether_addr(sd_netlink_message *m, unsigned short type, const struct ether_addr *data); +int sd_netlink_message_append_cache_info(sd_netlink_message *m, unsigned short type, const struct ifa_cacheinfo *info); + +int sd_netlink_message_open_container(sd_netlink_message *m, unsigned short type); +int sd_netlink_message_open_container_union(sd_netlink_message *m, unsigned short type, const char *key); +int sd_netlink_message_close_container(sd_netlink_message *m); + +int sd_netlink_message_read_string(sd_netlink_message *m, unsigned short type, const char **data); +int sd_netlink_message_read_u8(sd_netlink_message *m, unsigned short type, uint8_t *data); +int sd_netlink_message_read_u16(sd_netlink_message *m, unsigned short type, uint16_t *data); +int sd_netlink_message_read_u32(sd_netlink_message *m, unsigned short type, uint32_t *data); +int sd_netlink_message_read_ether_addr(sd_netlink_message *m, unsigned short type, struct ether_addr *data); +int sd_netlink_message_read_cache_info(sd_netlink_message *m, unsigned short type, struct ifa_cacheinfo *info); +int sd_netlink_message_read_in_addr(sd_netlink_message *m, unsigned short type, struct in_addr *data); +int sd_netlink_message_read_in6_addr(sd_netlink_message *m, unsigned short type, struct in6_addr *data); +int sd_netlink_message_enter_container(sd_netlink_message *m, unsigned short type); +int sd_netlink_message_exit_container(sd_netlink_message *m); + +int sd_netlink_message_rewind(sd_netlink_message *m); + +sd_netlink_message *sd_netlink_message_next(sd_netlink_message *m); + +sd_netlink_message *sd_netlink_message_ref(sd_netlink_message *m); +sd_netlink_message *sd_netlink_message_unref(sd_netlink_message *m); + +int sd_netlink_message_request_dump(sd_netlink_message *m, int dump); +int sd_netlink_message_is_error(sd_netlink_message *m); +int sd_netlink_message_get_errno(sd_netlink_message *m); +int sd_netlink_message_get_type(sd_netlink_message *m, uint16_t *type); +int sd_netlink_message_set_flags(sd_netlink_message *m, uint16_t flags); +int sd_netlink_message_is_broadcast(sd_netlink_message *m); + +/* rtnl */ + +int sd_rtnl_message_new_link(sd_netlink *nl, sd_netlink_message **ret, uint16_t msg_type, int index); +int sd_rtnl_message_new_addr_update(sd_netlink *nl, sd_netlink_message **ret, int index, int family); +int sd_rtnl_message_new_addr(sd_netlink *nl, sd_netlink_message **ret, uint16_t msg_type, int index, int family); +int sd_rtnl_message_new_route(sd_netlink *nl, sd_netlink_message **ret, uint16_t nlmsg_type, int rtm_family, unsigned char rtm_protocol); +int sd_rtnl_message_new_neigh(sd_netlink *nl, sd_netlink_message **ret, uint16_t msg_type, int index, int nda_family); + +int sd_rtnl_message_get_family(sd_netlink_message *m, int *family); + +int sd_rtnl_message_addr_set_prefixlen(sd_netlink_message *m, unsigned char prefixlen); +int sd_rtnl_message_addr_set_scope(sd_netlink_message *m, unsigned char scope); +int sd_rtnl_message_addr_set_flags(sd_netlink_message *m, unsigned char flags); +int sd_rtnl_message_addr_get_family(sd_netlink_message *m, int *family); +int sd_rtnl_message_addr_get_prefixlen(sd_netlink_message *m, unsigned char *prefixlen); +int sd_rtnl_message_addr_get_scope(sd_netlink_message *m, unsigned char *scope); +int sd_rtnl_message_addr_get_flags(sd_netlink_message *m, unsigned char *flags); +int sd_rtnl_message_addr_get_ifindex(sd_netlink_message *m, int *ifindex); + +int sd_rtnl_message_link_set_flags(sd_netlink_message *m, unsigned flags, unsigned change); +int sd_rtnl_message_link_set_type(sd_netlink_message *m, unsigned type); +int sd_rtnl_message_link_set_family(sd_netlink_message *m, unsigned family); +int sd_rtnl_message_link_get_ifindex(sd_netlink_message *m, int *ifindex); +int sd_rtnl_message_link_get_flags(sd_netlink_message *m, unsigned *flags); +int sd_rtnl_message_link_get_type(sd_netlink_message *m, unsigned short *type); + +int sd_rtnl_message_route_set_dst_prefixlen(sd_netlink_message *m, unsigned char prefixlen); +int sd_rtnl_message_route_set_src_prefixlen(sd_netlink_message *m, unsigned char prefixlen); +int sd_rtnl_message_route_set_scope(sd_netlink_message *m, unsigned char scope); +int sd_rtnl_message_route_set_flags(sd_netlink_message *m, unsigned flags); +int sd_rtnl_message_route_set_table(sd_netlink_message *m, unsigned char table); +int sd_rtnl_message_route_get_flags(sd_netlink_message *m, unsigned *flags); +int sd_rtnl_message_route_get_family(sd_netlink_message *m, int *family); +int sd_rtnl_message_route_set_family(sd_netlink_message *m, int family); +int sd_rtnl_message_route_get_protocol(sd_netlink_message *m, unsigned char *protocol); +int sd_rtnl_message_route_get_scope(sd_netlink_message *m, unsigned char *scope); +int sd_rtnl_message_route_get_tos(sd_netlink_message *m, unsigned char *tos); +int sd_rtnl_message_route_get_table(sd_netlink_message *m, unsigned char *table); +int sd_rtnl_message_route_get_dst_prefixlen(sd_netlink_message *m, unsigned char *dst_len); +int sd_rtnl_message_route_get_src_prefixlen(sd_netlink_message *m, unsigned char *src_len); + +int sd_rtnl_message_neigh_set_flags(sd_netlink_message *m, uint8_t flags); +int sd_rtnl_message_neigh_set_state(sd_netlink_message *m, uint16_t state); +int sd_rtnl_message_neigh_get_family(sd_netlink_message *m, int *family); +int sd_rtnl_message_neigh_get_ifindex(sd_netlink_message *m, int *family); +int sd_rtnl_message_neigh_get_state(sd_netlink_message *m, uint16_t *state); +int sd_rtnl_message_neigh_get_flags(sd_netlink_message *m, uint8_t *flags); + +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_netlink, sd_netlink_unref); +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_netlink_message, sd_netlink_message_unref); + +_SD_END_DECLARATIONS; + +#endif diff --git a/src/libsystemd/src/sd-netlink/test-netlink.c b/src/libsystemd/src/sd-netlink/test-netlink.c index 704b5a83b2..90513fa5a2 100644 --- a/src/libsystemd/src/sd-netlink/test-netlink.c +++ b/src/libsystemd/src/sd-netlink/test-netlink.c @@ -20,7 +20,7 @@ #include #include -#include +#include "sd-netlink.h" #include "basic/ether-addr-util.h" #include "basic/macro.h" diff --git a/src/libsystemd/src/sd-network/Makefile b/src/libsystemd/src/sd-network/Makefile deleted file mode 120000 index 71a1159ce0..0000000000 --- a/src/libsystemd/src/sd-network/Makefile +++ /dev/null @@ -1 +0,0 @@ -../subdir.mk \ No newline at end of file diff --git a/src/libsystemd/src/sd-network/Makefile b/src/libsystemd/src/sd-network/Makefile new file mode 100644 index 0000000000..821bb70dfc --- /dev/null +++ b/src/libsystemd/src/sd-network/Makefile @@ -0,0 +1,31 @@ +# -*- Mode: makefile; indent-tabs-mode: t -*- +# +# This file is part of systemd. +# +# Copyright 2010-2012 Lennart Poettering +# Copyright 2010-2012 Kay Sievers +# Copyright 2013 Zbigniew Jędrzejewski-Szmek +# Copyright 2013 David Strauss +# Copyright 2016 Luke Shumaker +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk + +systemd.CPPFLAGS += $(libsystemd.CPPFLAGS) +systemd.CPPFLAGS += $(libbasic.CPPFLAGS) +systemd.CPPFLAGS += $(libshared.CPPFLAGS) + +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libsystemd/src/sd-network/network-util.h b/src/libsystemd/src/sd-network/network-util.h index 8c4dbc68b1..26780dce28 100644 --- a/src/libsystemd/src/sd-network/network-util.h +++ b/src/libsystemd/src/sd-network/network-util.h @@ -19,6 +19,6 @@ along with systemd; If not, see . ***/ -#include +#include "sd-network.h" bool network_is_online(void); diff --git a/src/libsystemd/src/sd-network/sd-network.c b/src/libsystemd/src/sd-network/sd-network.c index 5c0f9d05e3..e97a68f566 100644 --- a/src/libsystemd/src/sd-network/sd-network.c +++ b/src/libsystemd/src/sd-network/sd-network.c @@ -23,7 +23,7 @@ #include #include -#include +#include "sd-network.h" #include "basic/alloc-util.h" #include "basic/fd-util.h" diff --git a/src/libsystemd/src/sd-network/sd-network.h b/src/libsystemd/src/sd-network/sd-network.h new file mode 100644 index 0000000000..ac2660de45 --- /dev/null +++ b/src/libsystemd/src/sd-network/sd-network.h @@ -0,0 +1,176 @@ +#ifndef foosdnetworkhfoo +#define foosdnetworkhfoo + +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + Copyright 2014 Tom Gundersen + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include + +#include + +/* + * A few points: + * + * Instead of returning an empty string array or empty integer array, we + * may return NULL. + * + * Free the data the library returns with libc free(). String arrays + * are NULL terminated, and you need to free the array itself in + * addition to the strings contained. + * + * We return error codes as negative errno, kernel-style. On success, we + * return 0 or positive. + * + * These functions access data in /run. This is a virtual file system; + * therefore, accesses are relatively cheap. + * + * See sd-network(3) for more information. + */ + +_SD_BEGIN_DECLARATIONS; + +/* Get overall operational state + * Possible states: down, up, dormant, carrier, degraded, routable + * Possible return codes: + * -ENODATA: networkd is not aware of any links + */ +int sd_network_get_operational_state(char **state); + +/* Get DNS entries for all links. These are string representations of + * IP addresses */ +int sd_network_get_dns(char ***dns); + +/* Get NTP entries for all links. These are domain names or string + * representations of IP addresses */ +int sd_network_get_ntp(char ***ntp); + +/* Get the search domains for all links. */ +int sd_network_get_search_domains(char ***domains); + +/* Get the search domains for all links. */ +int sd_network_get_route_domains(char ***domains); + +/* Get setup state from ifindex. + * Possible states: + * pending: udev is still processing the link, we don't yet know if we will manage it + * failed: networkd failed to manage the link + * configuring: in the process of retrieving configuration or configuring the link + * configured: link configured successfully + * unmanaged: networkd is not handling the link + * linger: the link is gone, but has not yet been dropped by networkd + * Possible return codes: + * -ENODATA: networkd is not aware of the link + */ +int sd_network_link_get_setup_state(int ifindex, char **state); + +/* Get operational state from ifindex. + * Possible states: + * off: the device is powered down + * no-carrier: the device is powered up, but it does not yet have a carrier + * dormant: the device has a carrier, but is not yet ready for normal traffic + * carrier: the link has a carrier + * degraded: the link has carrier and addresses valid on the local link configured + * routable: the link has carrier and routable address configured + * Possible return codes: + * -ENODATA: networkd is not aware of the link + */ +int sd_network_link_get_operational_state(int ifindex, char **state); + +/* Get path to .network file applied to link */ +int sd_network_link_get_network_file(int ifindex, char **filename); + +/* Get DNS entries for a given link. These are string representations of + * IP addresses */ +int sd_network_link_get_dns(int ifindex, char ***ret); + +/* Get NTP entries for a given link. These are domain names or string + * representations of IP addresses */ +int sd_network_link_get_ntp(int ifindex, char ***ret); + +/* Indicates whether or not LLMNR should be enabled for the link + * Possible levels of support: yes, no, resolve + * Possible return codes: + * -ENODATA: networkd is not aware of the link + */ +int sd_network_link_get_llmnr(int ifindex, char **llmnr); + +/* Indicates whether or not MulticastDNS should be enabled for the + * link. + * Possible levels of support: yes, no, resolve + * Possible return codes: + * -ENODATA: networkd is not aware of the link + */ +int sd_network_link_get_mdns(int ifindex, char **mdns); + +/* Indicates whether or not DNSSEC should be enabled for the link + * Possible levels of support: yes, no, allow-downgrade + * Possible return codes: + * -ENODATA: networkd is not aware of the link + */ +int sd_network_link_get_dnssec(int ifindex, char **dnssec); + +/* Returns the list of per-interface DNSSEC negative trust anchors + * Possible return codes: + * -ENODATA: networkd is not aware of the link, or has no such data + */ +int sd_network_link_get_dnssec_negative_trust_anchors(int ifindex, char ***nta); + +/* Get the search DNS domain names for a given link. */ +int sd_network_link_get_search_domains(int ifindex, char ***domains); + +/* Get the route DNS domain names for a given link. */ +int sd_network_link_get_route_domains(int ifindex, char ***domains); + +/* Get the carrier interface indexes to which current link is bound to. */ +int sd_network_link_get_carrier_bound_to(int ifindex, int **ifindexes); + +/* Get the CARRIERS that are bound to current link. */ +int sd_network_link_get_carrier_bound_by(int ifindex, int **ifindexes); + +/* Get the timezone that was learnt on a specific link. */ +int sd_network_link_get_timezone(int ifindex, char **timezone); + +/* Monitor object */ +typedef struct sd_network_monitor sd_network_monitor; + +/* Create a new monitor. Category must be NULL, "links" or "leases". */ +int sd_network_monitor_new(sd_network_monitor **ret, const char *category); + +/* Destroys the passed monitor. Returns NULL. */ +sd_network_monitor* sd_network_monitor_unref(sd_network_monitor *m); + +/* Flushes the monitor */ +int sd_network_monitor_flush(sd_network_monitor *m); + +/* Get FD from monitor */ +int sd_network_monitor_get_fd(sd_network_monitor *m); + +/* Get poll() mask to monitor */ +int sd_network_monitor_get_events(sd_network_monitor *m); + +/* Get timeout for poll(), as usec value relative to CLOCK_MONOTONIC's epoch */ +int sd_network_monitor_get_timeout(sd_network_monitor *m, uint64_t *timeout_usec); + +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_network_monitor, sd_network_monitor_unref); + +_SD_END_DECLARATIONS; + +#endif diff --git a/src/libsystemd/src/sd-resolve/Makefile b/src/libsystemd/src/sd-resolve/Makefile deleted file mode 120000 index 71a1159ce0..0000000000 --- a/src/libsystemd/src/sd-resolve/Makefile +++ /dev/null @@ -1 +0,0 @@ -../subdir.mk \ No newline at end of file diff --git a/src/libsystemd/src/sd-resolve/Makefile b/src/libsystemd/src/sd-resolve/Makefile new file mode 100644 index 0000000000..2b0ea2c84f --- /dev/null +++ b/src/libsystemd/src/sd-resolve/Makefile @@ -0,0 +1,32 @@ +# -*- Mode: makefile; indent-tabs-mode: t -*- +# +# This file is part of systemd. +# +# Copyright 2010-2012 Lennart Poettering +# Copyright 2010-2012 Kay Sievers +# Copyright 2013 Zbigniew Jędrzejewski-Szmek +# Copyright 2013 David Strauss +# Copyright 2016 Luke Shumaker +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk + +systemd.CPPFLAGS += $(libsystemd.CPPFLAGS) +systemd.CPPFLAGS += $(libbasic.CPPFLAGS) +systemd.CPPFLAGS += $(libshared.CPPFLAGS) +systemd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" + +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libsystemd/src/sd-resolve/sd-resolve.c b/src/libsystemd/src/sd-resolve/sd-resolve.c index 6a1eae4d9f..001f527c68 100644 --- a/src/libsystemd/src/sd-resolve/sd-resolve.c +++ b/src/libsystemd/src/sd-resolve/sd-resolve.c @@ -29,7 +29,7 @@ #include #include -#include +#include "sd-resolve.h" #include "basic/alloc-util.h" #include "basic/fd-util.h" diff --git a/src/libsystemd/src/sd-resolve/sd-resolve.h b/src/libsystemd/src/sd-resolve/sd-resolve.h new file mode 100644 index 0000000000..2e718ec543 --- /dev/null +++ b/src/libsystemd/src/sd-resolve/sd-resolve.h @@ -0,0 +1,117 @@ +#ifndef foosdresolvehfoo +#define foosdresolvehfoo + +/*** + This file is part of systemd. + + Copyright 2005-2014 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include +#include +#include +#include + +#include + +#include + +_SD_BEGIN_DECLARATIONS; + +/* An opaque sd-resolve session structure */ +typedef struct sd_resolve sd_resolve; + +/* An opaque sd-resolve query structure */ +typedef struct sd_resolve_query sd_resolve_query; + +/* A callback on completion */ +typedef int (*sd_resolve_getaddrinfo_handler_t)(sd_resolve_query *q, int ret, const struct addrinfo *ai, void *userdata); +typedef int (*sd_resolve_getnameinfo_handler_t)(sd_resolve_query *q, int ret, const char *host, const char *serv, void *userdata); + +enum { + SD_RESOLVE_GET_HOST = UINT64_C(1), + SD_RESOLVE_GET_SERVICE = UINT64_C(2), + SD_RESOLVE_GET_BOTH = UINT64_C(3), +}; + +int sd_resolve_default(sd_resolve **ret); + +/* Allocate a new sd-resolve session. */ +int sd_resolve_new(sd_resolve **ret); + +/* Free a sd-resolve session. This destroys all attached + * sd_resolve_query objects automatically. */ +sd_resolve* sd_resolve_unref(sd_resolve *resolve); +sd_resolve* sd_resolve_ref(sd_resolve *resolve); + +/* Return the UNIX file descriptor to poll() for events on. Use this + * function to integrate sd-resolve with your custom main loop. */ +int sd_resolve_get_fd(sd_resolve *resolve); + +/* Return the poll() events (a combination of flags like POLLIN, + * POLLOUT, ...) to check for. */ +int sd_resolve_get_events(sd_resolve *resolve); + +/* Return the poll() timeout to pass. Returns (uint64_t) -1 as + * timeout if no timeout is needed. */ +int sd_resolve_get_timeout(sd_resolve *resolve, uint64_t *timeout_usec); + +/* Process pending responses. After this function is called, you can + * get the next completed query object(s) using + * sd_resolve_get_next(). */ +int sd_resolve_process(sd_resolve *resolve); + +/* Wait for a resolve event to complete. */ +int sd_resolve_wait(sd_resolve *resolve, uint64_t timeout_usec); + +int sd_resolve_get_tid(sd_resolve *resolve, pid_t *tid); + +int sd_resolve_attach_event(sd_resolve *resolve, sd_event *e, int64_t priority); +int sd_resolve_detach_event(sd_resolve *resolve); +sd_event *sd_resolve_get_event(sd_resolve *resolve); + +/* Issue a name-to-address query on the specified session. The + * arguments are compatible with those of libc's + * getaddrinfo(3). The function returns a new query object. When the + * query is completed, you may retrieve the results using + * sd_resolve_getaddrinfo_done(). */ +int sd_resolve_getaddrinfo(sd_resolve *resolve, sd_resolve_query **q, const char *node, const char *service, const struct addrinfo *hints, sd_resolve_getaddrinfo_handler_t callback, void *userdata); + +/* Issue an address-to-name query on the specified session. The + * arguments are compatible with those of libc's + * getnameinfo(3). The function returns a new query object. When the + * query is completed, you may retrieve the results using + * sd_resolve_getnameinfo_done(). Set gethost (resp. getserv) to non-zero + * if you want to query the hostname (resp. the service name). */ +int sd_resolve_getnameinfo(sd_resolve *resolve, sd_resolve_query **q, const struct sockaddr *sa, socklen_t salen, int flags, uint64_t get, sd_resolve_getnameinfo_handler_t callback, void *userdata); + +sd_resolve_query *sd_resolve_query_ref(sd_resolve_query* q); +sd_resolve_query *sd_resolve_query_unref(sd_resolve_query* q); + +/* Returns non-zero when the query operation specified by q has been completed. */ +int sd_resolve_query_is_done(sd_resolve_query*q); + +void *sd_resolve_query_get_userdata(sd_resolve_query *q); +void *sd_resolve_query_set_userdata(sd_resolve_query *q, void *userdata); + +sd_resolve *sd_resolve_query_get_resolve(sd_resolve_query *q); + +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_resolve, sd_resolve_unref); +_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_resolve_query, sd_resolve_query_unref); + +_SD_END_DECLARATIONS; + +#endif diff --git a/src/libsystemd/src/sd-resolve/test-resolve.c b/src/libsystemd/src/sd-resolve/test-resolve.c index ac5cc0c28d..59dd0d540f 100644 --- a/src/libsystemd/src/sd-resolve/test-resolve.c +++ b/src/libsystemd/src/sd-resolve/test-resolve.c @@ -26,7 +26,7 @@ #include #include -#include +#include "sd-resolve.h" #include "basic/alloc-util.h" #include "basic/macro.h" diff --git a/src/libudev/src/libudev-device-internal.h b/src/libudev/src/libudev-device-internal.h index f76da09407..fd3711626c 100644 --- a/src/libudev/src/libudev-device-internal.h +++ b/src/libudev/src/libudev-device-internal.h @@ -21,7 +21,8 @@ ***/ #include "libudev.h" -#include + +#include "sd-device/sd-device.h" #include "libudev-private.h" diff --git a/src/libudev/src/libudev-device-private.c b/src/libudev/src/libudev-device-private.c index bd18d60c1e..654895e652 100644 --- a/src/libudev/src/libudev-device-private.c +++ b/src/libudev/src/libudev-device-private.c @@ -21,6 +21,7 @@ #include "libudev.h" #include "sd-device/device-private.h" + #include "libudev-device-internal.h" #include "libudev-private.h" diff --git a/src/libudev/src/libudev-device.c b/src/libudev/src/libudev-device.c index 3ad59176b3..dc4b0deb83 100644 --- a/src/libudev/src/libudev-device.c +++ b/src/libudev/src/libudev-device.c @@ -34,15 +34,16 @@ #include #include -#include "libudev.h" -#include +#include #include "basic/alloc-util.h" +#include "basic/parse-util.h" #include "sd-device/device-private.h" #include "sd-device/device-util.h" +#include "sd-device/sd-device.h" + #include "libudev-device-internal.h" #include "libudev-private.h" -#include "basic/parse-util.h" /** * SECTION:libudev-device diff --git a/src/libudev/src/libudev-enumerate.c b/src/libudev/src/libudev-enumerate.c index a58779866e..4b24c437e0 100644 --- a/src/libudev/src/libudev-enumerate.c +++ b/src/libudev/src/libudev-enumerate.c @@ -29,11 +29,12 @@ #include #include "libudev.h" -#include #include "basic/alloc-util.h" #include "sd-device/device-enumerator-private.h" #include "sd-device/device-util.h" +#include "sd-device/sd-device.h" + #include "libudev-device-internal.h" /** diff --git a/src/libudev/src/libudev-hwdb.c b/src/libudev/src/libudev-hwdb.c index 436e2ccb67..1d47cfaa4e 100644 --- a/src/libudev/src/libudev-hwdb.c +++ b/src/libudev/src/libudev-hwdb.c @@ -17,10 +17,10 @@ along with systemd; If not, see . ***/ -#include - #include "basic/alloc-util.h" #include "sd-hwdb/hwdb-util.h" +#include "sd-hwdb/sd-hwdb.h" + #include "libudev-private.h" /** diff --git a/src/libudev/src/udev.h b/src/libudev/src/udev.h index d50ad1c828..26afe63b55 100644 --- a/src/libudev/src/udev.h +++ b/src/libudev/src/udev.h @@ -23,12 +23,12 @@ #include #include -#include #include "basic/label.h" #include "basic/macro.h" #include "basic/strv.h" #include "basic/util.h" +#include "sd-netlink/sd-netlink.h" #include "libudev-private.h" diff --git a/src/systemd-cryptsetup/cryptsetup.c b/src/systemd-cryptsetup/cryptsetup.c index fc0d7e0e9a..eef2b1954c 100644 --- a/src/systemd-cryptsetup/cryptsetup.c +++ b/src/systemd-cryptsetup/cryptsetup.c @@ -23,11 +23,7 @@ #include #include -#include - #include "basic/alloc-util.h" -#include "shared/ask-password-api.h" -#include "sd-device/device-util.h" #include "basic/escape.h" #include "basic/fileio.h" #include "basic/log.h" @@ -37,6 +33,9 @@ #include "basic/string-util.h" #include "basic/strv.h" #include "basic/util.h" +#include "sd-device/device-util.h" +#include "sd-device/sd-device.h" +#include "shared/ask-password-api.h" static const char *arg_type = NULL; /* CRYPT_LUKS1, CRYPT_TCRYPT or CRYPT_PLAIN */ static char *arg_cipher = NULL; diff --git a/src/systemd-fsck/fsck.c b/src/systemd-fsck/fsck.c index f6e5309cd5..4ca018763f 100644 --- a/src/systemd-fsck/fsck.c +++ b/src/systemd-fsck/fsck.c @@ -28,13 +28,8 @@ #include #include -#include #include "basic/alloc-util.h" -#include "sd-bus/bus-common-errors.h" -#include "sd-bus/bus-error.h" -#include "shared/bus-util.h" -#include "sd-device/device-util.h" #include "basic/fd-util.h" #include "basic/fs-util.h" #include "basic/parse-util.h" @@ -46,6 +41,11 @@ #include "basic/special.h" #include "basic/stdio-util.h" #include "basic/util.h" +#include "sd-bus/bus-common-errors.h" +#include "sd-bus/bus-error.h" +#include "sd-device/device-util.h" +#include "sd-device/sd-device.h" +#include "shared/bus-util.h" /* exit codes as defined in fsck(8) */ enum { diff --git a/src/systemd-hwdb/hwdb.c b/src/systemd-hwdb/hwdb.c index 5ec2ba6169..0e96716b0f 100644 --- a/src/systemd-hwdb/hwdb.c +++ b/src/systemd-hwdb/hwdb.c @@ -27,14 +27,14 @@ #include "basic/fd-util.h" #include "basic/fileio.h" #include "basic/fs-util.h" -#include "sd-hwdb/hwdb-internal.h" -#include "sd-hwdb/hwdb-util.h" #include "basic/mkdir.h" #include "basic/strbuf.h" #include "basic/string-util.h" #include "basic/strv.h" #include "basic/util.h" #include "basic/verbs.h" +#include "sd-hwdb/hwdb-internal.h" +#include "sd-hwdb/hwdb-util.h" /* * Generic udev properties, key/value database based on modalias strings. diff --git a/src/systemd-nspawn/nspawn-expose-ports.c b/src/systemd-nspawn/nspawn-expose-ports.c index 4da7ef744f..a00e7600aa 100644 --- a/src/systemd-nspawn/nspawn-expose-ports.c +++ b/src/systemd-nspawn/nspawn-expose-ports.c @@ -17,18 +17,18 @@ along with systemd; If not, see . ***/ -#include - #include "basic/alloc-util.h" #include "basic/fd-util.h" -#include "firewall-util.h" #include "basic/in-addr-util.h" -#include "sd-netlink/local-addresses.h" -#include "nspawn-expose-ports.h" #include "basic/parse-util.h" #include "basic/socket-util.h" #include "basic/string-util.h" #include "basic/util.h" +#include "firewall-util.h" +#include "sd-netlink/local-addresses.h" +#include "sd-netlink/sd-netlink.h" + +#include "nspawn-expose-ports.h" int expose_port_parse(ExposePort **l, const char *s) { diff --git a/src/systemd-nspawn/nspawn-expose-ports.h b/src/systemd-nspawn/nspawn-expose-ports.h index 0003b74e62..2c0a5ecc88 100644 --- a/src/systemd-nspawn/nspawn-expose-ports.h +++ b/src/systemd-nspawn/nspawn-expose-ports.h @@ -22,10 +22,10 @@ #include #include -#include #include "basic/in-addr-util.h" #include "basic/list.h" +#include "sd-netlink/sd-netlink.h" typedef struct ExposePort { int protocol; diff --git a/src/systemd-nspawn/nspawn-network.c b/src/systemd-nspawn/nspawn-network.c index 98bb3e386f..4929615b74 100644 --- a/src/systemd-nspawn/nspawn-network.c +++ b/src/systemd-nspawn/nspawn-network.c @@ -22,18 +22,19 @@ #include "libudev.h" #include -#include #include "basic/alloc-util.h" #include "basic/ether-addr-util.h" #include "basic/lockfile-util.h" -#include "nspawn-network.h" #include "basic/siphash24.h" #include "basic/socket-util.h" #include "basic/stat-util.h" #include "basic/string-util.h" -#include "shared/udev-util.h" #include "basic/util.h" +#include "sd-netlink/sd-netlink.h" +#include "shared/udev-util.h" + +#include "nspawn-network.h" #define HOST_HASH_KEY SD_ID128_MAKE(1a,37,6f,c7,46,ec,45,0b,ad,a3,d5,31,06,60,5d,b1) #define CONTAINER_HASH_KEY SD_ID128_MAKE(c3,c4,f9,19,b5,57,b2,1c,e6,cf,14,27,03,9c,ee,a2) diff --git a/src/systemd-nspawn/nspawn-register.c b/src/systemd-nspawn/nspawn-register.c index 29e60ca48a..3f174b6f24 100644 --- a/src/systemd-nspawn/nspawn-register.c +++ b/src/systemd-nspawn/nspawn-register.c @@ -19,13 +19,14 @@ #include +#include "basic/stat-util.h" +#include "basic/strv.h" +#include "basic/util.h" #include "sd-bus/bus-error.h" /* for bus_error_message */ #include "shared/bus-unit-util.h" #include "shared/bus-util.h" + #include "nspawn-register.h" -#include "basic/stat-util.h" -#include "basic/strv.h" -#include "basic/util.h" int register_machine( const char *machine_name, diff --git a/src/systemd-socket-proxyd/socket-proxyd.c b/src/systemd-socket-proxyd/socket-proxyd.c index 59141d20aa..888850595b 100644 --- a/src/systemd-socket-proxyd/socket-proxyd.c +++ b/src/systemd-socket-proxyd/socket-proxyd.c @@ -30,7 +30,6 @@ #include #include -#include #include "basic/alloc-util.h" #include "basic/fd-util.h" @@ -40,6 +39,7 @@ #include "basic/socket-util.h" #include "basic/string-util.h" #include "basic/util.h" +#include "sd-resolve/sd-resolve.h" #define BUFFER_SIZE (256 * 1024) #define CONNECTIONS_MAX 256 diff --git a/src/systemd-timesyncd/timesyncd-manager.h b/src/systemd-timesyncd/timesyncd-manager.h index de6836087d..a70b187089 100644 --- a/src/systemd-timesyncd/timesyncd-manager.h +++ b/src/systemd-timesyncd/timesyncd-manager.h @@ -20,11 +20,11 @@ ***/ #include -#include -#include #include "basic/list.h" #include "basic/ratelimit.h" +#include "sd-network/sd-network.h" +#include "sd-resolve/sd-resolve.h" typedef struct Manager Manager; diff --git a/src/test/test-netlink-manual.c b/src/test/test-netlink-manual.c index 6540a35020..d7cb3b2c87 100644 --- a/src/test/test-netlink-manual.c +++ b/src/test/test-netlink-manual.c @@ -23,10 +23,9 @@ #include #include -#include - #include "basic/macro.h" #include "basic/util.h" +#include "sd-netlink/sd-netlink.h" static int load_module(const char *mod_name) { struct kmod_ctx *ctx; -- cgit v1.2.3-54-g00ecf