diff options
author | Thomas Haller <thaller@redhat.com> | 2016-02-29 14:26:16 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-02-29 14:26:16 +0100 |
commit | 18421e2fe8c52adf78cb8f3ad27205938aec28d2 (patch) | |
tree | 08585793deb7f3e66f4995bcfefbd520512c7648 | |
parent | 4ded98dd0f0c261b0d9f1add57e9571b6ae4a4c1 (diff) | |
parent | ae9cc8910ddd04d43c9a15dbbe92a4863b6c49f0 (diff) | |
download | NetworkManager-18421e2fe8c52adf78cb8f3ad27205938aec28d2.tar.gz |
systemd,lldp: merge branch 'th/systemd-lldp'
66 files changed, 88 insertions, 162 deletions
diff --git a/shared/nm-macros-internal.h b/shared/nm-macros-internal.h index 9971f15c8c..aa38bacf55 100644 --- a/shared/nm-macros-internal.h +++ b/shared/nm-macros-internal.h @@ -24,12 +24,14 @@ /********************************************************/ +#define nm_auto(fcn) __attribute ((cleanup(fcn))) + /** * nm_auto_free: * * Call free() on a variable location when it goes out of scope. */ -#define nm_auto_free __attribute__ ((cleanup(_nm_auto_free_impl))) +#define nm_auto_free nm_auto(_nm_auto_free_impl) GS_DEFINE_CLEANUP_FUNCTION(void*, _nm_auto_free_impl, free) /********************************************************/ diff --git a/src/Makefile.am b/src/Makefile.am index 1711b925c0..98ae942a7b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,9 +103,9 @@ libsystemd_nm_la_SOURCES = \ systemd/src/basic/random-util.c \ systemd/src/basic/random-util.h \ systemd/src/basic/refcnt.h \ + systemd/src/basic/set.h \ systemd/src/basic/siphash24.c \ systemd/src/basic/siphash24.h \ - systemd/src/basic/set.h \ systemd/src/basic/socket-util.h \ systemd/src/basic/sparse-endian.h \ systemd/src/basic/stdio-util.h \ @@ -138,15 +138,15 @@ libsystemd_nm_la_SOURCES = \ systemd/src/libsystemd-network/dhcp6-network.c \ systemd/src/libsystemd-network/dhcp6-option.c \ systemd/src/libsystemd-network/dhcp6-protocol.h \ - systemd/src/libsystemd-network/lldp.h \ - systemd/src/libsystemd-network/lldp-network.h \ + systemd/src/libsystemd-network/lldp-internal.c \ + systemd/src/libsystemd-network/lldp-internal.h \ systemd/src/libsystemd-network/lldp-network.c \ - systemd/src/libsystemd-network/lldp-tlv.c \ - systemd/src/libsystemd-network/lldp-tlv.h \ + systemd/src/libsystemd-network/lldp-network.h \ systemd/src/libsystemd-network/lldp-port.c \ systemd/src/libsystemd-network/lldp-port.h \ - systemd/src/libsystemd-network/lldp-internal.h \ - systemd/src/libsystemd-network/lldp-internal.c \ + systemd/src/libsystemd-network/lldp-tlv.c \ + systemd/src/libsystemd-network/lldp-tlv.h \ + systemd/src/libsystemd-network/lldp.h \ systemd/src/libsystemd-network/network-internal.c \ systemd/src/libsystemd-network/network-internal.h \ systemd/src/libsystemd-network/sd-dhcp-client.c \ @@ -164,11 +164,11 @@ libsystemd_nm_la_SOURCES = \ systemd/src/systemd/sd-dhcp-lease.h \ systemd/src/systemd/sd-dhcp6-client.h \ systemd/src/systemd/sd-dhcp6-lease.h \ - systemd/src/systemd/sd-lldp.h \ systemd/src/systemd/sd-event.h \ systemd/src/systemd/sd-id128.h \ systemd/src/systemd/sd-ipv4acd.h \ systemd/src/systemd/sd-ipv4ll.h \ + systemd/src/systemd/sd-lldp.h \ systemd/src/systemd/sd-ndisc.h libsystemd_nm_la_CPPFLAGS = \ diff --git a/src/devices/nm-lldp-listener.c b/src/devices/nm-lldp-listener.c index 767851bdde..8182781766 100644 --- a/src/devices/nm-lldp-listener.c +++ b/src/devices/nm-lldp-listener.c @@ -65,6 +65,32 @@ typedef struct { static void process_lldp_neighbors (NMLldpListener *self); +/*****************************************************************************/ + +#define _NMLOG_PREFIX_NAME "lldp" +#define _NMLOG_DOMAIN LOGD_DEVICE +#define _NMLOG(level, ...) \ + G_STMT_START { \ + const NMLogLevel _level = (level); \ + \ + if (nm_logging_enabled (_level, _NMLOG_DOMAIN)) { \ + char _sbuf[64]; \ + int _ifindex = (self) ? NM_LLDP_LISTENER_GET_PRIVATE (self)->ifindex : 0; \ + \ + _nm_log (_level, _NMLOG_DOMAIN, 0, \ + "%s%s: " _NM_UTILS_MACRO_FIRST (__VA_ARGS__), \ + _NMLOG_PREFIX_NAME, \ + ((_ifindex > 0) \ + ? nm_sprintf_buf (_sbuf, "[%p,%d]", (self), _ifindex) \ + : ((self) \ + ? nm_sprintf_buf (_sbuf, "[%p]", (self)) \ + : "")) \ + _NM_UTILS_MACRO_REST (__VA_ARGS__)); \ + } \ + } G_STMT_END \ + +/*****************************************************************************/ + static void gvalue_destroy (gpointer data) { @@ -100,11 +126,13 @@ static guint lldp_neighbor_id_hash (gconstpointer ptr) { const LLDPNeighbor *neigh = ptr; + guint hash; - return g_str_hash (neigh->chassis_id) ^ - g_str_hash (neigh->port_id) ^ - neigh->chassis_id_type ^ - (neigh->port_id_type * 33); + hash = 23423423u + ((guint) (neigh->chassis_id ? g_str_hash (neigh->chassis_id) : 12321u)); + hash = (hash * 33u) + ((guint) (neigh->port_id ? g_str_hash (neigh->port_id) : 34342343u)); + hash = (hash * 33u) + ((guint) neigh->chassis_id_type); + hash = (hash * 33u) + ((guint) neigh->port_id_type); + return hash; } static gboolean @@ -119,18 +147,22 @@ lldp_neighbor_id_equal (gconstpointer a, gconstpointer b) } static void -lldp_neighbor_free (gpointer data) +lldp_neighbor_free (LLDPNeighbor *neighbor) { - LLDPNeighbor *neighbor = data; - if (neighbor) { g_free (neighbor->chassis_id); g_free (neighbor->port_id); g_hash_table_unref (neighbor->tlvs); - g_free (neighbor); + g_slice_free (LLDPNeighbor, neighbor); } } +static void +lldp_neighbor_freep (LLDPNeighbor **ptr) +{ + lldp_neighbor_free (*ptr); +} + static gboolean lldp_neighbor_equal (LLDPNeighbor *a, LLDPNeighbor *b) { @@ -207,8 +239,12 @@ lldp_hash_table_equal (GHashTable *a, GHashTable *b) static gboolean lldp_timeout (gpointer user_data) { - NMLldpListener *self = NM_LLDP_LISTENER (user_data); - NMLldpListenerPrivate *priv = NM_LLDP_LISTENER_GET_PRIVATE (self); + NMLldpListener *self = user_data; + NMLldpListenerPrivate *priv; + + g_return_val_if_fail (NM_IS_LLDP_LISTENER (self), G_SOURCE_REMOVE); + + priv = NM_LLDP_LISTENER_GET_PRIVATE (self); priv->timer = 0; @@ -222,24 +258,26 @@ static void process_lldp_neighbors (NMLldpListener *self) { NMLldpListenerPrivate *priv = NM_LLDP_LISTENER_GET_PRIVATE (self); - sd_lldp_packet **packets = NULL; + nm_auto_free sd_lldp_packet **packets = NULL; GHashTable *hash; int num, i; + g_return_if_fail (priv->lldp_handle); + num = sd_lldp_get_packets (priv->lldp_handle, &packets); if (num < 0) { - nm_log_dbg (LOGD_DEVICE, "LLDP: error %d retrieving neighbor packets for %s", - num, priv->iface); + _LOGD ("process: error %d retrieving neighbor packets for %s", + num, priv->iface); return; } hash = g_hash_table_new_full (lldp_neighbor_id_hash, lldp_neighbor_id_equal, - lldp_neighbor_free, NULL); + (GDestroyNotify) lldp_neighbor_free, NULL); for (i = 0; packets && i < num; i++) { + nm_auto (lldp_neighbor_freep) LLDPNeighbor *neigh = NULL; uint8_t chassis_id_type, port_id_type, *chassis_id, *port_id, data8; uint16_t chassis_id_len, port_id_len, len, data16; - LLDPNeighbor *neigh; GValue *value; char *str; int r; @@ -257,37 +295,32 @@ process_lldp_neighbors (NMLldpListener *self) if (r < 0) goto next_packet; - neigh = g_malloc0 (sizeof (LLDPNeighbor)); + neigh = g_slice_new0 (LLDPNeighbor); neigh->tlvs = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, gvalue_destroy); neigh->chassis_id_type = chassis_id_type; neigh->port_id_type = port_id_type; sd_lldp_packet_get_destination_type (packets[i], &neigh->dest); - if (chassis_id_len < 1) { - lldp_neighbor_free (neigh); + if (chassis_id_len < 1) goto next_packet; - } switch (chassis_id_type) { case LLDP_CHASSIS_SUBTYPE_INTERFACE_ALIAS: case LLDP_CHASSIS_SUBTYPE_INTERFACE_NAME: case LLDP_CHASSIS_SUBTYPE_LOCALLY_ASSIGNED: case LLDP_CHASSIS_SUBTYPE_CHASSIS_COMPONENT: - neigh->chassis_id = strndup ((char *) chassis_id, chassis_id_len); + neigh->chassis_id = g_strndup ((const char *) chassis_id, chassis_id_len); break; case LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS: neigh->chassis_id = nm_utils_hwaddr_ntoa (chassis_id, chassis_id_len); break; default: - nm_log_dbg (LOGD_DEVICE, "LLDP: unsupported chassis ID type %d", chassis_id_type); - lldp_neighbor_free (neigh); + _LOGD ("process: unsupported chassis ID type %d", chassis_id_type); goto next_packet; } - if (port_id_len < 1) { - lldp_neighbor_free (neigh); + if (port_id_len < 1) goto next_packet; - } switch (port_id_type) { case LLDP_PORT_SUBTYPE_INTERFACE_ALIAS: @@ -300,8 +333,7 @@ process_lldp_neighbors (NMLldpListener *self) neigh->port_id = nm_utils_hwaddr_ntoa (port_id, port_id_len); break; default: - nm_log_dbg (LOGD_DEVICE, "LLDP: unsupported port ID type %d", port_id_type); - lldp_neighbor_free (neigh); + _LOGD ("process: unsupported port ID type %d", port_id_type); goto next_packet; } @@ -346,16 +378,15 @@ process_lldp_neighbors (NMLldpListener *self) g_hash_table_insert (neigh->tlvs, NM_LLDP_ATTR_IEEE_802_1_VLAN_NAME, value); } - nm_log_dbg (LOGD_DEVICE, "LLDP: new neigh: CHASSIS='%s' PORT='%s'", - neigh->chassis_id, neigh->port_id); + _LOGD ("process: new neigh: CHASSIS='%s' PORT='%s'", + neigh->chassis_id, neigh->port_id); g_hash_table_add (hash, neigh); + neigh = NULL; next_packet: sd_lldp_packet_unref (packets[i]); } - g_free (packets); - if (lldp_hash_table_equal (priv->lldp_neighbors, hash)) { g_hash_table_destroy (hash); } else { @@ -380,6 +411,7 @@ lldp_event_handler (sd_lldp *lldp, int event, void *userdata) NMLldpListenerPrivate *priv; g_return_if_fail (NM_IS_LLDP_LISTENER (self)); + priv = NM_LLDP_LISTENER_GET_PRIVATE (self); if (priv->timer > 0) { @@ -446,6 +478,7 @@ nm_lldp_listener_start (NMLldpListener *self, int ifindex, const char *iface, priv->ifindex = ifindex; priv->iface = strdup (iface); + _LOGD ("start"); return TRUE; err: @@ -466,6 +499,7 @@ nm_lldp_listener_stop (NMLldpListener *self) priv = NM_LLDP_LISTENER_GET_PRIVATE (self); if (priv->lldp_handle) { + _LOGD ("stop"); sd_lldp_stop (priv->lldp_handle); sd_lldp_detach_event (priv->lldp_handle); sd_lldp_unref (priv->lldp_handle); @@ -481,6 +515,7 @@ nm_lldp_listener_stop (NMLldpListener *self) } nm_clear_g_source (&priv->timer); + priv->ifindex = 0; } gboolean @@ -595,7 +630,9 @@ nm_lldp_listener_init (NMLldpListener *self) priv->lldp_neighbors = g_hash_table_new_full (lldp_neighbor_id_hash, lldp_neighbor_id_equal, - lldp_neighbor_free, NULL); + (GDestroyNotify) lldp_neighbor_free, NULL); + + _LOGT ("lldp listener created"); } NMLldpListener * @@ -623,6 +660,8 @@ finalize (GObject *object) nm_clear_g_variant (&priv->variant); + _LOGT ("lldp listener destroyed"); + G_OBJECT_CLASS (nm_lldp_listener_parent_class)->finalize (object); } diff --git a/src/devices/tests/test-lldp.c b/src/devices/tests/test-lldp.c index 7ec0d34e19..15aa324fac 100644 --- a/src/devices/tests/test-lldp.c +++ b/src/devices/tests/test-lldp.c @@ -136,7 +136,7 @@ get_lldp_neighbor_attribute (GVariant *neighbors, static void test_receive_frame (test_fixture *fixture, gconstpointer user_data) { - NMLldpListener *listener; + gs_unref_object NMLldpListener *listener = NULL; GMainLoop *loop; TestInfo info = { }; GVariant *neighbors, *attr; diff --git a/src/dhcp-manager/nm-dhcp-systemd.c b/src/dhcp-manager/nm-dhcp-systemd.c index 7c2bc78f59..b5a3d67cc0 100644 --- a/src/dhcp-manager/nm-dhcp-systemd.c +++ b/src/dhcp-manager/nm-dhcp-systemd.c @@ -36,6 +36,9 @@ #include "sd-dhcp-client.h" #include "sd-dhcp6-client.h" + +/* we use a private systemd header, thus need to include nm-sd-adapt.h. */ +#include "nm-sd-adapt.h" #include "dhcp-lease-internal.h" G_DEFINE_TYPE (NMDhcpSystemd, nm_dhcp_systemd, NM_TYPE_DHCP_CLIENT) diff --git a/src/systemd/nm-sd-adapt.c b/src/systemd/nm-sd-adapt.c index e10df9c746..fa7cd93878 100644 --- a/src/systemd/nm-sd-adapt.c +++ b/src/systemd/nm-sd-adapt.c @@ -18,7 +18,8 @@ #include "nm-default.h" -#include <glib.h> +#include "nm-sd-adapt.h" + #include <unistd.h> #include <errno.h> diff --git a/src/systemd/src/basic/alloc-util.h b/src/systemd/src/basic/alloc-util.h index 8482baba2d..679ba7f398 100644 --- a/src/systemd/src/basic/alloc-util.h +++ b/src/systemd/src/basic/alloc-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <alloca.h> #include <stddef.h> #include <stdlib.h> diff --git a/src/systemd/src/basic/async.h b/src/systemd/src/basic/async.h index 8d096982b2..9bd13ff6e0 100644 --- a/src/systemd/src/basic/async.h +++ b/src/systemd/src/basic/async.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - int asynchronous_job(void* (*func)(void *p), void *arg); int asynchronous_sync(void); diff --git a/src/systemd/src/basic/escape.h b/src/systemd/src/basic/escape.h index 9f1bb45f77..ce51811173 100644 --- a/src/systemd/src/basic/escape.h +++ b/src/systemd/src/basic/escape.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <stddef.h> #include <stdint.h> diff --git a/src/systemd/src/basic/fd-util.h b/src/systemd/src/basic/fd-util.h index 13e8a9fe62..44528c6e35 100644 --- a/src/systemd/src/basic/fd-util.h +++ b/src/systemd/src/basic/fd-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <dirent.h> #include <stdbool.h> #include <stdio.h> diff --git a/src/systemd/src/basic/fileio.h b/src/systemd/src/basic/fileio.h index 503af45494..8084895ff3 100644 --- a/src/systemd/src/basic/fileio.h +++ b/src/systemd/src/basic/fileio.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <dirent.h> #include <stdbool.h> #include <stddef.h> diff --git a/src/systemd/src/basic/fs-util.h b/src/systemd/src/basic/fs-util.h index b9b0f3d7b5..0e2fcb21b9 100644 --- a/src/systemd/src/basic/fs-util.h +++ b/src/systemd/src/basic/fs-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <fcntl.h> #include <limits.h> #include <stdbool.h> diff --git a/src/systemd/src/basic/hash-funcs.h b/src/systemd/src/basic/hash-funcs.h index 607ff7a3ae..299189d143 100644 --- a/src/systemd/src/basic/hash-funcs.h +++ b/src/systemd/src/basic/hash-funcs.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include "macro.h" #include "siphash24.h" diff --git a/src/systemd/src/basic/hashmap.h b/src/systemd/src/basic/hashmap.h index 76643a3c9f..6d1ae48b21 100644 --- a/src/systemd/src/basic/hashmap.h +++ b/src/systemd/src/basic/hashmap.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <limits.h> #include <stdbool.h> #include <stddef.h> diff --git a/src/systemd/src/basic/hexdecoct.h b/src/systemd/src/basic/hexdecoct.h index 263d6997db..1ba2f69ebd 100644 --- a/src/systemd/src/basic/hexdecoct.h +++ b/src/systemd/src/basic/hexdecoct.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <stdbool.h> #include <stddef.h> #include <stdio.h> diff --git a/src/systemd/src/basic/hostname-util.h b/src/systemd/src/basic/hostname-util.h index f0c1e2cea7..d062eddea1 100644 --- a/src/systemd/src/basic/hostname-util.h +++ b/src/systemd/src/basic/hostname-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <stdbool.h> #include "macro.h" diff --git a/src/systemd/src/basic/in-addr-util.h b/src/systemd/src/basic/in-addr-util.h index 4b21264564..17798ce816 100644 --- a/src/systemd/src/basic/in-addr-util.h +++ b/src/systemd/src/basic/in-addr-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <netinet/in.h> #include <stddef.h> #include <sys/socket.h> diff --git a/src/systemd/src/basic/io-util.h b/src/systemd/src/basic/io-util.h index b3cff3c000..142c940d92 100644 --- a/src/systemd/src/basic/io-util.h +++ b/src/systemd/src/basic/io-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <stdbool.h> #include <stddef.h> #include <stdint.h> diff --git a/src/systemd/src/basic/list.h b/src/systemd/src/basic/list.h index 781ea46797..c68185f587 100644 --- a/src/systemd/src/basic/list.h +++ b/src/systemd/src/basic/list.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - /* The head of the linked list. Use this in the structure that shall * contain the head of the linked list */ #define LIST_HEAD(t,name) \ diff --git a/src/systemd/src/basic/log.h b/src/systemd/src/basic/log.h index 8018149a1b..d0ec4dfab0 100644 --- a/src/systemd/src/basic/log.h +++ b/src/systemd/src/basic/log.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <errno.h> #include <stdarg.h> #include <stdbool.h> diff --git a/src/systemd/src/basic/macro.h b/src/systemd/src/basic/macro.h index 0ae6eaeca1..d12e09a797 100644 --- a/src/systemd/src/basic/macro.h +++ b/src/systemd/src/basic/macro.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <assert.h> #include <inttypes.h> #include <stdbool.h> diff --git a/src/systemd/src/basic/mempool.h b/src/systemd/src/basic/mempool.h index 710f234d23..fea7841bcf 100644 --- a/src/systemd/src/basic/mempool.h +++ b/src/systemd/src/basic/mempool.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <stddef.h> struct pool; diff --git a/src/systemd/src/basic/parse-util.h b/src/systemd/src/basic/parse-util.h index 0163df5c60..d8dc26a36e 100644 --- a/src/systemd/src/basic/parse-util.h +++ b/src/systemd/src/basic/parse-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <limits.h> #include <stddef.h> diff --git a/src/systemd/src/basic/path-util.h b/src/systemd/src/basic/path-util.h index 09d733c49b..2c2f87a9f2 100644 --- a/src/systemd/src/basic/path-util.h +++ b/src/systemd/src/basic/path-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <alloca.h> #include <stdbool.h> #include <stddef.h> diff --git a/src/systemd/src/basic/prioq.h b/src/systemd/src/basic/prioq.h index a4106b0416..113c73d040 100644 --- a/src/systemd/src/basic/prioq.h +++ b/src/systemd/src/basic/prioq.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <stdbool.h> #include "hashmap.h" diff --git a/src/systemd/src/basic/random-util.h b/src/systemd/src/basic/random-util.h index 1ae76ef03d..3cee4c5014 100644 --- a/src/systemd/src/basic/random-util.h +++ b/src/systemd/src/basic/random-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <stddef.h> #include <stdint.h> diff --git a/src/systemd/src/basic/refcnt.h b/src/systemd/src/basic/refcnt.h index 275cf9721e..1d77a6445a 100644 --- a/src/systemd/src/basic/refcnt.h +++ b/src/systemd/src/basic/refcnt.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - /* A type-safe atomic refcounter. * * DO NOT USE THIS UNLESS YOU ACTUALLY CARE ABOUT THREAD SAFETY! */ diff --git a/src/systemd/src/basic/set.h b/src/systemd/src/basic/set.h index 45ddd424f6..2bff5062da 100644 --- a/src/systemd/src/basic/set.h +++ b/src/systemd/src/basic/set.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include "hashmap.h" #include "macro.h" diff --git a/src/systemd/src/basic/siphash24.h b/src/systemd/src/basic/siphash24.h index d8d76083c3..54e2420cc6 100644 --- a/src/systemd/src/basic/siphash24.h +++ b/src/systemd/src/basic/siphash24.h @@ -1,7 +1,5 @@ #pragma once -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <stddef.h> #include <stdint.h> diff --git a/src/systemd/src/basic/socket-util.h b/src/systemd/src/basic/socket-util.h index 8ac915e7cd..92edc1dc22 100644 --- a/src/systemd/src/basic/socket-util.h +++ b/src/systemd/src/basic/socket-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <netinet/ether.h> #include <netinet/in.h> #include <stdbool.h> diff --git a/src/systemd/src/basic/sparse-endian.h b/src/systemd/src/basic/sparse-endian.h index 02de0feca8..c913fda8c5 100644 --- a/src/systemd/src/basic/sparse-endian.h +++ b/src/systemd/src/basic/sparse-endian.h @@ -21,8 +21,6 @@ #ifndef SPARSE_ENDIAN_H #define SPARSE_ENDIAN_H -#include "nm-sd-adapt.h" - #include <byteswap.h> #include <endian.h> #include <stdint.h> diff --git a/src/systemd/src/basic/stdio-util.h b/src/systemd/src/basic/stdio-util.h index af65e223ba..0a675571ff 100644 --- a/src/systemd/src/basic/stdio-util.h +++ b/src/systemd/src/basic/stdio-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <printf.h> #include <stdarg.h> #include <stdio.h> diff --git a/src/systemd/src/basic/string-table.h b/src/systemd/src/basic/string-table.h index 2eb266762d..b180488fe8 100644 --- a/src/systemd/src/basic/string-table.h +++ b/src/systemd/src/basic/string-table.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <errno.h> #include <stddef.h> #include <stdio.h> diff --git a/src/systemd/src/basic/string-util.h b/src/systemd/src/basic/string-util.h index 699e16b70f..ad0c813761 100644 --- a/src/systemd/src/basic/string-util.h +++ b/src/systemd/src/basic/string-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <alloca.h> #include <stdbool.h> #include <stddef.h> diff --git a/src/systemd/src/basic/strv.h b/src/systemd/src/basic/strv.h index e1e18a4e70..4a93818a42 100644 --- a/src/systemd/src/basic/strv.h +++ b/src/systemd/src/basic/strv.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <fnmatch.h> #include <stdarg.h> #include <stdbool.h> diff --git a/src/systemd/src/basic/time-util.h b/src/systemd/src/basic/time-util.h index 05c5c250bd..9894e626c5 100644 --- a/src/systemd/src/basic/time-util.h +++ b/src/systemd/src/basic/time-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <stdbool.h> #include <stddef.h> diff --git a/src/systemd/src/basic/umask-util.h b/src/systemd/src/basic/umask-util.h index b8ab47ed04..359d87d27c 100644 --- a/src/systemd/src/basic/umask-util.h +++ b/src/systemd/src/basic/umask-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <stdbool.h> #include <sys/stat.h> #include <sys/types.h> diff --git a/src/systemd/src/basic/unaligned.h b/src/systemd/src/basic/unaligned.h index a34771eb3e..79be645bed 100644 --- a/src/systemd/src/basic/unaligned.h +++ b/src/systemd/src/basic/unaligned.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <endian.h> #include <stdint.h> diff --git a/src/systemd/src/basic/utf8.h b/src/systemd/src/basic/utf8.h index 8b917cb03e..a3c8558ea5 100644 --- a/src/systemd/src/basic/utf8.h +++ b/src/systemd/src/basic/utf8.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <stdbool.h> #include <stddef.h> #include <stdint.h> diff --git a/src/systemd/src/basic/util.h b/src/systemd/src/basic/util.h index 9ec160302a..5033b02917 100644 --- a/src/systemd/src/basic/util.h +++ b/src/systemd/src/basic/util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <alloca.h> #include <errno.h> #include <fcntl.h> diff --git a/src/systemd/src/libsystemd-network/arp-util.h b/src/systemd/src/libsystemd-network/arp-util.h index 6ccb72c740..3ef56b002a 100644 --- a/src/systemd/src/libsystemd-network/arp-util.h +++ b/src/systemd/src/libsystemd-network/arp-util.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <netinet/if_ether.h> #include "socket-util.h" diff --git a/src/systemd/src/libsystemd-network/dhcp-identifier.h b/src/systemd/src/libsystemd-network/dhcp-identifier.h index 8ef7ad16c3..93f06f5938 100644 --- a/src/systemd/src/libsystemd-network/dhcp-identifier.h +++ b/src/systemd/src/libsystemd-network/dhcp-identifier.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include "sd-id128.h" #include "macro.h" diff --git a/src/systemd/src/libsystemd-network/dhcp-internal.h b/src/systemd/src/libsystemd-network/dhcp-internal.h index 517ae11352..a3b842cda3 100644 --- a/src/systemd/src/libsystemd-network/dhcp-internal.h +++ b/src/systemd/src/libsystemd-network/dhcp-internal.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <linux/if_packet.h> #include <net/ethernet.h> #include <net/if_arp.h> diff --git a/src/systemd/src/libsystemd-network/dhcp-lease-internal.h b/src/systemd/src/libsystemd-network/dhcp-lease-internal.h index 00b701f013..82cae2300a 100644 --- a/src/systemd/src/libsystemd-network/dhcp-lease-internal.h +++ b/src/systemd/src/libsystemd-network/dhcp-lease-internal.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <stdint.h> #include <linux/if_packet.h> diff --git a/src/systemd/src/libsystemd-network/dhcp-protocol.h b/src/systemd/src/libsystemd-network/dhcp-protocol.h index 421ae9bb32..3e32484c1d 100644 --- a/src/systemd/src/libsystemd-network/dhcp-protocol.h +++ b/src/systemd/src/libsystemd-network/dhcp-protocol.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <netinet/ip.h> #include <netinet/udp.h> #include <stdint.h> diff --git a/src/systemd/src/libsystemd-network/dhcp6-internal.h b/src/systemd/src/libsystemd-network/dhcp6-internal.h index af36480c1d..749086d33a 100644 --- a/src/systemd/src/libsystemd-network/dhcp6-internal.h +++ b/src/systemd/src/libsystemd-network/dhcp6-internal.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <net/ethernet.h> #include <netinet/in.h> diff --git a/src/systemd/src/libsystemd-network/dhcp6-lease-internal.h b/src/systemd/src/libsystemd-network/dhcp6-lease-internal.h index 83c62305b6..14e708ef63 100644 --- a/src/systemd/src/libsystemd-network/dhcp6-lease-internal.h +++ b/src/systemd/src/libsystemd-network/dhcp6-lease-internal.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <stdint.h> #include "sd-dhcp6-lease.h" diff --git a/src/systemd/src/libsystemd-network/dhcp6-protocol.h b/src/systemd/src/libsystemd-network/dhcp6-protocol.h index b12df5543f..ee4bdfb07f 100644 --- a/src/systemd/src/libsystemd-network/dhcp6-protocol.h +++ b/src/systemd/src/libsystemd-network/dhcp6-protocol.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <netinet/ip6.h> #include <netinet/udp.h> diff --git a/src/systemd/src/libsystemd-network/lldp-internal.h b/src/systemd/src/libsystemd-network/lldp-internal.h index 6f1ea1050b..15b4a11b15 100644 --- a/src/systemd/src/libsystemd-network/lldp-internal.h +++ b/src/systemd/src/libsystemd-network/lldp-internal.h @@ -20,8 +20,6 @@ #pragma once -#include "nm-sd-adapt.h" - #include "sd-event.h" #include "list.h" diff --git a/src/systemd/src/libsystemd-network/lldp-network.h b/src/systemd/src/libsystemd-network/lldp-network.h index 3957002b41..dcf31faa95 100644 --- a/src/systemd/src/libsystemd-network/lldp-network.h +++ b/src/systemd/src/libsystemd-network/lldp-network.h @@ -20,8 +20,6 @@ #pragma once -#include "nm-sd-adapt.h" - #include "sd-event.h" int lldp_network_bind_raw_socket(int ifindex); diff --git a/src/systemd/src/libsystemd-network/lldp-port.h b/src/systemd/src/libsystemd-network/lldp-port.h index a09bf0c2eb..96092f8df9 100644 --- a/src/systemd/src/libsystemd-network/lldp-port.h +++ b/src/systemd/src/libsystemd-network/lldp-port.h @@ -20,8 +20,6 @@ #pragma once -#include "nm-sd-adapt.h" - #include <net/ethernet.h> #include "sd-event.h" diff --git a/src/systemd/src/libsystemd-network/lldp-tlv.h b/src/systemd/src/libsystemd-network/lldp-tlv.h index b5eba52dac..8e7706c612 100644 --- a/src/systemd/src/libsystemd-network/lldp-tlv.h +++ b/src/systemd/src/libsystemd-network/lldp-tlv.h @@ -20,8 +20,6 @@ #pragma once -#include "nm-sd-adapt.h" - #include <net/ethernet.h> #include "sd-lldp.h" diff --git a/src/systemd/src/libsystemd-network/lldp.h b/src/systemd/src/libsystemd-network/lldp.h index ce2c1323ca..d2c7164633 100644 --- a/src/systemd/src/libsystemd-network/lldp.h +++ b/src/systemd/src/libsystemd-network/lldp.h @@ -20,8 +20,6 @@ #pragma once -#include "nm-sd-adapt.h" - #define LLDP_MULTICAST_ADDR { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e } #define ETHERTYPE_LLDP 0x88cc diff --git a/src/systemd/src/libsystemd-network/network-internal.h b/src/systemd/src/libsystemd-network/network-internal.h index bb8c7b717c..fd16105612 100644 --- a/src/systemd/src/libsystemd-network/network-internal.h +++ b/src/systemd/src/libsystemd-network/network-internal.h @@ -19,8 +19,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <stdbool.h> #include "sd-dhcp-lease.h" diff --git a/src/systemd/src/shared/dns-domain.h b/src/systemd/src/shared/dns-domain.h index ba0e001144..2de3642cb3 100644 --- a/src/systemd/src/shared/dns-domain.h +++ b/src/systemd/src/shared/dns-domain.h @@ -19,7 +19,6 @@ #pragma once -#include "nm-sd-adapt.h" #include <errno.h> #include <stdbool.h> diff --git a/src/systemd/src/systemd/_sd-common.h b/src/systemd/src/systemd/_sd-common.h index 59314265ee..2d4e1f26e1 100644 --- a/src/systemd/src/systemd/_sd-common.h +++ b/src/systemd/src/systemd/_sd-common.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - /* This is a private header; never even think of including this directly! */ #if __INCLUDE_LEVEL__ <= 1 diff --git a/src/systemd/src/systemd/sd-dhcp-client.h b/src/systemd/src/systemd/sd-dhcp-client.h index ce863ecc3f..2b865a80e1 100644 --- a/src/systemd/src/systemd/sd-dhcp-client.h +++ b/src/systemd/src/systemd/sd-dhcp-client.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <net/ethernet.h> #include <netinet/in.h> diff --git a/src/systemd/src/systemd/sd-dhcp-lease.h b/src/systemd/src/systemd/sd-dhcp-lease.h index 9ceef46d0d..2f565ca825 100644 --- a/src/systemd/src/systemd/sd-dhcp-lease.h +++ b/src/systemd/src/systemd/sd-dhcp-lease.h @@ -21,8 +21,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <net/ethernet.h> #include <netinet/in.h> diff --git a/src/systemd/src/systemd/sd-dhcp6-client.h b/src/systemd/src/systemd/sd-dhcp6-client.h index bfa10540e4..9608060830 100644 --- a/src/systemd/src/systemd/sd-dhcp6-client.h +++ b/src/systemd/src/systemd/sd-dhcp6-client.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <net/ethernet.h> #include <sys/types.h> diff --git a/src/systemd/src/systemd/sd-dhcp6-lease.h b/src/systemd/src/systemd/sd-dhcp6-lease.h index 691ee2de79..184fbb8e0d 100644 --- a/src/systemd/src/systemd/sd-dhcp6-lease.h +++ b/src/systemd/src/systemd/sd-dhcp6-lease.h @@ -21,8 +21,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <netinet/in.h> diff --git a/src/systemd/src/systemd/sd-event.h b/src/systemd/src/systemd/sd-event.h index 0d49067f97..1ea97e47f8 100644 --- a/src/systemd/src/systemd/sd-event.h +++ b/src/systemd/src/systemd/sd-event.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <signal.h> #include <sys/epoll.h> diff --git a/src/systemd/src/systemd/sd-id128.h b/src/systemd/src/systemd/sd-id128.h index efecb268b7..a3bf5897b8 100644 --- a/src/systemd/src/systemd/sd-id128.h +++ b/src/systemd/src/systemd/sd-id128.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <string.h> diff --git a/src/systemd/src/systemd/sd-ipv4acd.h b/src/systemd/src/systemd/sd-ipv4acd.h index c028aea972..3a2219c82c 100644 --- a/src/systemd/src/systemd/sd-ipv4acd.h +++ b/src/systemd/src/systemd/sd-ipv4acd.h @@ -21,8 +21,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <net/ethernet.h> #include <netinet/in.h> diff --git a/src/systemd/src/systemd/sd-ipv4ll.h b/src/systemd/src/systemd/sd-ipv4ll.h index 8e44d3a245..67c566fe0d 100644 --- a/src/systemd/src/systemd/sd-ipv4ll.h +++ b/src/systemd/src/systemd/sd-ipv4ll.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <net/ethernet.h> #include <netinet/in.h> diff --git a/src/systemd/src/systemd/sd-lldp.h b/src/systemd/src/systemd/sd-lldp.h index 6dc97da64f..ea952ef187 100644 --- a/src/systemd/src/systemd/sd-lldp.h +++ b/src/systemd/src/systemd/sd-lldp.h @@ -21,8 +21,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <net/ethernet.h> diff --git a/src/systemd/src/systemd/sd-ndisc.h b/src/systemd/src/systemd/sd-ndisc.h index e8ccf055e4..762947531d 100644 --- a/src/systemd/src/systemd/sd-ndisc.h +++ b/src/systemd/src/systemd/sd-ndisc.h @@ -20,8 +20,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "nm-sd-adapt.h" - #include <inttypes.h> #include <net/ethernet.h> |