systemd: move basic systemd library to shared/nm-utils

For better or worse, we already pull in large parts of systemd sources.

I need a base64 decode implementation (because glib's g_base64_decode()
cannot reject invalid encodings). Instead of coming up with my own or
copy-paste if from somewhere, reuse systemd's unbase64mem().

But for that, make systemd's basic bits an independent static library
first because I will need it in libnm-core.

This doesn't really change anything except making "libnm-systemd-core.la"
an indpendent static library that could be used from "libnm-core". We
shall still be mindful about which internal code of systemd we use, and only
access functionality that is exposed via "systemd/nm-sd-utils-shared.h".
This commit is contained in:
Thomas Haller 2018-12-28 18:11:16 +01:00
parent 616abe865d
commit 2c537b9d21
145 changed files with 564 additions and 383 deletions

View File

@ -1490,7 +1490,8 @@ libexec_PROGRAMS += \
noinst_LTLIBRARIES += \
src/libNetworkManagerBase.la \
src/libNetworkManager.la \
src/libsystemd-nm.la
src/libnm-systemd-core.la \
$(NULL)
check-config-options:
$(srcdir)/tools/check-config-options.sh "$(srcdir)"
@ -1499,141 +1500,173 @@ check_local += check-config-options
###############################################################################
src_libsystemd_nm_la_cppflags = \
libsystemd_cppflags = \
$(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/shared/systemd/ \
-I$(srcdir)/shared/systemd/sd-adapt-shared \
-I$(srcdir)/shared/systemd/src/basic \
$(LIBSYSTEMD_NM_CFLAGS) \
$(GLIB_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
$(NULL)
libsystemd_libadd = \
$(GLIB_LIBS) \
$(CODE_COVERAGE_LDFLAGS) \
$(NULL)
noinst_LTLIBRARIES += shared/systemd/libnm-systemd-shared.la
shared_systemd_libnm_systemd_shared_la_CPPFLAGS = \
$(libsystemd_cppflags) \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED \
-DG_LOG_DOMAIN=\""libnm"\" \
$(NULL)
shared_systemd_libnm_systemd_shared_la_SOURCES = \
shared/systemd/nm-sd-utils-shared.c \
shared/systemd/nm-sd-utils-shared.h \
shared/systemd/sd-adapt-shared/architecture.h \
shared/systemd/sd-adapt-shared/btrfs-util.h \
shared/systemd/sd-adapt-shared/build.h \
shared/systemd/sd-adapt-shared/cgroup-util.h \
shared/systemd/sd-adapt-shared/copy.h \
shared/systemd/sd-adapt-shared/def.h \
shared/systemd/sd-adapt-shared/device-nodes.h \
shared/systemd/sd-adapt-shared/dirent-util.h \
shared/systemd/sd-adapt-shared/errno-list.h \
shared/systemd/sd-adapt-shared/format-util.h \
shared/systemd/sd-adapt-shared/glob-util.h \
shared/systemd/sd-adapt-shared/gunicode.h \
shared/systemd/sd-adapt-shared/ioprio.h \
shared/systemd/sd-adapt-shared/locale-util.h \
shared/systemd/sd-adapt-shared/memfd-util.h \
shared/systemd/sd-adapt-shared/missing.h \
shared/systemd/sd-adapt-shared/missing_socket.h \
shared/systemd/sd-adapt-shared/missing_syscall.h \
shared/systemd/sd-adapt-shared/missing_timerfd.h \
shared/systemd/sd-adapt-shared/mkdir.h \
shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h \
shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h \
shared/systemd/sd-adapt-shared/procfs-util.h \
shared/systemd/sd-adapt-shared/raw-clone.h \
shared/systemd/sd-adapt-shared/rlimit-util.h \
shared/systemd/sd-adapt-shared/terminal-util.h \
shared/systemd/sd-adapt-shared/unaligned.h \
shared/systemd/sd-adapt-shared/user-util.h \
shared/systemd/sd-adapt-shared/virt.h \
shared/systemd/src/basic/alloc-util.c \
shared/systemd/src/basic/alloc-util.h \
shared/systemd/src/basic/async.h \
shared/systemd/src/basic/env-file.c \
shared/systemd/src/basic/env-file.h \
shared/systemd/src/basic/env-util.c \
shared/systemd/src/basic/env-util.h \
shared/systemd/src/basic/escape.c \
shared/systemd/src/basic/escape.h \
shared/systemd/src/basic/ether-addr-util.c \
shared/systemd/src/basic/ether-addr-util.h \
shared/systemd/src/basic/extract-word.c \
shared/systemd/src/basic/extract-word.h \
shared/systemd/src/basic/fd-util.c \
shared/systemd/src/basic/fd-util.h \
shared/systemd/src/basic/fileio.c \
shared/systemd/src/basic/fileio.h \
shared/systemd/src/basic/fs-util.c \
shared/systemd/src/basic/fs-util.h \
shared/systemd/src/basic/hash-funcs.c \
shared/systemd/src/basic/hash-funcs.h \
shared/systemd/src/basic/hashmap.c \
shared/systemd/src/basic/hashmap.h \
shared/systemd/src/basic/hexdecoct.c \
shared/systemd/src/basic/hexdecoct.h \
shared/systemd/src/basic/hostname-util.c \
shared/systemd/src/basic/hostname-util.h \
shared/systemd/src/basic/in-addr-util.c \
shared/systemd/src/basic/in-addr-util.h \
shared/systemd/src/basic/io-util.c \
shared/systemd/src/basic/io-util.h \
shared/systemd/src/basic/list.h \
shared/systemd/src/basic/log.h \
shared/systemd/src/basic/macro.h \
shared/systemd/src/basic/mempool.c \
shared/systemd/src/basic/mempool.h \
shared/systemd/src/basic/missing_type.h \
shared/systemd/src/basic/parse-util.c \
shared/systemd/src/basic/parse-util.h \
shared/systemd/src/basic/path-util.c \
shared/systemd/src/basic/path-util.h \
shared/systemd/src/basic/prioq.c \
shared/systemd/src/basic/prioq.h \
shared/systemd/src/basic/process-util.c \
shared/systemd/src/basic/process-util.h \
shared/systemd/src/basic/random-util.c \
shared/systemd/src/basic/random-util.h \
shared/systemd/src/basic/refcnt.h \
shared/systemd/src/basic/set.h \
shared/systemd/src/basic/signal-util.h \
shared/systemd/src/basic/siphash24.h \
shared/systemd/src/basic/socket-util.c \
shared/systemd/src/basic/socket-util.h \
shared/systemd/src/basic/sparse-endian.h \
shared/systemd/src/basic/stat-util.c \
shared/systemd/src/basic/stat-util.h \
shared/systemd/src/basic/stdio-util.h \
shared/systemd/src/basic/string-table.c \
shared/systemd/src/basic/string-table.h \
shared/systemd/src/basic/string-util.c \
shared/systemd/src/basic/string-util.h \
shared/systemd/src/basic/strv.c \
shared/systemd/src/basic/strv.h \
shared/systemd/src/basic/time-util.c \
shared/systemd/src/basic/time-util.h \
shared/systemd/src/basic/tmpfile-util.c \
shared/systemd/src/basic/tmpfile-util.h \
shared/systemd/src/basic/umask-util.h \
shared/systemd/src/basic/utf8.c \
shared/systemd/src/basic/utf8.h \
shared/systemd/src/basic/util.c \
shared/systemd/src/basic/util.h \
$(NULL)
shared_systemd_libnm_systemd_shared_la_LIBADD = \
$(libsystemd_libadd) \
$(NULL)
###############################################################################
src_libnm_systemd_core_la_cppflags = \
$(libsystemd_cppflags) \
-I$(srcdir)/libnm-core \
-I$(builddir)/libnm-core \
-I$(srcdir)/src \
-I$(srcdir)/src/systemd/sd-adapt \
-I$(srcdir)/src/systemd/sd-adapt-core \
-I$(srcdir)/src/systemd/src/systemd \
-I$(srcdir)/src/systemd/src/basic \
-I$(srcdir)/src/systemd/src/shared \
-I$(srcdir)/src/systemd/src/libsystemd-network \
-I$(srcdir)/src/systemd/src/libsystemd/sd-event \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD \
$(LIBSYSTEMD_NM_CFLAGS) \
$(GLIB_CFLAGS) \
$(CODE_COVERAGE_CFLAGS)
$(NULL)
src_libsystemd_nm_la_libadd = \
$(GLIB_LIBS) \
$(CODE_COVERAGE_LDFLAGS)
src_libnm_systemd_core_la_libadd = \
$(libsystemd_libadd) \
$(NULL)
src_libsystemd_nm_la_SOURCES = \
src_libnm_systemd_core_la_SOURCES = \
src/systemd/nm-sd-utils-core.c \
src/systemd/nm-sd-utils-core.h \
src/systemd/nm-sd.c \
src/systemd/nm-sd.h \
src/systemd/nm-sd-utils.c \
src/systemd/nm-sd-utils.h \
src/systemd/sd-adapt/nm-sd-adapt.c \
src/systemd/sd-adapt/nm-sd-adapt.h \
src/systemd/sd-adapt/architecture.h \
src/systemd/sd-adapt/btrfs-util.h \
src/systemd/sd-adapt/build.h \
src/systemd/sd-adapt/cgroup-util.h \
src/systemd/sd-adapt/condition.h \
src/systemd/sd-adapt/conf-parser.h \
src/systemd/sd-adapt/copy.h \
src/systemd/sd-adapt/def.h \
src/systemd/sd-adapt/device-nodes.h \
src/systemd/sd-adapt/dirent-util.h \
src/systemd/sd-adapt/errno-list.h \
src/systemd/sd-adapt/format-util.h \
src/systemd/sd-adapt/glob-util.h \
src/systemd/sd-adapt/gunicode.h \
src/systemd/sd-adapt/ioprio.h \
src/systemd/sd-adapt/khash.h \
src/systemd/sd-adapt/locale-util.h \
src/systemd/sd-adapt/memfd-util.h \
src/systemd/sd-adapt/missing.h \
src/systemd/sd-adapt/missing_socket.h \
src/systemd/sd-adapt/missing_syscall.h \
src/systemd/sd-adapt/missing_timerfd.h \
src/systemd/sd-adapt/mkdir.h \
src/systemd/sd-adapt/procfs-util.h \
src/systemd/sd-adapt/raw-clone.h \
src/systemd/sd-adapt/rlimit-util.h \
src/systemd/sd-adapt/sd-daemon.h \
src/systemd/sd-adapt/sd-device.h \
src/systemd/sd-adapt/serialize.h \
src/systemd/sd-adapt/stat-util.h \
src/systemd/sd-adapt/terminal-util.h \
src/systemd/sd-adapt/unaligned.h \
src/systemd/sd-adapt/user-util.h \
src/systemd/sd-adapt/virt.h \
src/systemd/src/basic/alloc-util.c \
src/systemd/src/basic/alloc-util.h \
src/systemd/src/basic/async.h \
src/systemd/src/basic/env-file.c \
src/systemd/src/basic/env-file.h \
src/systemd/src/basic/env-util.c \
src/systemd/src/basic/env-util.h \
src/systemd/src/basic/escape.c \
src/systemd/src/basic/escape.h \
src/systemd/src/basic/ether-addr-util.c \
src/systemd/src/basic/ether-addr-util.h \
src/systemd/src/basic/extract-word.c \
src/systemd/src/basic/extract-word.h \
src/systemd/src/basic/fd-util.c \
src/systemd/src/basic/fd-util.h \
src/systemd/src/basic/fileio.c \
src/systemd/src/basic/fileio.h \
src/systemd/src/basic/fs-util.c \
src/systemd/src/basic/fs-util.h \
src/systemd/src/basic/hash-funcs.c \
src/systemd/src/basic/hash-funcs.h \
src/systemd/src/basic/hashmap.c \
src/systemd/src/basic/hashmap.h \
src/systemd/src/basic/hexdecoct.c \
src/systemd/src/basic/hexdecoct.h \
src/systemd/src/basic/hostname-util.c \
src/systemd/src/basic/hostname-util.h \
src/systemd/src/basic/in-addr-util.c \
src/systemd/src/basic/in-addr-util.h \
src/systemd/src/basic/io-util.c \
src/systemd/src/basic/io-util.h \
src/systemd/src/basic/list.h \
src/systemd/src/basic/log.h \
src/systemd/src/basic/macro.h \
src/systemd/src/basic/mempool.c \
src/systemd/src/basic/mempool.h \
src/systemd/src/basic/missing_type.h \
src/systemd/src/basic/parse-util.c \
src/systemd/src/basic/parse-util.h \
src/systemd/src/basic/path-util.c \
src/systemd/src/basic/path-util.h \
src/systemd/src/basic/prioq.c \
src/systemd/src/basic/prioq.h \
src/systemd/src/basic/process-util.c \
src/systemd/src/basic/process-util.h \
src/systemd/src/basic/random-util.c \
src/systemd/src/basic/random-util.h \
src/systemd/src/basic/refcnt.h \
src/systemd/src/basic/set.h \
src/systemd/src/basic/signal-util.h \
src/systemd/src/basic/siphash24.h \
src/systemd/src/basic/socket-util.c \
src/systemd/src/basic/socket-util.h \
src/systemd/src/basic/sparse-endian.h \
src/systemd/src/basic/stat-util.c \
src/systemd/src/basic/stat-util.h \
src/systemd/src/basic/stdio-util.h \
src/systemd/src/basic/string-table.c \
src/systemd/src/basic/string-table.h \
src/systemd/src/basic/string-util.c \
src/systemd/src/basic/string-util.h \
src/systemd/src/basic/strv.c \
src/systemd/src/basic/strv.h \
src/systemd/src/basic/time-util.c \
src/systemd/src/basic/time-util.h \
src/systemd/src/basic/tmpfile-util.c \
src/systemd/src/basic/tmpfile-util.h \
src/systemd/src/basic/umask-util.h \
src/systemd/src/basic/utf8.c \
src/systemd/src/basic/utf8.h \
src/systemd/src/basic/util.c \
src/systemd/src/basic/util.h \
src/systemd/sd-adapt-core/condition.h \
src/systemd/sd-adapt-core/conf-parser.h \
src/systemd/sd-adapt-core/khash.h \
src/systemd/sd-adapt-core/nm-sd-adapt-core.c \
src/systemd/sd-adapt-core/nm-sd-adapt-core.h \
src/systemd/sd-adapt-core/sd-daemon.h \
src/systemd/sd-adapt-core/sd-device.h \
src/systemd/sd-adapt-core/stat-util.h \
src/systemd/src/libsystemd-network/arp-util.c \
src/systemd/src/libsystemd-network/arp-util.h \
src/systemd/src/libsystemd-network/dhcp-identifier.c \
@ -1684,9 +1717,9 @@ src_libsystemd_nm_la_SOURCES = \
src/systemd/src/systemd/sd-lldp.h \
src/systemd/src/systemd/sd-ndisc.h
src_libsystemd_nm_la_CPPFLAGS = $(src_libsystemd_nm_la_cppflags)
src_libsystemd_nm_la_LIBADD = $(src_libsystemd_nm_la_libadd)
$(src_libsystemd_nm_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
src_libnm_systemd_core_la_CPPFLAGS = $(src_libnm_systemd_core_la_cppflags)
src_libnm_systemd_core_la_LIBADD = $(src_libnm_systemd_core_la_libadd)
$(src_libnm_systemd_core_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
EXTRA_DIST += \
src/systemd/meson.build
@ -1960,7 +1993,8 @@ src_libNetworkManager_la_SOURCES = \
src_libNetworkManager_la_LIBADD = \
src/libNetworkManagerBase.la \
src/libsystemd-nm.la \
src/libnm-systemd-core.la \
shared/systemd/libnm-systemd-shared.la \
shared/libnacd.la \
$(GLIB_LIBS) \
$(LIBUDEV_LIBS) \
@ -2033,7 +2067,8 @@ src_nm_iface_helper_SOURCES = \
src_nm_iface_helper_LDADD = \
src/libNetworkManagerBase.la \
src/libsystemd-nm.la \
src/libnm-systemd-core.la \
shared/systemd/libnm-systemd-shared.la \
$(GLIB_LIBS) \
$(LIBUDEV_LIBS) \
$(LIBNDP_LIBS) \
@ -3609,14 +3644,13 @@ $(src_tests_test_wired_defname_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
$(src_tests_test_utils_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
src_tests_test_systemd_CPPFLAGS = \
$(src_libsystemd_nm_la_cppflags) \
$(src_libnm_systemd_core_la_cppflags) \
-DNETWORKMANAGER_COMPILATION_TEST
src_tests_test_systemd_SOURCES = \
src/tests/test-systemd.c
src_tests_test_systemd_LDADD = \
src/libsystemd-nm.la \
src/libnm-systemd-core.la \
shared/systemd/libnm-systemd-shared.la \
shared/libcsiphash.la \
$(src_libsystemd_nm_la_libadd) \
$(src_libnm_systemd_core_la_libadd) \
$(NULL)
$(src_tests_test_systemd_OBJECTS): $(libnm_core_lib_h_pub_mkenums)

View File

@ -146,3 +146,64 @@ test(
test_script,
args: test_args + [test_shared_general.full_path()]
)
###############################################################################
libnm_systemd_shared = static_library(
'nm-systemd-shared',
sources: files(
'systemd/src/basic/alloc-util.c',
'systemd/src/basic/escape.c',
'systemd/src/basic/env-file.c',
'systemd/src/basic/env-util.c',
'systemd/src/basic/ether-addr-util.c',
'systemd/src/basic/extract-word.c',
'systemd/src/basic/fd-util.c',
'systemd/src/basic/fileio.c',
'systemd/src/basic/fs-util.c',
'systemd/src/basic/hash-funcs.c',
'systemd/src/basic/hashmap.c',
'systemd/src/basic/hexdecoct.c',
'systemd/src/basic/hostname-util.c',
'systemd/src/basic/in-addr-util.c',
'systemd/src/basic/io-util.c',
'systemd/src/basic/mempool.c',
'systemd/src/basic/parse-util.c',
'systemd/src/basic/path-util.c',
'systemd/src/basic/prioq.c',
'systemd/src/basic/process-util.c',
'systemd/src/basic/random-util.c',
'systemd/src/basic/socket-util.c',
'systemd/src/basic/stat-util.c',
'systemd/src/basic/string-table.c',
'systemd/src/basic/string-util.c',
'systemd/src/basic/strv.c',
'systemd/src/basic/time-util.c',
'systemd/src/basic/tmpfile-util.c',
'systemd/src/basic/utf8.c',
'systemd/src/basic/util.c',
'systemd/nm-sd-utils-shared.c',
),
include_directories: include_directories(
'systemd/sd-adapt-shared',
'systemd/src/basic',
),
dependencies: shared_dep,
c_args: [
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED',
'-DG_LOG_DOMAIN="libnm"',
],
)
libnm_systemd_shared_dep = declare_dependency(
include_directories: include_directories(
'systemd/sd-adapt-shared',
'systemd/src/basic',
),
dependencies: [
shared_dep,
],
link_with: [
libnm_systemd_shared,
],
)

View File

@ -78,9 +78,14 @@
| NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON \
)
#define NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED ( 0 \
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \
| NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD \
)
#define NM_NETWORKMANAGER_COMPILATION_SYSTEMD ( 0 \
| NM_NETWORKMANAGER_COMPILATION_DAEMON \
| NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD \
| NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED \
)
#define NM_NETWORKMANAGER_COMPILATION_GLIB ( 0 \

View File

@ -18,14 +18,11 @@
#include "nm-default.h"
#include "nm-sd-utils.h"
#include "nm-sd-utils-shared.h"
#include "nm-core-internal.h"
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include "path-util.h"
#include "sd-id128.h"
/*****************************************************************************/
@ -46,16 +43,3 @@ nm_sd_utils_path_startswith (const char *path, const char *prefix)
{
return path_startswith (path, prefix);
}
/*****************************************************************************/
NMUuid *
nm_sd_utils_id128_get_machine (NMUuid *out_uuid)
{
g_assert (out_uuid);
G_STATIC_ASSERT_EXPR (sizeof (*out_uuid) == sizeof (sd_id128_t));
if (sd_id128_get_machine ((sd_id128_t *) out_uuid) < 0)
return NULL;
return out_uuid;
}

View File

@ -16,8 +16,8 @@
* Copyright (C) 2018 Red Hat, Inc.
*/
#ifndef __NM_SD_UTILS_H__
#define __NM_SD_UTILS_H__
#ifndef __NM_SD_UTILS_SHARED_H__
#define __NM_SD_UTILS_SHARED_H__
/*****************************************************************************/
@ -29,10 +29,4 @@ const char *nm_sd_utils_path_startswith (const char *path, const char *prefix);
/*****************************************************************************/
struct _NMUuid;
struct _NMUuid *nm_sd_utils_id128_get_machine (struct _NMUuid *out_uuid);
/*****************************************************************************/
#endif /* __NM_SD_UTILS_H__ */
#endif /* __NM_SD_UTILS_SHARED_H__ */

View File

@ -13,40 +13,17 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2014 - 2015 Red Hat, Inc.
* Copyright (C) 2014 - 2018 Red Hat, Inc.
*/
#ifndef NM_SD_ADAPT_H
#define NM_SD_ADAPT_H
#ifndef __NM_SD_ADAPT_BASIC_H__
#define __NM_SD_ADAPT_BASIC_H__
#include "nm-default.h"
#include <stdbool.h>
#include <syslog.h>
#include <sys/resource.h>
#include <time.h>
#if defined(HAVE_DECL_REALLOCARRAY) && HAVE_DECL_REALLOCARRAY == 1
#define HAVE_REALLOCARRAY 1
#else
#define HAVE_REALLOCARRAY 0
#endif
#if defined(HAVE_DECL_EXPLICIT_BZERO) && HAVE_DECL_EXPLICIT_BZERO == 1
#define HAVE_EXPLICIT_BZERO 1
#else
#define HAVE_EXPLICIT_BZERO 0
#endif
#define ENABLE_DEBUG_HASHMAP 0
#ifndef HAVE_SYS_AUXV_H
#define HAVE_SYS_AUXV_H 0
#endif
/* we build with C11 and thus <uchar.h> provides char32_t,char16_t. */
#define HAVE_CHAR32_T 1
#define HAVE_CHAR16_T 1
#include "nm-utils/nm-logging-fwd.h"
/*****************************************************************************/
@ -77,7 +54,7 @@ _nm_log_get_max_level_realm (void)
const int _nm_e = (error); \
const NMLogLevel _nm_l = _slog_level_to_nm ((level)); \
\
if (nm_logging_enabled (_nm_l, LOGD_SYSTEMD)) { \
if (_nm_log_enabled (_nm_l, LOGD_SYSTEMD)) { \
const char *_nm_location = strrchr ((""file), '/'); \
\
_nm_log_impl (_nm_location ? _nm_location + 1 : (""file), (line), (func), _nm_l, LOGD_SYSTEMD, _nm_e, NULL, NULL, ("%s"format), "libsystemd: ", ## __VA_ARGS__); \
@ -104,6 +81,12 @@ G_STMT_START { \
(void) 0; \
})
/*****************************************************************************/
#define VALGRIND 0
#define ENABLE_DEBUG_HASHMAP 0
/*****************************************************************************
* The remainder of the header is only enabled when building the systemd code
* itself.
@ -111,39 +94,9 @@ G_STMT_START { \
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD
#include <netinet/in.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <elf.h>
#ifdef HAVE_SYS_AUXV_H
#include <sys/auxv.h>
#endif
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/ioctl.h>
#include <net/if_arp.h>
/* Missing in Linux 3.2.0, in Ubuntu 12.04 */
#ifndef BPF_XOR
#define BPF_XOR 0xa0
#endif
#ifndef ETHERTYPE_LLDP
#define ETHERTYPE_LLDP 0x88cc
#endif
#ifndef HAVE_SECURE_GETENV
# ifdef HAVE___SECURE_GETENV
# define secure_getenv __secure_getenv
# else
# error neither secure_getenv nor __secure_getenv is available
# endif
#endif
#define VALGRIND 0
static inline pid_t
raw_getpid (void) {
#if defined(__alpha__)
@ -153,37 +106,28 @@ raw_getpid (void) {
#endif
}
/*****************************************************************************/
static inline int
sd_notify (int unset_environment, const char *state)
{
return 0;
}
/* Can't include both net/if.h and linux/if.h; so have to define this here */
#ifndef IF_NAMESIZE
#define IF_NAMESIZE 16
#endif
#ifndef IFNAMSIZ
#define IFNAMSIZ IF_NAMESIZE
#endif
#ifndef MAX_HANDLE_SZ
#define MAX_HANDLE_SZ 128
#endif
#include "sd-id128.h"
#include "sparse-endian.h"
#include "async.h"
#include "util.h"
static inline pid_t gettid(void) {
return (pid_t) syscall(SYS_gettid);
}
/* we build with C11 and thus <uchar.h> provides char32_t,char16_t. */
#define HAVE_CHAR32_T 1
#define HAVE_CHAR16_T 1
#if defined(HAVE_DECL_REALLOCARRAY) && HAVE_DECL_REALLOCARRAY == 1
#define HAVE_REALLOCARRAY 1
#else
#define HAVE_REALLOCARRAY 0
#endif
#if defined(HAVE_DECL_EXPLICIT_BZERO) && HAVE_DECL_EXPLICIT_BZERO == 1
#define HAVE_EXPLICIT_BZERO 1
#else
#define HAVE_EXPLICIT_BZERO 0
#endif
#endif /* (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD */
#endif /* NM_SD_ADAPT_H */
/*****************************************************************************/
#endif /* __NM_SD_ADAPT_BASIC_H__ */

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <stdint.h>
#include <string.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <stdio_ext.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <limits.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <stdlib.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <net/ethernet.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <stdarg.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <fcntl.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <ctype.h>
#include <errno.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <stddef.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <string.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <stdint.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <ctype.h>
#include <errno.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <limits.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <arpa/inet.h>
#include <endian.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <limits.h>

View File

@ -183,6 +183,7 @@ _noreturn_ void log_assert_failed_realm(
#define log_assert_failed(text, ...) \
log_assert_failed_realm(LOG_REALM, (text), __VA_ARGS__)
_noreturn_ void log_assert_failed_unreachable_realm(
LogRealm realm,
const char *text,

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <stdint.h>
#include <stdlib.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <inttypes.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <limits.h>

View File

@ -10,7 +10,7 @@
* The underlying algorithm used in this implementation is a Heap.
*/
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <stdlib.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <ctype.h>
#include <errno.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#if defined(__i386__) || defined(__x86_64__)
#include <cpuid.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <arpa/inet.h>
#include <errno.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <dirent.h>
#include <errno.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include "string-table.h"
#include "string-util.h"

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <stdarg.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <errno.h>
#include <fnmatch.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <ctype.h>
#include <errno.h>
@ -26,7 +26,9 @@
#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#if 0 /* NM_IGNORED */
#include "serialize.h"
#endif /* NM_IGNORED */
#include "stat-util.h"
#include "string-util.h"
#include "strv.h"

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h"
#include "nm-sd-adapt-shared.h"
#include <sys/mman.h>

Some files were not shown because too many files have changed in this diff Show More