shared,systemd: merge branch 'th/shared-systemd'

https://github.com/NetworkManager/NetworkManager/pull/270
This commit is contained in:
Thomas Haller
2019-01-02 17:09:30 +01:00
155 changed files with 949 additions and 478 deletions

View File

@@ -105,7 +105,7 @@ endif
endif endif
dflt_cppflags = -std=gnu99 dflt_cppflags = -std=gnu11
############################################################################### ###############################################################################
@@ -222,7 +222,10 @@ shared_libcsiphash_la_SOURCES = \
noinst_LTLIBRARIES += shared/libcrbtree.la noinst_LTLIBRARIES += shared/libcrbtree.la
shared_libcrbtree_la_CFLAGS = $(AM_CFLAGS) -std=c11 shared_libcrbtree_la_CFLAGS = \
$(AM_CFLAGS) \
-std=c11 \
$(NULL)
shared_libcrbtree_la_CPPFLAGS = \ shared_libcrbtree_la_CPPFLAGS = \
$(CODE_COVERAGE_CFLAGS) \ $(CODE_COVERAGE_CFLAGS) \
@@ -309,6 +312,7 @@ shared_nm_utils_libnm_utils_base_la_SOURCES = \
shared/nm-utils/nm-hash-utils.h \ shared/nm-utils/nm-hash-utils.h \
shared/nm-utils/nm-io-utils.c \ shared/nm-utils/nm-io-utils.c \
shared/nm-utils/nm-io-utils.h \ shared/nm-utils/nm-io-utils.h \
shared/nm-utils/nm-logging-fwd.h \
shared/nm-utils/nm-macros-internal.h \ shared/nm-utils/nm-macros-internal.h \
shared/nm-utils/nm-obj.h \ shared/nm-utils/nm-obj.h \
shared/nm-utils/nm-random-utils.c \ shared/nm-utils/nm-random-utils.c \
@@ -936,6 +940,8 @@ nodist_libnm_core_tests_test_general_SOURCES = \
libnm_core_tests_ldadd = \ libnm_core_tests_ldadd = \
libnm-core/libnm-core.la \ libnm-core/libnm-core.la \
shared/systemd/libnm-systemd-shared.la \
shared/systemd/libnm-systemd-logging-stub.la \
shared/nm-utils/libnm-utils-base.la \ shared/nm-utils/libnm-utils-base.la \
$(libnm_crypto_lib) \ $(libnm_crypto_lib) \
$(GLIB_LIBS) $(GLIB_LIBS)
@@ -1187,6 +1193,8 @@ EXTRA_libnm_libnm_la_DEPENDENCIES = \
libnm_libnm_la_LIBADD = \ libnm_libnm_la_LIBADD = \
libnm/libnm-utils.la \ libnm/libnm-utils.la \
shared/systemd/libnm-systemd-shared.la \
shared/systemd/libnm-systemd-logging-stub.la \
shared/nm-utils/libnm-utils-udev.la \ shared/nm-utils/libnm-utils-udev.la \
$(DL_LIBS) \ $(DL_LIBS) \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
@@ -1353,6 +1361,8 @@ libnm_tests_cppflags = \
libnm_tests_ldadd = \ libnm_tests_ldadd = \
libnm/libnm.la \ libnm/libnm.la \
shared/systemd/libnm-systemd-shared.la \
shared/systemd/libnm-systemd-logging-stub.la \
$(GLIB_LIBS) $(GLIB_LIBS)
libnm_tests_ldflags = \ libnm_tests_ldflags = \
@@ -1486,7 +1496,8 @@ libexec_PROGRAMS += \
noinst_LTLIBRARIES += \ noinst_LTLIBRARIES += \
src/libNetworkManagerBase.la \ src/libNetworkManagerBase.la \
src/libNetworkManager.la \ src/libNetworkManager.la \
src/libsystemd-nm.la src/libnm-systemd-core.la \
$(NULL)
check-config-options: check-config-options:
$(srcdir)/tools/check-config-options.sh "$(srcdir)" $(srcdir)/tools/check-config-options.sh "$(srcdir)"
@@ -1495,141 +1506,189 @@ check_local += check-config-options
############################################################################### ###############################################################################
src_libsystemd_nm_la_cppflags = \ libsystemd_cppflags = \
$(dflt_cppflags) \ $(dflt_cppflags) \
-I$(srcdir)/shared \ -I$(srcdir)/shared \
-I$(builddir)/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-logging-stub.la
shared_systemd_libnm_systemd_logging_stub_la_CPPFLAGS = \
$(libsystemd_cppflags) \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED \
-DG_LOG_DOMAIN=\""libnm"\" \
$(NULL)
shared_systemd_libnm_systemd_logging_stub_la_SOURCES = \
shared/systemd/nm-logging-stub.c \
$(NULL)
shared_systemd_libnm_systemd_logging_stub_la_LIBADD = \
$(libsystemd_libadd) \
$(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$(srcdir)/libnm-core \
-I$(builddir)/libnm-core \ -I$(builddir)/libnm-core \
-I$(srcdir)/src \ -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/systemd \
-I$(srcdir)/src/systemd/src/basic \
-I$(srcdir)/src/systemd/src/shared \ -I$(srcdir)/src/systemd/src/shared \
-I$(srcdir)/src/systemd/src/libsystemd-network \ -I$(srcdir)/src/systemd/src/libsystemd-network \
-I$(srcdir)/src/systemd/src/libsystemd/sd-event \ -I$(srcdir)/src/systemd/src/libsystemd/sd-event \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD \ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD \
$(LIBSYSTEMD_NM_CFLAGS) \ $(NULL)
$(GLIB_CFLAGS) \
$(CODE_COVERAGE_CFLAGS)
src_libsystemd_nm_la_libadd = \ src_libnm_systemd_core_la_libadd = \
$(GLIB_LIBS) \ $(libsystemd_libadd) \
$(CODE_COVERAGE_LDFLAGS) $(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.c \
src/systemd/nm-sd.h \ src/systemd/nm-sd.h \
src/systemd/nm-sd-utils.c \ src/systemd/sd-adapt-core/condition.h \
src/systemd/nm-sd-utils.h \ src/systemd/sd-adapt-core/conf-parser.h \
src/systemd/sd-adapt/nm-sd-adapt.c \ src/systemd/sd-adapt-core/khash.h \
src/systemd/sd-adapt/nm-sd-adapt.h \ src/systemd/sd-adapt-core/nm-sd-adapt-core.c \
src/systemd/sd-adapt/architecture.h \ src/systemd/sd-adapt-core/nm-sd-adapt-core.h \
src/systemd/sd-adapt/btrfs-util.h \ src/systemd/sd-adapt-core/sd-daemon.h \
src/systemd/sd-adapt/build.h \ src/systemd/sd-adapt-core/sd-device.h \
src/systemd/sd-adapt/cgroup-util.h \ src/systemd/sd-adapt-core/stat-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/missing_type.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/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/src/libsystemd-network/arp-util.c \ src/systemd/src/libsystemd-network/arp-util.c \
src/systemd/src/libsystemd-network/arp-util.h \ src/systemd/src/libsystemd-network/arp-util.h \
src/systemd/src/libsystemd-network/dhcp-identifier.c \ src/systemd/src/libsystemd-network/dhcp-identifier.c \
@@ -1680,9 +1739,9 @@ src_libsystemd_nm_la_SOURCES = \
src/systemd/src/systemd/sd-lldp.h \ src/systemd/src/systemd/sd-lldp.h \
src/systemd/src/systemd/sd-ndisc.h src/systemd/src/systemd/sd-ndisc.h
src_libsystemd_nm_la_CPPFLAGS = $(src_libsystemd_nm_la_cppflags) src_libnm_systemd_core_la_CPPFLAGS = $(src_libnm_systemd_core_la_cppflags)
src_libsystemd_nm_la_LIBADD = $(src_libsystemd_nm_la_libadd) src_libnm_systemd_core_la_LIBADD = $(src_libnm_systemd_core_la_libadd)
$(src_libsystemd_nm_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums) $(src_libnm_systemd_core_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
EXTRA_DIST += \ EXTRA_DIST += \
src/systemd/meson.build src/systemd/meson.build
@@ -1956,7 +2015,8 @@ src_libNetworkManager_la_SOURCES = \
src_libNetworkManager_la_LIBADD = \ src_libNetworkManager_la_LIBADD = \
src/libNetworkManagerBase.la \ src/libNetworkManagerBase.la \
src/libsystemd-nm.la \ src/libnm-systemd-core.la \
shared/systemd/libnm-systemd-shared.la \
shared/libnacd.la \ shared/libnacd.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(LIBUDEV_LIBS) \ $(LIBUDEV_LIBS) \
@@ -2029,7 +2089,8 @@ src_nm_iface_helper_SOURCES = \
src_nm_iface_helper_LDADD = \ src_nm_iface_helper_LDADD = \
src/libNetworkManagerBase.la \ src/libNetworkManagerBase.la \
src/libsystemd-nm.la \ src/libnm-systemd-core.la \
shared/systemd/libnm-systemd-shared.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(LIBUDEV_LIBS) \ $(LIBUDEV_LIBS) \
$(LIBNDP_LIBS) \ $(LIBNDP_LIBS) \
@@ -2066,6 +2127,7 @@ src_initrd_nm_initrd_generator_LDADD = \
libnm-core/libnm-core.la \ libnm-core/libnm-core.la \
src/initrd/libnmi-core.la \ src/initrd/libnmi-core.la \
src/libNetworkManagerBase.la \ src/libNetworkManagerBase.la \
shared/systemd/libnm-systemd-shared.la \
shared/nm-utils/libnm-utils-base.la \ shared/nm-utils/libnm-utils-base.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(NULL) $(NULL)
@@ -3605,14 +3667,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_utils_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
src_tests_test_systemd_CPPFLAGS = \ src_tests_test_systemd_CPPFLAGS = \
$(src_libsystemd_nm_la_cppflags) \ $(src_libnm_systemd_core_la_cppflags) \
-DNETWORKMANAGER_COMPILATION_TEST -DNETWORKMANAGER_COMPILATION_TEST
src_tests_test_systemd_SOURCES = \
src/tests/test-systemd.c
src_tests_test_systemd_LDADD = \ src_tests_test_systemd_LDADD = \
src/libsystemd-nm.la \ src/libnm-systemd-core.la \
shared/systemd/libnm-systemd-shared.la \
shared/libcsiphash.la \ shared/libcsiphash.la \
$(src_libsystemd_nm_la_libadd) \ $(src_libnm_systemd_core_la_libadd) \
$(NULL) $(NULL)
$(src_tests_test_systemd_OBJECTS): $(libnm_core_lib_h_pub_mkenums) $(src_tests_test_systemd_OBJECTS): $(libnm_core_lib_h_pub_mkenums)

View File

@@ -200,6 +200,7 @@ nm_core_dep = declare_dependency(
dependencies: [ dependencies: [
shared_dep, shared_dep,
shared_c_siphash_dep, shared_c_siphash_dep,
libnm_systemd_shared_dep,
], ],
) )

View File

@@ -33,7 +33,10 @@ foreach test_unit: test_units
exe = executable( exe = executable(
'libnm-core-' + test_unit, 'libnm-core-' + test_unit,
[test_unit + '.c'] + enum, [test_unit + '.c'] + enum,
dependencies: nm_core_dep, dependencies: [
nm_core_dep,
libnm_systemd_shared_no_logging_dep,
],
c_args: [ c_args: [
'-DNETWORKMANAGER_COMPILATION_TEST', '-DNETWORKMANAGER_COMPILATION_TEST',
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE', '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE',

View File

@@ -147,6 +147,7 @@ deps = [
libudev_dep, libudev_dep,
shared_dep, shared_dep,
uuid_dep, uuid_dep,
libnm_systemd_shared_no_logging_dep,
] ]
linker_script = join_paths(meson.current_source_dir(), 'libnm.ver') linker_script = join_paths(meson.current_source_dir(), 'libnm.ver')

View File

@@ -20,6 +20,7 @@ foreach test_unit: test_units
dependencies: [ dependencies: [
libnm_dep, libnm_dep,
nm_core_dep, nm_core_dep,
libnm_systemd_shared_no_logging_dep,
], ],
c_args: cflags, c_args: cflags,
link_with: test_unit[1], link_with: test_unit[1],

View File

@@ -146,3 +146,89 @@ test(
test_script, test_script,
args: test_args + [test_shared_general.full_path()] 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,
],
)
libnm_systemd_logging_stub = static_library(
'nm-systemd-logging-stub',
sources: files(
'systemd/nm-logging-stub.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_no_logging_dep = declare_dependency(
dependencies: [
libnm_systemd_shared_dep,
],
link_with: [
libnm_systemd_logging_stub,
],
)

View File

@@ -78,9 +78,14 @@
| NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON \ | 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 \ #define NM_NETWORKMANAGER_COMPILATION_SYSTEMD ( 0 \
| NM_NETWORKMANAGER_COMPILATION_DAEMON \ | NM_NETWORKMANAGER_COMPILATION_DAEMON \
| NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD \ | NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED \
) )
#define NM_NETWORKMANAGER_COMPILATION_GLIB ( 0 \ #define NM_NETWORKMANAGER_COMPILATION_GLIB ( 0 \

View File

@@ -0,0 +1,111 @@
/* NetworkManager -- Network link manager
*
* This library 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 of the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* Copyright (C) 2006 - 2018 Red Hat, Inc.
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
#ifndef __NM_LOGGING_DEFINES_H__
#define __NM_LOGGING_DEFINES_H__
/* Log domains */
typedef enum { /*< skip >*/
LOGD_NONE = 0LL,
LOGD_PLATFORM = (1LL << 0), /* Platform services */
LOGD_RFKILL = (1LL << 1),
LOGD_ETHER = (1LL << 2),
LOGD_WIFI = (1LL << 3),
LOGD_BT = (1LL << 4),
LOGD_MB = (1LL << 5), /* mobile broadband */
LOGD_DHCP4 = (1LL << 6),
LOGD_DHCP6 = (1LL << 7),
LOGD_PPP = (1LL << 8),
LOGD_WIFI_SCAN = (1LL << 9),
LOGD_IP4 = (1LL << 10),
LOGD_IP6 = (1LL << 11),
LOGD_AUTOIP4 = (1LL << 12),
LOGD_DNS = (1LL << 13),
LOGD_VPN = (1LL << 14),
LOGD_SHARING = (1LL << 15), /* Connection sharing/dnsmasq */
LOGD_SUPPLICANT = (1LL << 16), /* Wi-Fi and 802.1x */
LOGD_AGENTS = (1LL << 17), /* Secret agents */
LOGD_SETTINGS = (1LL << 18), /* Settings */
LOGD_SUSPEND = (1LL << 19), /* Suspend/Resume */
LOGD_CORE = (1LL << 20), /* Core daemon and policy stuff */
LOGD_DEVICE = (1LL << 21), /* Device state and activation */
LOGD_OLPC = (1LL << 22),
LOGD_INFINIBAND = (1LL << 23),
LOGD_FIREWALL = (1LL << 24),
LOGD_ADSL = (1LL << 25),
LOGD_BOND = (1LL << 26),
LOGD_VLAN = (1LL << 27),
LOGD_BRIDGE = (1LL << 28),
LOGD_DBUS_PROPS = (1LL << 29),
LOGD_TEAM = (1LL << 30),
LOGD_CONCHECK = (1LL << 31),
LOGD_DCB = (1LL << 32), /* Data Center Bridging */
LOGD_DISPATCH = (1LL << 33),
LOGD_AUDIT = (1LL << 34),
LOGD_SYSTEMD = (1LL << 35),
LOGD_VPN_PLUGIN = (1LL << 36),
LOGD_PROXY = (1LL << 37),
__LOGD_MAX,
LOGD_ALL = (((__LOGD_MAX - 1LL) << 1) - 1LL),
LOGD_DEFAULT = LOGD_ALL & ~(
LOGD_DBUS_PROPS |
LOGD_WIFI_SCAN |
LOGD_VPN_PLUGIN |
0),
/* aliases: */
LOGD_DHCP = LOGD_DHCP4 | LOGD_DHCP6,
LOGD_IP = LOGD_IP4 | LOGD_IP6,
} NMLogDomain;
/* Log levels */
typedef enum { /*< skip >*/
LOGL_TRACE,
LOGL_DEBUG,
LOGL_INFO,
LOGL_WARN,
LOGL_ERR,
_LOGL_N_REAL, /* the number of actual logging levels */
_LOGL_OFF = _LOGL_N_REAL, /* special logging level that is always disabled. */
_LOGL_KEEP, /* special logging level to indicate that the logging level should not be changed. */
_LOGL_N, /* the number of logging levels including "OFF" */
} NMLogLevel;
gboolean _nm_log_enabled (NMLogLevel level,
NMLogDomain domain);
void _nm_log_impl (const char *file,
guint line,
const char *func,
NMLogLevel level,
NMLogDomain domain,
int error,
const char *ifname,
const char *con_uuid,
const char *fmt,
...) _nm_printf (9, 10);
#endif /* __NM_LOGGING_DEFINES_H__ */

View File

@@ -460,6 +460,10 @@ NM_G_ERROR_MSG (GError *error)
#endif #endif
#ifndef _NM_CC_SUPPORT_GENERIC #ifndef _NM_CC_SUPPORT_GENERIC
/* In the meantime, NetworkManager requires C11 and _Generic() should always be available.
* However, shared/nm-utils may also be used in VPN/applet, which possibly did not yet
* bump the C standard requirement. Leave this for the moment, but eventually we can
* drop it. */
#if (defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9 ))) || (defined (__clang__)) #if (defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9 ))) || (defined (__clang__))
#define _NM_CC_SUPPORT_GENERIC 1 #define _NM_CC_SUPPORT_GENERIC 1
#else #else

View File

@@ -0,0 +1,45 @@
/*
* This library 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 of the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* Copyright 2018 Red Hat, Inc.
*/
#include "nm-default.h"
#include "nm-utils/nm-logging-fwd.h"
/*****************************************************************************/
gboolean
_nm_log_enabled (NMLogLevel level,
NMLogDomain domain)
{
return FALSE;
}
void
_nm_log_impl (const char *file,
guint line,
const char *func,
NMLogLevel level,
NMLogDomain domain,
int error,
const char *ifname,
const char *con_uuid,
const char *fmt,
...)
{
}

View File

@@ -0,0 +1,82 @@
/* This library 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 of the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* Copyright (C) 2018 Red Hat, Inc.
*/
#include "nm-default.h"
#include "nm-sd-utils-shared.h"
#include "nm-sd-adapt-shared.h"
#include "path-util.h"
#include "hexdecoct.h"
/*****************************************************************************/
gboolean
nm_sd_utils_path_equal (const char *a, const char *b)
{
return path_equal (a, b);
}
char *
nm_sd_utils_path_simplify (char *path, gboolean kill_dots)
{
return path_simplify (path, kill_dots);
}
const char *
nm_sd_utils_path_startswith (const char *path, const char *prefix)
{
return path_startswith (path, prefix);
}
/*****************************************************************************/
gboolean
nm_sd_utils_unbase64char (char ch, gboolean accept_padding_equal)
{
if ( ch == '='
&& accept_padding_equal)
return G_MAXINT;
return unbase64char (ch);
}
/**
* nm_sd_utils_unbase64mem:
* @p: a valid base64 string. Whitespace is ignored, but invalid encodings
* will cause the function to fail.
* @l: the length of @p. @p is not treated as NUL terminated string but
* merely as a buffer of ascii characters.
* @mem: (transfer full): the decoded buffer on success.
* @len: the length of @mem on success.
*
* glib provides g_base64_decode(), but that does not report any errors
* from invalid encodings. Expose systemd's implementation which does
* reject invalid inputs.
*
* Returns: a non-negative code on success. Invalid encoding let the
* function fail.
*/
int
nm_sd_utils_unbase64mem (const char *p,
size_t l,
guint8 **mem,
size_t *len)
{
return unbase64mem (p, l, (void **) mem, len);
}

View File

@@ -16,8 +16,8 @@
* Copyright (C) 2018 Red Hat, Inc. * Copyright (C) 2018 Red Hat, Inc.
*/ */
#ifndef __NM_SD_UTILS_H__ #ifndef __NM_SD_UTILS_SHARED_H__
#define __NM_SD_UTILS_H__ #define __NM_SD_UTILS_SHARED_H__
/*****************************************************************************/ /*****************************************************************************/
@@ -29,10 +29,10 @@ const char *nm_sd_utils_path_startswith (const char *path, const char *prefix);
/*****************************************************************************/ /*****************************************************************************/
struct _NMUuid; int nm_sd_utils_unbase64char (char ch, gboolean accept_padding_equal);
struct _NMUuid *nm_sd_utils_id128_get_machine (struct _NMUuid *out_uuid); int nm_sd_utils_unbase64mem (const char *p, size_t l, guint8 **mem, size_t *len);
/*****************************************************************************/ /*****************************************************************************/
#endif /* __NM_SD_UTILS_H__ */ #endif /* __NM_SD_UTILS_SHARED_H__ */

View File

@@ -13,36 +13,17 @@
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 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 #ifndef __NM_SD_ADAPT_BASIC_H__
#define NM_SD_ADAPT_H #define __NM_SD_ADAPT_BASIC_H__
#include "nm-default.h" #include "nm-default.h"
#include <stdbool.h>
#include <syslog.h> #include <syslog.h>
#include <sys/resource.h>
#include <time.h>
#if defined(HAVE_DECL_REALLOCARRAY) && HAVE_DECL_REALLOCARRAY == 1 #include "nm-utils/nm-logging-fwd.h"
#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
/*****************************************************************************/ /*****************************************************************************/
@@ -73,7 +54,7 @@ _nm_log_get_max_level_realm (void)
const int _nm_e = (error); \ const int _nm_e = (error); \
const NMLogLevel _nm_l = _slog_level_to_nm ((level)); \ 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), '/'); \ 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__); \ _nm_log_impl (_nm_location ? _nm_location + 1 : (""file), (line), (func), _nm_l, LOGD_SYSTEMD, _nm_e, NULL, NULL, ("%s"format), "libsystemd: ", ## __VA_ARGS__); \
@@ -100,6 +81,12 @@ G_STMT_START { \
(void) 0; \ (void) 0; \
}) })
/*****************************************************************************/
#define VALGRIND 0
#define ENABLE_DEBUG_HASHMAP 0
/***************************************************************************** /*****************************************************************************
* The remainder of the header is only enabled when building the systemd code * The remainder of the header is only enabled when building the systemd code
* itself. * itself.
@@ -107,39 +94,9 @@ G_STMT_START { \
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD #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/syscall.h>
#include <sys/ioctl.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 static inline pid_t
raw_getpid (void) { raw_getpid (void) {
#if defined(__alpha__) #if defined(__alpha__)
@@ -149,43 +106,28 @@ raw_getpid (void) {
#endif #endif
} }
/*****************************************************************************/
/* work around missing uchar.h */
typedef guint16 char16_t;
typedef guint32 char32_t;
/*****************************************************************************/
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) { static inline pid_t gettid(void) {
return (pid_t) syscall(SYS_gettid); 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 /* (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+ */ /* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h" #include "nm-sd-adapt-shared.h"
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>

View File

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

View File

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

View File

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

View File

@@ -5,9 +5,7 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <sys/types.h> #include <sys/types.h>
#if 0 /* NM_IGNORED */
#include <uchar.h> #include <uchar.h>
#endif /* NM_IGNORED */
#include "string-util.h" #include "string-util.h"
#include "missing_type.h" #include "missing_type.h"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */ /* SPDX-License-Identifier: LGPL-2.1+ */
#include "nm-sd-adapt.h" #include "nm-sd-adapt-shared.h"
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
@@ -515,6 +515,7 @@ char base64char(int x) {
"0123456789+/"; "0123456789+/";
return table[x & 63]; return table[x & 63];
} }
#endif /* NM_IGNORED */
int unbase64char(char c) { int unbase64char(char c) {
unsigned offset; unsigned offset;
@@ -545,6 +546,7 @@ int unbase64char(char c) {
return -EINVAL; return -EINVAL;
} }
#if 0 /* NM_IGNORED */
ssize_t base64mem(const void *p, size_t l, char **out) { ssize_t base64mem(const void *p, size_t l, char **out) {
char *r, *z; char *r, *z;
const uint8_t *x; const uint8_t *x;
@@ -644,6 +646,7 @@ int base64_append(
/* leave plen on the left, keep last column free */ /* leave plen on the left, keep last column free */
return base64_append_width(prefix, plen, NULL, plen, p, l, width - plen - 1); return base64_append_width(prefix, plen, NULL, plen, p, l, width - plen - 1);
} }
#endif /* NM_IGNORED */
static int unbase64_next(const char **p, size_t *l) { static int unbase64_next(const char **p, size_t *l) {
int ret; int ret;
@@ -775,6 +778,7 @@ int unbase64mem(const char *p, size_t l, void **ret, size_t *ret_size) {
return 0; return 0;
} }
#if 0 /* NM_IGNORED */
void hexdump(FILE *f, const void *p, size_t s) { void hexdump(FILE *f, const void *p, size_t s) {
const uint8_t *b = p; const uint8_t *b = p;
unsigned n = 0; unsigned n = 0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,12 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <uchar.h>
#if !HAVE_CHAR32_T
#define char32_t uint32_t
#endif
#if !HAVE_CHAR16_T
#define char16_t uint16_t
#endif

View File

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

View File

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

View File

@@ -10,7 +10,7 @@
* The underlying algorithm used in this implementation is a Heap. * 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 <errno.h>
#include <stdlib.h> #include <stdlib.h>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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