diff --git a/.gitignore b/.gitignore index 45d9e3503f..0a7f0c195a 100644 --- a/.gitignore +++ b/.gitignore @@ -136,7 +136,6 @@ test-*.trs /shared/nm-glib-aux/tests/test-json-aux /shared/nm-glib-aux/tests/test-shared-general /shared/nm-platform/tests/test-nm-platform -/shared/nm-version-macros.h /introspection/org.freedesktop.NetworkManager*.[ch] @@ -149,6 +148,7 @@ test-*.trs /libnm-core/tests/test-secrets /libnm-core/tests/test-setting /libnm-core/nm-dbus-types.xml +/libnm-core/nm-version-macros.h /libnm-core/nm-vpn-dbus-types.xml /libnm/nm-property-infos-dbus.xml @@ -349,6 +349,7 @@ test-*.trs /policy/org.freedesktop.NetworkManager.policy /policy/org.freedesktop.NetworkManager.policy.in /shared/nm-utils/tests/test-shared-general +/shared/nm-version-macros.h /src/devices/tests/test-arping /src/devices/wifi/tests/test-general /src/devices/wifi/tests/test-wifi-ap-utils diff --git a/Makefile.am b/Makefile.am index 7ae9648838..6c6b3c2ed9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -354,7 +354,6 @@ shared_nm_std_aux_libnm_std_aux_la_CPPFLAGS = \ $(CODE_COVERAGE_CFLAGS) \ $(SANITIZER_LIB_CFLAGS) \ -DG_LOG_DOMAIN=\""libnm"\" \ - -DNETWORKMANAGER_COMPILATION='0' \ $(NULL) shared_nm_std_aux_libnm_std_aux_la_SOURCES = \ @@ -362,6 +361,8 @@ shared_nm_std_aux_libnm_std_aux_la_SOURCES = \ shared/nm-std-aux/c-list-util.c \ shared/nm-std-aux/c-list-util.h \ shared/nm-std-aux/nm-dbus-compat.h \ + shared/nm-std-aux/nm-default-std.h \ + shared/nm-std-aux/nm-networkmanager-compilation.h \ shared/nm-std-aux/nm-std-aux.h \ shared/nm-std-aux/nm-std-utils.c \ shared/nm-std-aux/nm-std-utils.h \ @@ -382,7 +383,6 @@ shared_nm_glib_aux_cppflags = \ $(SANITIZER_LIB_CFLAGS) \ $(GLIB_CFLAGS) \ -DG_LOG_DOMAIN=\""libnm"\" \ - -DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)' \ $(NULL) noinst_LTLIBRARIES += shared/nm-glib-aux/libnm-glib-aux.la @@ -397,10 +397,14 @@ shared_nm_glib_aux_libnm_glib_aux_la_SOURCES = \ shared/nm-glib-aux/nm-dbus-aux.h \ shared/nm-glib-aux/nm-dedup-multi.c \ shared/nm-glib-aux/nm-dedup-multi.h \ + shared/nm-glib-aux/nm-default-glib-i18n-lib.h \ + shared/nm-glib-aux/nm-default-glib-i18n-prog.h \ + shared/nm-glib-aux/nm-default-glib.h \ shared/nm-glib-aux/nm-enum-utils.c \ shared/nm-glib-aux/nm-enum-utils.h \ shared/nm-glib-aux/nm-errno.c \ shared/nm-glib-aux/nm-errno.h \ + shared/nm-glib-aux/nm-gassert-patch.h \ shared/nm-glib-aux/nm-glib.h \ shared/nm-glib-aux/nm-hash-utils.c \ shared/nm-glib-aux/nm-hash-utils.h \ @@ -499,7 +503,6 @@ shared_nm_log_core_libnm_log_core_la_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(SYSTEMD_JOURNAL_CFLAGS) \ -DG_LOG_DOMAIN=\""NetworkManager"\" \ - -DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)' \ $(NULL) shared_nm_log_core_libnm_log_core_la_SOURCES = \ @@ -551,8 +554,7 @@ check_programs += shared/nm-platform/tests/test-nm-platform shared_nm_platform_tests_test_nm_platform_CPPFLAGS = \ $(dflt_cppflags) \ -I$(srcdir)/shared \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)' \ + -DG_LOG_DOMAIN=\""test"\" \ $(CODE_COVERAGE_CFLAGS) \ $(SYSTEMD_JOURNAL_CFLAGS) \ $(GLIB_CFLAGS) \ @@ -592,7 +594,6 @@ libnm_core_nm_libnm_core_intern_libnm_libnm_core_intern_la_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(SANITIZER_LIB_CFLAGS) \ -DG_LOG_DOMAIN=\""libnm"\" \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \ $(NULL) libnm_core_nm_libnm_core_intern_libnm_libnm_core_intern_la_SOURCES = \ @@ -630,7 +631,6 @@ libnm_core_nm_libnm_core_aux_libnm_libnm_core_aux_la_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(SANITIZER_LIB_CFLAGS) \ -DG_LOG_DOMAIN=\""libnm"\" \ - -DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_WITH_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)' \ $(NULL) libnm_core_nm_libnm_core_aux_libnm_libnm_core_aux_la_SOURCES = \ @@ -654,41 +654,6 @@ EXTRA_DIST += libnm-core/nm-libnm-core-aux/README.md ############################################################################### -noinst_LTLIBRARIES += libnm-core/nm-keyfile/libnm-keyfile.la - -libnm_core_nm_keyfile_libnm_keyfile_la_CPPFLAGS = \ - $(dflt_cppflags) \ - -I$(srcdir)/shared \ - -I$(builddir)/shared \ - -I$(srcdir)/libnm-core \ - -I$(builddir)/libnm-core \ - $(CODE_COVERAGE_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(SANITIZER_LIB_CFLAGS) \ - -DG_LOG_DOMAIN=\""libnm"\" \ - -DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)' \ - $(NULL) - -libnm_core_nm_keyfile_libnm_keyfile_la_SOURCES = \ - libnm-core/nm-keyfile/nm-keyfile-internal.h \ - libnm-core/nm-keyfile/nm-keyfile-utils.c \ - libnm-core/nm-keyfile/nm-keyfile-utils.h \ - libnm-core/nm-keyfile/nm-keyfile.c \ - $(NULL) - -libnm_core_nm_keyfile_libnm_keyfile_la_LDFLAGS = \ - $(CODE_COVERAGE_LDFLAGS) \ - $(SANITIZER_LIB_LDFLAGS) \ - $(NULL) - -libnm_core_nm_keyfile_libnm_keyfile_la_LIBADD = \ - $(GLIB_LIBS) \ - $(NULL) - -$(libnm_core_nm_keyfile_libnm_keyfile_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums) - -############################################################################### - noinst_LTLIBRARIES += libnm/nm-libnm-aux/libnm-libnm-aux.la libnm_nm_libnm_aux_libnm_libnm_aux_la_CPPFLAGS = \ @@ -703,7 +668,6 @@ libnm_nm_libnm_aux_libnm_libnm_aux_la_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(SANITIZER_LIB_CFLAGS) \ -DG_LOG_DOMAIN=\""libnmc"\" \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \ $(NULL) libnm_nm_libnm_aux_libnm_libnm_aux_la_SOURCES = \ @@ -740,8 +704,7 @@ check_programs += shared/nm-glib-aux/tests/test-shared-general shared_nm_glib_aux_tests_test_shared_general_CPPFLAGS = \ $(dflt_cppflags) \ -I$(srcdir)/shared \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)' \ + -DG_LOG_DOMAIN=\""test"\" \ $(CODE_COVERAGE_CFLAGS) \ $(GLIB_CFLAGS) \ $(SANITIZER_LIB_CFLAGS) \ @@ -769,8 +732,7 @@ check_programs += shared/nm-glib-aux/tests/test-json-aux shared_nm_glib_aux_tests_test_json_aux_CPPFLAGS = \ $(dflt_cppflags) \ -I$(srcdir)/shared \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)' \ + -DG_LOG_DOMAIN=\""test"\" \ $(CODE_COVERAGE_CFLAGS) \ $(GLIB_CFLAGS) \ $(JANSSON_CFLAGS) \ @@ -1041,7 +1003,6 @@ check_local += check-docs ############################################################################### libnm_core_lib_h_pub_real = \ - shared/nm-version-macros.h \ libnm-core/nm-connection.h \ libnm-core/nm-core-types.h \ libnm-core/nm-dbus-interface.h \ @@ -1102,6 +1063,7 @@ libnm_core_lib_h_pub_real = \ libnm-core/nm-setting.h \ libnm-core/nm-simple-connection.h \ libnm-core/nm-utils.h \ + libnm-core/nm-version-macros.h \ libnm-core/nm-version.h \ libnm-core/nm-vpn-dbus-interface.h \ libnm-core/nm-vpn-editor-plugin.h \ @@ -1111,12 +1073,16 @@ libnm_core_lib_h_pub_mkenums = \ libnm-core/nm-core-enum-types.h \ $(NULL) libnm_core_lib_h_priv = \ - shared/nm-meta-setting.h \ libnm-core/nm-connection-private.h \ libnm-core/nm-core-internal.h \ libnm-core/nm-core-types-internal.h \ libnm-core/nm-crypto-impl.h \ libnm-core/nm-crypto.h \ + libnm-core/nm-default-libnm-core.h \ + libnm-core/nm-keyfile-internal.h \ + libnm-core/nm-keyfile-utils.h \ + libnm-core/nm-meta-setting-base-impl.h \ + libnm-core/nm-meta-setting-base.h \ libnm-core/nm-property-compare.h \ libnm-core/nm-setting-private.h \ libnm-core/nm-team-utils.h \ @@ -1178,11 +1144,13 @@ libnm_core_lib_c_settings_real = \ $(NULL) libnm_core_lib_c_real = \ $(libnm_core_lib_c_settings_real) \ - shared/nm-meta-setting.c \ libnm-core/nm-connection.c \ libnm-core/nm-crypto.c \ libnm-core/nm-dbus-utils.c \ libnm-core/nm-errors.c \ + libnm-core/nm-keyfile-utils.c \ + libnm-core/nm-keyfile.c \ + libnm-core/nm-meta-setting-base-impl.c \ libnm-core/nm-property-compare.c \ libnm-core/nm-setting.c \ libnm-core/nm-simple-connection.c \ @@ -1222,7 +1190,7 @@ GLIB_GENERATED += \ $(libnm_core_lib_c_mkenums) nm_core_enum_types_sources = $(libnm_core_lib_h_pub_real) -nm_core_enum_types_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "nm-default.h"\n' +nm_core_enum_types_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "libnm-core/nm-default-libnm-core.h"\n' libnm-core/nm-core-enum-types.h.stamp: libnm-core/.dirstamp libnm-core/nm-core-enum-types.c.stamp: libnm-core/.dirstamp @@ -1243,7 +1211,6 @@ $(src_core_devices_ovs_libnm_device_plugin_ovs_la_OBJECTS): $(li libnm_core_libnm_core_la_CPPFLAGS = \ $(dflt_cppflags_libnm_core) \ -DG_LOG_DOMAIN=\""libnm"\" \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \ $(NULL) libnm_core_libnm_core_la_SOURCES = \ @@ -1268,8 +1235,6 @@ libnm_core_libnm_core_la_LDFLAGS = \ EXTRA_DIST += \ libnm-core/nm-crypto-gnutls.c \ libnm-core/nm-crypto-nss.c \ - libnm-core/nm-core-enum-types.c.template \ - libnm-core/nm-core-enum-types.h.template \ libnm-core/meson.build \ $(NULL) @@ -1344,7 +1309,7 @@ GLIB_GENERATED += \ libnm-core/tests/nm-core-tests-enum-types.h \ libnm-core/tests/nm-core-tests-enum-types.c nm_core_tests_enum_types_sources = libnm-core/tests/test-general-enums.h -nm_core_tests_enum_types_MKENUMS_C_FLAGS = --fhead '\#include "nm-default.h"\n' +nm_core_tests_enum_types_MKENUMS_C_FLAGS = --fhead '\#include "libnm-core/nm-default-libnm-core.h"\n' libnm-core/tests/nm-core-tests-enum-types.h.stamp: libnm-core/tests/.dirstamp libnm-core/tests/nm-core-tests-enum-types.c.stamp: libnm-core/tests/.dirstamp @@ -1355,8 +1320,7 @@ libnm_core_tests_cppflags = \ -I$(srcdir)/libnm-core/tests \ -I$(builddir)/libnm-core/tests \ $(dflt_cppflags_libnm_core) \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \ + -DG_LOG_DOMAIN=\""test"\" \ $(SANITIZER_EXEC_CFLAGS) \ $(NULL) @@ -1380,7 +1344,6 @@ nodist_libnm_core_tests_test_general_SOURCES = \ libnm_core_tests_ldadd = \ libnm-core/nm-libnm-core-aux/libnm-libnm-core-aux.la \ - libnm-core/nm-keyfile/libnm-keyfile.la \ libnm-core/libnm-core.la \ $(libnm_crypto_lib) \ libnm-core/nm-libnm-core-intern/libnm-libnm-core-intern.la \ @@ -1457,7 +1420,6 @@ EXTRA_DIST += \ ############################################################################### libnm_lib_h_pub_real = \ - shared/nm-version-macros.h \ libnm/NetworkManager.h \ libnm/nm-access-point.h \ libnm/nm-active-connection.h \ @@ -1510,14 +1472,16 @@ libnm_lib_h_pub_real = \ libnm_lib_h_pub_mkenums = \ libnm/nm-enum-types.h libnm_lib_h_priv = \ - libnm/nm-libnm-utils.h \ libnm/nm-dbus-helpers.h \ + libnm/nm-default-client.h \ + libnm/nm-default-libnm.h \ libnm/nm-device-private.h \ libnm/nm-dhcp4-config.h \ libnm/nm-dhcp6-config.h \ libnm/nm-dns-manager.h \ libnm/nm-ip4-config.h \ libnm/nm-ip6-config.h \ + libnm/nm-libnm-utils.h \ libnm/nm-object-private.h \ libnm/nm-remote-connection-private.h \ $(NULL) @@ -1584,7 +1548,6 @@ libnm_lib_cppflags = \ -I$(builddir)/libnm \ $(dflt_cppflags_libnm_core) \ -DG_LOG_DOMAIN=\""libnm"\" \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \ $(NULL) libnminclude_HEADERS += \ @@ -1613,7 +1576,6 @@ nodist_libnm_libnm_static_la_SOURCES = \ libnm_libnm_static_la_LIBADD = \ libnm-core/nm-libnm-core-aux/libnm-libnm-core-aux.la \ - libnm-core/nm-keyfile/libnm-keyfile.la \ libnm-core/libnm-core.la \ $(libnm_crypto_lib) \ libnm-core/nm-libnm-core-intern/libnm-libnm-core-intern.la \ @@ -1645,7 +1607,7 @@ nm_enum_types_sources = \ $(libnm_lib_h_pub_mkenums) \ $(libnm_lib_h_pub_real) nm_enum_types_MKENUMS_H_FLAGS = --identifier-prefix NM --fhead '\#include "nm-core-enum-types.h"\n' -nm_enum_types_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "nm-default.h"\n' +nm_enum_types_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "libnm/nm-default-libnm.h"\n' $(dispatcher_nm_dispatcher_OBJECTS): $(libnm_lib_h_pub_mkenums) $(dispatcher_libnm_dispatcher_core_la_OBJECTS): $(libnm_lib_h_pub_mkenums) @@ -1699,7 +1661,10 @@ libnm/NM-1.0.gir: libnm/libnm.la libnm_NM_1_0_gir_INCLUDES = Gio-2.0 libnm_NM_1_0_gir_PACKAGES = gio-2.0 libnm_NM_1_0_gir_EXPORT_PACKAGES = libnm -libnm_NM_1_0_gir_CFLAGS = $(libnm_libnm_la_CPPFLAGS) +libnm_NM_1_0_gir_CFLAGS = \ + $(libnm_libnm_la_CPPFLAGS) \ + -DNETWORKMANAGER_COMPILATION \ + $(NULL) libnm_NM_1_0_gir_LIBS = libnm/libnm.la libnm_NM_1_0_gir_FILES = \ $(libnm_core_lib_h_pub_mkenums) \ @@ -1708,7 +1673,6 @@ libnm_NM_1_0_gir_FILES = \ $(libnm_core_lib_c_real) \ $(libnm_lib_h_pub_mkenums) \ $(libnm_lib_h_pub_real) \ - libnm-core/nm-keyfile/nm-keyfile.c \ $(libnm_lib_c_mkenums) \ $(libnm_lib_c_real) libnm_NM_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=NM --symbol-prefix=nm @@ -1777,8 +1741,6 @@ EXTRA_DIST += \ tools/generate-docs-nm-settings-docs-merge.py \ tools/generate-docs-nm-settings-docs-gir.py \ libnm/meson.build \ - libnm/nm-enum-types.c.template \ - libnm/nm-enum-types.h.template \ $(NULL) ############################################################################### @@ -1800,8 +1762,7 @@ libnm_tests_cppflags = \ -I$(srcdir)/libnm \ -I$(builddir)/libnm \ $(dflt_cppflags_libnm_core) \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \ + -DG_LOG_DOMAIN=\""test"\" \ $(SANITIZER_EXEC_CFLAGS) \ $(NULL) @@ -1880,8 +1841,7 @@ libnm_tests_libnm_vpn_plugin_utils_test_la_CFLAGS = \ -I$(builddir)/libnm \ $(GLIB_CFLAGS) \ $(SANITIZER_EXEC_CFLAGS) \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \ + -DG_LOG_DOMAIN=\""test"\" \ $(NULL) libnm_tests_libnm_vpn_plugin_utils_test_la_LIBADD = \ @@ -1898,13 +1858,12 @@ EXTRA_DIST += \ src_core_cppflags_base = \ -I$(srcdir)/src/core \ $(dflt_cppflags_libnm_core) \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \ + -DG_LOG_DOMAIN=\""NetworkManager"\" \ $(SANITIZER_EXEC_CFLAGS) \ $(NULL) src_core_cppflags_base_test = \ $(src_core_cppflags_base) \ - -DNETWORKMANAGER_COMPILATION_TEST \ $(NULL) src_core_cppflags_device_plugin = \ @@ -1925,7 +1884,6 @@ src_core_cppflags = \ src_core_cppflags_test = \ $(src_core_cppflags) \ - -DNETWORKMANAGER_COMPILATION_TEST \ $(NULL) if REQUIRE_ROOT_TESTS @@ -1970,7 +1928,6 @@ 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) @@ -1987,11 +1944,11 @@ 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-default-systemd-shared.h \ shared/systemd/nm-sd-utils-shared.c \ shared/systemd/nm-sd-utils-shared.h \ shared/systemd/sd-adapt-shared/architecture.h \ @@ -2018,7 +1975,6 @@ shared_systemd_libnm_systemd_shared_la_SOURCES = \ shared/systemd/sd-adapt-shared/mkdir.h \ shared/systemd/sd-adapt-shared/namespace-util.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/nulstr-util.h \ shared/systemd/sd-adapt-shared/raw-clone.h \ shared/systemd/sd-adapt-shared/rlimit-util.h \ @@ -2137,7 +2093,7 @@ src_core_libnm_systemd_core_la_cppflags = \ -I$(srcdir)/src/core/systemd/src/systemd \ -I$(srcdir)/src/core/systemd/src/libsystemd-network \ -I$(srcdir)/src/core/systemd/src/libsystemd/sd-event \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD \ + -DG_LOG_DOMAIN=\""NetworkManager"\" \ $(NULL) src_core_libnm_systemd_core_la_libadd = \ @@ -2146,6 +2102,7 @@ src_core_libnm_systemd_core_la_libadd = \ $(NULL) src_core_libnm_systemd_core_la_SOURCES = \ + src/core/systemd/nm-default-systemd.h \ src/core/systemd/nm-sd-utils-core.c \ src/core/systemd/nm-sd-utils-core.h \ src/core/systemd/nm-sd.c \ @@ -2317,6 +2274,8 @@ EXTRA_DIST += \ src_core_libNetworkManager_la_CPPFLAGS = $(src_core_cppflags) src_core_libNetworkManager_la_SOURCES = \ + \ + src/core/nm-default-daemon.h \ \ src/core/nm-checkpoint.c \ src/core/nm-checkpoint.h \ @@ -2496,7 +2455,6 @@ src_core_libNetworkManager_la_SOURCES = \ src_core_libNetworkManager_la_LIBADD = \ src/core/libNetworkManagerBase.la \ libnm-core/nm-libnm-core-aux/libnm-libnm-core-aux.la \ - libnm-core/nm-keyfile/libnm-keyfile.la \ libnm-core/libnm-core.la \ $(libnm_crypto_lib) \ libnm-core/nm-libnm-core-intern/libnm-libnm-core-intern.la \ @@ -2610,7 +2568,6 @@ src_core_nm_iface_helper_SOURCES = \ src_core_nm_iface_helper_LDADD = \ src/core/libNetworkManagerBase.la \ libnm-core/nm-libnm-core-aux/libnm-libnm-core-aux.la \ - libnm-core/nm-keyfile/libnm-keyfile.la \ libnm-core/libnm-core.la \ $(libnm_crypto_lib) \ libnm-core/nm-libnm-core-intern/libnm-libnm-core-intern.la \ @@ -2665,7 +2622,6 @@ src_core_initrd_nm_initrd_generator_LDADD = \ src/core/initrd/libnmi-core.la \ src/core/libNetworkManagerBase.la \ libnm-core/nm-libnm-core-aux/libnm-libnm-core-aux.la \ - libnm-core/nm-keyfile/libnm-keyfile.la \ libnm-core/libnm-core.la \ $(libnm_crypto_lib) \ libnm-core/nm-libnm-core-intern/libnm-libnm-core-intern.la \ @@ -2691,13 +2647,13 @@ src_core_initrd_nm_initrd_generator_LDFLAGS = \ check_programs += src/core/initrd/tests/test-dt-reader src_core_initrd_tests_test_dt_reader_CPPFLAGS = \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DTEST_INITRD_DIR=\"$(abs_srcdir)/src/core/initrd/tests\" \ - $(src_core_cppflags) + $(src_core_cppflags) \ + $(NULL) src_core_initrd_tests_test_dt_reader_LDFLAGS = \ $(CODE_COVERAGE_LDFLAGS) \ - $(SANITIZER_EXEC_LDFLAGS) + $(SANITIZER_EXEC_LDFLAGS) \ + $(NULL) src_core_initrd_tests_test_dt_reader_LDADD = \ src/core/initrd/libnmi-core.la \ @@ -2711,13 +2667,13 @@ src_core_initrd_tests_test_dt_reader_LDADD = \ check_programs += src/core/initrd/tests/test-ibft-reader src_core_initrd_tests_test_ibft_reader_CPPFLAGS = \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DTEST_INITRD_DIR=\"$(abs_srcdir)/src/core/initrd/tests\" \ - $(src_core_cppflags) + $(src_core_cppflags) \ + $(NULL) src_core_initrd_tests_test_ibft_reader_LDFLAGS = \ $(CODE_COVERAGE_LDFLAGS) \ - $(SANITIZER_EXEC_LDFLAGS) + $(SANITIZER_EXEC_LDFLAGS) \ + $(NULL) src_core_initrd_tests_test_ibft_reader_LDADD = \ src/core/initrd/libnmi-core.la \ @@ -2947,9 +2903,8 @@ EXTRA_DIST += \ check_programs += src/core/initrd/tests/test-cmdline-reader src_core_initrd_tests_test_cmdline_reader_CPPFLAGS = \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DTEST_INITRD_DIR=\"$(abs_srcdir)/src/core/initrd/tests\" \ - $(src_core_cppflags) + $(src_core_cppflags) \ + $(NULL) src_core_initrd_tests_test_cmdline_reader_LDFLAGS = \ $(CODE_COVERAGE_LDFLAGS) \ @@ -2988,7 +2943,6 @@ src_core_dhcp_nm_dhcp_helper_CPPFLAGS = \ -I$(srcdir)/shared \ -I$(builddir)/shared \ -DG_LOG_DOMAIN=\""nm-dhcp-helper"\" \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB \ $(GLIB_CFLAGS) \ $(NULL) @@ -3051,7 +3005,6 @@ src_core_ppp_nm_pppd_plugin_la_CPPFLAGS = \ -I$(builddir)/shared \ -I$(srcdir)/libnm-core \ -DG_LOG_DOMAIN=\""nm-pppd-plugin"\" \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB \ $(GLIB_CFLAGS) src_core_ppp_nm_pppd_plugin_la_SOURCES = \ @@ -4330,7 +4283,6 @@ $(src_core_tests_test_wired_defname_OBJECTS): $(libnm_core_lib_h_pub_mkenums) src_core_tests_test_systemd_CPPFLAGS = \ $(src_core_libnm_systemd_core_la_cppflags) \ - -DNETWORKMANAGER_COMPILATION_TEST \ $(NULL) src_core_tests_test_systemd_LDFLAGS = \ @@ -4391,7 +4343,6 @@ dispatcher_cppflags = \ -I$(builddir)/dispatcher \ $(GLIB_CFLAGS) \ -DG_LOG_DOMAIN=\""nm-dispatcher"\" \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \ $(NULL) dispatcher_libnm_dispatcher_core_la_SOURCES = \ @@ -4472,8 +4423,7 @@ dispatcher_tests_test_dispatcher_envp_CPPFLAGS = \ -I$(builddir)/libnm \ -I$(srcdir)/dispatcher \ -I$(builddir)/dispatcher \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \ + -DG_LOG_DOMAIN=\""NetworkManager"\" \ $(GLIB_CFLAGS) \ $(SANITIZER_EXEC_CFLAGS) \ $(INTROSPECTION_EXTRA_CFLAGS) \ @@ -4529,7 +4479,6 @@ clients_nm_online_CPPFLAGS = \ -I$(builddir)/libnm \ $(GLIB_CFLAGS) \ -DG_LOG_DOMAIN=\""nm-online"\" \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \ $(NULL) clients_nm_online_LDFLAGS = \ @@ -4565,7 +4514,6 @@ clients_cppflags = \ -I$(srcdir)/libnm \ -I$(builddir)/libnm \ -I$(srcdir)/clients/common \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \ $(GLIB_CFLAGS) \ $(SANITIZER_EXEC_CFLAGS) \ $(NULL) @@ -4625,8 +4573,9 @@ EXTRA_LTLIBRARIES += clients/common/libnmc.la endif clients_common_libnmc_la_SOURCES = \ - shared/nm-meta-setting.c \ - shared/nm-meta-setting.h \ + clients/common/nm-meta-setting-base-impl.c \ + clients/common/nm-meta-setting-base-impl.h \ + clients/common/nm-meta-setting-base.h \ \ clients/common/nm-meta-setting-desc.c \ clients/common/nm-meta-setting-desc.h \ @@ -4660,7 +4609,7 @@ endif clients_common_tests_test_clients_common_CPPFLAGS = \ -I$(srcdir)/clients/common/tests \ $(clients_cppflags) \ - -DNETWORKMANAGER_COMPILATION_TEST \ + -DG_LOG_DOMAIN=\""test"\" \ $(NULL) clients_common_tests_test_clients_common_LDFLAGS = \ @@ -4701,8 +4650,7 @@ clients_common_tests_test_libnm_core_aux_CPPFLAGS = \ -I$(srcdir)/libnm-core \ -I$(builddir)/libnm \ -I$(srcdir)/libnm \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \ + -DG_LOG_DOMAIN=\""test"\" \ $(CODE_COVERAGE_CFLAGS) \ $(GLIB_CFLAGS) \ $(SANITIZER_LIB_CFLAGS) \ @@ -5435,8 +5383,6 @@ EXTRA_DIST += \ \ po/meson.build \ \ - shared/nm-default.h \ - shared/nm-gassert-patch.h \ shared/nm-test-libnm-utils.h \ shared/nm-test-utils-impl.c \ shared/nm-utils/nm-compat.c \ @@ -5446,14 +5392,16 @@ EXTRA_DIST += \ shared/nm-utils/nm-vpn-plugin-macros.h \ shared/nm-utils/nm-vpn-plugin-utils.c \ shared/nm-utils/nm-vpn-plugin-utils.h \ - shared/nm-version-macros.h.in \ shared/meson.build \ \ + libnm-core/nm-version-macros.h.in \ + \ tools/check-config-options.sh \ tools/check-docs.sh \ tools/check-exports.sh \ tools/check-compare-generated.sh \ tools/check-gitlab-ci.sh \ + tools/check-tree.sh \ tools/create-exports-NetworkManager.sh \ tools/debug-helper.py \ tools/meson-post-install.sh \ @@ -5489,6 +5437,11 @@ endif ############################################################################### +check-tree: + "$(top_srcdir)/tools/check-tree.sh" + +check_local += check-tree + check-po-msgfmt: @echo "check-po-msgfmt: check $(top_srcdir)/po/*.po files with msgfmt -vc" @for f in "$(top_srcdir)/po"/*.po ; do \ diff --git a/clients/cli/agent.c b/clients/cli/agent.c index c8ab2a607c..a3c60c46e7 100644 --- a/clients/cli/agent.c +++ b/clients/cli/agent.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include #include diff --git a/clients/cli/common.c b/clients/cli/common.c index f60a7326fb..934ff70ef0 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -3,7 +3,7 @@ * Copyright (C) 2012 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "common.h" diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 805e765bb8..ee7b8fbbe9 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "connections.h" diff --git a/clients/cli/devices.c b/clients/cli/devices.c index 4051ff81ed..eea82653c0 100644 --- a/clients/cli/devices.c +++ b/clients/cli/devices.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "devices.h" diff --git a/clients/cli/general.c b/clients/cli/general.c index d1673beb3f..1dae57e116 100644 --- a/clients/cli/general.c +++ b/clients/cli/general.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include diff --git a/clients/cli/generate-docs-nm-settings-nmcli.c b/clients/cli/generate-docs-nm-settings-nmcli.c index aa40268474..d277b132e4 100644 --- a/clients/cli/generate-docs-nm-settings-nmcli.c +++ b/clients/cli/generate-docs-nm-settings-nmcli.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-meta-setting-desc.h" diff --git a/clients/cli/meson.build b/clients/cli/meson.build index 5d07c7fe9e..f8e6a8236d 100644 --- a/clients/cli/meson.build +++ b/clients/cli/meson.build @@ -27,7 +27,9 @@ executable( readline_dep, libnm_libnm_aux_dep, ], - c_args: clients_c_flags + ['-DG_LOG_DOMAIN="@0@"'.format('nmcli')], + c_args: [ + '-DG_LOG_DOMAIN="nmcli"', + ], link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, install: true, @@ -45,7 +47,9 @@ generate_docs_nm_settings_nmcli = executable( libnmc_dep, libnm_libnm_aux_dep, ], - c_args: clients_c_flags + ['-DG_LOG_DOMAIN="@0@"'.format('nmcli')], + c_args: [ + '-DG_LOG_DOMAIN="nmcli"', + ], link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, ) @@ -61,7 +65,11 @@ if enable_docs test( 'check-local-generate-docs-nm-settings-nmcli', find_program(join_paths(source_root, 'tools', 'check-compare-generated.sh')), - args: [source_root, build_root, 'clients/cli/generate-docs-nm-settings-nmcli.xml'], + args: [ + source_root, + build_root, + 'clients/cli/generate-docs-nm-settings-nmcli.xml', + ], ) else settings_docs_source = configure_file( diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c index c21e480e17..3945721105 100644 --- a/clients/cli/nmcli.c +++ b/clients/cli/nmcli.c @@ -4,7 +4,7 @@ * Copyright (C) 2010 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmcli.h" diff --git a/clients/cli/polkit-agent.c b/clients/cli/polkit-agent.c index e66294267a..2f07a2751e 100644 --- a/clients/cli/polkit-agent.c +++ b/clients/cli/polkit-agent.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "polkit-agent.h" diff --git a/clients/cli/settings.c b/clients/cli/settings.c index c479fc5170..2c1037f222 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "settings.h" diff --git a/clients/cli/settings.h b/clients/cli/settings.h index f759d67e2f..f103b8fd06 100644 --- a/clients/cli/settings.h +++ b/clients/cli/settings.h @@ -6,7 +6,6 @@ #ifndef NMC_SETTINGS_H #define NMC_SETTINGS_H -#include "nm-meta-setting.h" #include "nm-meta-setting-desc.h" #include "nmcli.h" diff --git a/clients/cli/utils.c b/clients/cli/utils.c index 8278655c98..0a62c35cfa 100644 --- a/clients/cli/utils.c +++ b/clients/cli/utils.c @@ -4,7 +4,7 @@ * Copyright (C) 2010 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "utils.h" diff --git a/clients/cloud-setup/main.c b/clients/cloud-setup/main.c index 235f25bef0..065901760a 100644 --- a/clients/cloud-setup/main.c +++ b/clients/cloud-setup/main.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-libnm-aux/nm-libnm-aux.h" diff --git a/clients/cloud-setup/meson.build b/clients/cloud-setup/meson.build index 70a9d57c34..5b48229971 100644 --- a/clients/cloud-setup/meson.build +++ b/clients/cloud-setup/meson.build @@ -1,7 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -name = 'nm-cloud-setup' - if install_systemdunitdir nm_cloud_setup_service = configure_file( @@ -23,27 +21,26 @@ if install_systemdunitdir endif -sources = files( - 'main.c', - 'nm-cloud-setup-utils.c', - 'nm-http-client.c', - 'nmcs-provider-ec2.c', - 'nmcs-provider-gcp.c', - 'nmcs-provider-azure.c', - 'nmcs-provider.c', -) - executable( - name, - sources, + 'nm-cloud-setup', + files( + 'main.c', + 'nm-cloud-setup-utils.c', + 'nm-http-client.c', + 'nmcs-provider-ec2.c', + 'nmcs-provider-gcp.c', + 'nmcs-provider-azure.c', + 'nmcs-provider.c', + ), dependencies: [ libnmc_base_dep, libnmc_dep, libcurl_dep, libnm_libnm_aux_dep, ], - c_args: clients_c_flags + - ['-DG_LOG_DOMAIN="@0@"'.format(name)], + c_args: [ + '-DG_LOG_DOMAIN="nm-cloud-setup"', + ], link_with: libnm_systemd_logging_stub, link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, diff --git a/clients/cloud-setup/nm-cloud-setup-utils.c b/clients/cloud-setup/nm-cloud-setup-utils.c index 95a84d10f6..6d446343fc 100644 --- a/clients/cloud-setup/nm-cloud-setup-utils.c +++ b/clients/cloud-setup/nm-cloud-setup-utils.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-cloud-setup-utils.h" diff --git a/clients/cloud-setup/nm-http-client.c b/clients/cloud-setup/nm-http-client.c index 529a77fe22..144513fce5 100644 --- a/clients/cloud-setup/nm-http-client.c +++ b/clients/cloud-setup/nm-http-client.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-http-client.h" diff --git a/clients/cloud-setup/nmcs-provider-azure.c b/clients/cloud-setup/nmcs-provider-azure.c index e55ecc9d28..0a5d522cc3 100644 --- a/clients/cloud-setup/nmcs-provider-azure.c +++ b/clients/cloud-setup/nmcs-provider-azure.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmcs-provider-azure.h" diff --git a/clients/cloud-setup/nmcs-provider-ec2.c b/clients/cloud-setup/nmcs-provider-ec2.c index 49b909bf77..1e060034f5 100644 --- a/clients/cloud-setup/nmcs-provider-ec2.c +++ b/clients/cloud-setup/nmcs-provider-ec2.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmcs-provider-ec2.h" diff --git a/clients/cloud-setup/nmcs-provider-gcp.c b/clients/cloud-setup/nmcs-provider-gcp.c index 425621b43f..1deaea10f3 100644 --- a/clients/cloud-setup/nmcs-provider-gcp.c +++ b/clients/cloud-setup/nmcs-provider-gcp.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmcs-provider-gcp.h" diff --git a/clients/cloud-setup/nmcs-provider.c b/clients/cloud-setup/nmcs-provider.c index 6512b76faf..c700d8e1a3 100644 --- a/clients/cloud-setup/nmcs-provider.c +++ b/clients/cloud-setup/nmcs-provider.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmcs-provider.h" diff --git a/clients/common/meson.build b/clients/common/meson.build index 6c1997a6a3..bf591b539d 100644 --- a/clients/common/meson.build +++ b/clients/common/meson.build @@ -2,72 +2,87 @@ common_inc = include_directories('.') -common_deps = [ - libnm_dep, - libnm_nm_default_dep, -] - -common_c_flags = clients_c_flags + ['-DG_LOG_DOMAIN="libnmc"'] - -sources = files( - 'nm-client-utils.c', - 'nm-secret-agent-simple.c', - 'nm-vpn-helpers.c', - 'nm-polkit-listener.c', -) - libnmc_base = static_library( 'nmc-base', - sources: sources, - dependencies: common_deps, - c_args: common_c_flags, + sources: files( + 'nm-client-utils.c', + 'nm-secret-agent-simple.c', + 'nm-vpn-helpers.c', + 'nm-polkit-listener.c', + ), + dependencies: [ + libnm_dep, + libnm_nm_default_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="libnmc"', + ], ) libnmc_base_dep = declare_dependency( include_directories: common_inc, - dependencies: common_deps, + dependencies: [ + libnm_dep, + libnm_nm_default_dep, + ], link_with: libnmc_base, ) -settings_docs = 'settings-docs.h' - if enable_docs settings_docs_source = custom_target( - settings_docs, + 'settings-docs.h', input: nm_settings_docs_xml_gir, - output: settings_docs, - command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), 'settings-docs.xsl'), '@INPUT@'], + output: 'settings-docs.h', + command: [ + xsltproc, + '--output', + '@OUTPUT@', + join_paths(meson.current_source_dir(), 'settings-docs.xsl'), + '@INPUT@', + ], ) test( 'check-settings-docs', find_program(join_paths(source_root, 'tools', 'check-compare-generated.sh')), - args: [source_root, build_root, 'clients/common/' + settings_docs], + args: [ + source_root, + build_root, + 'clients/common/settings-docs.h', + ], ) else settings_docs_source = configure_file( - input: settings_docs + '.in', + input: 'settings-docs.h.in', output: '@BASENAME@', configuration: configuration_data(), ) endif -sources = nm_meta_setting_source + [settings_docs_source] + files( - 'nm-meta-setting-access.c', - 'nm-meta-setting-desc.c', -) - libnmc = static_library( 'nmc', - sources: sources, - dependencies: common_deps + [libnm_libnm_core_aux_dep], - c_args: c_flags, + sources: [settings_docs_source] + files( + 'nm-meta-setting-access.c', + 'nm-meta-setting-base-impl.c', + 'nm-meta-setting-desc.c', + ), + dependencies: [ + libnm_dep, + libnm_nm_default_dep, + libnm_libnm_core_aux_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="libnmc"', + ], link_depends: settings_docs_source, ) libnmc_dep = declare_dependency( include_directories: common_inc, - dependencies: common_deps, + dependencies: [ + libnm_dep, + libnm_nm_default_dep, + ], link_with: libnmc, ) diff --git a/clients/common/nm-client-utils.c b/clients/common/nm-client-utils.c index f1ccc65d98..0e1a6bf5cf 100644 --- a/clients/common/nm-client-utils.c +++ b/clients/common/nm-client-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-client-utils.h" diff --git a/clients/common/nm-client-utils.h b/clients/common/nm-client-utils.h index b88950ee76..d6f163434a 100644 --- a/clients/common/nm-client-utils.h +++ b/clients/common/nm-client-utils.h @@ -6,7 +6,7 @@ #ifndef __NM_CLIENT_UTILS_H__ #define __NM_CLIENT_UTILS_H__ -#include "nm-meta-setting.h" +#include "nm-meta-setting-desc.h" #include "nm-active-connection.h" #include "nm-device.h" #include "nm-libnm-core-intern/nm-libnm-core-utils.h" diff --git a/clients/common/nm-meta-setting-access.c b/clients/common/nm-meta-setting-access.c index 873e59f1a5..dd493f28ae 100644 --- a/clients/common/nm-meta-setting-access.c +++ b/clients/common/nm-meta-setting-access.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-meta-setting-access.h" diff --git a/clients/common/nm-meta-setting-access.h b/clients/common/nm-meta-setting-access.h index 8dbd45dd2d..81aa3b6f67 100644 --- a/clients/common/nm-meta-setting-access.h +++ b/clients/common/nm-meta-setting-access.h @@ -6,7 +6,6 @@ #ifndef _NM_META_SETTING_ACCESS_H__ #define _NM_META_SETTING_ACCESS_H__ -#include "nm-meta-setting.h" #include "nm-meta-setting-desc.h" /*****************************************************************************/ diff --git a/shared/nm-meta-setting.c b/clients/common/nm-meta-setting-base-impl.c similarity index 98% rename from shared/nm-meta-setting.c rename to clients/common/nm-meta-setting-base-impl.c index 530d76f566..523c0d5db3 100644 --- a/shared/nm-meta-setting.c +++ b/clients/common/nm-meta-setting-base-impl.c @@ -3,9 +3,9 @@ * Copyright (C) 2017 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" -#include "nm-meta-setting.h" +#include "nm-meta-setting-base.h" #include "nm-setting-6lowpan.h" #include "nm-setting-8021x.h" @@ -516,8 +516,7 @@ nm_meta_setting_infos_by_name(const char *name) { gssize idx; -#if NM_MORE_ASSERTS > 10 - { + if (NM_MORE_ASSERTS > 10) { guint i, j; for (i = 0; i < _NM_META_SETTING_TYPE_NUM; i++) { @@ -545,7 +544,6 @@ nm_meta_setting_infos_by_name(const char *name) } } } -#endif G_STATIC_ASSERT_EXPR(G_STRUCT_OFFSET(NMMetaSettingInfo, setting_name) == 0); idx = nm_utils_array_find_binary_search(nm_meta_setting_infos, @@ -561,7 +559,7 @@ nm_meta_setting_infos_by_name(const char *name) const NMMetaSettingInfo * nm_meta_setting_infos_by_gtype(GType gtype) { -#if ((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL) +#if _NM_META_SETTING_BASE_IMPL_LIBNM nm_auto_unref_gtypeclass GTypeClass *gtypeclass_unref = NULL; GTypeClass * gtypeclass; NMSettingClass * klass; @@ -587,20 +585,19 @@ nm_meta_setting_infos_by_gtype(GType gtype) out_none: - #if NM_MORE_ASSERTS > 10 -{ - int i; + if (NM_MORE_ASSERTS > 10) { + int i; - /* this might hint to a bug, but it would be expected for NM_TYPE_SETTING + /* this might hint to a bug, but it would be expected for NM_TYPE_SETTING * and NM_TYPE_SETTING_IP_CONFIG. * * Assert that we didn't lookup for a gtype, which we would expect to find. * An assertion failure here, hints to a bug in nm_setting_*_class_init(). */ - for (i = 0; i < _NM_META_SETTING_TYPE_NUM; i++) - nm_assert(nm_meta_setting_infos[i].get_setting_gtype() != gtype); -} - #endif + for (i = 0; i < _NM_META_SETTING_TYPE_NUM; i++) + nm_assert(nm_meta_setting_infos[i].get_setting_gtype() != gtype); + } + return NULL; #else guint i; diff --git a/shared/nm-meta-setting.h b/clients/common/nm-meta-setting-base-impl.h similarity index 78% rename from shared/nm-meta-setting.h rename to clients/common/nm-meta-setting-base-impl.h index 85952490ef..94b14e844f 100644 --- a/shared/nm-meta-setting.h +++ b/clients/common/nm-meta-setting-base-impl.h @@ -3,8 +3,8 @@ * Copyright (C) 2017 - 2018 Red Hat, Inc. */ -#ifndef __NM_META_SETTING_H__ -#define __NM_META_SETTING_H__ +#ifndef __NM_META_SETTING_BASE_IMPL_H__ +#define __NM_META_SETTING_BASE_IMPL_H__ #include "nm-setting-8021x.h" @@ -158,50 +158,21 @@ typedef enum { _NM_META_SETTING_TYPE_NUM = NM_META_SETTING_TYPE_UNKNOWN, } NMMetaSettingType; -/* this header is statically linked with both libnm-core.la and libnmc.la. - * Though, there is no stable API/ABI, so whenever on of these components - * accesses NMMetaSettingInfo or NMMetaSettingType, it only has meaning - * inside the same component. - * - * Note how NMSettingClass has field of type "struct _NMMetaSettingInfo". - * It would be a serious bug, if libnmc tries to interpret this pointer - * with the meaning of NMMetaSettingInfo. They might be different, because - * libnm.so (libnm-core.la) might be a newer version than nmcli (libnmc.la). - * - * This define helps to ensure that we don't accidentally use the pointer - * in different contexts. */ -#if ((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL) - #define _NMMetaSettingInfoXX _NMMetaSettingInfo +#if _NM_META_SETTING_BASE_IMPL_LIBNM + #define _NMMetaSettingInfo_Alias _NMMetaSettingInfo #else - #define _NMMetaSettingInfoXX _NMMetaSettingInfoCli + #define _NMMetaSettingInfo_Alias _NMMetaSettingInfoCli #endif -struct _NMMetaSettingInfoXX { + +struct _NMMetaSettingInfo_Alias { const char *setting_name; GType (*get_setting_gtype)(void); NMMetaSettingType meta_type; NMSettingPriority setting_priority; }; -typedef struct _NMMetaSettingInfoXX NMMetaSettingInfo; +typedef struct _NMMetaSettingInfo_Alias NMMetaSettingInfo; -/* note that we statically link nm-meta-setting.h both to libnm-core.la and - * libnmc.la. That means, there are two versions of nm_meta_setting_infos - * in nmcli. That is not easily avoidable, because at this point, we don't - * want yet to making it public API. - * - * Eventually, this should become public API of libnm, and nmcli/libnmc.la - * should use that version. - * - * Downsides of the current solution: - * - * - duplication of the array in nmcli. - * - * - there is no stable API/ABI. That means, when you have a NMMetaSettingInfo - * pointer, or a NMMetaSettingType value, the value can only be used within - * the current context (libnm-core.la or libnmc.la). In other words, libnmc.la - * (and nmcli) must never access a NMMetaSettingInfo/NMMetaSettingType value, - * that comes from libnm-core.la. - */ extern const NMMetaSettingInfo nm_meta_setting_infos[_NM_META_SETTING_TYPE_NUM + 1]; const NMMetaSettingInfo *nm_meta_setting_infos_by_name(const char *name); @@ -213,4 +184,4 @@ NMSettingPriority nm_meta_setting_info_get_base_type_priority(const NMMetaSettin GType gtype); NMSettingPriority _nm_setting_type_get_base_type_priority(GType type); -#endif /* __NM_META_SETTING_H__ */ +#endif /* __NM_META_SETTING_BASE_IMPL_H__ */ diff --git a/clients/common/nm-meta-setting-base.h b/clients/common/nm-meta-setting-base.h new file mode 100644 index 0000000000..85d790a331 --- /dev/null +++ b/clients/common/nm-meta-setting-base.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + +#ifndef __NM_META_SETTING_BASE_H__ +#define __NM_META_SETTING_BASE_H__ + +#define _NM_META_SETTING_BASE_IMPL_LIBNM 0 + +#include "nm-meta-setting-base-impl.h" + +#endif /* __NM_META_SETTING_BASE_H__ */ diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 785405aa4a..b6e3d671fa 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-meta-setting-desc.h" diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h index 288880a31d..2f520b216a 100644 --- a/clients/common/nm-meta-setting-desc.h +++ b/clients/common/nm-meta-setting-desc.h @@ -7,7 +7,7 @@ #define __NM_META_SETTING_DESC_H__ #include "nm-glib-aux/nm-obj.h" -#include "nm-meta-setting.h" +#include "nm-meta-setting-base.h" #include "nm-base/nm-ethtool-base.h" struct _NMDevice; diff --git a/clients/common/nm-polkit-listener.c b/clients/common/nm-polkit-listener.c index 84308907f2..db21abfc98 100644 --- a/clients/common/nm-polkit-listener.c +++ b/clients/common/nm-polkit-listener.c @@ -18,7 +18,7 @@ * https://github.com/lxde/lxqt-policykit/tree/master/src */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-polkit-listener.h" diff --git a/clients/common/nm-secret-agent-simple.c b/clients/common/nm-secret-agent-simple.c index 45060a438c..1857432538 100644 --- a/clients/common/nm-secret-agent-simple.c +++ b/clients/common/nm-secret-agent-simple.c @@ -16,7 +16,7 @@ * replace ShellNetworkAgent. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-secret-agent-simple.h" diff --git a/clients/common/nm-vpn-helpers.c b/clients/common/nm-vpn-helpers.c index 43513a8e59..15c47c3ecc 100644 --- a/clients/common/nm-vpn-helpers.c +++ b/clients/common/nm-vpn-helpers.c @@ -8,7 +8,7 @@ * @short_description: VPN-related utilities */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-vpn-helpers.h" diff --git a/clients/common/tests/meson.build b/clients/common/tests/meson.build index 097f69f4e6..28b27ae9e0 100644 --- a/clients/common/tests/meson.build +++ b/clients/common/tests/meson.build @@ -1,45 +1,39 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -common_c_flags = clients_c_flags + ['-DNETWORKMANAGER_COMPILATION_TEST'] - -test_name = 'test-clients-common' - -deps = [ - libnmc_base_dep, - libnmc_dep, -] - exe = executable( - test_name, - test_name + '.c', - dependencies: deps, - c_args: common_c_flags, + 'test-clients-common', + 'test-clients-common.c', + dependencies: [ + libnmc_base_dep, + libnmc_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="test"', + ], ) test( - 'clients/common/tests/' + test_name, + 'clients/common/tests/test-clients-common', test_script, args: test_args + [exe.full_path()], ) -test_name = 'test-libnm-core-aux' - -deps = [ - libnm_dep, - libnm_libnm_core_aux_dep, - libnm_nm_default_dep, -] - exe = executable( - test_name, - test_name + '.c', - dependencies: deps, - c_args: common_c_flags, + 'test-libnm-core-aux', + 'test-libnm-core-aux.c', + dependencies: [ + libnm_dep, + libnm_libnm_core_aux_dep, + libnm_nm_default_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="test"', + ], link_with: libnm_systemd_logging_stub, ) test( - 'clients/common/tests/' + test_name, + 'clients/common/tests/test-libnm-core-aux', test_script, args: test_args + [exe.full_path()] ) diff --git a/clients/common/tests/test-clients-common.c b/clients/common/tests/test-clients-common.c index 7020e83339..4336f0d533 100644 --- a/clients/common/tests/test-clients-common.c +++ b/clients/common/tests/test-clients-common.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-meta-setting-access.h" #include "nm-vpn-helpers.h" diff --git a/clients/common/tests/test-libnm-core-aux.c b/clients/common/tests/test-libnm-core-aux.c index f5148d9456..bf639878c0 100644 --- a/clients/common/tests/test-libnm-core-aux.c +++ b/clients/common/tests/test-libnm-core-aux.c @@ -3,7 +3,7 @@ * Copyright (C) 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-libnm-core-aux/nm-libnm-core-aux.h" #include "nm-libnm-core-intern/nm-libnm-core-utils.h" diff --git a/clients/meson.build b/clients/meson.build index 257b9a07ff..2c92e29098 100644 --- a/clients/meson.build +++ b/clients/meson.build @@ -1,18 +1,16 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -clients_c_flags = ['-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT'] - -name = 'nm-online' - executable( - name, - name + '.c', + 'nm-online', + 'nm-online' + '.c', dependencies: [ libnm_dep, libnm_nm_default_dep, libnm_libnm_aux_dep, ], - c_args: clients_c_flags + ['-DG_LOG_DOMAIN="@0@"'.format(name)], + c_args: [ + '-DG_LOG_DOMAIN="nm-online"', + ], link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, install: true, diff --git a/clients/nm-online.c b/clients/nm-online.c index b40d8b4945..c5cdeb38a0 100644 --- a/clients/nm-online.c +++ b/clients/nm-online.c @@ -16,7 +16,7 @@ * Robert Love */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include #include diff --git a/clients/tui/meson.build b/clients/tui/meson.build index 468f552dd6..89f842e643 100644 --- a/clients/tui/meson.build +++ b/clients/tui/meson.build @@ -1,66 +1,60 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -name = 'nmtui' - -common_c_flags = clients_c_flags + ['-DG_LOG_DOMAIN="@0@"'.format(name)] - subdir('newt') -sources = files( - 'nm-editor-bindings.c', - 'nm-editor-utils.c', - 'nmt-address-list.c', - 'nmt-connect-connection-list.c', - 'nmt-device-entry.c', - 'nmt-edit-connection-list.c', - 'nmt-editor.c', - 'nmt-editor-grid.c', - 'nmt-editor-page.c', - 'nmt-editor-page-device.c', - 'nmt-editor-section.c', - 'nmt-ip-entry.c', - 'nmt-mac-entry.c', - 'nmt-mtu-entry.c', - 'nmt-page-bond.c', - 'nmt-page-bridge.c', - 'nmt-page-bridge-port.c', - 'nmt-page-dsl.c', - 'nmt-page-ethernet.c', - 'nmt-page-infiniband.c', - 'nmt-page-ip4.c', - 'nmt-page-ip6.c', - 'nmt-page-ip-tunnel.c', - 'nmt-page-ppp.c', - 'nmt-page-team.c', - 'nmt-page-team-port.c', - 'nmt-page-vlan.c', - 'nmt-page-wifi.c', - 'nmt-password-dialog.c', - 'nmt-password-fields.c', - 'nmt-route-editor.c', - 'nmt-route-entry.c', - 'nmt-route-table.c', - 'nmt-slave-list.c', - 'nmtui.c', - 'nmtui-connect.c', - 'nmtui-edit.c', - 'nmtui-hostname.c', - 'nmt-utils.c', - 'nmt-widget-list.c', -) - -deps = [ - libnmc_base_dep, - libnmc_dep, - libnmt_newt_dep, - libnm_libnm_aux_dep, -] - executable( - name, - sources, - dependencies: deps, - c_args: common_c_flags, + 'nmtui', + files( + 'nm-editor-bindings.c', + 'nm-editor-utils.c', + 'nmt-address-list.c', + 'nmt-connect-connection-list.c', + 'nmt-device-entry.c', + 'nmt-edit-connection-list.c', + 'nmt-editor.c', + 'nmt-editor-grid.c', + 'nmt-editor-page.c', + 'nmt-editor-page-device.c', + 'nmt-editor-section.c', + 'nmt-ip-entry.c', + 'nmt-mac-entry.c', + 'nmt-mtu-entry.c', + 'nmt-page-bond.c', + 'nmt-page-bridge.c', + 'nmt-page-bridge-port.c', + 'nmt-page-dsl.c', + 'nmt-page-ethernet.c', + 'nmt-page-infiniband.c', + 'nmt-page-ip4.c', + 'nmt-page-ip6.c', + 'nmt-page-ip-tunnel.c', + 'nmt-page-ppp.c', + 'nmt-page-team.c', + 'nmt-page-team-port.c', + 'nmt-page-vlan.c', + 'nmt-page-wifi.c', + 'nmt-password-dialog.c', + 'nmt-password-fields.c', + 'nmt-route-editor.c', + 'nmt-route-entry.c', + 'nmt-route-table.c', + 'nmt-slave-list.c', + 'nmtui.c', + 'nmtui-connect.c', + 'nmtui-edit.c', + 'nmtui-hostname.c', + 'nmt-utils.c', + 'nmt-widget-list.c', + ), + dependencies: [ + libnmc_base_dep, + libnmc_dep, + libnmt_newt_dep, + libnm_libnm_aux_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="nmtui"', + ], link_with: libnm_systemd_logging_stub, link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, diff --git a/clients/tui/newt/meson.build b/clients/tui/newt/meson.build index a18b31c206..0c89c0f681 100644 --- a/clients/tui/newt/meson.build +++ b/clients/tui/newt/meson.build @@ -1,38 +1,36 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -sources = files( - 'nmt-newt-button-box.c', - 'nmt-newt-button.c', - 'nmt-newt-checkbox.c', - 'nmt-newt-component.c', - 'nmt-newt-container.c', - 'nmt-newt-entry.c', - 'nmt-newt-entry-numeric.c', - 'nmt-newt-form.c', - 'nmt-newt-grid.c', - 'nmt-newt-hacks.c', - 'nmt-newt-label.c', - 'nmt-newt-listbox.c', - 'nmt-newt-popup.c', - 'nmt-newt-section.c', - 'nmt-newt-separator.c', - 'nmt-newt-stack.c', - 'nmt-newt-textbox.c', - 'nmt-newt-toggle-button.c', - 'nmt-newt-utils.c', - 'nmt-newt-widget.c', -) - -deps = [ - libnm_nm_default_dep, - newt_dep, -] - libnmt_newt = static_library( 'nmt-newt', - sources: sources, - dependencies: deps, - c_args: common_c_flags, + sources: files( + 'nmt-newt-button-box.c', + 'nmt-newt-button.c', + 'nmt-newt-checkbox.c', + 'nmt-newt-component.c', + 'nmt-newt-container.c', + 'nmt-newt-entry.c', + 'nmt-newt-entry-numeric.c', + 'nmt-newt-form.c', + 'nmt-newt-grid.c', + 'nmt-newt-hacks.c', + 'nmt-newt-label.c', + 'nmt-newt-listbox.c', + 'nmt-newt-popup.c', + 'nmt-newt-section.c', + 'nmt-newt-separator.c', + 'nmt-newt-stack.c', + 'nmt-newt-textbox.c', + 'nmt-newt-toggle-button.c', + 'nmt-newt-utils.c', + 'nmt-newt-widget.c', + ), + dependencies: [ + libnm_nm_default_dep, + newt_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="nmtui"', + ], ) libnmt_newt_dep = declare_dependency( diff --git a/clients/tui/newt/nmt-newt-button-box.c b/clients/tui/newt/nmt-newt-button-box.c index 9dc8ee78d2..212d04afa2 100644 --- a/clients/tui/newt/nmt-newt-button-box.c +++ b/clients/tui/newt/nmt-newt-button-box.c @@ -16,7 +16,7 @@ * within each of the two sections. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-button-box.h" diff --git a/clients/tui/newt/nmt-newt-button.c b/clients/tui/newt/nmt-newt-button.c index 050d6bd8c0..1a30a63d4c 100644 --- a/clients/tui/newt/nmt-newt-button.c +++ b/clients/tui/newt/nmt-newt-button.c @@ -10,7 +10,7 @@ * #NmtNewtButton implements a button widget. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-button.h" #include "nmt-newt-utils.h" diff --git a/clients/tui/newt/nmt-newt-checkbox.c b/clients/tui/newt/nmt-newt-checkbox.c index 304075e919..f806494277 100644 --- a/clients/tui/newt/nmt-newt-checkbox.c +++ b/clients/tui/newt/nmt-newt-checkbox.c @@ -10,7 +10,7 @@ * #NmtNewtCheckbox implements a checkbox widget. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-checkbox.h" #include "nmt-newt-utils.h" diff --git a/clients/tui/newt/nmt-newt-component.c b/clients/tui/newt/nmt-newt-component.c index 687c1e6371..64648ea6bb 100644 --- a/clients/tui/newt/nmt-newt-component.c +++ b/clients/tui/newt/nmt-newt-component.c @@ -11,7 +11,7 @@ * wrap a (single) #newtComponent. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-component.h" #include "nmt-newt-form.h" diff --git a/clients/tui/newt/nmt-newt-container.c b/clients/tui/newt/nmt-newt-container.c index f6060c147b..dfb5891661 100644 --- a/clients/tui/newt/nmt-newt-container.c +++ b/clients/tui/newt/nmt-newt-container.c @@ -13,7 +13,7 @@ * #NmtNewtGrid is the most generic container type. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-container.h" diff --git a/clients/tui/newt/nmt-newt-entry-numeric.c b/clients/tui/newt/nmt-newt-entry-numeric.c index 6df61af70f..c08ad00a24 100644 --- a/clients/tui/newt/nmt-newt-entry-numeric.c +++ b/clients/tui/newt/nmt-newt-entry-numeric.c @@ -13,7 +13,7 @@ * #NmtNewtEntryValidator functions, so you should not set your own. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include diff --git a/clients/tui/newt/nmt-newt-entry.c b/clients/tui/newt/nmt-newt-entry.c index eee75c0f67..2c2ee13535 100644 --- a/clients/tui/newt/nmt-newt-entry.c +++ b/clients/tui/newt/nmt-newt-entry.c @@ -13,7 +13,7 @@ * See also #NmtNewtEntryNumeric, for numeric-only entries. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-entry.h" #include "nmt-newt-form.h" diff --git a/clients/tui/newt/nmt-newt-form.c b/clients/tui/newt/nmt-newt-form.c index b596be7444..23118e3403 100644 --- a/clients/tui/newt/nmt-newt-form.c +++ b/clients/tui/newt/nmt-newt-form.c @@ -11,7 +11,7 @@ * "form" (aka dialog) to the user. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include #include diff --git a/clients/tui/newt/nmt-newt-grid.c b/clients/tui/newt/nmt-newt-grid.c index 873afbd917..9fdd615a72 100644 --- a/clients/tui/newt/nmt-newt-grid.c +++ b/clients/tui/newt/nmt-newt-grid.c @@ -27,7 +27,7 @@ * must be implemented by the container... */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-grid.h" diff --git a/clients/tui/newt/nmt-newt-hacks.c b/clients/tui/newt/nmt-newt-hacks.c index f1a5199ff0..4120acbb3f 100644 --- a/clients/tui/newt/nmt-newt-hacks.c +++ b/clients/tui/newt/nmt-newt-hacks.c @@ -11,7 +11,7 @@ * functions that were added after 0.52.15. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-hacks.h" diff --git a/clients/tui/newt/nmt-newt-label.c b/clients/tui/newt/nmt-newt-label.c index 3ef963675e..1902b57f2d 100644 --- a/clients/tui/newt/nmt-newt-label.c +++ b/clients/tui/newt/nmt-newt-label.c @@ -12,7 +12,7 @@ * See also #NmtNewtTextbox, for multiline. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-label.h" diff --git a/clients/tui/newt/nmt-newt-listbox.c b/clients/tui/newt/nmt-newt-listbox.c index 293f8b72a3..7031fc0f99 100644 --- a/clients/tui/newt/nmt-newt-listbox.c +++ b/clients/tui/newt/nmt-newt-listbox.c @@ -18,7 +18,7 @@ * presses Return on a selection. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-listbox.h" #include "nmt-newt-form.h" diff --git a/clients/tui/newt/nmt-newt-popup.c b/clients/tui/newt/nmt-newt-popup.c index 6c385bfd12..c8d8034dd9 100644 --- a/clients/tui/newt/nmt-newt-popup.c +++ b/clients/tui/newt/nmt-newt-popup.c @@ -13,7 +13,7 @@ * #NmtNewtForm containing an #NmtNewtListbox to select from. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-popup.h" #include "nmt-newt-form.h" diff --git a/clients/tui/newt/nmt-newt-section.c b/clients/tui/newt/nmt-newt-section.c index aacc10ac51..6075563950 100644 --- a/clients/tui/newt/nmt-newt-section.c +++ b/clients/tui/newt/nmt-newt-section.c @@ -22,7 +22,7 @@ * extent of the section. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-section.h" diff --git a/clients/tui/newt/nmt-newt-separator.c b/clients/tui/newt/nmt-newt-separator.c index 49e5d2cccd..c0dde744bc 100644 --- a/clients/tui/newt/nmt-newt-separator.c +++ b/clients/tui/newt/nmt-newt-separator.c @@ -12,7 +12,7 @@ * between widgets in containers that don't implement padding. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-separator.h" diff --git a/clients/tui/newt/nmt-newt-stack.c b/clients/tui/newt/nmt-newt-stack.c index 7d730e7a6f..f3a2d1f0c4 100644 --- a/clients/tui/newt/nmt-newt-stack.c +++ b/clients/tui/newt/nmt-newt-stack.c @@ -16,7 +16,7 @@ * children. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-stack.h" diff --git a/clients/tui/newt/nmt-newt-textbox.c b/clients/tui/newt/nmt-newt-textbox.c index 523a1e1b94..c8e3d576e5 100644 --- a/clients/tui/newt/nmt-newt-textbox.c +++ b/clients/tui/newt/nmt-newt-textbox.c @@ -11,7 +11,7 @@ * word-wrapping. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-textbox.h" diff --git a/clients/tui/newt/nmt-newt-toggle-button.c b/clients/tui/newt/nmt-newt-toggle-button.c index 3d5d07c4ef..cbc813fb30 100644 --- a/clients/tui/newt/nmt-newt-toggle-button.c +++ b/clients/tui/newt/nmt-newt-toggle-button.c @@ -10,7 +10,7 @@ * #NmtNewtToggleButton implements a two-state toggle button. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-toggle-button.h" diff --git a/clients/tui/newt/nmt-newt-utils.c b/clients/tui/newt/nmt-newt-utils.c index d3f807a99e..af24824558 100644 --- a/clients/tui/newt/nmt-newt-utils.c +++ b/clients/tui/newt/nmt-newt-utils.c @@ -8,7 +8,7 @@ * @short_description: Utility functions */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include #include diff --git a/clients/tui/newt/nmt-newt-widget.c b/clients/tui/newt/nmt-newt-widget.c index 6eeeaa189a..902949527a 100644 --- a/clients/tui/newt/nmt-newt-widget.c +++ b/clients/tui/newt/nmt-newt-widget.c @@ -21,7 +21,7 @@ * FIXME: need RTL support */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt-widget.h" #include "nmt-newt-form.h" diff --git a/clients/tui/nm-editor-bindings.c b/clients/tui/nm-editor-bindings.c index 7f1bcb6778..01f22f64ca 100644 --- a/clients/tui/nm-editor-bindings.c +++ b/clients/tui/nm-editor-bindings.c @@ -12,7 +12,7 @@ * shared between nmtui, nm-connection-editor, and gnome-control-center. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-editor-bindings.h" diff --git a/clients/tui/nm-editor-utils.c b/clients/tui/nm-editor-utils.c index 4bb8e7114f..21dc3aef92 100644 --- a/clients/tui/nm-editor-utils.c +++ b/clients/tui/nm-editor-utils.c @@ -12,7 +12,7 @@ * nm-connection-editor, and gnome-control-center. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-editor-utils.h" #if 0 diff --git a/clients/tui/nmt-address-list.c b/clients/tui/nmt-address-list.c index a33a2307fc..bb3651d956 100644 --- a/clients/tui/nmt-address-list.c +++ b/clients/tui/nmt-address-list.c @@ -15,7 +15,7 @@ * functions. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-address-list.h" diff --git a/clients/tui/nmt-connect-connection-list.c b/clients/tui/nmt-connect-connection-list.c index 8960f47ff8..e8a90d0a31 100644 --- a/clients/tui/nmt-connect-connection-list.c +++ b/clients/tui/nmt-connect-connection-list.c @@ -11,7 +11,7 @@ * access points displayed by "nmtui connect". */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include diff --git a/clients/tui/nmt-device-entry.c b/clients/tui/nmt-device-entry.c index 593b7b6af9..dcc2c6d24d 100644 --- a/clients/tui/nmt-device-entry.c +++ b/clients/tui/nmt-device-entry.c @@ -21,7 +21,7 @@ * to implement that then we should make it just an #NmtNewtEntry. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-device-entry.h" diff --git a/clients/tui/nmt-edit-connection-list.c b/clients/tui/nmt-edit-connection-list.c index b57e48031a..52535e077c 100644 --- a/clients/tui/nmt-edit-connection-list.c +++ b/clients/tui/nmt-edit-connection-list.c @@ -11,7 +11,7 @@ * "nmtui edit". */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmtui.h" #include "nmtui-edit.h" diff --git a/clients/tui/nmt-editor-grid.c b/clients/tui/nmt-editor-grid.c index c7e657a109..9bd07066c9 100644 --- a/clients/tui/nmt-editor-grid.c +++ b/clients/tui/nmt-editor-grid.c @@ -24,7 +24,7 @@ * section border into account as well. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-editor-grid.h" diff --git a/clients/tui/nmt-editor-page-device.c b/clients/tui/nmt-editor-page-device.c index e899b3a476..18f886bda5 100644 --- a/clients/tui/nmt-editor-page-device.c +++ b/clients/tui/nmt-editor-page-device.c @@ -15,7 +15,7 @@ * an actual page type. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-editor-page-device.h" diff --git a/clients/tui/nmt-editor-page.c b/clients/tui/nmt-editor-page.c index 200462bf14..24ff9bebca 100644 --- a/clients/tui/nmt-editor-page.c +++ b/clients/tui/nmt-editor-page.c @@ -11,7 +11,7 @@ * A "page" is a set of related #NmtEditorSections. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-editor-page.h" diff --git a/clients/tui/nmt-editor-section.c b/clients/tui/nmt-editor-section.c index 34eaceda8f..0b85cd2935 100644 --- a/clients/tui/nmt-editor-section.c +++ b/clients/tui/nmt-editor-section.c @@ -10,7 +10,7 @@ * #NmtEditorSection is the abstract base class for #NmtEditor sections. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-editor-section.h" #include "nmt-newt-toggle-button.h" diff --git a/clients/tui/nmt-editor.c b/clients/tui/nmt-editor.c index eb5d2fb2a6..2f5a09b097 100644 --- a/clients/tui/nmt-editor.c +++ b/clients/tui/nmt-editor.c @@ -10,7 +10,7 @@ * #NmtEditor is the top-level form for editing a connection. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-editor.h" diff --git a/clients/tui/nmt-ip-entry.c b/clients/tui/nmt-ip-entry.c index 2d292c98ce..e6d1306d5c 100644 --- a/clients/tui/nmt-ip-entry.c +++ b/clients/tui/nmt-ip-entry.c @@ -14,7 +14,7 @@ * contains a valid IP address. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include #include diff --git a/clients/tui/nmt-mac-entry.c b/clients/tui/nmt-mac-entry.c index db49e564cb..2768eaab35 100644 --- a/clients/tui/nmt-mac-entry.c +++ b/clients/tui/nmt-mac-entry.c @@ -13,7 +13,7 @@ * on whether it currently contains a valid hardware address. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-mac-entry.h" diff --git a/clients/tui/nmt-mtu-entry.c b/clients/tui/nmt-mtu-entry.c index 096f8b469c..7b1c0f3be1 100644 --- a/clients/tui/nmt-mtu-entry.c +++ b/clients/tui/nmt-mtu-entry.c @@ -17,7 +17,7 @@ * indicating the units used by the entry. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include diff --git a/clients/tui/nmt-page-bond.c b/clients/tui/nmt-page-bond.c index d24d6311a2..9c86a49860 100644 --- a/clients/tui/nmt-page-bond.c +++ b/clients/tui/nmt-page-bond.c @@ -12,7 +12,7 @@ * can't just use #GBinding. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-page-bond.h" diff --git a/clients/tui/nmt-page-bridge-port.c b/clients/tui/nmt-page-bridge-port.c index fc1e9ed66d..228acc20c0 100644 --- a/clients/tui/nmt-page-bridge-port.c +++ b/clients/tui/nmt-page-bridge-port.c @@ -8,7 +8,7 @@ * @short_description: The editor page for Bridge ports */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-page-bridge-port.h" diff --git a/clients/tui/nmt-page-bridge.c b/clients/tui/nmt-page-bridge.c index b2120cc0fb..7fc85eb2ed 100644 --- a/clients/tui/nmt-page-bridge.c +++ b/clients/tui/nmt-page-bridge.c @@ -8,7 +8,7 @@ * @short_description: The editor page for Bridge connections */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-page-bridge.h" diff --git a/clients/tui/nmt-page-dsl.c b/clients/tui/nmt-page-dsl.c index ded0fd4a9a..8e1e69f3f2 100644 --- a/clients/tui/nmt-page-dsl.c +++ b/clients/tui/nmt-page-dsl.c @@ -8,7 +8,7 @@ * @short_description: The editor page for DSL connections */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-page-dsl.h" #include "nmt-page-ethernet.h" diff --git a/clients/tui/nmt-page-ethernet.c b/clients/tui/nmt-page-ethernet.c index db6b5598a2..61ef811ca8 100644 --- a/clients/tui/nmt-page-ethernet.c +++ b/clients/tui/nmt-page-ethernet.c @@ -8,7 +8,7 @@ * @short_description: The editor page for Ethernet connections */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-page-ethernet.h" diff --git a/clients/tui/nmt-page-infiniband.c b/clients/tui/nmt-page-infiniband.c index 00e87ec471..0529caf367 100644 --- a/clients/tui/nmt-page-infiniband.c +++ b/clients/tui/nmt-page-infiniband.c @@ -8,7 +8,7 @@ * @short_description: The editor page for InfiniBand connections */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-page-infiniband.h" #include "nmt-mtu-entry.h" diff --git a/clients/tui/nmt-page-ip-tunnel.c b/clients/tui/nmt-page-ip-tunnel.c index 02b0a25473..ab58038989 100644 --- a/clients/tui/nmt-page-ip-tunnel.c +++ b/clients/tui/nmt-page-ip-tunnel.c @@ -7,7 +7,7 @@ * @short_description: The editor page for IP tunnel connections */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-page-ip-tunnel.h" diff --git a/clients/tui/nmt-page-ip4.c b/clients/tui/nmt-page-ip4.c index 7611567bce..1f01155bf4 100644 --- a/clients/tui/nmt-page-ip4.c +++ b/clients/tui/nmt-page-ip4.c @@ -8,7 +8,7 @@ * @short_description: The editor page for IP4 configuration */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include diff --git a/clients/tui/nmt-page-ip6.c b/clients/tui/nmt-page-ip6.c index d44d0b952a..f4e4f3d0ea 100644 --- a/clients/tui/nmt-page-ip6.c +++ b/clients/tui/nmt-page-ip6.c @@ -8,7 +8,7 @@ * @short_description: The editor page for IP6 configuration */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include diff --git a/clients/tui/nmt-page-ppp.c b/clients/tui/nmt-page-ppp.c index 9e5564cb8c..b60835af09 100644 --- a/clients/tui/nmt-page-ppp.c +++ b/clients/tui/nmt-page-ppp.c @@ -8,7 +8,7 @@ * @short_description: The editor page for PPP configuration */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include diff --git a/clients/tui/nmt-page-team-port.c b/clients/tui/nmt-page-team-port.c index 22510946c0..fd71140813 100644 --- a/clients/tui/nmt-page-team-port.c +++ b/clients/tui/nmt-page-team-port.c @@ -8,7 +8,7 @@ * @short_description: The editor page for Team ports. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-page-team-port.h" diff --git a/clients/tui/nmt-page-team.c b/clients/tui/nmt-page-team.c index 705ff95782..f0a3f839d7 100644 --- a/clients/tui/nmt-page-team.c +++ b/clients/tui/nmt-page-team.c @@ -8,7 +8,7 @@ * @short_description: The editor page for Team connections */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-page-team.h" diff --git a/clients/tui/nmt-page-vlan.c b/clients/tui/nmt-page-vlan.c index ad8ab490e5..549156dd33 100644 --- a/clients/tui/nmt-page-vlan.c +++ b/clients/tui/nmt-page-vlan.c @@ -8,7 +8,7 @@ * @short_description: The editor page for VLAN connections */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-editor-bindings.h" diff --git a/clients/tui/nmt-page-wifi.c b/clients/tui/nmt-page-wifi.c index a0b66fcb76..817e23bde6 100644 --- a/clients/tui/nmt-page-wifi.c +++ b/clients/tui/nmt-page-wifi.c @@ -12,7 +12,7 @@ * properties. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include #include diff --git a/clients/tui/nmt-password-dialog.c b/clients/tui/nmt-password-dialog.c index 845aa4a885..679bf05229 100644 --- a/clients/tui/nmt-password-dialog.c +++ b/clients/tui/nmt-password-dialog.c @@ -11,7 +11,7 @@ * secrets when activating a connection. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-password-dialog.h" #include "nm-secret-agent-simple.h" diff --git a/clients/tui/nmt-password-fields.c b/clients/tui/nmt-password-fields.c index 77514bb54f..c4c54a26bf 100644 --- a/clients/tui/nmt-password-fields.c +++ b/clients/tui/nmt-password-fields.c @@ -12,7 +12,7 @@ * "Show password" checkbox that toggles whether the password is visible. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-password-fields.h" diff --git a/clients/tui/nmt-route-editor.c b/clients/tui/nmt-route-editor.c index a89e2be6d6..d2e54122e7 100644 --- a/clients/tui/nmt-route-editor.c +++ b/clients/tui/nmt-route-editor.c @@ -12,7 +12,7 @@ * wide to fit into the main window. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-route-editor.h" #include "nmt-route-table.h" diff --git a/clients/tui/nmt-route-entry.c b/clients/tui/nmt-route-entry.c index 025d712117..545eaf14ea 100644 --- a/clients/tui/nmt-route-entry.c +++ b/clients/tui/nmt-route-entry.c @@ -13,7 +13,7 @@ * This is used as a building block by #NmtRouteTable. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include #include diff --git a/clients/tui/nmt-route-table.c b/clients/tui/nmt-route-table.c index 4386e50257..e38149450a 100644 --- a/clients/tui/nmt-route-table.c +++ b/clients/tui/nmt-route-table.c @@ -11,7 +11,7 @@ * and buttons to add and remove entries. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include #include diff --git a/clients/tui/nmt-slave-list.c b/clients/tui/nmt-slave-list.c index 5e787dc2a5..9a2f6d241c 100644 --- a/clients/tui/nmt-slave-list.c +++ b/clients/tui/nmt-slave-list.c @@ -11,7 +11,7 @@ * slaves of a connection. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-slave-list.h" diff --git a/clients/tui/nmt-utils.c b/clients/tui/nmt-utils.c index e80c50035a..39889e11c6 100644 --- a/clients/tui/nmt-utils.c +++ b/clients/tui/nmt-utils.c @@ -8,7 +8,7 @@ * @short_description: Miscellaneous nmtui-specific utilities */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-utils.h" diff --git a/clients/tui/nmt-widget-list.c b/clients/tui/nmt-widget-list.c index dd645c4c6a..d25c01c77e 100644 --- a/clients/tui/nmt-widget-list.c +++ b/clients/tui/nmt-widget-list.c @@ -17,7 +17,7 @@ * FIXME: The way this works is sort of weird. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-widget-list.h" diff --git a/clients/tui/nmtui-connect.c b/clients/tui/nmtui-connect.c index 36182077ca..356badb011 100644 --- a/clients/tui/nmtui-connect.c +++ b/clients/tui/nmtui-connect.c @@ -11,7 +11,7 @@ * including presenting a password dialog if necessary. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include diff --git a/clients/tui/nmtui-edit.c b/clients/tui/nmtui-edit.c index ac205b05ae..8a88e1162a 100644 --- a/clients/tui/nmtui-edit.c +++ b/clients/tui/nmtui-edit.c @@ -10,7 +10,7 @@ * nmtui-edit implements editing #NMConnections. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include diff --git a/clients/tui/nmtui-hostname.c b/clients/tui/nmtui-hostname.c index 494827c230..07e0f6058c 100644 --- a/clients/tui/nmtui-hostname.c +++ b/clients/tui/nmtui-hostname.c @@ -10,7 +10,7 @@ * nmtui-hostname implements the "set hostname" functionality */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmt-newt.h" diff --git a/clients/tui/nmtui.c b/clients/tui/nmtui.c index f73e087593..73ead40e8f 100644 --- a/clients/tui/nmtui.c +++ b/clients/tui/nmtui.c @@ -11,7 +11,7 @@ * nmtui_edit(), and nmtui_hostname(). */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nmtui.h" diff --git a/configure.ac b/configure.ac index cd5837eb2a..bd3cf3caa6 100644 --- a/configure.ac +++ b/configure.ac @@ -1293,7 +1293,7 @@ AC_SUBST(AM_CFLAGS) AC_CONFIG_FILES([ Makefile -shared/nm-version-macros.h +libnm-core/nm-version-macros.h libnm/libnm.pc po/Makefile.in data/org.freedesktop.NetworkManager.policy.in diff --git a/dispatcher/meson.build b/dispatcher/meson.build index a99c57555a..d12e47145f 100644 --- a/dispatcher/meson.build +++ b/dispatcher/meson.build @@ -2,8 +2,6 @@ dispatcher_inc = include_directories('.') -name = 'nm-dispatcher' - configure_file( input: 'org.freedesktop.nm_dispatcher.service.in', output: '@BASENAME@', @@ -16,36 +14,37 @@ install_data( install_dir: dbus_conf_dir, ) -deps = [ - libnm_dep, - libnm_nm_default_dep, - libnm_libnm_aux_dep, -] - -c_flags = [ - '-DG_LOG_DOMAIN="@0@"'.format(name), - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT', -] - libnm_dispatcher_core = static_library( - name + '-core', + 'nm-dispatcher-core', sources: 'nm-dispatcher-utils.c', - dependencies: deps, - c_args: c_flags, + dependencies: [ + libnm_dep, + libnm_nm_default_dep, + libnm_libnm_aux_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="nm-dispatcher"', + ], ) nmdbus_dispatcher_sources = gnome.gdbus_codegen( 'nmdbus-dispatcher', - name + '.xml', + 'nm-dispatcher.xml', interface_prefix: 'org.freedesktop', namespace: 'NMDBus', ) executable( - name, - name + '.c', - dependencies: deps, - c_args: c_flags, + 'nm-dispatcher', + 'nm-dispatcher.c', + dependencies: [ + libnm_dep, + libnm_nm_default_dep, + libnm_libnm_aux_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="nm-dispatcher"', + ], link_with: libnm_dispatcher_core, link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, diff --git a/dispatcher/nm-dispatcher-utils.c b/dispatcher/nm-dispatcher-utils.c index aa0f006aba..f1ec979f27 100644 --- a/dispatcher/nm-dispatcher-utils.c +++ b/dispatcher/nm-dispatcher-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-dispatcher-utils.h" diff --git a/dispatcher/nm-dispatcher.c b/dispatcher/nm-dispatcher.c index 548097b3e4..9891bf3d15 100644 --- a/dispatcher/nm-dispatcher.c +++ b/dispatcher/nm-dispatcher.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include #include diff --git a/dispatcher/tests/meson.build b/dispatcher/tests/meson.build index 90f3cad419..84b4b61c66 100644 --- a/dispatcher/tests/meson.build +++ b/dispatcher/tests/meson.build @@ -1,24 +1,24 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_unit = 'test-dispatcher-envp' - exe = executable( - test_unit, - [test_unit + '.c', nmdbus_dispatcher_sources], + 'test-dispatcher-envp', + [ + 'test-dispatcher-envp.c', + nmdbus_dispatcher_sources, + ], include_directories: dispatcher_inc, dependencies: [ libnm_nm_default_dep, libnm_glib_aux_dep, ], c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT', + '-DG_LOG_DOMAIN="test"', ] + introspection_extra_cflags, link_with: libnm_dispatcher_core, ) test( - 'dispatcher/' + test_unit, + 'dispatcher/test-dispatcher-envp', test_script, args: test_args + [exe.full_path()], ) diff --git a/dispatcher/tests/test-dispatcher-envp.c b/dispatcher/tests/test-dispatcher-envp.c index 073d95bc79..4c37dd6c07 100644 --- a/dispatcher/tests/test-dispatcher-envp.c +++ b/dispatcher/tests/test-dispatcher-envp.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include #include diff --git a/docs/libnm/Makefile.am b/docs/libnm/Makefile.am index c8f095f215..ae61d85af0 100644 --- a/docs/libnm/Makefile.am +++ b/docs/libnm/Makefile.am @@ -40,6 +40,7 @@ IGNORE_HFILES= \ nm-crypto-impl.h \ nm-crypto.h \ nm-dbus-helpers.h \ + nm-default-libnm-core.h \ nm-device-private.h \ nm-dhcp4-config.h \ nm-dhcp6-config.h \ diff --git a/docs/libnm/meson.build b/docs/libnm/meson.build index 2f70eb5c84..102009899d 100644 --- a/docs/libnm/meson.build +++ b/docs/libnm/meson.build @@ -13,6 +13,7 @@ private_headers = [ 'nm-crypto-impl.h', 'nm-crypto.h', 'nm-dbus-helpers.h', + 'nm-default-libnm-core.h', 'nm-device-private.h', 'nm-dhcp4-config.h', 'nm-dhcp6-config.h', diff --git a/libnm-core/meson.build b/libnm-core/meson.build index a02bbe1bf2..ec9fb8ce52 100644 --- a/libnm-core/meson.build +++ b/libnm-core/meson.build @@ -2,6 +2,12 @@ libnm_core_inc = include_directories('.') +nm_version_macro_header = configure_file( + input: 'nm-version-macros.h.in', + output: '@BASENAME@', + configuration: data_conf, +) + libnm_core_nm_default_dep = declare_dependency( sources: nm_version_macro_header, include_directories: libnm_core_inc, @@ -79,7 +85,7 @@ libnm_core_enum_sources = gnome.mkenums_simple( 'nm-core-enum-types', sources: libnm_core_headers + [nm_version_macro_header], identifier_prefix: nm_id_prefix, - body_prefix: '#include "nm-default.h"', + body_prefix: '#include "libnm-core/nm-default-libnm-core.h"', install_header: true, install_dir: libnm_pkgincludedir, ) @@ -95,8 +101,7 @@ libnm_libnm_core_intern = static_library( libnm_base_dep, ], c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE', + '-DG_LOG_DOMAIN="libnm"', ], ) @@ -118,8 +123,7 @@ libnm_crypto = static_library( libnm_glib_aux_dep, ], c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE', + '-DG_LOG_DOMAIN="libnm"', ], ) @@ -183,6 +187,9 @@ libnm_core_sources = libnm_core_settings_sources + files( 'nm-crypto.c', 'nm-dbus-utils.c', 'nm-errors.c', + 'nm-keyfile-utils.c', + 'nm-keyfile.c', + 'nm-meta-setting-base-impl.c', 'nm-property-compare.c', 'nm-setting.c', 'nm-simple-connection.c', @@ -194,7 +201,7 @@ libnm_core_sources = libnm_core_settings_sources + files( libnm_core = static_library( 'nm-core', - sources: libnm_core_sources + libnm_core_enum_sources + nm_meta_setting_source + [nm_version_macro_header], + sources: libnm_core_sources + libnm_core_enum_sources + [nm_version_macro_header], include_directories: top_inc, dependencies: [ dl_dep, @@ -203,8 +210,7 @@ libnm_core = static_library( uuid_dep, ], c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE', + '-DG_LOG_DOMAIN="libnm"', ], link_with: [ libnm_crypto, @@ -226,8 +232,7 @@ libnm_libnm_core_aux = static_library( ) + [libnm_core_enum_sources[1]], dependencies: libnm_glib_aux_dep, c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_WITH_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)', + '-DG_LOG_DOMAIN="libnm"', ], link_with: [ libnm_libnm_core_intern, @@ -242,29 +247,6 @@ libnm_libnm_core_aux_dep = declare_dependency( link_with: libnm_libnm_core_aux, ) -nm_keyfile_source = files( - 'nm-keyfile/nm-keyfile-utils.c', - 'nm-keyfile/nm-keyfile.c', -) - -libnm_keyfile = static_library( - 'nm-keyfile', - sources: nm_keyfile_source + [libnm_core_enum_sources[1]], - dependencies: libnm_glib_aux_dep, - c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)', - ], - link_with: libnm_libnm_core_intern, -) - -libnm_keyfile_dep = declare_dependency( - sources: [libnm_core_enum_sources[1], nm_version_macro_header], - include_directories: [libnm_core_inc, shared_inc], - dependencies: glib_dep, - link_with: libnm_keyfile, -) - docbooks = [ ['nm-dbus-types', 'nm-dbus-interface.h', 'NetworkManager D-Bus API Types'], ['nm-vpn-dbus-types', 'nm-vpn-dbus-interface.h', 'VPN Plugin D-Bus API Types'], diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c index 60b2485fec..b39c41d7bd 100644 --- a/libnm-core/nm-connection.c +++ b/libnm-core/nm-connection.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-connection.h" diff --git a/libnm-core/nm-core-enum-types.c.template b/libnm-core/nm-core-enum-types.c.template deleted file mode 100644 index b6cb38eecc..0000000000 --- a/libnm-core/nm-core-enum-types.c.template +++ /dev/null @@ -1,90 +0,0 @@ -/*** BEGIN file-header ***/ -#include "config.h" - -#include "nm-core-enum-types.h" -#include "nm-default.h" - -#include "nm-connection.h" -#include "nm-core-types.h" -#include "nm-dbus-interface.h" -#include "nm-errors.h" -#include "nm-setting-8021x.h" -#include "nm-setting-adsl.h" -#include "nm-setting-bluetooth.h" -#include "nm-setting-bond.h" -#include "nm-setting-bridge-port.h" -#include "nm-setting-bridge.h" -#include "nm-setting-cdma.h" -#include "nm-setting-connection.h" -#include "nm-setting-dcb.h" -#include "nm-setting-dummy.h" -#include "nm-setting-generic.h" -#include "nm-setting-gsm.h" -#include "nm-setting-infiniband.h" -#include "nm-setting-ip-config.h" -#include "nm-setting-ip-tunnel.h" -#include "nm-setting-ip4-config.h" -#include "nm-setting-ip6-config.h" -#include "nm-setting-macsec.h" -#include "nm-setting-macvlan.h" -#include "nm-setting-olpc-mesh.h" -#include "nm-setting-ovs-bridge.h" -#include "nm-setting-ovs-interface.h" -#include "nm-setting-ovs-dpdk.h" -#include "nm-setting-ovs-patch.h" -#include "nm-setting-ovs-port.h" -#include "nm-setting-ppp.h" -#include "nm-setting-pppoe.h" -#include "nm-setting-proxy.h" -#include "nm-setting-serial.h" -#include "nm-setting-team-port.h" -#include "nm-setting-team.h" -#include "nm-setting-tun.h" -#include "nm-setting-user.h" -#include "nm-setting-vlan.h" -#include "nm-setting-vpn.h" -#include "nm-setting-vxlan.h" -#include "nm-setting-wifi-p2p.h" -#include "nm-setting-wimax.h" -#include "nm-setting-wired.h" -#include "nm-setting-wireguard.h" -#include "nm-setting-wireless-security.h" -#include "nm-setting-wireless.h" -#include "nm-setting-wpan.h" -#include "nm-setting.h" -#include "nm-simple-connection.h" -#include "nm-utils.h" -#include "nm-version-macros.h" -#include "nm-version.h" -#include "nm-vpn-dbus-interface.h" -#include "nm-vpn-editor-plugin.h" -#include "nm-vpn-plugin-info.h" -/*** END file-header ***/ - -/*** BEGIN value-header ***/ -GType -@enum_name@_get_type (void) -{ - static volatile gsize g_define_type_id__volatile = 0; - - if (g_once_init_enter (&g_define_type_id__volatile)) - { - static const G@Type@Value values[] = { -/*** END value-header ***/ - -/*** BEGIN value-production ***/ - { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, -/*** END value-production ***/ - -/*** BEGIN value-tail ***/ - { 0, NULL, NULL } - }; - GType g_define_type_id = - g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); - } - - return g_define_type_id__volatile; -} - -/*** END value-tail ***/ diff --git a/libnm-core/nm-core-enum-types.h.template b/libnm-core/nm-core-enum-types.h.template deleted file mode 100644 index 0f1be1e13e..0000000000 --- a/libnm-core/nm-core-enum-types.h.template +++ /dev/null @@ -1,21 +0,0 @@ -/*** BEGIN file-header ***/ -#ifndef __NM_CORE_ENUM_TYPES_H__ -#define __NM_CORE_ENUM_TYPES_H__ - -#include - -G_BEGIN_DECLS - -/*** END file-header ***/ - -/*** BEGIN enumeration-production ***/ -GType @enum_name@_get_type (void) G_GNUC_CONST; -#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) - -/*** END enumeration-production ***/ - -/*** BEGIN file-tail ***/ -G_END_DECLS - -#endif /* __NM_CORE_ENUM_TYPES_H__ */ -/*** END file-tail ***/ diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h index bda7f89d14..d9374fe5a7 100644 --- a/libnm-core/nm-core-internal.h +++ b/libnm-core/nm-core-internal.h @@ -24,7 +24,7 @@ #include "nm-connection.h" #include "nm-core-enum-types.h" #include "nm-core-types-internal.h" -#include "nm-meta-setting.h" +#include "nm-meta-setting-base.h" #include "nm-setting-6lowpan.h" #include "nm-setting-8021x.h" #include "nm-setting-adsl.h" diff --git a/libnm-core/nm-crypto-gnutls.c b/libnm-core/nm-crypto-gnutls.c index 6b71efee23..17c5d1dc6a 100644 --- a/libnm-core/nm-crypto-gnutls.c +++ b/libnm-core/nm-crypto-gnutls.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-crypto-impl.h" diff --git a/libnm-core/nm-crypto-nss.c b/libnm-core/nm-crypto-nss.c index 871b6d70e2..8cbb4daf67 100644 --- a/libnm-core/nm-crypto-nss.c +++ b/libnm-core/nm-crypto-nss.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2009 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-crypto-impl.h" diff --git a/libnm-core/nm-crypto.c b/libnm-core/nm-crypto.c index 229f564c0a..0eaeeb72f5 100644 --- a/libnm-core/nm-crypto.c +++ b/libnm-core/nm-crypto.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-crypto.h" diff --git a/libnm-core/nm-dbus-utils.c b/libnm-core/nm-dbus-utils.c index 52a3c028c6..cf679daf9c 100644 --- a/libnm-core/nm-dbus-utils.c +++ b/libnm-core/nm-dbus-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-core-internal.h" diff --git a/libnm-core/nm-default-libnm-core.h b/libnm-core/nm-default-libnm-core.h new file mode 100644 index 0000000000..6eb84b947a --- /dev/null +++ b/libnm-core/nm-default-libnm-core.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEFAULT_LIBNM_CORE_H__ +#define __NM_DEFAULT_LIBNM_CORE_H__ + +/*****************************************************************************/ + +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" + +#undef NETWORKMANAGER_COMPILATION +#define NETWORKMANAGER_COMPILATION NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE + +/*****************************************************************************/ + +#include "nm-version.h" + +/*****************************************************************************/ + +#endif /* __NM_DEFAULT_LIBNM_CORE_H__ */ diff --git a/libnm-core/nm-errors.c b/libnm-core/nm-errors.c index 95a12c0717..023926630a 100644 --- a/libnm-core/nm-errors.c +++ b/libnm-core/nm-errors.c @@ -3,7 +3,7 @@ * Copyright (C) 2004 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-errors.h" diff --git a/libnm-core/nm-keyfile/nm-keyfile-internal.h b/libnm-core/nm-keyfile-internal.h similarity index 99% rename from libnm-core/nm-keyfile/nm-keyfile-internal.h rename to libnm-core/nm-keyfile-internal.h index 78996ebe6b..bb89214c5e 100644 --- a/libnm-core/nm-keyfile/nm-keyfile-internal.h +++ b/libnm-core/nm-keyfile-internal.h @@ -19,7 +19,6 @@ #include "nm-setting-8021x.h" #include "nm-core-internal.h" -#include "nm-meta-setting.h" /*****************************************************************************/ diff --git a/libnm-core/nm-keyfile/nm-keyfile-utils.c b/libnm-core/nm-keyfile-utils.c similarity index 99% rename from libnm-core/nm-keyfile/nm-keyfile-utils.c rename to libnm-core/nm-keyfile-utils.c index f14e89c89d..8de4b0d257 100644 --- a/libnm-core/nm-keyfile/nm-keyfile-utils.c +++ b/libnm-core/nm-keyfile-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-keyfile-utils.h" diff --git a/libnm-core/nm-keyfile/nm-keyfile-utils.h b/libnm-core/nm-keyfile-utils.h similarity index 100% rename from libnm-core/nm-keyfile/nm-keyfile-utils.h rename to libnm-core/nm-keyfile-utils.h diff --git a/libnm-core/nm-keyfile/nm-keyfile.c b/libnm-core/nm-keyfile.c similarity index 99% rename from libnm-core/nm-keyfile/nm-keyfile.c rename to libnm-core/nm-keyfile.c index cfae785c19..c9c8cf8966 100644 --- a/libnm-core/nm-keyfile/nm-keyfile.c +++ b/libnm-core/nm-keyfile.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-keyfile-internal.h" diff --git a/libnm-core/nm-libnm-core-aux/nm-libnm-core-aux.c b/libnm-core/nm-libnm-core-aux/nm-libnm-core-aux.c index 651ab502b1..888dbac4b2 100644 --- a/libnm-core/nm-libnm-core-aux/nm-libnm-core-aux.c +++ b/libnm-core/nm-libnm-core-aux/nm-libnm-core-aux.c @@ -3,7 +3,7 @@ * Copyright (C) 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-libnm-core-aux.h" diff --git a/libnm-core/nm-libnm-core-intern/nm-auth-subject.c b/libnm-core/nm-libnm-core-intern/nm-auth-subject.c index 4e79e0ba19..1866662c2d 100644 --- a/libnm-core/nm-libnm-core-intern/nm-auth-subject.c +++ b/libnm-core/nm-libnm-core-intern/nm-auth-subject.c @@ -11,7 +11,7 @@ * makes requests, like process identifier and user UID. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-auth-subject.h" diff --git a/libnm-core/nm-libnm-core-intern/nm-libnm-core-utils.c b/libnm-core/nm-libnm-core-intern/nm-libnm-core-utils.c index 92426d33d9..1ab0fcf253 100644 --- a/libnm-core/nm-libnm-core-intern/nm-libnm-core-utils.c +++ b/libnm-core/nm-libnm-core-intern/nm-libnm-core-utils.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-libnm-core-utils.h" diff --git a/libnm-core/nm-meta-setting-base-impl.c b/libnm-core/nm-meta-setting-base-impl.c new file mode 100644 index 0000000000..523c0d5db3 --- /dev/null +++ b/libnm-core/nm-meta-setting-base-impl.c @@ -0,0 +1,641 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2017 - 2018 Red Hat, Inc. + */ + +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" + +#include "nm-meta-setting-base.h" + +#include "nm-setting-6lowpan.h" +#include "nm-setting-8021x.h" +#include "nm-setting-adsl.h" +#include "nm-setting-bluetooth.h" +#include "nm-setting-bond.h" +#include "nm-setting-bridge-port.h" +#include "nm-setting-bridge.h" +#include "nm-setting-cdma.h" +#include "nm-setting-connection.h" +#include "nm-setting-dcb.h" +#include "nm-setting-dummy.h" +#include "nm-setting-ethtool.h" +#include "nm-setting-generic.h" +#include "nm-setting-gsm.h" +#include "nm-setting-hostname.h" +#include "nm-setting-infiniband.h" +#include "nm-setting-ip-config.h" +#include "nm-setting-ip-tunnel.h" +#include "nm-setting-ip4-config.h" +#include "nm-setting-ip6-config.h" +#include "nm-setting-macsec.h" +#include "nm-setting-macvlan.h" +#include "nm-setting-match.h" +#include "nm-setting-olpc-mesh.h" +#include "nm-setting-ovs-bridge.h" +#include "nm-setting-ovs-interface.h" +#include "nm-setting-ovs-dpdk.h" +#include "nm-setting-ovs-external-ids.h" +#include "nm-setting-ovs-patch.h" +#include "nm-setting-ovs-port.h" +#include "nm-setting-ppp.h" +#include "nm-setting-pppoe.h" +#include "nm-setting-proxy.h" +#include "nm-setting-serial.h" +#include "nm-setting-tc-config.h" +#include "nm-setting-team-port.h" +#include "nm-setting-team.h" +#include "nm-setting-tun.h" +#include "nm-setting-user.h" +#include "nm-setting-veth.h" +#include "nm-setting-vlan.h" +#include "nm-setting-vpn.h" +#include "nm-setting-vrf.h" +#include "nm-setting-vxlan.h" +#include "nm-setting-wifi-p2p.h" +#include "nm-setting-wimax.h" +#include "nm-setting-wired.h" +#include "nm-setting-wireguard.h" +#include "nm-setting-wireless-security.h" +#include "nm-setting-wireless.h" +#include "nm-setting-wpan.h" + +/*****************************************************************************/ + +const NMSetting8021xSchemeVtable nm_setting_8021x_scheme_vtable[] = { + +#define _D(_scheme_type, ...) [(_scheme_type)] = {.scheme_type = (_scheme_type), __VA_ARGS__} + + _D(NM_SETTING_802_1X_SCHEME_TYPE_UNKNOWN), + + _D(NM_SETTING_802_1X_SCHEME_TYPE_CA_CERT, + .setting_key = NM_SETTING_802_1X_CA_CERT, + .scheme_func = nm_setting_802_1x_get_ca_cert_scheme, + .format_func = NULL, + .path_func = nm_setting_802_1x_get_ca_cert_path, + .blob_func = nm_setting_802_1x_get_ca_cert_blob, + .uri_func = nm_setting_802_1x_get_ca_cert_uri, + .passwd_func = nm_setting_802_1x_get_ca_cert_password, + .pwflag_func = nm_setting_802_1x_get_ca_cert_password_flags, + .set_cert_func = nm_setting_802_1x_set_ca_cert, + .file_suffix = "ca-cert", ), + + _D(NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CA_CERT, + .setting_key = NM_SETTING_802_1X_PHASE2_CA_CERT, + .scheme_func = nm_setting_802_1x_get_phase2_ca_cert_scheme, + .format_func = NULL, + .path_func = nm_setting_802_1x_get_phase2_ca_cert_path, + .blob_func = nm_setting_802_1x_get_phase2_ca_cert_blob, + .uri_func = nm_setting_802_1x_get_phase2_ca_cert_uri, + .passwd_func = nm_setting_802_1x_get_phase2_ca_cert_password, + .pwflag_func = nm_setting_802_1x_get_phase2_ca_cert_password_flags, + .set_cert_func = nm_setting_802_1x_set_phase2_ca_cert, + .file_suffix = "inner-ca-cert", ), + + _D(NM_SETTING_802_1X_SCHEME_TYPE_CLIENT_CERT, + .setting_key = NM_SETTING_802_1X_CLIENT_CERT, + .scheme_func = nm_setting_802_1x_get_client_cert_scheme, + .format_func = NULL, + .path_func = nm_setting_802_1x_get_client_cert_path, + .blob_func = nm_setting_802_1x_get_client_cert_blob, + .uri_func = nm_setting_802_1x_get_client_cert_uri, + .passwd_func = nm_setting_802_1x_get_client_cert_password, + .pwflag_func = nm_setting_802_1x_get_client_cert_password_flags, + .set_cert_func = nm_setting_802_1x_set_client_cert, + .file_suffix = "client-cert", ), + + _D(NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CLIENT_CERT, + .setting_key = NM_SETTING_802_1X_PHASE2_CLIENT_CERT, + .scheme_func = nm_setting_802_1x_get_phase2_client_cert_scheme, + .format_func = NULL, + .path_func = nm_setting_802_1x_get_phase2_client_cert_path, + .blob_func = nm_setting_802_1x_get_phase2_client_cert_blob, + .uri_func = nm_setting_802_1x_get_phase2_client_cert_uri, + .passwd_func = nm_setting_802_1x_get_phase2_client_cert_password, + .pwflag_func = nm_setting_802_1x_get_phase2_client_cert_password_flags, + .set_cert_func = nm_setting_802_1x_set_phase2_client_cert, + .file_suffix = "inner-client-cert", ), + + _D(NM_SETTING_802_1X_SCHEME_TYPE_PRIVATE_KEY, + .setting_key = NM_SETTING_802_1X_PRIVATE_KEY, + .scheme_func = nm_setting_802_1x_get_private_key_scheme, + .format_func = nm_setting_802_1x_get_private_key_format, + .path_func = nm_setting_802_1x_get_private_key_path, + .blob_func = nm_setting_802_1x_get_private_key_blob, + .uri_func = nm_setting_802_1x_get_private_key_uri, + .passwd_func = nm_setting_802_1x_get_private_key_password, + .pwflag_func = nm_setting_802_1x_get_private_key_password_flags, + .set_private_key_func = nm_setting_802_1x_set_private_key, + .file_suffix = "private-key", + .is_secret = TRUE, ), + + _D(NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_PRIVATE_KEY, + .setting_key = NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, + .scheme_func = nm_setting_802_1x_get_phase2_private_key_scheme, + .format_func = nm_setting_802_1x_get_phase2_private_key_format, + .path_func = nm_setting_802_1x_get_phase2_private_key_path, + .blob_func = nm_setting_802_1x_get_phase2_private_key_blob, + .uri_func = nm_setting_802_1x_get_phase2_private_key_uri, + .passwd_func = nm_setting_802_1x_get_phase2_private_key_password, + .pwflag_func = nm_setting_802_1x_get_phase2_private_key_password_flags, + .set_private_key_func = nm_setting_802_1x_set_phase2_private_key, + .file_suffix = "inner-private-key", + .is_secret = TRUE, ), + +#undef _D +}; + +/*****************************************************************************/ + +const NMMetaSettingInfo nm_meta_setting_infos[] = { + [NM_META_SETTING_TYPE_6LOWPAN] = + { + .meta_type = NM_META_SETTING_TYPE_6LOWPAN, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_6LOWPAN_SETTING_NAME, + .get_setting_gtype = nm_setting_6lowpan_get_type, + }, + [NM_META_SETTING_TYPE_802_1X] = + { + .meta_type = NM_META_SETTING_TYPE_802_1X, + .setting_priority = NM_SETTING_PRIORITY_HW_AUX, + .setting_name = NM_SETTING_802_1X_SETTING_NAME, + .get_setting_gtype = nm_setting_802_1x_get_type, + }, + [NM_META_SETTING_TYPE_ADSL] = + { + .meta_type = NM_META_SETTING_TYPE_ADSL, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_ADSL_SETTING_NAME, + .get_setting_gtype = nm_setting_adsl_get_type, + }, + [NM_META_SETTING_TYPE_BLUETOOTH] = + { + .meta_type = NM_META_SETTING_TYPE_BLUETOOTH, + .setting_priority = NM_SETTING_PRIORITY_HW_NON_BASE, + .setting_name = NM_SETTING_BLUETOOTH_SETTING_NAME, + .get_setting_gtype = nm_setting_bluetooth_get_type, + }, + [NM_META_SETTING_TYPE_BOND] = + { + .meta_type = NM_META_SETTING_TYPE_BOND, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_BOND_SETTING_NAME, + .get_setting_gtype = nm_setting_bond_get_type, + }, + [NM_META_SETTING_TYPE_BRIDGE] = + { + .meta_type = NM_META_SETTING_TYPE_BRIDGE, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_BRIDGE_SETTING_NAME, + .get_setting_gtype = nm_setting_bridge_get_type, + }, + [NM_META_SETTING_TYPE_BRIDGE_PORT] = + { + .meta_type = NM_META_SETTING_TYPE_BRIDGE_PORT, + .setting_priority = NM_SETTING_PRIORITY_AUX, + .setting_name = NM_SETTING_BRIDGE_PORT_SETTING_NAME, + .get_setting_gtype = nm_setting_bridge_port_get_type, + }, + [NM_META_SETTING_TYPE_CDMA] = + { + .meta_type = NM_META_SETTING_TYPE_CDMA, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_CDMA_SETTING_NAME, + .get_setting_gtype = nm_setting_cdma_get_type, + }, + [NM_META_SETTING_TYPE_CONNECTION] = + { + .meta_type = NM_META_SETTING_TYPE_CONNECTION, + .setting_priority = NM_SETTING_PRIORITY_CONNECTION, + .setting_name = NM_SETTING_CONNECTION_SETTING_NAME, + .get_setting_gtype = nm_setting_connection_get_type, + }, + [NM_META_SETTING_TYPE_DCB] = + { + .meta_type = NM_META_SETTING_TYPE_DCB, + .setting_priority = NM_SETTING_PRIORITY_HW_AUX, + .setting_name = NM_SETTING_DCB_SETTING_NAME, + .get_setting_gtype = nm_setting_dcb_get_type, + }, + [NM_META_SETTING_TYPE_DUMMY] = + { + .meta_type = NM_META_SETTING_TYPE_DUMMY, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_DUMMY_SETTING_NAME, + .get_setting_gtype = nm_setting_dummy_get_type, + }, + [NM_META_SETTING_TYPE_ETHTOOL] = + { + .meta_type = NM_META_SETTING_TYPE_ETHTOOL, + .setting_priority = NM_SETTING_PRIORITY_AUX, + .setting_name = NM_SETTING_ETHTOOL_SETTING_NAME, + .get_setting_gtype = nm_setting_ethtool_get_type, + }, + [NM_META_SETTING_TYPE_GENERIC] = + { + .meta_type = NM_META_SETTING_TYPE_GENERIC, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_GENERIC_SETTING_NAME, + .get_setting_gtype = nm_setting_generic_get_type, + }, + [NM_META_SETTING_TYPE_GSM] = + { + .meta_type = NM_META_SETTING_TYPE_GSM, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_GSM_SETTING_NAME, + .get_setting_gtype = nm_setting_gsm_get_type, + }, + [NM_META_SETTING_TYPE_HOSTNAME] = + { + .meta_type = NM_META_SETTING_TYPE_HOSTNAME, + .setting_priority = NM_SETTING_PRIORITY_IP, + .setting_name = NM_SETTING_HOSTNAME_SETTING_NAME, + .get_setting_gtype = nm_setting_hostname_get_type, + }, + [NM_META_SETTING_TYPE_INFINIBAND] = + { + .meta_type = NM_META_SETTING_TYPE_INFINIBAND, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_INFINIBAND_SETTING_NAME, + .get_setting_gtype = nm_setting_infiniband_get_type, + }, + [NM_META_SETTING_TYPE_IP4_CONFIG] = + { + .meta_type = NM_META_SETTING_TYPE_IP4_CONFIG, + .setting_priority = NM_SETTING_PRIORITY_IP, + .setting_name = NM_SETTING_IP4_CONFIG_SETTING_NAME, + .get_setting_gtype = nm_setting_ip4_config_get_type, + }, + [NM_META_SETTING_TYPE_IP6_CONFIG] = + { + .meta_type = NM_META_SETTING_TYPE_IP6_CONFIG, + .setting_priority = NM_SETTING_PRIORITY_IP, + .setting_name = NM_SETTING_IP6_CONFIG_SETTING_NAME, + .get_setting_gtype = nm_setting_ip6_config_get_type, + }, + [NM_META_SETTING_TYPE_IP_TUNNEL] = + { + .meta_type = NM_META_SETTING_TYPE_IP_TUNNEL, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_IP_TUNNEL_SETTING_NAME, + .get_setting_gtype = nm_setting_ip_tunnel_get_type, + }, + [NM_META_SETTING_TYPE_MACSEC] = + { + .meta_type = NM_META_SETTING_TYPE_MACSEC, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_MACSEC_SETTING_NAME, + .get_setting_gtype = nm_setting_macsec_get_type, + }, + [NM_META_SETTING_TYPE_MACVLAN] = + { + .meta_type = NM_META_SETTING_TYPE_MACVLAN, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_MACVLAN_SETTING_NAME, + .get_setting_gtype = nm_setting_macvlan_get_type, + }, + [NM_META_SETTING_TYPE_MATCH] = + { + .meta_type = NM_META_SETTING_TYPE_MATCH, + .setting_priority = NM_SETTING_PRIORITY_AUX, + .setting_name = NM_SETTING_MATCH_SETTING_NAME, + .get_setting_gtype = nm_setting_match_get_type, + }, + [NM_META_SETTING_TYPE_OLPC_MESH] = + { + .meta_type = NM_META_SETTING_TYPE_OLPC_MESH, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_OLPC_MESH_SETTING_NAME, + .get_setting_gtype = nm_setting_olpc_mesh_get_type, + }, + [NM_META_SETTING_TYPE_OVS_BRIDGE] = + { + .meta_type = NM_META_SETTING_TYPE_OVS_BRIDGE, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_OVS_BRIDGE_SETTING_NAME, + .get_setting_gtype = nm_setting_ovs_bridge_get_type, + }, + [NM_META_SETTING_TYPE_OVS_DPDK] = + { + .meta_type = NM_META_SETTING_TYPE_OVS_DPDK, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_OVS_DPDK_SETTING_NAME, + .get_setting_gtype = nm_setting_ovs_dpdk_get_type, + }, + [NM_META_SETTING_TYPE_OVS_EXTERNAL_IDS] = + { + .meta_type = NM_META_SETTING_TYPE_OVS_EXTERNAL_IDS, + .setting_priority = NM_SETTING_PRIORITY_AUX, + .setting_name = NM_SETTING_OVS_EXTERNAL_IDS_SETTING_NAME, + .get_setting_gtype = nm_setting_ovs_external_ids_get_type, + }, + [NM_META_SETTING_TYPE_OVS_INTERFACE] = + { + .meta_type = NM_META_SETTING_TYPE_OVS_INTERFACE, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_OVS_INTERFACE_SETTING_NAME, + .get_setting_gtype = nm_setting_ovs_interface_get_type, + }, + [NM_META_SETTING_TYPE_OVS_PATCH] = + { + .meta_type = NM_META_SETTING_TYPE_OVS_PATCH, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_OVS_PATCH_SETTING_NAME, + .get_setting_gtype = nm_setting_ovs_patch_get_type, + }, + [NM_META_SETTING_TYPE_OVS_PORT] = + { + .meta_type = NM_META_SETTING_TYPE_OVS_PORT, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_OVS_PORT_SETTING_NAME, + .get_setting_gtype = nm_setting_ovs_port_get_type, + }, + [NM_META_SETTING_TYPE_PPPOE] = + { + .meta_type = NM_META_SETTING_TYPE_PPPOE, + .setting_priority = NM_SETTING_PRIORITY_AUX, + .setting_name = NM_SETTING_PPPOE_SETTING_NAME, + .get_setting_gtype = nm_setting_pppoe_get_type, + }, + [NM_META_SETTING_TYPE_PPP] = + { + .meta_type = NM_META_SETTING_TYPE_PPP, + .setting_priority = NM_SETTING_PRIORITY_AUX, + .setting_name = NM_SETTING_PPP_SETTING_NAME, + .get_setting_gtype = nm_setting_ppp_get_type, + }, + [NM_META_SETTING_TYPE_PROXY] = + { + .meta_type = NM_META_SETTING_TYPE_PROXY, + .setting_priority = NM_SETTING_PRIORITY_IP, + .setting_name = NM_SETTING_PROXY_SETTING_NAME, + .get_setting_gtype = nm_setting_proxy_get_type, + }, + [NM_META_SETTING_TYPE_SERIAL] = + { + .meta_type = NM_META_SETTING_TYPE_SERIAL, + .setting_priority = NM_SETTING_PRIORITY_HW_AUX, + .setting_name = NM_SETTING_SERIAL_SETTING_NAME, + .get_setting_gtype = nm_setting_serial_get_type, + }, + [NM_META_SETTING_TYPE_SRIOV] = + { + .meta_type = NM_META_SETTING_TYPE_SRIOV, + .setting_priority = NM_SETTING_PRIORITY_HW_AUX, + .setting_name = NM_SETTING_SRIOV_SETTING_NAME, + .get_setting_gtype = nm_setting_sriov_get_type, + }, + [NM_META_SETTING_TYPE_TC_CONFIG] = + { + .meta_type = NM_META_SETTING_TYPE_TC_CONFIG, + .setting_priority = NM_SETTING_PRIORITY_IP, + .setting_name = NM_SETTING_TC_CONFIG_SETTING_NAME, + .get_setting_gtype = nm_setting_tc_config_get_type, + }, + [NM_META_SETTING_TYPE_TEAM] = + { + .meta_type = NM_META_SETTING_TYPE_TEAM, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_TEAM_SETTING_NAME, + .get_setting_gtype = nm_setting_team_get_type, + }, + [NM_META_SETTING_TYPE_TEAM_PORT] = + { + .meta_type = NM_META_SETTING_TYPE_TEAM_PORT, + .setting_priority = NM_SETTING_PRIORITY_AUX, + .setting_name = NM_SETTING_TEAM_PORT_SETTING_NAME, + .get_setting_gtype = nm_setting_team_port_get_type, + }, + [NM_META_SETTING_TYPE_TUN] = + { + .meta_type = NM_META_SETTING_TYPE_TUN, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_TUN_SETTING_NAME, + .get_setting_gtype = nm_setting_tun_get_type, + }, + [NM_META_SETTING_TYPE_USER] = + { + .meta_type = NM_META_SETTING_TYPE_USER, + .setting_priority = NM_SETTING_PRIORITY_USER, + .setting_name = NM_SETTING_USER_SETTING_NAME, + .get_setting_gtype = nm_setting_user_get_type, + }, + [NM_META_SETTING_TYPE_VETH] = + { + .meta_type = NM_META_SETTING_TYPE_VETH, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_VETH_SETTING_NAME, + .get_setting_gtype = nm_setting_veth_get_type, + }, + [NM_META_SETTING_TYPE_VLAN] = + { + .meta_type = NM_META_SETTING_TYPE_VLAN, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_VLAN_SETTING_NAME, + .get_setting_gtype = nm_setting_vlan_get_type, + }, + [NM_META_SETTING_TYPE_VPN] = + { + .meta_type = NM_META_SETTING_TYPE_VPN, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_VPN_SETTING_NAME, + .get_setting_gtype = nm_setting_vpn_get_type, + }, + [NM_META_SETTING_TYPE_VRF] = + { + .meta_type = NM_META_SETTING_TYPE_VRF, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_VRF_SETTING_NAME, + .get_setting_gtype = nm_setting_vrf_get_type, + }, + [NM_META_SETTING_TYPE_VXLAN] = + { + .meta_type = NM_META_SETTING_TYPE_VXLAN, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_VXLAN_SETTING_NAME, + .get_setting_gtype = nm_setting_vxlan_get_type, + }, + [NM_META_SETTING_TYPE_WIFI_P2P] = + { + .meta_type = NM_META_SETTING_TYPE_WIFI_P2P, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_WIFI_P2P_SETTING_NAME, + .get_setting_gtype = nm_setting_wifi_p2p_get_type, + }, + [NM_META_SETTING_TYPE_WIMAX] = + { + .meta_type = NM_META_SETTING_TYPE_WIMAX, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_WIMAX_SETTING_NAME, + .get_setting_gtype = nm_setting_wimax_get_type, + }, + [NM_META_SETTING_TYPE_WIRED] = + { + .meta_type = NM_META_SETTING_TYPE_WIRED, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_WIRED_SETTING_NAME, + .get_setting_gtype = nm_setting_wired_get_type, + }, + [NM_META_SETTING_TYPE_WIREGUARD] = + { + .meta_type = NM_META_SETTING_TYPE_WIREGUARD, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_WIREGUARD_SETTING_NAME, + .get_setting_gtype = nm_setting_wireguard_get_type, + }, + [NM_META_SETTING_TYPE_WIRELESS] = + { + .meta_type = NM_META_SETTING_TYPE_WIRELESS, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_WIRELESS_SETTING_NAME, + .get_setting_gtype = nm_setting_wireless_get_type, + }, + [NM_META_SETTING_TYPE_WIRELESS_SECURITY] = + { + .meta_type = NM_META_SETTING_TYPE_WIRELESS_SECURITY, + .setting_priority = NM_SETTING_PRIORITY_HW_AUX, + .setting_name = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + .get_setting_gtype = nm_setting_wireless_security_get_type, + }, + [NM_META_SETTING_TYPE_WPAN] = + { + .meta_type = NM_META_SETTING_TYPE_WPAN, + .setting_priority = NM_SETTING_PRIORITY_HW_BASE, + .setting_name = NM_SETTING_WPAN_SETTING_NAME, + .get_setting_gtype = nm_setting_wpan_get_type, + }, + + [NM_META_SETTING_TYPE_UNKNOWN] = + { + .meta_type = NM_META_SETTING_TYPE_UNKNOWN, + }, +}; + +const NMMetaSettingInfo * +nm_meta_setting_infos_by_name(const char *name) +{ + gssize idx; + + if (NM_MORE_ASSERTS > 10) { + guint i, j; + + for (i = 0; i < _NM_META_SETTING_TYPE_NUM; i++) { + const NMMetaSettingInfo *setting_info = &nm_meta_setting_infos[i]; + + nm_assert(setting_info->meta_type == (NMMetaSettingType) i); + nm_assert(setting_info->setting_name); + nm_assert(setting_info->setting_name[0]); + nm_assert(setting_info->get_setting_gtype); + nm_assert(setting_info->setting_priority != NM_SETTING_PRIORITY_INVALID); + if (i > 0 + && strcmp(nm_meta_setting_infos[i - 1].setting_name, setting_info->setting_name) + >= 0) { + g_error("nm_meta_setting_infos[%u, \"%s\"] is wrongly sorted before " + "nm_meta_setting_infos[%u, \"%s\"]. Rearange NMMetaSettingType enum", + i - 1, + nm_meta_setting_infos[i - 1].setting_name, + i, + setting_info->setting_name); + } + for (j = 0; j < i; j++) { + const NMMetaSettingInfo *s = &nm_meta_setting_infos[j]; + + nm_assert(setting_info->get_setting_gtype != s->get_setting_gtype); + } + } + } + + G_STATIC_ASSERT_EXPR(G_STRUCT_OFFSET(NMMetaSettingInfo, setting_name) == 0); + idx = nm_utils_array_find_binary_search(nm_meta_setting_infos, + sizeof(NMMetaSettingInfo), + _NM_META_SETTING_TYPE_NUM, + &name, + nm_strcmp_p_with_data, + NULL); + + return idx >= 0 ? &nm_meta_setting_infos[idx] : NULL; +} + +const NMMetaSettingInfo * +nm_meta_setting_infos_by_gtype(GType gtype) +{ +#if _NM_META_SETTING_BASE_IMPL_LIBNM + nm_auto_unref_gtypeclass GTypeClass *gtypeclass_unref = NULL; + GTypeClass * gtypeclass; + NMSettingClass * klass; + + if (!g_type_is_a(gtype, NM_TYPE_SETTING)) + goto out_none; + + gtypeclass = g_type_class_peek(gtype); + if (!gtypeclass) + gtypeclass = gtypeclass_unref = g_type_class_ref(gtype); + + nm_assert(NM_IS_SETTING_CLASS(gtypeclass)); + + klass = (NMSettingClass *) gtypeclass; + + if (!klass->setting_info) + goto out_none; + + nm_assert(klass->setting_info->get_setting_gtype); + nm_assert(klass->setting_info->get_setting_gtype() == gtype); + + return klass->setting_info; + +out_none: + + if (NM_MORE_ASSERTS > 10) { + int i; + + /* this might hint to a bug, but it would be expected for NM_TYPE_SETTING + * and NM_TYPE_SETTING_IP_CONFIG. + * + * Assert that we didn't lookup for a gtype, which we would expect to find. + * An assertion failure here, hints to a bug in nm_setting_*_class_init(). + */ + for (i = 0; i < _NM_META_SETTING_TYPE_NUM; i++) + nm_assert(nm_meta_setting_infos[i].get_setting_gtype() != gtype); + } + + return NULL; +#else + guint i; + + for (i = 0; i < _NM_META_SETTING_TYPE_NUM; i++) { + if (nm_meta_setting_infos[i].get_setting_gtype() == gtype) + return &nm_meta_setting_infos[i]; + } + return NULL; +#endif +} + +/*****************************************************************************/ + +NMSettingPriority +nm_meta_setting_info_get_base_type_priority(const NMMetaSettingInfo *setting_info, GType gtype) +{ + /* Historical oddity: PPPoE is a base-type even though it's not + * priority 1. It needs to be sorted *after* lower-level stuff like + * Wi-Fi security or 802.1x for secrets, but it's still allowed as a + * base type. + */ + + if (setting_info) { + if (NM_IN_SET(setting_info->setting_priority, + NM_SETTING_PRIORITY_HW_BASE, + NM_SETTING_PRIORITY_HW_NON_BASE) + || gtype == NM_TYPE_SETTING_PPPOE) + return setting_info->setting_priority; + } + + return NM_SETTING_PRIORITY_INVALID; +} + +NMSettingPriority +_nm_setting_type_get_base_type_priority(GType type) +{ + return nm_meta_setting_info_get_base_type_priority(nm_meta_setting_infos_by_gtype(type), type); +} + +/*****************************************************************************/ diff --git a/libnm-core/nm-meta-setting-base-impl.h b/libnm-core/nm-meta-setting-base-impl.h new file mode 100644 index 0000000000..94b14e844f --- /dev/null +++ b/libnm-core/nm-meta-setting-base-impl.h @@ -0,0 +1,187 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2017 - 2018 Red Hat, Inc. + */ + +#ifndef __NM_META_SETTING_BASE_IMPL_H__ +#define __NM_META_SETTING_BASE_IMPL_H__ + +#include "nm-setting-8021x.h" + +/*****************************************************************************/ + +/* + * A setting's priority should roughly follow the OSI layer model, but it also + * controls which settings get asked for secrets first. Thus settings which + * relate to things that must be working first, like hardware, should get a + * higher priority than things which layer on top of the hardware. For example, + * the GSM/CDMA settings should provide secrets before the PPP setting does, + * because a PIN is required to unlock the device before PPP can even start. + * Even settings without secrets should be assigned the right priority. + * + * 0: reserved for invalid + * + * 1: reserved for the Connection setting + * + * 2,3: hardware-related settings like Ethernet, Wi-Fi, InfiniBand, Bridge, etc. + * These priority 1 settings are also "base types", which means that at least + * one of them is required for the connection to be valid, and their name is + * valid in the 'type' property of the Connection setting. + * + * 4: hardware-related auxiliary settings that require a base setting to be + * successful first, like Wi-Fi security, 802.1x, etc. + * + * 5: hardware-independent settings that are required before IP connectivity + * can be established, like PPP, PPPoE, etc. + * + * 6: IP-level stuff + * + * 10: NMSettingUser + */ +typedef enum { /*< skip >*/ + NM_SETTING_PRIORITY_INVALID = 0, + NM_SETTING_PRIORITY_CONNECTION = 1, + NM_SETTING_PRIORITY_HW_BASE = 2, + NM_SETTING_PRIORITY_HW_NON_BASE = 3, + NM_SETTING_PRIORITY_HW_AUX = 4, + NM_SETTING_PRIORITY_AUX = 5, + NM_SETTING_PRIORITY_IP = 6, + NM_SETTING_PRIORITY_USER = 10, +} NMSettingPriority; + +/*****************************************************************************/ + +typedef enum { + NM_SETTING_802_1X_SCHEME_TYPE_CA_CERT, + NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CA_CERT, + NM_SETTING_802_1X_SCHEME_TYPE_CLIENT_CERT, + NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CLIENT_CERT, + NM_SETTING_802_1X_SCHEME_TYPE_PRIVATE_KEY, + NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_PRIVATE_KEY, + + NM_SETTING_802_1X_SCHEME_TYPE_UNKNOWN, + + _NM_SETTING_802_1X_SCHEME_TYPE_NUM = NM_SETTING_802_1X_SCHEME_TYPE_UNKNOWN, +} NMSetting8021xSchemeType; + +typedef struct { + const char *setting_key; + NMSetting8021xCKScheme (*scheme_func)(NMSetting8021x *setting); + NMSetting8021xCKFormat (*format_func)(NMSetting8021x *setting); + const char *(*path_func)(NMSetting8021x *setting); + GBytes *(*blob_func)(NMSetting8021x *setting); + const char *(*uri_func)(NMSetting8021x *setting); + const char *(*passwd_func)(NMSetting8021x *setting); + NMSettingSecretFlags (*pwflag_func)(NMSetting8021x *setting); + gboolean (*set_cert_func)(NMSetting8021x * setting, + const char * value, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError ** error); + gboolean (*set_private_key_func)(NMSetting8021x * setting, + const char * value, + const char * password, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError ** error); + const char * file_suffix; + NMSetting8021xSchemeType scheme_type; + bool is_secret : 1; +} NMSetting8021xSchemeVtable; + +extern const NMSetting8021xSchemeVtable + nm_setting_8021x_scheme_vtable[_NM_SETTING_802_1X_SCHEME_TYPE_NUM + 1]; + +/*****************************************************************************/ + +typedef enum { + /* the enum (and their numeric values) are internal API. Do not assign + * any meaning the numeric values, because they already have one: + * + * they are sorted in a way, that corresponds to the asciibetical sort + * order of the corresponding setting-name. */ + + NM_META_SETTING_TYPE_6LOWPAN, + NM_META_SETTING_TYPE_OLPC_MESH, + NM_META_SETTING_TYPE_WIRELESS, + NM_META_SETTING_TYPE_WIRELESS_SECURITY, + NM_META_SETTING_TYPE_802_1X, + NM_META_SETTING_TYPE_WIRED, + NM_META_SETTING_TYPE_ADSL, + NM_META_SETTING_TYPE_BLUETOOTH, + NM_META_SETTING_TYPE_BOND, + NM_META_SETTING_TYPE_BRIDGE, + NM_META_SETTING_TYPE_BRIDGE_PORT, + NM_META_SETTING_TYPE_CDMA, + NM_META_SETTING_TYPE_CONNECTION, + NM_META_SETTING_TYPE_DCB, + NM_META_SETTING_TYPE_DUMMY, + NM_META_SETTING_TYPE_ETHTOOL, + NM_META_SETTING_TYPE_GENERIC, + NM_META_SETTING_TYPE_GSM, + NM_META_SETTING_TYPE_HOSTNAME, + NM_META_SETTING_TYPE_INFINIBAND, + NM_META_SETTING_TYPE_IP_TUNNEL, + NM_META_SETTING_TYPE_IP4_CONFIG, + NM_META_SETTING_TYPE_IP6_CONFIG, + NM_META_SETTING_TYPE_MACSEC, + NM_META_SETTING_TYPE_MACVLAN, + NM_META_SETTING_TYPE_MATCH, + NM_META_SETTING_TYPE_OVS_BRIDGE, + NM_META_SETTING_TYPE_OVS_DPDK, + NM_META_SETTING_TYPE_OVS_EXTERNAL_IDS, + NM_META_SETTING_TYPE_OVS_INTERFACE, + NM_META_SETTING_TYPE_OVS_PATCH, + NM_META_SETTING_TYPE_OVS_PORT, + NM_META_SETTING_TYPE_PPP, + NM_META_SETTING_TYPE_PPPOE, + NM_META_SETTING_TYPE_PROXY, + NM_META_SETTING_TYPE_SERIAL, + NM_META_SETTING_TYPE_SRIOV, + NM_META_SETTING_TYPE_TC_CONFIG, + NM_META_SETTING_TYPE_TEAM, + NM_META_SETTING_TYPE_TEAM_PORT, + NM_META_SETTING_TYPE_TUN, + NM_META_SETTING_TYPE_USER, + NM_META_SETTING_TYPE_VETH, + NM_META_SETTING_TYPE_VLAN, + NM_META_SETTING_TYPE_VPN, + NM_META_SETTING_TYPE_VRF, + NM_META_SETTING_TYPE_VXLAN, + NM_META_SETTING_TYPE_WIFI_P2P, + NM_META_SETTING_TYPE_WIMAX, + NM_META_SETTING_TYPE_WIREGUARD, + NM_META_SETTING_TYPE_WPAN, + + NM_META_SETTING_TYPE_UNKNOWN, + + _NM_META_SETTING_TYPE_NUM = NM_META_SETTING_TYPE_UNKNOWN, +} NMMetaSettingType; + +#if _NM_META_SETTING_BASE_IMPL_LIBNM + #define _NMMetaSettingInfo_Alias _NMMetaSettingInfo +#else + #define _NMMetaSettingInfo_Alias _NMMetaSettingInfoCli +#endif + +struct _NMMetaSettingInfo_Alias { + const char *setting_name; + GType (*get_setting_gtype)(void); + NMMetaSettingType meta_type; + NMSettingPriority setting_priority; +}; + +typedef struct _NMMetaSettingInfo_Alias NMMetaSettingInfo; + +extern const NMMetaSettingInfo nm_meta_setting_infos[_NM_META_SETTING_TYPE_NUM + 1]; + +const NMMetaSettingInfo *nm_meta_setting_infos_by_name(const char *name); +const NMMetaSettingInfo *nm_meta_setting_infos_by_gtype(GType gtype); + +/*****************************************************************************/ + +NMSettingPriority nm_meta_setting_info_get_base_type_priority(const NMMetaSettingInfo *setting_info, + GType gtype); +NMSettingPriority _nm_setting_type_get_base_type_priority(GType type); + +#endif /* __NM_META_SETTING_BASE_IMPL_H__ */ diff --git a/libnm-core/nm-meta-setting-base.h b/libnm-core/nm-meta-setting-base.h new file mode 100644 index 0000000000..72fa8e6602 --- /dev/null +++ b/libnm-core/nm-meta-setting-base.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + +#ifndef __NM_META_SETTING_BASE_H__ +#define __NM_META_SETTING_BASE_H__ + +#define _NM_META_SETTING_BASE_IMPL_LIBNM 1 + +#include "nm-meta-setting-base-impl.h" + +#endif /* __NM_META_SETTING_BASE_H__ */ diff --git a/libnm-core/nm-property-compare.c b/libnm-core/nm-property-compare.c index 053dfbfe58..c7cf10a26b 100644 --- a/libnm-core/nm-property-compare.c +++ b/libnm-core/nm-property-compare.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-property-compare.h" diff --git a/libnm-core/nm-setting-6lowpan.c b/libnm-core/nm-setting-6lowpan.c index e90887f6c7..f71daf3258 100644 --- a/libnm-core/nm-setting-6lowpan.c +++ b/libnm-core/nm-setting-6lowpan.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-6lowpan.h" diff --git a/libnm-core/nm-setting-8021x.c b/libnm-core/nm-setting-8021x.c index 24daf3f43a..9361f035d8 100644 --- a/libnm-core/nm-setting-8021x.c +++ b/libnm-core/nm-setting-8021x.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-8021x.h" diff --git a/libnm-core/nm-setting-adsl.c b/libnm-core/nm-setting-adsl.c index 54ec5b6aa2..f26698b6da 100644 --- a/libnm-core/nm-setting-adsl.c +++ b/libnm-core/nm-setting-adsl.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-adsl.h" diff --git a/libnm-core/nm-setting-bluetooth.c b/libnm-core/nm-setting-bluetooth.c index 643b386941..eb0e59300d 100644 --- a/libnm-core/nm-setting-bluetooth.c +++ b/libnm-core/nm-setting-bluetooth.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-bluetooth.h" diff --git a/libnm-core/nm-setting-bond.c b/libnm-core/nm-setting-bond.c index a5ed07b312..2d64ef02b4 100644 --- a/libnm-core/nm-setting-bond.c +++ b/libnm-core/nm-setting-bond.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-bond.h" diff --git a/libnm-core/nm-setting-bridge-port.c b/libnm-core/nm-setting-bridge-port.c index 7d565274f9..74c6384772 100644 --- a/libnm-core/nm-setting-bridge-port.c +++ b/libnm-core/nm-setting-bridge-port.c @@ -3,7 +3,7 @@ * Copyright (C) 2012 - 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-bridge-port.h" diff --git a/libnm-core/nm-setting-bridge.c b/libnm-core/nm-setting-bridge.c index 44e4b62724..15d663db40 100644 --- a/libnm-core/nm-setting-bridge.c +++ b/libnm-core/nm-setting-bridge.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-bridge.h" diff --git a/libnm-core/nm-setting-cdma.c b/libnm-core/nm-setting-cdma.c index 2b6635a801..42e77c6169 100644 --- a/libnm-core/nm-setting-cdma.c +++ b/libnm-core/nm-setting-cdma.c @@ -3,7 +3,7 @@ * Copyright (C) 2007 - 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-cdma.h" diff --git a/libnm-core/nm-setting-connection.c b/libnm-core/nm-setting-connection.c index 16277ff18e..d6626a4d5a 100644 --- a/libnm-core/nm-setting-connection.c +++ b/libnm-core/nm-setting-connection.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-connection.h" diff --git a/libnm-core/nm-setting-dcb.c b/libnm-core/nm-setting-dcb.c index 1d5a324e4b..839d914674 100644 --- a/libnm-core/nm-setting-dcb.c +++ b/libnm-core/nm-setting-dcb.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-dcb.h" diff --git a/libnm-core/nm-setting-dummy.c b/libnm-core/nm-setting-dummy.c index 0a5f57798f..9ba626dc82 100644 --- a/libnm-core/nm-setting-dummy.c +++ b/libnm-core/nm-setting-dummy.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-dummy.h" diff --git a/libnm-core/nm-setting-ethtool.c b/libnm-core/nm-setting-ethtool.c index 7d3f4d96f9..f2c6d15e91 100644 --- a/libnm-core/nm-setting-ethtool.c +++ b/libnm-core/nm-setting-ethtool.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ethtool.h" diff --git a/libnm-core/nm-setting-generic.c b/libnm-core/nm-setting-generic.c index 564b1e5014..07dbd9b8f7 100644 --- a/libnm-core/nm-setting-generic.c +++ b/libnm-core/nm-setting-generic.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-generic.h" diff --git a/libnm-core/nm-setting-gsm.c b/libnm-core/nm-setting-gsm.c index 143e6ddaaa..c4eda96918 100644 --- a/libnm-core/nm-setting-gsm.c +++ b/libnm-core/nm-setting-gsm.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-gsm.h" diff --git a/libnm-core/nm-setting-hostname.c b/libnm-core/nm-setting-hostname.c index fa781b1fbb..2396b7bdd1 100644 --- a/libnm-core/nm-setting-hostname.c +++ b/libnm-core/nm-setting-hostname.c @@ -3,7 +3,7 @@ * Copyright (C) 2020 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-hostname.h" diff --git a/libnm-core/nm-setting-infiniband.c b/libnm-core/nm-setting-infiniband.c index 451e2fea2c..c315843c69 100644 --- a/libnm-core/nm-setting-infiniband.c +++ b/libnm-core/nm-setting-infiniband.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-infiniband.h" diff --git a/libnm-core/nm-setting-ip-config.c b/libnm-core/nm-setting-ip-config.c index 5b7081961f..45ecbd8868 100644 --- a/libnm-core/nm-setting-ip-config.c +++ b/libnm-core/nm-setting-ip-config.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ip-config.h" diff --git a/libnm-core/nm-setting-ip-tunnel.c b/libnm-core/nm-setting-ip-tunnel.c index efd7cf0989..998b816bd3 100644 --- a/libnm-core/nm-setting-ip-tunnel.c +++ b/libnm-core/nm-setting-ip-tunnel.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ip-tunnel.h" diff --git a/libnm-core/nm-setting-ip4-config.c b/libnm-core/nm-setting-ip4-config.c index 8d9c12d8ce..20fbc017bc 100644 --- a/libnm-core/nm-setting-ip4-config.c +++ b/libnm-core/nm-setting-ip4-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ip4-config.h" diff --git a/libnm-core/nm-setting-ip6-config.c b/libnm-core/nm-setting-ip6-config.c index 2b55b0a53e..06463f82f7 100644 --- a/libnm-core/nm-setting-ip6-config.c +++ b/libnm-core/nm-setting-ip6-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2007 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ip6-config.h" diff --git a/libnm-core/nm-setting-macsec.c b/libnm-core/nm-setting-macsec.c index 2e9aad1f06..d70696d95d 100644 --- a/libnm-core/nm-setting-macsec.c +++ b/libnm-core/nm-setting-macsec.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-macsec.h" diff --git a/libnm-core/nm-setting-macvlan.c b/libnm-core/nm-setting-macvlan.c index e183ca6bc1..8c8c6279be 100644 --- a/libnm-core/nm-setting-macvlan.c +++ b/libnm-core/nm-setting-macvlan.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-macvlan.h" diff --git a/libnm-core/nm-setting-match.c b/libnm-core/nm-setting-match.c index 1a6f86e8d3..108aba95f2 100644 --- a/libnm-core/nm-setting-match.c +++ b/libnm-core/nm-setting-match.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-match.h" diff --git a/libnm-core/nm-setting-olpc-mesh.c b/libnm-core/nm-setting-olpc-mesh.c index 6397759def..ef0b5d603d 100644 --- a/libnm-core/nm-setting-olpc-mesh.c +++ b/libnm-core/nm-setting-olpc-mesh.c @@ -5,7 +5,7 @@ * Copyright (C) 2009 One Laptop per Child */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-olpc-mesh.h" diff --git a/libnm-core/nm-setting-ovs-bridge.c b/libnm-core/nm-setting-ovs-bridge.c index 1a7c7b7f13..07d24d7bf0 100644 --- a/libnm-core/nm-setting-ovs-bridge.c +++ b/libnm-core/nm-setting-ovs-bridge.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ovs-bridge.h" diff --git a/libnm-core/nm-setting-ovs-dpdk.c b/libnm-core/nm-setting-ovs-dpdk.c index 97d507fe5b..6d27d78c4d 100644 --- a/libnm-core/nm-setting-ovs-dpdk.c +++ b/libnm-core/nm-setting-ovs-dpdk.c @@ -3,7 +3,7 @@ * Copyright (C) 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ovs-dpdk.h" diff --git a/libnm-core/nm-setting-ovs-external-ids.c b/libnm-core/nm-setting-ovs-external-ids.c index a0b1e6001b..16becb7272 100644 --- a/libnm-core/nm-setting-ovs-external-ids.c +++ b/libnm-core/nm-setting-ovs-external-ids.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 - 2020 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ovs-external-ids.h" diff --git a/libnm-core/nm-setting-ovs-interface.c b/libnm-core/nm-setting-ovs-interface.c index 8bdd174721..0c04a66cbb 100644 --- a/libnm-core/nm-setting-ovs-interface.c +++ b/libnm-core/nm-setting-ovs-interface.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ovs-interface.h" diff --git a/libnm-core/nm-setting-ovs-patch.c b/libnm-core/nm-setting-ovs-patch.c index 0479f395f8..18a62d2eb4 100644 --- a/libnm-core/nm-setting-ovs-patch.c +++ b/libnm-core/nm-setting-ovs-patch.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ovs-patch.h" diff --git a/libnm-core/nm-setting-ovs-port.c b/libnm-core/nm-setting-ovs-port.c index dfe13c4bc5..63da66fca1 100644 --- a/libnm-core/nm-setting-ovs-port.c +++ b/libnm-core/nm-setting-ovs-port.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ovs-port.h" diff --git a/libnm-core/nm-setting-ppp.c b/libnm-core/nm-setting-ppp.c index de0b005c27..36fe84c34b 100644 --- a/libnm-core/nm-setting-ppp.c +++ b/libnm-core/nm-setting-ppp.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-ppp.h" diff --git a/libnm-core/nm-setting-pppoe.c b/libnm-core/nm-setting-pppoe.c index 6e48cde2a5..ef1d9ba1a9 100644 --- a/libnm-core/nm-setting-pppoe.c +++ b/libnm-core/nm-setting-pppoe.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-pppoe.h" diff --git a/libnm-core/nm-setting-proxy.c b/libnm-core/nm-setting-proxy.c index 07eefad81f..10cebc7370 100644 --- a/libnm-core/nm-setting-proxy.c +++ b/libnm-core/nm-setting-proxy.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Atul Anand . */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-proxy.h" diff --git a/libnm-core/nm-setting-serial.c b/libnm-core/nm-setting-serial.c index 1758e2aff7..1e5418a149 100644 --- a/libnm-core/nm-setting-serial.c +++ b/libnm-core/nm-setting-serial.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-serial.h" diff --git a/libnm-core/nm-setting-sriov.c b/libnm-core/nm-setting-sriov.c index f2a469754a..47625a4109 100644 --- a/libnm-core/nm-setting-sriov.c +++ b/libnm-core/nm-setting-sriov.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-sriov.h" diff --git a/libnm-core/nm-setting-tc-config.c b/libnm-core/nm-setting-tc-config.c index d85fb264eb..33df6d34e5 100644 --- a/libnm-core/nm-setting-tc-config.c +++ b/libnm-core/nm-setting-tc-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-tc-config.h" diff --git a/libnm-core/nm-setting-team-port.c b/libnm-core/nm-setting-team-port.c index 0912d3711d..ea8115a74a 100644 --- a/libnm-core/nm-setting-team-port.c +++ b/libnm-core/nm-setting-team-port.c @@ -4,7 +4,7 @@ * Copyright (C) 2013 Jiri Pirko */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-team-port.h" diff --git a/libnm-core/nm-setting-team.c b/libnm-core/nm-setting-team.c index 14a116e816..f89a3031f3 100644 --- a/libnm-core/nm-setting-team.c +++ b/libnm-core/nm-setting-team.c @@ -4,7 +4,7 @@ * Copyright (C) 2013 Jiri Pirko */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-team.h" diff --git a/libnm-core/nm-setting-tun.c b/libnm-core/nm-setting-tun.c index 767a5dfde2..1208a62bad 100644 --- a/libnm-core/nm-setting-tun.c +++ b/libnm-core/nm-setting-tun.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-tun.h" diff --git a/libnm-core/nm-setting-user.c b/libnm-core/nm-setting-user.c index 3164cf47a0..f62b8babbc 100644 --- a/libnm-core/nm-setting-user.c +++ b/libnm-core/nm-setting-user.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-user.h" diff --git a/libnm-core/nm-setting-veth.c b/libnm-core/nm-setting-veth.c index 7c2e54161e..6270afb38d 100644 --- a/libnm-core/nm-setting-veth.c +++ b/libnm-core/nm-setting-veth.c @@ -3,7 +3,7 @@ * Copyright (C) 2020 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-veth.h" diff --git a/libnm-core/nm-setting-vlan.c b/libnm-core/nm-setting-vlan.c index 5543485fa2..123c11919c 100644 --- a/libnm-core/nm-setting-vlan.c +++ b/libnm-core/nm-setting-vlan.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-vlan.h" diff --git a/libnm-core/nm-setting-vpn.c b/libnm-core/nm-setting-vpn.c index 6cd5203c91..8ee5c2b972 100644 --- a/libnm-core/nm-setting-vpn.c +++ b/libnm-core/nm-setting-vpn.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-vpn.h" diff --git a/libnm-core/nm-setting-vrf.c b/libnm-core/nm-setting-vrf.c index a3ed8db71b..d4198a7b78 100644 --- a/libnm-core/nm-setting-vrf.c +++ b/libnm-core/nm-setting-vrf.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-vrf.h" diff --git a/libnm-core/nm-setting-vxlan.c b/libnm-core/nm-setting-vxlan.c index d6b22b0f2b..ea8d454681 100644 --- a/libnm-core/nm-setting-vxlan.c +++ b/libnm-core/nm-setting-vxlan.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-vxlan.h" diff --git a/libnm-core/nm-setting-wifi-p2p.c b/libnm-core/nm-setting-wifi-p2p.c index 98fadb59b2..e026cb8fbb 100644 --- a/libnm-core/nm-setting-wifi-p2p.c +++ b/libnm-core/nm-setting-wifi-p2p.c @@ -3,7 +3,7 @@ * Copyright (C) 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-wifi-p2p.h" diff --git a/libnm-core/nm-setting-wimax.c b/libnm-core/nm-setting-wimax.c index 04ea4ddd9a..dcb59412f4 100644 --- a/libnm-core/nm-setting-wimax.c +++ b/libnm-core/nm-setting-wimax.c @@ -4,7 +4,7 @@ * Copyright (C) 2009 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-wimax.h" diff --git a/libnm-core/nm-setting-wired.c b/libnm-core/nm-setting-wired.c index 748fd75ca3..857f11b1f9 100644 --- a/libnm-core/nm-setting-wired.c +++ b/libnm-core/nm-setting-wired.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-wired.h" diff --git a/libnm-core/nm-setting-wireguard.c b/libnm-core/nm-setting-wireguard.c index 37d3fa1dd6..3a36dabafb 100644 --- a/libnm-core/nm-setting-wireguard.c +++ b/libnm-core/nm-setting-wireguard.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 - 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-wireguard.h" diff --git a/libnm-core/nm-setting-wireless-security.c b/libnm-core/nm-setting-wireless-security.c index a966718c48..162f92202c 100644 --- a/libnm-core/nm-setting-wireless-security.c +++ b/libnm-core/nm-setting-wireless-security.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-wireless-security.h" diff --git a/libnm-core/nm-setting-wireless.c b/libnm-core/nm-setting-wireless.c index 20e69d66bb..232bc7a05d 100644 --- a/libnm-core/nm-setting-wireless.c +++ b/libnm-core/nm-setting-wireless.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-wireless.h" diff --git a/libnm-core/nm-setting-wpan.c b/libnm-core/nm-setting-wpan.c index 29dbdc26dc..13bd368469 100644 --- a/libnm-core/nm-setting-wpan.c +++ b/libnm-core/nm-setting-wpan.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Lubomir Rintel */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-wpan.h" diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c index 13aa4b1787..45644ac341 100644 --- a/libnm-core/nm-setting.c +++ b/libnm-core/nm-setting.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting.h" diff --git a/libnm-core/nm-simple-connection.c b/libnm-core/nm-simple-connection.c index b4c0b65c2b..6f1e3a9b3f 100644 --- a/libnm-core/nm-simple-connection.c +++ b/libnm-core/nm-simple-connection.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-simple-connection.h" diff --git a/libnm-core/nm-team-utils.c b/libnm-core/nm-team-utils.c index 8981e86ae2..b7da35aae2 100644 --- a/libnm-core/nm-team-utils.c +++ b/libnm-core/nm-team-utils.c @@ -5,7 +5,7 @@ #define NM_VALUE_TYPE_DEFINE_FUNCTIONS -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-team-utils.h" diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index ab5de92a46..e19d5ed5fc 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2005 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-utils.h" diff --git a/shared/nm-version-macros.h.in b/libnm-core/nm-version-macros.h.in similarity index 100% rename from shared/nm-version-macros.h.in rename to libnm-core/nm-version-macros.h.in diff --git a/libnm-core/nm-vpn-editor-plugin.c b/libnm-core/nm-vpn-editor-plugin.c index b5407a7551..e68bdc24ee 100644 --- a/libnm-core/nm-vpn-editor-plugin.c +++ b/libnm-core/nm-vpn-editor-plugin.c @@ -5,7 +5,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-vpn-editor-plugin.h" diff --git a/libnm-core/nm-vpn-plugin-info.c b/libnm-core/nm-vpn-plugin-info.c index fd48deef69..cb739510f1 100644 --- a/libnm-core/nm-vpn-plugin-info.c +++ b/libnm-core/nm-vpn-plugin-info.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-vpn-plugin-info.h" diff --git a/libnm-core/tests/meson.build b/libnm-core/tests/meson.build index 83ba89c476..df5209b4dc 100644 --- a/libnm-core/tests/meson.build +++ b/libnm-core/tests/meson.build @@ -4,7 +4,7 @@ enum_sources = gnome.mkenums_simple( 'nm-core-tests-enum-types', sources: 'test-general-enums.h', identifier_prefix: nm_id_prefix, - body_prefix: '#include "nm-default.h"', + body_prefix: '#include "libnm-core/nm-default-libnm-core.h"', ) test_units = [ @@ -22,14 +22,12 @@ foreach test_unit: test_units 'libnm-core-' + test_unit, [test_unit + '.c'] + enum_sources, dependencies: [ - libnm_keyfile_dep, libnm_core_dep, libnm_core_nm_default_dep, libnm_base_dep, ], c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE', + '-DG_LOG_DOMAIN="test"', ], link_with: libnm_systemd_logging_stub, ) diff --git a/libnm-core/tests/test-compare.c b/libnm-core/tests/test-compare.c index 73cf4a7a7f..27049e875a 100644 --- a/libnm-core/tests/test-compare.c +++ b/libnm-core/tests/test-compare.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include #include diff --git a/libnm-core/tests/test-crypto.c b/libnm-core/tests/test-crypto.c index d62cde0a0c..4e288b7b65 100644 --- a/libnm-core/tests/test-crypto.c +++ b/libnm-core/tests/test-crypto.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include #include diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c index abe0218140..885319fc16 100644 --- a/libnm-core/tests/test-general.c +++ b/libnm-core/tests/test-general.c @@ -5,7 +5,7 @@ #define NM_GLIB_COMPAT_H_TEST -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include #include @@ -57,7 +57,7 @@ #include "nm-setting-wireless-security.h" #include "nm-setting-wpan.h" #include "nm-simple-connection.h" -#include "nm-keyfile/nm-keyfile-internal.h" +#include "nm-keyfile-internal.h" #include "nm-glib-aux/nm-dedup-multi.h" #include "nm-base/nm-ethtool-base.h" #include "nm-base/nm-ethtool-utils-base.h" diff --git a/libnm-core/tests/test-keyfile.c b/libnm-core/tests/test-keyfile.c index eb41a7959b..b3af6c4e4a 100644 --- a/libnm-core/tests/test-keyfile.c +++ b/libnm-core/tests/test-keyfile.c @@ -3,11 +3,11 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-glib-aux/nm-json-aux.h" -#include "nm-keyfile/nm-keyfile-utils.h" -#include "nm-keyfile/nm-keyfile-internal.h" +#include "nm-keyfile-utils.h" +#include "nm-keyfile-internal.h" #include "nm-simple-connection.h" #include "nm-setting-connection.h" #include "nm-setting-wired.h" diff --git a/libnm-core/tests/test-secrets.c b/libnm-core/tests/test-secrets.c index 901d2da67e..42f1fd0a32 100644 --- a/libnm-core/tests/test-secrets.c +++ b/libnm-core/tests/test-secrets.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-setting-8021x.h" #include "nm-setting-cdma.h" diff --git a/libnm-core/tests/test-setting.c b/libnm-core/tests/test-setting.c index b17ba15d51..01cdb41cb2 100644 --- a/libnm-core/tests/test-setting.c +++ b/libnm-core/tests/test-setting.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include #include @@ -26,7 +26,7 @@ #include "nm-simple-connection.h" #include "nm-setting-connection.h" #include "nm-errors.h" -#include "nm-keyfile/nm-keyfile-internal.h" +#include "nm-keyfile-internal.h" #include "nm-utils/nm-test-utils.h" diff --git a/libnm-core/tests/test-settings-defaults.c b/libnm-core/tests/test-settings-defaults.c index d0ec11f4a7..1e6acd3c5f 100644 --- a/libnm-core/tests/test-settings-defaults.c +++ b/libnm-core/tests/test-settings-defaults.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm-core/nm-default-libnm-core.h" #include "nm-utils.h" #include "nm-setting-8021x.h" diff --git a/libnm/meson.build b/libnm/meson.build index a9d38f8de7..d0846419c5 100644 --- a/libnm/meson.build +++ b/libnm/meson.build @@ -137,13 +137,11 @@ libnm_static = static_library( libnmdbus_dep, libnm_libnm_core_intern_dep, libnm_nm_default_dep, - libnm_keyfile_dep, libnm_udev_aux_dep, libudev_dep, ], c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM', + '-DG_LOG_DOMAIN="libnm"', ], link_with: libnm_systemd_logging_stub, ) @@ -157,7 +155,6 @@ libnm = shared_library( link_whole: [ libnm_static, libnm_core, - libnm_keyfile, libnmdbus, libnm_systemd_logging_stub, libnm_glib_aux, @@ -197,7 +194,7 @@ if enable_introspection libnm_gir = gnome.generate_gir( libnm, - sources: libnm_core_sources + nm_keyfile_source + libnm_core_headers + libnm_core_enum_sources + libnm_sources + libnm_headers + libnm_enum_sources + [nm_version_macro_header], + sources: libnm_core_sources + libnm_core_headers + libnm_core_enum_sources + libnm_sources + libnm_headers + libnm_enum_sources + [nm_version_macro_header], includes: 'Gio-2.0', nsversion: nm_gir_version, namespace: 'NM', @@ -206,8 +203,8 @@ if enable_introspection header: 'NetworkManager.h', export_packages: libnm_name, extra_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM', + '-DG_LOG_DOMAIN="libnm"', + '-DNETWORKMANAGER_COMPILATION', ], install: true, ) @@ -300,8 +297,7 @@ libnm_libnm_aux = static_library( 'nm-libnm-aux/nm-libnm-aux.c', ), c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format('libnmc'), - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT', + '-DG_LOG_DOMAIN="libnmc"', ], dependencies: [ libnm_core_nm_default_dep, diff --git a/libnm/nm-access-point.c b/libnm/nm-access-point.c index 608ec28022..abe1a5538a 100644 --- a/libnm/nm-access-point.c +++ b/libnm/nm-access-point.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-access-point.h" diff --git a/libnm/nm-active-connection.c b/libnm/nm-active-connection.c index 1dfe9c90c8..80fb25115b 100644 --- a/libnm/nm-active-connection.c +++ b/libnm/nm-active-connection.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-active-connection.h" diff --git a/libnm/nm-checkpoint.c b/libnm/nm-checkpoint.c index 5cdd58729a..5fd55bc1d7 100644 --- a/libnm/nm-checkpoint.c +++ b/libnm/nm-checkpoint.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-checkpoint.h" diff --git a/libnm/nm-client.c b/libnm/nm-client.c index 9f63630ccc..2c7751965a 100644 --- a/libnm/nm-client.c +++ b/libnm/nm-client.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-client.h" diff --git a/libnm/nm-dbus-helpers.c b/libnm/nm-dbus-helpers.c index a3794b5a0b..b146185575 100644 --- a/libnm/nm-dbus-helpers.c +++ b/libnm/nm-dbus-helpers.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-dbus-helpers.h" diff --git a/libnm/nm-default-client.h b/libnm/nm-default-client.h new file mode 100644 index 0000000000..b5d1a6d318 --- /dev/null +++ b/libnm/nm-default-client.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEFAULT_CLIENT_H__ +#define __NM_DEFAULT_CLIENT_H__ + +/*****************************************************************************/ + +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" + +#undef NETWORKMANAGER_COMPILATION +#define NETWORKMANAGER_COMPILATION NM_NETWORKMANAGER_COMPILATION_CLIENT + +/*****************************************************************************/ + +#include "nm-version.h" +#include "NetworkManager.h" + +/*****************************************************************************/ + +#endif /* __NM_DEFAULT_CLIENT_H__ */ diff --git a/libnm/nm-default-libnm.h b/libnm/nm-default-libnm.h new file mode 100644 index 0000000000..799547bc84 --- /dev/null +++ b/libnm/nm-default-libnm.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEFAULT_LIBNM_H__ +#define __NM_DEFAULT_LIBNM_H__ + +/*****************************************************************************/ + +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" + +#undef NETWORKMANAGER_COMPILATION +#define NETWORKMANAGER_COMPILATION NM_NETWORKMANAGER_COMPILATION_LIBNM + +/*****************************************************************************/ + +#include "nm-version.h" +#include "nm-libnm-utils.h" + +/*****************************************************************************/ + +#endif /* __NM_DEFAULT_LIBNM_H__ */ diff --git a/libnm/nm-device-6lowpan.c b/libnm/nm-device-6lowpan.c index b08146be69..ccb8ae0103 100644 --- a/libnm/nm-device-6lowpan.c +++ b/libnm/nm-device-6lowpan.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-6lowpan.h" diff --git a/libnm/nm-device-adsl.c b/libnm/nm-device-adsl.c index f9600b3ad6..ff64cd3a54 100644 --- a/libnm/nm-device-adsl.c +++ b/libnm/nm-device-adsl.c @@ -4,7 +4,7 @@ * Copyright (C) 2009 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-adsl.h" diff --git a/libnm/nm-device-bond.c b/libnm/nm-device-bond.c index 2ff91f14aa..1214964161 100644 --- a/libnm/nm-device-bond.c +++ b/libnm/nm-device-bond.c @@ -3,7 +3,7 @@ * Copyright (C) 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-setting-bond.h" diff --git a/libnm/nm-device-bridge.c b/libnm/nm-device-bridge.c index 2cc848bedc..732c5a2ceb 100644 --- a/libnm/nm-device-bridge.c +++ b/libnm/nm-device-bridge.c @@ -3,7 +3,7 @@ * Copyright (C) 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-setting-bridge.h" diff --git a/libnm/nm-device-bt.c b/libnm/nm-device-bt.c index 605e1e8e9b..55f0a942a2 100644 --- a/libnm/nm-device-bt.c +++ b/libnm/nm-device-bt.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-bt.h" diff --git a/libnm/nm-device-dummy.c b/libnm/nm-device-dummy.c index dd326535e8..6b92810230 100644 --- a/libnm/nm-device-dummy.c +++ b/libnm/nm-device-dummy.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-dummy.h" diff --git a/libnm/nm-device-ethernet.c b/libnm/nm-device-ethernet.c index cf5efcaf02..b7173c806b 100644 --- a/libnm/nm-device-ethernet.c +++ b/libnm/nm-device-ethernet.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-ethernet.h" diff --git a/libnm/nm-device-generic.c b/libnm/nm-device-generic.c index 7a724242e0..ebc73a7e9c 100644 --- a/libnm/nm-device-generic.c +++ b/libnm/nm-device-generic.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-generic.h" diff --git a/libnm/nm-device-infiniband.c b/libnm/nm-device-infiniband.c index 9500ff353f..820a4ab438 100644 --- a/libnm/nm-device-infiniband.c +++ b/libnm/nm-device-infiniband.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-infiniband.h" diff --git a/libnm/nm-device-ip-tunnel.c b/libnm/nm-device-ip-tunnel.c index 005307eb3d..a6d2ef4a4c 100644 --- a/libnm/nm-device-ip-tunnel.c +++ b/libnm/nm-device-ip-tunnel.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-ip-tunnel.h" diff --git a/libnm/nm-device-macsec.c b/libnm/nm-device-macsec.c index 10d902c4b9..3d6e1d388d 100644 --- a/libnm/nm-device-macsec.c +++ b/libnm/nm-device-macsec.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-macsec.h" diff --git a/libnm/nm-device-macvlan.c b/libnm/nm-device-macvlan.c index d29fc79d17..773de99009 100644 --- a/libnm/nm-device-macvlan.c +++ b/libnm/nm-device-macvlan.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-setting-macvlan.h" diff --git a/libnm/nm-device-modem.c b/libnm/nm-device-modem.c index 06db196d4c..51b49feabe 100644 --- a/libnm/nm-device-modem.c +++ b/libnm/nm-device-modem.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-modem.h" diff --git a/libnm/nm-device-olpc-mesh.c b/libnm/nm-device-olpc-mesh.c index 573556b36a..697b3381e0 100644 --- a/libnm/nm-device-olpc-mesh.c +++ b/libnm/nm-device-olpc-mesh.c @@ -3,7 +3,7 @@ * Copyright (C) 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-olpc-mesh.h" diff --git a/libnm/nm-device-ovs-bridge.c b/libnm/nm-device-ovs-bridge.c index f2f9553666..9c17554899 100644 --- a/libnm/nm-device-ovs-bridge.c +++ b/libnm/nm-device-ovs-bridge.c @@ -3,7 +3,7 @@ * Copyright (C) 2017, 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-ovs-bridge.h" diff --git a/libnm/nm-device-ovs-interface.c b/libnm/nm-device-ovs-interface.c index 8148b6cd2d..1c757a5b49 100644 --- a/libnm/nm-device-ovs-interface.c +++ b/libnm/nm-device-ovs-interface.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-ovs-interface.h" diff --git a/libnm/nm-device-ovs-port.c b/libnm/nm-device-ovs-port.c index dfad8bcbab..1b3faa53f1 100644 --- a/libnm/nm-device-ovs-port.c +++ b/libnm/nm-device-ovs-port.c @@ -3,7 +3,7 @@ * Copyright (C) 2017, 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-ovs-port.h" diff --git a/libnm/nm-device-ppp.c b/libnm/nm-device-ppp.c index c693a4f64c..a1c1f74184 100644 --- a/libnm/nm-device-ppp.c +++ b/libnm/nm-device-ppp.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-ppp.h" diff --git a/libnm/nm-device-team.c b/libnm/nm-device-team.c index d75acce687..d76dd5c1c1 100644 --- a/libnm/nm-device-team.c +++ b/libnm/nm-device-team.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Jiri Pirko */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-team.h" diff --git a/libnm/nm-device-tun.c b/libnm/nm-device-tun.c index aed354813b..0445da9aa4 100644 --- a/libnm/nm-device-tun.c +++ b/libnm/nm-device-tun.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-tun.h" diff --git a/libnm/nm-device-veth.c b/libnm/nm-device-veth.c index 34f1cdaf1d..9a9f768011 100644 --- a/libnm/nm-device-veth.c +++ b/libnm/nm-device-veth.c @@ -3,7 +3,7 @@ * Copyright (C) 2020 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-veth.h" diff --git a/libnm/nm-device-vlan.c b/libnm/nm-device-vlan.c index 4b39993d63..e7419b23ee 100644 --- a/libnm/nm-device-vlan.c +++ b/libnm/nm-device-vlan.c @@ -3,7 +3,7 @@ * Copyright (C) 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-vlan.h" diff --git a/libnm/nm-device-vrf.c b/libnm/nm-device-vrf.c index 3d2dcb6878..73f2770723 100644 --- a/libnm/nm-device-vrf.c +++ b/libnm/nm-device-vrf.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-vrf.h" diff --git a/libnm/nm-device-vxlan.c b/libnm/nm-device-vxlan.c index b31580188f..36d95f91f3 100644 --- a/libnm/nm-device-vxlan.c +++ b/libnm/nm-device-vxlan.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-vxlan.h" diff --git a/libnm/nm-device-wifi-p2p.c b/libnm/nm-device-wifi-p2p.c index 60425806c7..019bf1cf6a 100644 --- a/libnm/nm-device-wifi-p2p.c +++ b/libnm/nm-device-wifi-p2p.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 - 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-wifi-p2p.h" diff --git a/libnm/nm-device-wifi.c b/libnm/nm-device-wifi.c index 9c602206f1..90e4a302f2 100644 --- a/libnm/nm-device-wifi.c +++ b/libnm/nm-device-wifi.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-wifi.h" diff --git a/libnm/nm-device-wimax.c b/libnm/nm-device-wimax.c index 37c55347f4..9b42354c7a 100644 --- a/libnm/nm-device-wimax.c +++ b/libnm/nm-device-wimax.c @@ -4,7 +4,7 @@ * Copyright (C) 2009 Novell, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-wimax.h" diff --git a/libnm/nm-device-wireguard.c b/libnm/nm-device-wireguard.c index 1a978845aa..a4baec4f17 100644 --- a/libnm/nm-device-wireguard.c +++ b/libnm/nm-device-wireguard.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Javier Arteaga */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-wireguard.h" diff --git a/libnm/nm-device-wpan.c b/libnm/nm-device-wpan.c index 5d94c8ea76..7218a8c604 100644 --- a/libnm/nm-device-wpan.c +++ b/libnm/nm-device-wpan.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Lubomir Rintel */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device-wpan.h" diff --git a/libnm/nm-device.c b/libnm/nm-device.c index 031ce43d30..9cb88dae8e 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-device.h" diff --git a/libnm/nm-dhcp-config.c b/libnm/nm-dhcp-config.c index b76cbe94e8..ec7da6ded0 100644 --- a/libnm/nm-dhcp-config.c +++ b/libnm/nm-dhcp-config.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-dhcp-config.h" diff --git a/libnm/nm-dhcp4-config.c b/libnm/nm-dhcp4-config.c index be280694f0..25219d45f3 100644 --- a/libnm/nm-dhcp4-config.c +++ b/libnm/nm-dhcp4-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-dhcp4-config.h" diff --git a/libnm/nm-dhcp6-config.c b/libnm/nm-dhcp6-config.c index 3659f608f8..2574b36cfd 100644 --- a/libnm/nm-dhcp6-config.c +++ b/libnm/nm-dhcp6-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-dhcp6-config.h" diff --git a/libnm/nm-dns-manager.c b/libnm/nm-dns-manager.c index ada97871be..6261c71ac6 100644 --- a/libnm/nm-dns-manager.c +++ b/libnm/nm-dns-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-dns-manager.h" diff --git a/libnm/nm-enum-types.c.template b/libnm/nm-enum-types.c.template index 5abd5c794c..ccad218c07 100644 --- a/libnm/nm-enum-types.c.template +++ b/libnm/nm-enum-types.c.template @@ -2,7 +2,8 @@ #include "config.h" #include "nm-enum-types.h" -#include "nm-default.h" +# +#include "libnm/nm-default-libnm.h" #include "nm-version-macros.h" #include "NetworkManager.h" diff --git a/libnm/nm-enum-types.h.template b/libnm/nm-enum-types.h.template index 3bd86cce00..bc70af134a 100644 --- a/libnm/nm-enum-types.h.template +++ b/libnm/nm-enum-types.h.template @@ -3,6 +3,7 @@ #define __NM_ENUM_TYPES_H__ #include "nm-core-enum-types.h" +# #include G_BEGIN_DECLS diff --git a/libnm/nm-ip-config.c b/libnm/nm-ip-config.c index 3c2b221119..1663c62257 100644 --- a/libnm/nm-ip-config.c +++ b/libnm/nm-ip-config.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-ip-config.h" diff --git a/libnm/nm-ip4-config.c b/libnm/nm-ip4-config.c index a73fc9f80b..6c4a4ab3ad 100644 --- a/libnm/nm-ip4-config.c +++ b/libnm/nm-ip4-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-ip4-config.h" diff --git a/libnm/nm-ip6-config.c b/libnm/nm-ip6-config.c index a58da8efa3..19c869c6f6 100644 --- a/libnm/nm-ip6-config.c +++ b/libnm/nm-ip6-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-ip6-config.h" diff --git a/libnm/nm-libnm-aux/nm-libnm-aux.c b/libnm/nm-libnm-aux/nm-libnm-aux.c index 90152b5896..2b8d2c2ef9 100644 --- a/libnm/nm-libnm-aux/nm-libnm-aux.c +++ b/libnm/nm-libnm-aux/nm-libnm-aux.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-libnm-aux.h" diff --git a/libnm/nm-libnm-utils.c b/libnm/nm-libnm-utils.c index fc843bc951..1fb6a47c3d 100644 --- a/libnm/nm-libnm-utils.c +++ b/libnm/nm-libnm-utils.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-libnm-utils.h" diff --git a/libnm/nm-object.c b/libnm/nm-object.c index 8b8dfd4950..00e520d7e5 100644 --- a/libnm/nm-object.c +++ b/libnm/nm-object.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-object.h" diff --git a/libnm/nm-remote-connection.c b/libnm/nm-remote-connection.c index 70e43bacee..b5b12bf020 100644 --- a/libnm/nm-remote-connection.c +++ b/libnm/nm-remote-connection.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-remote-connection.h" diff --git a/libnm/nm-secret-agent-old.c b/libnm/nm-secret-agent-old.c index 3b64c665db..8f826ed86b 100644 --- a/libnm/nm-secret-agent-old.c +++ b/libnm/nm-secret-agent-old.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-secret-agent-old.h" diff --git a/libnm/nm-vpn-connection.c b/libnm/nm-vpn-connection.c index e7ae3bf1d0..cdbaefc032 100644 --- a/libnm/nm-vpn-connection.c +++ b/libnm/nm-vpn-connection.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-vpn-connection.h" diff --git a/libnm/nm-vpn-editor.c b/libnm/nm-vpn-editor.c index c2b9f1f761..e326958881 100644 --- a/libnm/nm-vpn-editor.c +++ b/libnm/nm-vpn-editor.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 Novell, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-vpn-editor.h" diff --git a/libnm/nm-vpn-plugin-old.c b/libnm/nm-vpn-plugin-old.c index b082663098..f45d0c09e9 100644 --- a/libnm/nm-vpn-plugin-old.c +++ b/libnm/nm-vpn-plugin-old.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-vpn-plugin-old.h" diff --git a/libnm/nm-vpn-service-plugin.c b/libnm/nm-vpn-service-plugin.c index 52e065784b..34de21b875 100644 --- a/libnm/nm-vpn-service-plugin.c +++ b/libnm/nm-vpn-service-plugin.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-vpn-service-plugin.h" diff --git a/libnm/nm-wifi-p2p-peer.c b/libnm/nm-wifi-p2p-peer.c index 75a37757f7..cab4648ecf 100644 --- a/libnm/nm-wifi-p2p-peer.c +++ b/libnm/nm-wifi-p2p-peer.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 - 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-wifi-p2p-peer.h" diff --git a/libnm/nm-wimax-nsp.c b/libnm/nm-wimax-nsp.c index 0a853d83e7..421fe9e7ab 100644 --- a/libnm/nm-wimax-nsp.c +++ b/libnm/nm-wimax-nsp.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-wimax-nsp.h" diff --git a/libnm/tests/meson.build b/libnm/tests/meson.build index 71dc83e706..08eecfbdee 100644 --- a/libnm/tests/meson.build +++ b/libnm/tests/meson.build @@ -20,8 +20,7 @@ foreach test_unit: test_units libnm_nm_default_dep, ], c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM', + '-DG_LOG_DOMAIN="test"', ], link_with: libnm_static, ) @@ -41,7 +40,6 @@ libnm_vpn_plugin_utils_test = static_library( include_directories: libnm_inc, dependencies: libnm_nm_default_dep, c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM', + '-DG_LOG_DOMAIN="test"', ], ) diff --git a/libnm/tests/test-libnm.c b/libnm/tests/test-libnm.c index 48f4bc789f..a90acd9b10 100644 --- a/libnm/tests/test-libnm.c +++ b/libnm/tests/test-libnm.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #if defined(HAVE_DECL_MEMFD_CREATE) && HAVE_DECL_MEMFD_CREATE #include diff --git a/libnm/tests/test-nm-client.c b/libnm/tests/test-nm-client.c index 42eafae20b..5452c623b2 100644 --- a/libnm/tests/test-nm-client.c +++ b/libnm/tests/test-nm-client.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include #include diff --git a/libnm/tests/test-remote-settings-client.c b/libnm/tests/test-remote-settings-client.c index 9a99cfac85..0e7b744d52 100644 --- a/libnm/tests/test-remote-settings-client.c +++ b/libnm/tests/test-remote-settings-client.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include #include diff --git a/libnm/tests/test-secret-agent.c b/libnm/tests/test-secret-agent.c index bc1e6247e5..08c77f8c87 100644 --- a/libnm/tests/test-secret-agent.c +++ b/libnm/tests/test-secret-agent.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include #include diff --git a/meson.build b/meson.build index 59ff11b99a..6f1ab6282f 100644 --- a/meson.build +++ b/meson.build @@ -809,6 +809,11 @@ test( args: [source_root], ) +test( + 'check-tree', + find_program(join_paths(source_root, 'tools', 'check-tree.sh')), +) + # Tests, utilities and documentation tests = get_option('tests') enable_tests = (tests != 'no') diff --git a/po/POTFILES.in b/po/POTFILES.in index e48d9a8e29..21507eecee 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -56,8 +56,8 @@ libnm-core/nm-crypto-gnutls.c libnm-core/nm-crypto-nss.c libnm-core/nm-connection.c libnm-core/nm-dbus-utils.c -libnm-core/nm-keyfile/nm-keyfile-utils.c -libnm-core/nm-keyfile/nm-keyfile.c +libnm-core/nm-keyfile-utils.c +libnm-core/nm-keyfile.c libnm-core/nm-libnm-core-aux/nm-libnm-core-aux.c libnm-core/nm-libnm-core-intern/nm-libnm-core-utils.c libnm-core/nm-setting-6lowpan.c diff --git a/shared/meson.build b/shared/meson.build index 86a50ddef9..52eb6b9b10 100644 --- a/shared/meson.build +++ b/shared/meson.build @@ -94,14 +94,6 @@ libn_dhcp4_dep = declare_dependency( link_with: libn_dhcp4, ) -nm_version_macro_header = configure_file( - input: 'nm-version-macros.h.in', - output: '@BASENAME@', - configuration: data_conf, -) - -nm_meta_setting_source = files('nm-meta-setting.c') - nm_test_utils_impl_source = files('nm-test-utils-impl.c') nm_vpn_plugin_utils_source = files('nm-utils/nm-vpn-plugin-utils.c') @@ -114,8 +106,7 @@ libnm_std_aux = static_library( ], include_directories: top_inc, c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=0', + '-DG_LOG_DOMAIN="libnm"', ], ) @@ -139,8 +130,7 @@ libnm_glib_aux = static_library( ), dependencies: glib_nm_default_dep, c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)', + '-DG_LOG_DOMAIN="libnm"', ], link_with: [ libc_siphash, @@ -161,8 +151,7 @@ libnm_udev_aux = static_library( libudev_dep, ], c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)', + '-DG_LOG_DOMAIN="libnm"', ], ) @@ -178,8 +167,7 @@ libnm_base = static_library( ), dependencies: libnm_glib_aux_dep, c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)', + '-DG_LOG_DOMAIN="libnm"', ], ) @@ -198,7 +186,6 @@ libnm_log_core = static_library( ], c_args: [ '-DG_LOG_DOMAIN="NetworkManager"', - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)', ], ) @@ -222,7 +209,6 @@ libnm_platform = static_library( ], c_args: [ '-DG_LOG_DOMAIN="NetworkManager"', - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)', ], ) @@ -283,8 +269,7 @@ libnm_systemd_shared = static_library( ), dependencies: glib_nm_default_dep, c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED', + '-DG_LOG_DOMAIN="libnm"', ], ) @@ -303,8 +288,7 @@ libnm_systemd_logging_stub = static_library( sources: 'systemd/nm-logging-stub.c', dependencies: glib_nm_default_dep, c_args: [ - '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED', + '-DG_LOG_DOMAIN="libnm"', ], ) diff --git a/shared/nm-base/nm-ethtool-base.c b/shared/nm-base/nm-ethtool-base.c index a2f662769d..52ff28714a 100644 --- a/shared/nm-base/nm-ethtool-base.c +++ b/shared/nm-base/nm-ethtool-base.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-ethtool-base.h" diff --git a/shared/nm-base/nm-ethtool-utils-base.h b/shared/nm-base/nm-ethtool-utils-base.h deleted file mode 120000 index ee2598578b..0000000000 --- a/shared/nm-base/nm-ethtool-utils-base.h +++ /dev/null @@ -1 +0,0 @@ -../../libnm/nm-ethtool-utils.h \ No newline at end of file diff --git a/shared/nm-base/nm-ethtool-utils-base.h b/shared/nm-base/nm-ethtool-utils-base.h new file mode 100644 index 0000000000..d422724bab --- /dev/null +++ b/shared/nm-base/nm-ethtool-utils-base.h @@ -0,0 +1,107 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2018 Red Hat, Inc. + */ + +#ifndef __NM_ETHTOOL_UTILS_H__ +#define __NM_ETHTOOL_UTILS_H__ + +G_BEGIN_DECLS + +/*****************************************************************************/ + +#define NM_ETHTOOL_OPTNAME_FEATURE_ESP_HW_OFFLOAD "feature-esp-hw-offload" +#define NM_ETHTOOL_OPTNAME_FEATURE_ESP_TX_CSUM_HW_OFFLOAD "feature-esp-tx-csum-hw-offload" +#define NM_ETHTOOL_OPTNAME_FEATURE_FCOE_MTU "feature-fcoe-mtu" +#define NM_ETHTOOL_OPTNAME_FEATURE_GRO "feature-gro" +#define NM_ETHTOOL_OPTNAME_FEATURE_GSO "feature-gso" +#define NM_ETHTOOL_OPTNAME_FEATURE_HIGHDMA "feature-highdma" +#define NM_ETHTOOL_OPTNAME_FEATURE_HW_TC_OFFLOAD "feature-hw-tc-offload" +#define NM_ETHTOOL_OPTNAME_FEATURE_L2_FWD_OFFLOAD "feature-l2-fwd-offload" +#define NM_ETHTOOL_OPTNAME_FEATURE_LOOPBACK "feature-loopback" +#define NM_ETHTOOL_OPTNAME_FEATURE_LRO "feature-lro" +#define NM_ETHTOOL_OPTNAME_FEATURE_MACSEC_HW_OFFLOAD "feature-macsec-hw-offload" +#define NM_ETHTOOL_OPTNAME_FEATURE_NTUPLE "feature-ntuple" +#define NM_ETHTOOL_OPTNAME_FEATURE_RX "feature-rx" +#define NM_ETHTOOL_OPTNAME_FEATURE_RXHASH "feature-rxhash" +#define NM_ETHTOOL_OPTNAME_FEATURE_RXVLAN "feature-rxvlan" +#define NM_ETHTOOL_OPTNAME_FEATURE_RX_ALL "feature-rx-all" +#define NM_ETHTOOL_OPTNAME_FEATURE_RX_FCS "feature-rx-fcs" +#define NM_ETHTOOL_OPTNAME_FEATURE_RX_GRO_HW "feature-rx-gro-hw" +#define NM_ETHTOOL_OPTNAME_FEATURE_RX_GRO_LIST "feature-rx-gro-list" +#define NM_ETHTOOL_OPTNAME_FEATURE_RX_UDP_GRO_FORWARDING "feature-rx-udp-gro-forwarding" +#define NM_ETHTOOL_OPTNAME_FEATURE_RX_UDP_TUNNEL_PORT_OFFLOAD "feature-rx-udp_tunnel-port-offload" +#define NM_ETHTOOL_OPTNAME_FEATURE_RX_VLAN_FILTER "feature-rx-vlan-filter" +#define NM_ETHTOOL_OPTNAME_FEATURE_RX_VLAN_STAG_FILTER "feature-rx-vlan-stag-filter" +#define NM_ETHTOOL_OPTNAME_FEATURE_RX_VLAN_STAG_HW_PARSE "feature-rx-vlan-stag-hw-parse" +#define NM_ETHTOOL_OPTNAME_FEATURE_SG "feature-sg" +#define NM_ETHTOOL_OPTNAME_FEATURE_TLS_HW_RECORD "feature-tls-hw-record" +#define NM_ETHTOOL_OPTNAME_FEATURE_TLS_HW_RX_OFFLOAD "feature-tls-hw-rx-offload" +#define NM_ETHTOOL_OPTNAME_FEATURE_TLS_HW_TX_OFFLOAD "feature-tls-hw-tx-offload" +#define NM_ETHTOOL_OPTNAME_FEATURE_TSO "feature-tso" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX "feature-tx" +#define NM_ETHTOOL_OPTNAME_FEATURE_TXVLAN "feature-txvlan" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_CHECKSUM_FCOE_CRC "feature-tx-checksum-fcoe-crc" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_CHECKSUM_IPV4 "feature-tx-checksum-ipv4" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_CHECKSUM_IPV6 "feature-tx-checksum-ipv6" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_CHECKSUM_IP_GENERIC "feature-tx-checksum-ip-generic" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_CHECKSUM_SCTP "feature-tx-checksum-sctp" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_ESP_SEGMENTATION "feature-tx-esp-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_FCOE_SEGMENTATION "feature-tx-fcoe-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_GRE_CSUM_SEGMENTATION "feature-tx-gre-csum-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_GRE_SEGMENTATION "feature-tx-gre-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_GSO_LIST "feature-tx-gso-list" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_GSO_PARTIAL "feature-tx-gso-partial" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_GSO_ROBUST "feature-tx-gso-robust" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_IPXIP4_SEGMENTATION "feature-tx-ipxip4-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_IPXIP6_SEGMENTATION "feature-tx-ipxip6-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_NOCACHE_COPY "feature-tx-nocache-copy" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_SCATTER_GATHER "feature-tx-scatter-gather" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_SCATTER_GATHER_FRAGLIST "feature-tx-scatter-gather-fraglist" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_SCTP_SEGMENTATION "feature-tx-sctp-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_TCP6_SEGMENTATION "feature-tx-tcp6-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_TCP_ECN_SEGMENTATION "feature-tx-tcp-ecn-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_TCP_MANGLEID_SEGMENTATION \ + "feature-tx-tcp-mangleid-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_TCP_SEGMENTATION "feature-tx-tcp-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_TUNNEL_REMCSUM_SEGMENTATION \ + "feature-tx-tunnel-remcsum-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_UDP_SEGMENTATION "feature-tx-udp-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_UDP_TNL_CSUM_SEGMENTATION \ + "feature-tx-udp_tnl-csum-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_UDP_TNL_SEGMENTATION "feature-tx-udp_tnl-segmentation" +#define NM_ETHTOOL_OPTNAME_FEATURE_TX_VLAN_STAG_HW_INSERT "feature-tx-vlan-stag-hw-insert" + +#define NM_ETHTOOL_OPTNAME_COALESCE_ADAPTIVE_RX "coalesce-adaptive-rx" +#define NM_ETHTOOL_OPTNAME_COALESCE_ADAPTIVE_TX "coalesce-adaptive-tx" +#define NM_ETHTOOL_OPTNAME_COALESCE_PKT_RATE_HIGH "coalesce-pkt-rate-high" +#define NM_ETHTOOL_OPTNAME_COALESCE_PKT_RATE_LOW "coalesce-pkt-rate-low" +#define NM_ETHTOOL_OPTNAME_COALESCE_RX_FRAMES "coalesce-rx-frames" +#define NM_ETHTOOL_OPTNAME_COALESCE_RX_FRAMES_HIGH "coalesce-rx-frames-high" +#define NM_ETHTOOL_OPTNAME_COALESCE_RX_FRAMES_IRQ "coalesce-rx-frames-irq" +#define NM_ETHTOOL_OPTNAME_COALESCE_RX_FRAMES_LOW "coalesce-rx-frames-low" +#define NM_ETHTOOL_OPTNAME_COALESCE_RX_USECS "coalesce-rx-usecs" +#define NM_ETHTOOL_OPTNAME_COALESCE_RX_USECS_HIGH "coalesce-rx-usecs-high" +#define NM_ETHTOOL_OPTNAME_COALESCE_RX_USECS_IRQ "coalesce-rx-usecs-irq" +#define NM_ETHTOOL_OPTNAME_COALESCE_RX_USECS_LOW "coalesce-rx-usecs-low" +#define NM_ETHTOOL_OPTNAME_COALESCE_SAMPLE_INTERVAL "coalesce-sample-interval" +#define NM_ETHTOOL_OPTNAME_COALESCE_STATS_BLOCK_USECS "coalesce-stats-block-usecs" +#define NM_ETHTOOL_OPTNAME_COALESCE_TX_FRAMES "coalesce-tx-frames" +#define NM_ETHTOOL_OPTNAME_COALESCE_TX_FRAMES_HIGH "coalesce-tx-frames-high" +#define NM_ETHTOOL_OPTNAME_COALESCE_TX_FRAMES_IRQ "coalesce-tx-frames-irq" +#define NM_ETHTOOL_OPTNAME_COALESCE_TX_FRAMES_LOW "coalesce-tx-frames-low" +#define NM_ETHTOOL_OPTNAME_COALESCE_TX_USECS "coalesce-tx-usecs" +#define NM_ETHTOOL_OPTNAME_COALESCE_TX_USECS_HIGH "coalesce-tx-usecs-high" +#define NM_ETHTOOL_OPTNAME_COALESCE_TX_USECS_IRQ "coalesce-tx-usecs-irq" +#define NM_ETHTOOL_OPTNAME_COALESCE_TX_USECS_LOW "coalesce-tx-usecs-low" + +#define NM_ETHTOOL_OPTNAME_RING_RX "ring-rx" +#define NM_ETHTOOL_OPTNAME_RING_RX_JUMBO "ring-rx-jumbo" +#define NM_ETHTOOL_OPTNAME_RING_RX_MINI "ring-rx-mini" +#define NM_ETHTOOL_OPTNAME_RING_TX "ring-tx" + +/*****************************************************************************/ + +G_END_DECLS + +#endif /* __NM_ETHTOOL_UTILS_H__ */ diff --git a/shared/nm-default.h b/shared/nm-default.h deleted file mode 100644 index c285f3e1ea..0000000000 --- a/shared/nm-default.h +++ /dev/null @@ -1,237 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* - * Copyright (C) 2015 Red Hat, Inc. - */ - -/* With autotools (and also meson), all our source files are expected to include . - * as very first header. Then they are expected to include "config-extra.h" and a small set - * of headers that we always want to have included (depending on what sources we compile - * (as determined by NETWORKMANAGER_COMPILATION define) that can be "nm-glib-aux/nm-macros-internal.h" - * and similar. - * - * To simplify that, all our source files are only expected to include "nm-default.h" as first, - * and thereby rely on getting a basic set of headers already. - */ - -#ifndef __NM_DEFAULT_H__ -#define __NM_DEFAULT_H__ - -#define NM_NETWORKMANAGER_COMPILATION_WITH_GLIB (1 << 0) -#define NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB (1 << 1) -#define NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG (1 << 2) -#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM (1 << 3) -#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE (1 << 4) -#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE (1 << 5) -#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL (1 << 6) -#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE (1 << 7) -#define NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON (1 << 10) -#define NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD (1 << 11) - -#define NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \ - (0 | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \ - | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB \ - | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE \ - | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE \ - | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL) - -#define NM_NETWORKMANAGER_COMPILATION_LIBNM \ - (0 | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \ - | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM \ - | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE \ - | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE \ - | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL) - -#define NM_NETWORKMANAGER_COMPILATION_CLIENT \ - (0 | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \ - | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG \ - | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE) - -#define NM_NETWORKMANAGER_COMPILATION_DAEMON \ - (0 | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \ - | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG \ - | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE \ - | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL \ - | 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_SYSTEMD_SHARED) - -#define NM_NETWORKMANAGER_COMPILATION_GLIB (0 | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB) - -#ifndef NETWORKMANAGER_COMPILATION - #error Define NETWORKMANAGER_COMPILATION accordingly -#endif - -#ifndef G_LOG_DOMAIN - #if defined(NETWORKMANAGER_COMPILATION_TEST) - #define G_LOG_DOMAIN "test" - #elif NETWORKMANAGER_COMPILATION & NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON - #define G_LOG_DOMAIN "NetworkManager" - #else - #error Need to define G_LOG_DOMAIN - #endif -#endif - -/*****************************************************************************/ - -/* always include these headers for our internal source files. */ - -#ifndef ___CONFIG_H__ - #define ___CONFIG_H__ - #include -#endif - -#include "config-extra.h" - -/* for internal compilation we don't want the deprecation macros - * to be in effect. Define the widest range of versions to effectively - * disable deprecation checks */ -#define NM_VERSION_MIN_REQUIRED NM_VERSION_0_9_8 - -#ifndef NM_MORE_ASSERTS - #define NM_MORE_ASSERTS 0 -#endif - -#if NM_MORE_ASSERTS == 0 - /* The cast macros like NM_TYPE() are implemented via G_TYPE_CHECK_INSTANCE_CAST() - * and _G_TYPE_CIC(). The latter, by default performs runtime checks of the type - * by calling g_type_check_instance_cast(). - * This check has a certain overhead without being helpful. - * - * Example 1: - * static void foo (NMType *obj) - * { - * access_obj_without_check (obj); - * } - * foo ((NMType *) obj); - * // There is no runtime check and passing an invalid pointer - * // leads to a crash. - * - * Example 2: - * static void foo (NMType *obj) - * { - * access_obj_without_check (obj); - * } - * foo (NM_TYPE (obj)); - * // There is a runtime check which prints a g_warning(), but that doesn't - * // avoid the crash as NM_TYPE() cannot do anything then passing on the - * // invalid pointer. - * - * Example 3: - * static void foo (NMType *obj) - * { - * g_return_if_fail (NM_IS_TYPE (obj)); - * access_obj_without_check (obj); - * } - * foo ((NMType *) obj); - * // There is a runtime check which prints a g_critical() which also avoids - * // the crash. That is actually helpful to catch bugs and avoid crashes. - * - * Example 4: - * static void foo (NMType *obj) - * { - * g_return_if_fail (NM_IS_TYPE (obj)); - * access_obj_without_check (obj); - * } - * foo (NM_TYPE (obj)); - * // The runtime check is performed twice, with printing a g_warning() and - * // a g_critical() and avoiding the crash. - * - * Example 3 is how it should be done. Type checks in NM_TYPE() are pointless. - * Disable them for our production builds. - */ - #ifndef G_DISABLE_CAST_CHECKS - #define G_DISABLE_CAST_CHECKS - #endif -#endif - -#if NM_MORE_ASSERTS == 0 - #ifndef G_DISABLE_CAST_CHECKS - /* Unless compiling with G_DISABLE_CAST_CHECKS, glib performs type checking - * during G_VARIANT_TYPE() via g_variant_type_checked_(). This is not necessary - * because commonly this cast is needed during something like - * - * g_variant_builder_init (&props, G_VARIANT_TYPE ("a{sv}")); - * - * Note that in if the variant type would be invalid, the check still - * wouldn't make the buggy code magically work. Instead of passing a - * bogus type string (bad), it would pass %NULL to g_variant_builder_init() - * (also bad). - * - * Also, a function like g_variant_builder_init() already validates - * the input type via something like - * - * g_return_if_fail (g_variant_type_is_container (type)); - * - * So, by having G_VARIANT_TYPE() also validate the type, we validate - * twice, whereas the first validation is rather pointless because it - * doesn't prevent the function to be called with invalid arguments. - * - * Just patch G_VARIANT_TYPE() to perform no check. - */ - #undef G_VARIANT_TYPE - #define G_VARIANT_TYPE(type_string) ((const GVariantType *) (type_string)) - #endif -#endif - -#include - -/*****************************************************************************/ - -#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_GLIB - - #include - - #if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG - #if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB - #error Cannot define NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG and NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB - #endif - #include - #elif (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB - #include - #endif - - /*****************************************************************************/ - - #include "nm-gassert-patch.h" - - #include "nm-std-aux/nm-std-aux.h" - #include "nm-std-aux/nm-std-utils.h" - #include "nm-glib-aux/nm-macros-internal.h" - #include "nm-glib-aux/nm-shared-utils.h" - #include "nm-glib-aux/nm-errno.h" - #include "nm-glib-aux/nm-hash-utils.h" - - /*****************************************************************************/ - - #if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE - #include "nm-version.h" - #endif - - /*****************************************************************************/ - - #if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON - #include "nm-core-types.h" - #include "nm-types.h" - #include "nm-log-core/nm-logging.h" - #endif - - #if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE - #include "nm-libnm-utils.h" - #endif - - #if ((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM) \ - && !((NETWORKMANAGER_COMPILATION) \ - & (NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE \ - | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL)) - #include "NetworkManager.h" - #endif - -#endif /* NM_NETWORKMANAGER_COMPILATION_WITH_GLIB */ - -/*****************************************************************************/ - -#endif /* __NM_DEFAULT_H__ */ diff --git a/shared/nm-glib-aux/nm-dbus-aux.c b/shared/nm-glib-aux/nm-dbus-aux.c index e4ba5234ca..ec409ff1fa 100644 --- a/shared/nm-glib-aux/nm-dbus-aux.c +++ b/shared/nm-glib-aux/nm-dbus-aux.c @@ -3,7 +3,7 @@ * Copyright (C) 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-dbus-aux.h" diff --git a/shared/nm-glib-aux/nm-dedup-multi.c b/shared/nm-glib-aux/nm-dedup-multi.c index 498e543e95..99da3b3502 100644 --- a/shared/nm-glib-aux/nm-dedup-multi.c +++ b/shared/nm-glib-aux/nm-dedup-multi.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-dedup-multi.h" diff --git a/shared/nm-glib-aux/nm-default-glib-i18n-lib.h b/shared/nm-glib-aux/nm-default-glib-i18n-lib.h new file mode 100644 index 0000000000..9393d1921e --- /dev/null +++ b/shared/nm-glib-aux/nm-default-glib-i18n-lib.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEFAULT_GLIB_I18N_LIB_H__ +#define __NM_DEFAULT_GLIB_I18N_LIB_H__ + +/*****************************************************************************/ + +#define _NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB + +#include "nm-glib-aux/nm-default-glib.h" + +#undef NETWORKMANAGER_COMPILATION +#define NETWORKMANAGER_COMPILATION \ + (NM_NETWORKMANAGER_COMPILATION_GLIB | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB) + +/*****************************************************************************/ + +#endif /* __NM_DEFAULT_GLIB_I18N_LIB_H__ */ diff --git a/shared/nm-glib-aux/nm-default-glib-i18n-prog.h b/shared/nm-glib-aux/nm-default-glib-i18n-prog.h new file mode 100644 index 0000000000..0abe807b9d --- /dev/null +++ b/shared/nm-glib-aux/nm-default-glib-i18n-prog.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEFAULT_GLIB_I18N_PROG_H__ +#define __NM_DEFAULT_GLIB_I18N_PROG_H__ + +/*****************************************************************************/ + +#define _NETWORKMANAGER_COMPILATION_GLIB_I18N_PROG + +#include "nm-glib-aux/nm-default-glib.h" + +#undef NETWORKMANAGER_COMPILATION +#define NETWORKMANAGER_COMPILATION \ + (NM_NETWORKMANAGER_COMPILATION_GLIB | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG) + +/*****************************************************************************/ + +#endif /* __NM_DEFAULT_GLIB_I18N_PROG_H__ */ diff --git a/shared/nm-glib-aux/nm-default-glib.h b/shared/nm-glib-aux/nm-default-glib.h new file mode 100644 index 0000000000..34b23f7761 --- /dev/null +++ b/shared/nm-glib-aux/nm-default-glib.h @@ -0,0 +1,75 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEFAULT_GLIB_H__ +#define __NM_DEFAULT_GLIB_H__ + +/*****************************************************************************/ + +#include "nm-std-aux/nm-default-std.h" + +#undef NETWORKMANAGER_COMPILATION +#define NETWORKMANAGER_COMPILATION NM_NETWORKMANAGER_COMPILATION_WITH_GLIB + +/*****************************************************************************/ + +#include + +#if defined(_NETWORKMANAGER_COMPILATION_GLIB_I18N_PROG) + #if defined(_NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB) + #error Cannot define _NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB and _NETWORKMANAGER_COMPILATION_GLIB_I18N_PROG together + #endif + #undef _NETWORKMANAGER_COMPILATION_GLIB_I18N_PROG + #include +#elif defined(_NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB) + #undef _NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB + #include +#endif + +/*****************************************************************************/ + +#if NM_MORE_ASSERTS == 0 + #ifndef G_DISABLE_CAST_CHECKS + /* Unless compiling with G_DISABLE_CAST_CHECKS, glib performs type checking + * during G_VARIANT_TYPE() via g_variant_type_checked_(). This is not necessary + * because commonly this cast is needed during something like + * + * g_variant_builder_init (&props, G_VARIANT_TYPE ("a{sv}")); + * + * Note that in if the variant type would be invalid, the check still + * wouldn't make the buggy code magically work. Instead of passing a + * bogus type string (bad), it would pass %NULL to g_variant_builder_init() + * (also bad). + * + * Also, a function like g_variant_builder_init() already validates + * the input type via something like + * + * g_return_if_fail (g_variant_type_is_container (type)); + * + * So, by having G_VARIANT_TYPE() also validate the type, we validate + * twice, whereas the first validation is rather pointless because it + * doesn't prevent the function to be called with invalid arguments. + * + * Just patch G_VARIANT_TYPE() to perform no check. + */ + #undef G_VARIANT_TYPE + #define G_VARIANT_TYPE(type_string) ((const GVariantType *) (type_string)) + #endif +#endif + +/*****************************************************************************/ + +#include "nm-gassert-patch.h" + +#include "nm-std-aux/nm-std-aux.h" +#include "nm-std-aux/nm-std-utils.h" +#include "nm-glib-aux/nm-macros-internal.h" +#include "nm-glib-aux/nm-shared-utils.h" +#include "nm-glib-aux/nm-errno.h" +#include "nm-glib-aux/nm-hash-utils.h" + +/*****************************************************************************/ + +#endif /* __NM_DEFAULT_GLIB_H__ */ diff --git a/shared/nm-glib-aux/nm-enum-utils.c b/shared/nm-glib-aux/nm-enum-utils.c index 9b778d6ba5..b06f2bb2fb 100644 --- a/shared/nm-glib-aux/nm-enum-utils.c +++ b/shared/nm-glib-aux/nm-enum-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-enum-utils.h" #include "nm-str-buf.h" diff --git a/shared/nm-glib-aux/nm-errno.c b/shared/nm-glib-aux/nm-errno.c index 37e884c9c7..668606cacd 100644 --- a/shared/nm-glib-aux/nm-errno.c +++ b/shared/nm-glib-aux/nm-errno.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-errno.h" diff --git a/shared/nm-gassert-patch.h b/shared/nm-glib-aux/nm-gassert-patch.h similarity index 100% rename from shared/nm-gassert-patch.h rename to shared/nm-glib-aux/nm-gassert-patch.h diff --git a/shared/nm-glib-aux/nm-hash-utils.c b/shared/nm-glib-aux/nm-hash-utils.c index ec101843ca..29349b1d0d 100644 --- a/shared/nm-glib-aux/nm-hash-utils.c +++ b/shared/nm-glib-aux/nm-hash-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-hash-utils.h" diff --git a/shared/nm-glib-aux/nm-io-utils.c b/shared/nm-glib-aux/nm-io-utils.c index 3ccdcd8435..429591ad22 100644 --- a/shared/nm-glib-aux/nm-io-utils.c +++ b/shared/nm-glib-aux/nm-io-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-io-utils.h" diff --git a/shared/nm-glib-aux/nm-json-aux.c b/shared/nm-glib-aux/nm-json-aux.c index 2fa8ee880f..97ee606fe0 100644 --- a/shared/nm-glib-aux/nm-json-aux.c +++ b/shared/nm-glib-aux/nm-json-aux.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 - 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-json-aux.h" diff --git a/shared/nm-glib-aux/nm-keyfile-aux.c b/shared/nm-glib-aux/nm-keyfile-aux.c index 7a3ab95ade..b59627128f 100644 --- a/shared/nm-glib-aux/nm-keyfile-aux.c +++ b/shared/nm-glib-aux/nm-keyfile-aux.c @@ -3,7 +3,7 @@ * Copyright (C) 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-keyfile-aux.h" diff --git a/shared/nm-glib-aux/nm-logging-base.c b/shared/nm-glib-aux/nm-logging-base.c index 5e11d7ee81..66b591b21e 100644 --- a/shared/nm-glib-aux/nm-logging-base.c +++ b/shared/nm-glib-aux/nm-logging-base.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-logging-base.h" diff --git a/shared/nm-glib-aux/nm-random-utils.c b/shared/nm-glib-aux/nm-random-utils.c index 2ab38e45de..c95d368dd3 100644 --- a/shared/nm-glib-aux/nm-random-utils.c +++ b/shared/nm-glib-aux/nm-random-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-random-utils.h" diff --git a/shared/nm-glib-aux/nm-ref-string.c b/shared/nm-glib-aux/nm-ref-string.c index aa76582c84..902f1c802a 100644 --- a/shared/nm-glib-aux/nm-ref-string.c +++ b/shared/nm-glib-aux/nm-ref-string.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-ref-string.h" diff --git a/shared/nm-glib-aux/nm-secret-utils.c b/shared/nm-glib-aux/nm-secret-utils.c index d5dd5f8eb3..8188b503a3 100644 --- a/shared/nm-glib-aux/nm-secret-utils.c +++ b/shared/nm-glib-aux/nm-secret-utils.c @@ -4,7 +4,7 @@ * Copyright (C) 2015 - 2019 Jason A. Donenfeld . All Rights Reserved. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-secret-utils.h" diff --git a/shared/nm-glib-aux/nm-shared-utils.c b/shared/nm-glib-aux/nm-shared-utils.c index 8e3f1879bd..492a3d5098 100644 --- a/shared/nm-glib-aux/nm-shared-utils.c +++ b/shared/nm-glib-aux/nm-shared-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-shared-utils.h" diff --git a/shared/nm-glib-aux/nm-time-utils.c b/shared/nm-glib-aux/nm-time-utils.c index 44e6b7bf6c..df98176a12 100644 --- a/shared/nm-glib-aux/nm-time-utils.c +++ b/shared/nm-glib-aux/nm-time-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-time-utils.h" diff --git a/shared/nm-glib-aux/tests/meson.build b/shared/nm-glib-aux/tests/meson.build index d1f23eedc0..464f4e7c86 100644 --- a/shared/nm-glib-aux/tests/meson.build +++ b/shared/nm-glib-aux/tests/meson.build @@ -4,8 +4,7 @@ exe = executable( 'test-shared-general', 'test-shared-general.c', c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)', + '-DG_LOG_DOMAIN="test"', ], dependencies: libnm_glib_aux_dep, link_with: libnm_systemd_logging_stub, @@ -23,8 +22,7 @@ if jansson_dep.found() 'test-json-aux', 'test-json-aux.c', c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)', + '-DG_LOG_DOMAIN="test"', ], dependencies: [ libnm_glib_aux_dep, diff --git a/shared/nm-glib-aux/tests/test-json-aux.c b/shared/nm-glib-aux/tests/test-json-aux.c index 9275e6713f..b07d673fa6 100644 --- a/shared/nm-glib-aux/tests/test-json-aux.c +++ b/shared/nm-glib-aux/tests/test-json-aux.c @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#define NM_TEST_UTILS_NO_LIBNM 1 - -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-prog.h" #include diff --git a/shared/nm-glib-aux/tests/test-shared-general.c b/shared/nm-glib-aux/tests/test-shared-general.c index d0fdedd516..f42c6fb108 100644 --- a/shared/nm-glib-aux/tests/test-shared-general.c +++ b/shared/nm-glib-aux/tests/test-shared-general.c @@ -3,9 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#define NM_TEST_UTILS_NO_LIBNM 1 - -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-prog.h" #include "nm-std-aux/unaligned.h" #include "nm-glib-aux/nm-random-utils.h" diff --git a/shared/nm-log-core/nm-logging.c b/shared/nm-log-core/nm-logging.c index 495d5aca3c..cf3c3a8657 100644 --- a/shared/nm-log-core/nm-logging.c +++ b/shared/nm-log-core/nm-logging.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-logging.h" diff --git a/shared/nm-platform/nm-netlink.c b/shared/nm-platform/nm-netlink.c index f9ebd1b623..7a6d7e045b 100644 --- a/shared/nm-platform/nm-netlink.c +++ b/shared/nm-platform/nm-netlink.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-netlink.h" diff --git a/shared/nm-platform/nm-platform-utils.c b/shared/nm-platform/nm-platform-utils.c index 53ef2746bf..c1c5b1a356 100644 --- a/shared/nm-platform/nm-platform-utils.c +++ b/shared/nm-platform/nm-platform-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-platform-utils.h" diff --git a/shared/nm-platform/nmp-netns.c b/shared/nm-platform/nmp-netns.c index 01aefde66a..c7cb617b7e 100644 --- a/shared/nm-platform/nmp-netns.c +++ b/shared/nm-platform/nmp-netns.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nmp-netns.h" diff --git a/shared/nm-platform/tests/meson.build b/shared/nm-platform/tests/meson.build index 8d2b9c0f6e..a8fcdbca8e 100644 --- a/shared/nm-platform/tests/meson.build +++ b/shared/nm-platform/tests/meson.build @@ -4,8 +4,7 @@ exe = executable( 'test-nm-platform', 'test-nm-platform.c', c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)', + '-DG_LOG_DOMAIN="test"', ], dependencies: [ libnm_log_core_dep, diff --git a/shared/nm-platform/tests/test-nm-platform.c b/shared/nm-platform/tests/test-nm-platform.c index 0386a3a546..a3e9ff13ba 100644 --- a/shared/nm-platform/tests/test-nm-platform.c +++ b/shared/nm-platform/tests/test-nm-platform.c @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#define NM_TEST_UTILS_NO_LIBNM 1 - -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-prog.h" #include "nm-log-core/nm-logging.h" #include "nm-platform/nm-netlink.h" diff --git a/shared/nm-std-aux/nm-default-std.h b/shared/nm-std-aux/nm-default-std.h new file mode 100644 index 0000000000..fe16d35fe2 --- /dev/null +++ b/shared/nm-std-aux/nm-default-std.h @@ -0,0 +1,102 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEFAULT_STD_H__ +#define __NM_DEFAULT_STD_H__ + +#include "nm-networkmanager-compilation.h" + +#ifdef NETWORKMANAGER_COMPILATION + #error Dont define NETWORKMANAGER_COMPILATION +#endif + +#ifndef G_LOG_DOMAIN + #error Define G_LOG_DOMAIN +#endif + +/*****************************************************************************/ + +#define NETWORKMANAGER_COMPILATION 0 + +/*****************************************************************************/ + +/* always include these headers for our internal source files. */ + +#ifndef ___CONFIG_H__ + #define ___CONFIG_H__ + #include +#endif + +#include "config-extra.h" + +/* for internal compilation we don't want the deprecation macros + * to be in effect. Define the widest range of versions to effectively + * disable deprecation checks */ +#define NM_VERSION_MIN_REQUIRED NM_VERSION_0_9_8 + +#ifndef NM_MORE_ASSERTS + #define NM_MORE_ASSERTS 0 +#endif + +#if NM_MORE_ASSERTS == 0 + /* The cast macros like NM_TYPE() are implemented via G_TYPE_CHECK_INSTANCE_CAST() + * and _G_TYPE_CIC(). The latter, by default performs runtime checks of the type + * by calling g_type_check_instance_cast(). + * This check has a certain overhead without being helpful. + * + * Example 1: + * static void foo (NMType *obj) + * { + * access_obj_without_check (obj); + * } + * foo ((NMType *) obj); + * // There is no runtime check and passing an invalid pointer + * // leads to a crash. + * + * Example 2: + * static void foo (NMType *obj) + * { + * access_obj_without_check (obj); + * } + * foo (NM_TYPE (obj)); + * // There is a runtime check which prints a g_warning(), but that doesn't + * // avoid the crash as NM_TYPE() cannot do anything then passing on the + * // invalid pointer. + * + * Example 3: + * static void foo (NMType *obj) + * { + * g_return_if_fail (NM_IS_TYPE (obj)); + * access_obj_without_check (obj); + * } + * foo ((NMType *) obj); + * // There is a runtime check which prints a g_critical() which also avoids + * // the crash. That is actually helpful to catch bugs and avoid crashes. + * + * Example 4: + * static void foo (NMType *obj) + * { + * g_return_if_fail (NM_IS_TYPE (obj)); + * access_obj_without_check (obj); + * } + * foo (NM_TYPE (obj)); + * // The runtime check is performed twice, with printing a g_warning() and + * // a g_critical() and avoiding the crash. + * + * Example 3 is how it should be done. Type checks in NM_TYPE() are pointless. + * Disable them for our production builds. + */ + #ifndef G_DISABLE_CAST_CHECKS + #define G_DISABLE_CAST_CHECKS + #endif +#endif + +/*****************************************************************************/ + +#include + +/*****************************************************************************/ + +#endif /* __NM_DEFAULT_STD_H__ */ diff --git a/shared/nm-std-aux/nm-networkmanager-compilation.h b/shared/nm-std-aux/nm-networkmanager-compilation.h new file mode 100644 index 0000000000..025a158d34 --- /dev/null +++ b/shared/nm-std-aux/nm-networkmanager-compilation.h @@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_NETWORKMANAGER_COMPILATION_H__ +#define __NM_NETWORKMANAGER_COMPILATION_H__ + +#define NM_NETWORKMANAGER_COMPILATION_WITH_GLIB (1 << 0) +#define NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB (1 << 1) +#define NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG (1 << 2) +#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM (1 << 3) +#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE (1 << 4) +#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE (1 << 5) +#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL (1 << 6) +#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE (1 << 7) +#define NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON (1 << 10) +#define NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD (1 << 11) + +#define NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \ + (0 | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \ + | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB \ + | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE \ + | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE \ + | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL) + +#define NM_NETWORKMANAGER_COMPILATION_LIBNM \ + (0 | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \ + | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM \ + | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE \ + | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE \ + | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL) + +#define NM_NETWORKMANAGER_COMPILATION_CLIENT \ + (0 | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \ + | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG \ + | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE) + +#define NM_NETWORKMANAGER_COMPILATION_DAEMON \ + (0 | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \ + | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG \ + | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE \ + | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL \ + | 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_SYSTEMD_SHARED) + +#define NM_NETWORKMANAGER_COMPILATION_GLIB (0 | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB) + +#endif /* __NM_NETWORKMANAGER_COMPILATION_H__ */ diff --git a/shared/nm-std-aux/nm-std-utils.c b/shared/nm-std-aux/nm-std-utils.c index 8c76237156..18692b198c 100644 --- a/shared/nm-std-aux/nm-std-utils.c +++ b/shared/nm-std-aux/nm-std-utils.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "nm-default-std.h" #include "nm-std-utils.h" diff --git a/shared/nm-test-utils-impl.c b/shared/nm-test-utils-impl.c index 36ef190552..f8f98d8170 100644 --- a/shared/nm-test-utils-impl.c +++ b/shared/nm-test-utils-impl.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include diff --git a/shared/nm-udev-aux/nm-udev-utils.c b/shared/nm-udev-aux/nm-udev-utils.c index f7e8e6d9f1..0b941dff53 100644 --- a/shared/nm-udev-aux/nm-udev-utils.c +++ b/shared/nm-udev-aux/nm-udev-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-udev-utils.h" diff --git a/shared/nm-utils/nm-compat.c b/shared/nm-utils/nm-compat.c index 62e6ea3bb6..dad4822755 100644 --- a/shared/nm-utils/nm-compat.c +++ b/shared/nm-utils/nm-compat.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-libnm.h" #include "nm-compat.h" diff --git a/shared/nm-utils/nm-test-utils.h b/shared/nm-utils/nm-test-utils.h index 66d5ae2796..14446562f4 100644 --- a/shared/nm-utils/nm-test-utils.h +++ b/shared/nm-utils/nm-test-utils.h @@ -6,10 +6,6 @@ #ifndef __NM_TEST_UTILS_H__ #define __NM_TEST_UTILS_H__ -#if defined(NETWORKMANAGER_COMPILATION) && !defined(NETWORKMANAGER_COMPILATION_TEST) - #error Need to mark the compilation with NETWORKMANAGER_COMPILATION_TEST. -#endif - /******************************************************************************* * HOWTO run tests. * @@ -84,8 +80,6 @@ * *******************************************************************************/ -#include "nm-default.h" - #if defined(NM_ASSERT_NO_MSG) && NM_ASSERT_NO_MSG #undef g_return_if_fail_warning #undef g_assertion_message_expr @@ -98,10 +92,6 @@ #include #include -#ifndef NM_TEST_UTILS_NO_LIBNM - #include "nm-utils.h" -#endif - /*****************************************************************************/ #define NMTST_G_RETURN_MSG_S(expr) "*: assertion '" NM_ASSERT_G_RETURN_EXPR(expr) "' failed" diff --git a/shared/nm-utils/nm-vpn-plugin-utils.c b/shared/nm-utils/nm-vpn-plugin-utils.c index 6a057e8520..89285ecd2f 100644 --- a/shared/nm-utils/nm-vpn-plugin-utils.c +++ b/shared/nm-utils/nm-vpn-plugin-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2016, 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "libnm/nm-default-client.h" #include "nm-vpn-plugin-utils.h" diff --git a/shared/systemd/nm-default-systemd-shared.h b/shared/systemd/nm-default-systemd-shared.h new file mode 100644 index 0000000000..bc0e6c4ca0 --- /dev/null +++ b/shared/systemd/nm-default-systemd-shared.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEFAULT_SYSTEMD_SHARED_H__ +#define __NM_DEFAULT_SYSTEMD_SHARED_H__ + +/*****************************************************************************/ + +#include "nm-glib-aux/nm-default-glib.h" + +#undef NETWORKMANAGER_COMPILATION +#define NETWORKMANAGER_COMPILATION NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED + +/*****************************************************************************/ + +#endif /* __NM_DEFAULT_SYSTEMD_SHARED_H__ */ diff --git a/shared/systemd/nm-logging-stub.c b/shared/systemd/nm-logging-stub.c index b875e61696..8db90cd9eb 100644 --- a/shared/systemd/nm-logging-stub.c +++ b/shared/systemd/nm-logging-stub.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "shared/systemd/nm-default-systemd-shared.h" #include "nm-glib-aux/nm-logging-fwd.h" diff --git a/shared/systemd/nm-sd-utils-shared.c b/shared/systemd/nm-sd-utils-shared.c index 55854854e5..c93e89c630 100644 --- a/shared/systemd/nm-sd-utils-shared.c +++ b/shared/systemd/nm-sd-utils-shared.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "shared/systemd/nm-default-systemd-shared.h" #include "nm-sd-utils-shared.h" diff --git a/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h b/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h index 41cfb1c976..b094ce40b6 100644 --- a/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h +++ b/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h @@ -6,7 +6,7 @@ #ifndef __NM_SD_ADAPT_SHARED_H__ #define __NM_SD_ADAPT_SHARED_H__ -#include "nm-default.h" +#include "shared/systemd/nm-default-systemd-shared.h" #include "nm-glib-aux/nm-logging-fwd.h" diff --git a/src/core/NetworkManagerUtils.c b/src/core/NetworkManagerUtils.c index d55df95e13..5407221097 100644 --- a/src/core/NetworkManagerUtils.c +++ b/src/core/NetworkManagerUtils.c @@ -4,7 +4,7 @@ * Copyright (C) 2005 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "NetworkManagerUtils.h" diff --git a/src/core/devices/adsl/nm-atm-manager.c b/src/core/devices/adsl/nm-atm-manager.c index eab723d5f1..9be9b5ce43 100644 --- a/src/core/devices/adsl/nm-atm-manager.c +++ b/src/core/devices/adsl/nm-atm-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2009 - 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/devices/adsl/nm-device-adsl.c b/src/core/devices/adsl/nm-device-adsl.c index 29a73ba14e..34c062a8db 100644 --- a/src/core/devices/adsl/nm-device-adsl.c +++ b/src/core/devices/adsl/nm-device-adsl.c @@ -3,7 +3,7 @@ * Pantelis Koukousoulas */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-adsl.h" diff --git a/src/core/devices/bluetooth/nm-bluez-manager.c b/src/core/devices/bluetooth/nm-bluez-manager.c index 3343b6ede9..dd998d29b0 100644 --- a/src/core/devices/bluetooth/nm-bluez-manager.c +++ b/src/core/devices/bluetooth/nm-bluez-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-bluez-manager.h" diff --git a/src/core/devices/bluetooth/nm-bluez5-dun.c b/src/core/devices/bluetooth/nm-bluez5-dun.c index d803b748e0..e29884d8b9 100644 --- a/src/core/devices/bluetooth/nm-bluez5-dun.c +++ b/src/core/devices/bluetooth/nm-bluez5-dun.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/devices/bluetooth/nm-bt-error.c b/src/core/devices/bluetooth/nm-bt-error.c index ed091474aa..2e49eb7acf 100644 --- a/src/core/devices/bluetooth/nm-bt-error.c +++ b/src/core/devices/bluetooth/nm-bt-error.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-bt-error.h" diff --git a/src/core/devices/bluetooth/nm-device-bt.c b/src/core/devices/bluetooth/nm-device-bt.c index 0515d29c11..c07be2d3b9 100644 --- a/src/core/devices/bluetooth/nm-device-bt.c +++ b/src/core/devices/bluetooth/nm-device-bt.c @@ -3,7 +3,7 @@ * Copyright (C) 2009 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-bt.h" diff --git a/src/core/devices/bluetooth/tests/nm-bt-test.c b/src/core/devices/bluetooth/tests/nm-bt-test.c index 546c06a77e..0fc8aa872c 100644 --- a/src/core/devices/bluetooth/tests/nm-bt-test.c +++ b/src/core/devices/bluetooth/tests/nm-bt-test.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/devices/nm-acd-manager.c b/src/core/devices/nm-acd-manager.c index 82b7146d86..b95f90fd45 100644 --- a/src/core/devices/nm-acd-manager.c +++ b/src/core/devices/nm-acd-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-acd-manager.h" diff --git a/src/core/devices/nm-device-6lowpan.c b/src/core/devices/nm-device-6lowpan.c index 7c0be5978b..fe116dd47a 100644 --- a/src/core/devices/nm-device-6lowpan.c +++ b/src/core/devices/nm-device-6lowpan.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-6lowpan.h" diff --git a/src/core/devices/nm-device-bond.c b/src/core/devices/nm-device-bond.c index 5671a42ef5..f68c080b18 100644 --- a/src/core/devices/nm-device-bond.c +++ b/src/core/devices/nm-device-bond.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-bond.h" diff --git a/src/core/devices/nm-device-bridge.c b/src/core/devices/nm-device-bridge.c index 6557558d4c..c919d85dfb 100644 --- a/src/core/devices/nm-device-bridge.c +++ b/src/core/devices/nm-device-bridge.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-bridge.h" diff --git a/src/core/devices/nm-device-dummy.c b/src/core/devices/nm-device-dummy.c index 5ec0b7fe7f..13cfd3b0a3 100644 --- a/src/core/devices/nm-device-dummy.c +++ b/src/core/devices/nm-device-dummy.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-dummy.h" diff --git a/src/core/devices/nm-device-ethernet-utils.c b/src/core/devices/nm-device-ethernet-utils.c index 50da2678e3..a36d12b723 100644 --- a/src/core/devices/nm-device-ethernet-utils.c +++ b/src/core/devices/nm-device-ethernet-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-ethernet-utils.h" diff --git a/src/core/devices/nm-device-ethernet.c b/src/core/devices/nm-device-ethernet.c index 1c6c300e15..44428869cd 100644 --- a/src/core/devices/nm-device-ethernet.c +++ b/src/core/devices/nm-device-ethernet.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-ethernet.h" diff --git a/src/core/devices/nm-device-factory.c b/src/core/devices/nm-device-factory.c index 7034202823..81124a8dc3 100644 --- a/src/core/devices/nm-device-factory.c +++ b/src/core/devices/nm-device-factory.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-factory.h" diff --git a/src/core/devices/nm-device-generic.c b/src/core/devices/nm-device-generic.c index 17ff407099..a319666a9c 100644 --- a/src/core/devices/nm-device-generic.c +++ b/src/core/devices/nm-device-generic.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-generic.h" diff --git a/src/core/devices/nm-device-infiniband.c b/src/core/devices/nm-device-infiniband.c index af1a49b2a4..f54ffcf038 100644 --- a/src/core/devices/nm-device-infiniband.c +++ b/src/core/devices/nm-device-infiniband.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-infiniband.h" diff --git a/src/core/devices/nm-device-ip-tunnel.c b/src/core/devices/nm-device-ip-tunnel.c index 9124c44643..da6afb3b50 100644 --- a/src/core/devices/nm-device-ip-tunnel.c +++ b/src/core/devices/nm-device-ip-tunnel.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-ip-tunnel.h" diff --git a/src/core/devices/nm-device-macsec.c b/src/core/devices/nm-device-macsec.c index 390cc6dccd..51b820a165 100644 --- a/src/core/devices/nm-device-macsec.c +++ b/src/core/devices/nm-device-macsec.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-macsec.h" diff --git a/src/core/devices/nm-device-macvlan.c b/src/core/devices/nm-device-macvlan.c index 051f9d6784..e8b39ed6b0 100644 --- a/src/core/devices/nm-device-macvlan.c +++ b/src/core/devices/nm-device-macvlan.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 - 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-macvlan.h" diff --git a/src/core/devices/nm-device-ppp.c b/src/core/devices/nm-device-ppp.c index e8a2cb8a09..4040f2d316 100644 --- a/src/core/devices/nm-device-ppp.c +++ b/src/core/devices/nm-device-ppp.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-ppp.h" diff --git a/src/core/devices/nm-device-tun.c b/src/core/devices/nm-device-tun.c index c4dd4b47bb..edca69e9fa 100644 --- a/src/core/devices/nm-device-tun.c +++ b/src/core/devices/nm-device-tun.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 - 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-tun.h" diff --git a/src/core/devices/nm-device-veth.c b/src/core/devices/nm-device-veth.c index 0fc76b1b86..e0ba843df7 100644 --- a/src/core/devices/nm-device-veth.c +++ b/src/core/devices/nm-device-veth.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/devices/nm-device-vlan.c b/src/core/devices/nm-device-vlan.c index edb16ed1ed..bfde60efec 100644 --- a/src/core/devices/nm-device-vlan.c +++ b/src/core/devices/nm-device-vlan.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-vlan.h" diff --git a/src/core/devices/nm-device-vrf.c b/src/core/devices/nm-device-vrf.c index 6e672b665f..4fec59ba5a 100644 --- a/src/core/devices/nm-device-vrf.c +++ b/src/core/devices/nm-device-vrf.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-vrf.h" diff --git a/src/core/devices/nm-device-vxlan.c b/src/core/devices/nm-device-vxlan.c index 763aee95e5..f16a52c4b1 100644 --- a/src/core/devices/nm-device-vxlan.c +++ b/src/core/devices/nm-device-vxlan.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 - 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-vxlan.h" diff --git a/src/core/devices/nm-device-wireguard.c b/src/core/devices/nm-device-wireguard.c index 1b109969ee..fd057ded9c 100644 --- a/src/core/devices/nm-device-wireguard.c +++ b/src/core/devices/nm-device-wireguard.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Javier Arteaga */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-wireguard.h" diff --git a/src/core/devices/nm-device-wpan.c b/src/core/devices/nm-device-wpan.c index 05b48a70d3..2f3b16ff8a 100644 --- a/src/core/devices/nm-device-wpan.c +++ b/src/core/devices/nm-device-wpan.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Lubomir Rintel */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-manager.h" #include "nm-device-wpan.h" diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index e572e8143a..040dd0b4d3 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device.h" diff --git a/src/core/devices/nm-lldp-listener.c b/src/core/devices/nm-lldp-listener.c index e645b9d620..c60fb3ada6 100644 --- a/src/core/devices/nm-lldp-listener.c +++ b/src/core/devices/nm-lldp-listener.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-lldp-listener.h" diff --git a/src/core/devices/ovs/nm-device-ovs-bridge.c b/src/core/devices/ovs/nm-device-ovs-bridge.c index 1b7035bd9d..3ae8a4813c 100644 --- a/src/core/devices/ovs/nm-device-ovs-bridge.c +++ b/src/core/devices/ovs/nm-device-ovs-bridge.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-ovs-bridge.h" diff --git a/src/core/devices/ovs/nm-device-ovs-interface.c b/src/core/devices/ovs/nm-device-ovs-interface.c index b9d3d509e9..5d07c2117e 100644 --- a/src/core/devices/ovs/nm-device-ovs-interface.c +++ b/src/core/devices/ovs/nm-device-ovs-interface.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-ovs-interface.h" diff --git a/src/core/devices/ovs/nm-device-ovs-port.c b/src/core/devices/ovs/nm-device-ovs-port.c index 5f7a697d8f..2ecb95e881 100644 --- a/src/core/devices/ovs/nm-device-ovs-port.c +++ b/src/core/devices/ovs/nm-device-ovs-port.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-ovs-port.h" diff --git a/src/core/devices/ovs/nm-ovs-factory.c b/src/core/devices/ovs/nm-ovs-factory.c index d5875bc118..e7af38d83d 100644 --- a/src/core/devices/ovs/nm-ovs-factory.c +++ b/src/core/devices/ovs/nm-ovs-factory.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-manager.h" #include "nm-ovsdb.h" diff --git a/src/core/devices/ovs/nm-ovsdb.c b/src/core/devices/ovs/nm-ovsdb.c index de54a2e6c9..da3a7989a8 100644 --- a/src/core/devices/ovs/nm-ovsdb.c +++ b/src/core/devices/ovs/nm-ovsdb.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-ovsdb.h" diff --git a/src/core/devices/team/nm-device-team.c b/src/core/devices/team/nm-device-team.c index 7b7a679617..d2d717298d 100644 --- a/src/core/devices/team/nm-device-team.c +++ b/src/core/devices/team/nm-device-team.c @@ -4,7 +4,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-team.h" diff --git a/src/core/devices/team/nm-team-factory.c b/src/core/devices/team/nm-team-factory.c index ce623e29e2..57b51bf843 100644 --- a/src/core/devices/team/nm-team-factory.c +++ b/src/core/devices/team/nm-team-factory.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/devices/tests/test-acd.c b/src/core/devices/tests/test-acd.c index 875dfff9e1..b0af59db43 100644 --- a/src/core/devices/tests/test-acd.c +++ b/src/core/devices/tests/test-acd.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "n-acd/src/n-acd.h" diff --git a/src/core/devices/tests/test-lldp.c b/src/core/devices/tests/test-lldp.c index 04c3b5b6fe..27f0b4be8f 100644 --- a/src/core/devices/tests/test-lldp.c +++ b/src/core/devices/tests/test-lldp.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/devices/wifi/nm-device-iwd.c b/src/core/devices/wifi/nm-device-iwd.c index 8bfdcaa309..63c5255607 100644 --- a/src/core/devices/wifi/nm-device-iwd.c +++ b/src/core/devices/wifi/nm-device-iwd.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Intel Corporation */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-iwd.h" diff --git a/src/core/devices/wifi/nm-device-olpc-mesh.c b/src/core/devices/wifi/nm-device-olpc-mesh.c index 1554411617..af83c4a334 100644 --- a/src/core/devices/wifi/nm-device-olpc-mesh.c +++ b/src/core/devices/wifi/nm-device-olpc-mesh.c @@ -8,7 +8,7 @@ * Copyright (C) 2009 One Laptop per Child */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-olpc-mesh.h" diff --git a/src/core/devices/wifi/nm-device-wifi-p2p.c b/src/core/devices/wifi/nm-device-wifi-p2p.c index b2f071fb55..fb9876005f 100644 --- a/src/core/devices/wifi/nm-device-wifi-p2p.c +++ b/src/core/devices/wifi/nm-device-wifi-p2p.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-wifi-p2p.h" diff --git a/src/core/devices/wifi/nm-device-wifi.c b/src/core/devices/wifi/nm-device-wifi.c index d9fdb4cc68..042d48871a 100644 --- a/src/core/devices/wifi/nm-device-wifi.c +++ b/src/core/devices/wifi/nm-device-wifi.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-wifi.h" diff --git a/src/core/devices/wifi/nm-iwd-manager.c b/src/core/devices/wifi/nm-iwd-manager.c index 70c2448ae2..3aa29e6d45 100644 --- a/src/core/devices/wifi/nm-iwd-manager.c +++ b/src/core/devices/wifi/nm-iwd-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Intel Corporation */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-iwd-manager.h" diff --git a/src/core/devices/wifi/nm-wifi-ap.c b/src/core/devices/wifi/nm-wifi-ap.c index 4df2f35c00..08fa10ec33 100644 --- a/src/core/devices/wifi/nm-wifi-ap.c +++ b/src/core/devices/wifi/nm-wifi-ap.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-wifi-ap.h" diff --git a/src/core/devices/wifi/nm-wifi-common.c b/src/core/devices/wifi/nm-wifi-common.c index 053537af7f..c715c07ce3 100644 --- a/src/core/devices/wifi/nm-wifi-common.c +++ b/src/core/devices/wifi/nm-wifi-common.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-wifi-common.h" diff --git a/src/core/devices/wifi/nm-wifi-factory.c b/src/core/devices/wifi/nm-wifi-factory.c index c4afd3fe24..40375e1c1f 100644 --- a/src/core/devices/wifi/nm-wifi-factory.c +++ b/src/core/devices/wifi/nm-wifi-factory.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/devices/wifi/nm-wifi-p2p-peer.c b/src/core/devices/wifi/nm-wifi-p2p-peer.c index 01f4f9bba5..8488f32dca 100644 --- a/src/core/devices/wifi/nm-wifi-p2p-peer.c +++ b/src/core/devices/wifi/nm-wifi-p2p-peer.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-wifi-p2p-peer.h" diff --git a/src/core/devices/wifi/nm-wifi-utils.c b/src/core/devices/wifi/nm-wifi-utils.c index f0b772c647..5887cafb96 100644 --- a/src/core/devices/wifi/nm-wifi-utils.c +++ b/src/core/devices/wifi/nm-wifi-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-wifi-utils.h" diff --git a/src/core/devices/wifi/tests/test-devices-wifi.c b/src/core/devices/wifi/tests/test-devices-wifi.c index 3ff09639d8..bc0ba126dc 100644 --- a/src/core/devices/wifi/tests/test-devices-wifi.c +++ b/src/core/devices/wifi/tests/test-devices-wifi.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "devices/wifi/nm-wifi-utils.h" #include "devices/wifi/nm-device-wifi.h" diff --git a/src/core/devices/wwan/nm-device-modem.c b/src/core/devices/wwan/nm-device-modem.c index a715cebb61..3ea89d2c69 100644 --- a/src/core/devices/wwan/nm-device-modem.c +++ b/src/core/devices/wwan/nm-device-modem.c @@ -3,7 +3,7 @@ * Copyright (C) 2009 - 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-device-modem.h" diff --git a/src/core/devices/wwan/nm-modem-broadband.c b/src/core/devices/wwan/nm-modem-broadband.c index d2debac5bf..ca02880417 100644 --- a/src/core/devices/wwan/nm-modem-broadband.c +++ b/src/core/devices/wwan/nm-modem-broadband.c @@ -3,7 +3,7 @@ * Copyright (C) 2012 Aleksander Morgado */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-modem-broadband.h" #include "nm-service-providers.h" diff --git a/src/core/devices/wwan/nm-modem-manager.c b/src/core/devices/wwan/nm-modem-manager.c index d05c77a148..598c689810 100644 --- a/src/core/devices/wwan/nm-modem-manager.c +++ b/src/core/devices/wwan/nm-modem-manager.c @@ -5,7 +5,7 @@ * Copyright (C) 2009 - 2013 Canonical Ltd. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-modem-manager.h" diff --git a/src/core/devices/wwan/nm-modem-ofono.c b/src/core/devices/wwan/nm-modem-ofono.c index ec43cd82d0..21734cee77 100644 --- a/src/core/devices/wwan/nm-modem-ofono.c +++ b/src/core/devices/wwan/nm-modem-ofono.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 - 2016 Canonical Ltd. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-modem-ofono.h" diff --git a/src/core/devices/wwan/nm-modem.c b/src/core/devices/wwan/nm-modem.c index 4e4412279e..0d334fa465 100644 --- a/src/core/devices/wwan/nm-modem.c +++ b/src/core/devices/wwan/nm-modem.c @@ -4,7 +4,7 @@ * Copyright (C) 2009 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-modem.h" diff --git a/src/core/devices/wwan/nm-service-providers.c b/src/core/devices/wwan/nm-service-providers.c index b9187036a2..89add6c51c 100644 --- a/src/core/devices/wwan/nm-service-providers.c +++ b/src/core/devices/wwan/nm-service-providers.c @@ -6,7 +6,7 @@ * Copyright (C) 2012 Lanedo GmbH */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-service-providers.h" diff --git a/src/core/devices/wwan/nm-wwan-factory.c b/src/core/devices/wwan/nm-wwan-factory.c index 7418d7aaca..5d2ce2b320 100644 --- a/src/core/devices/wwan/nm-wwan-factory.c +++ b/src/core/devices/wwan/nm-wwan-factory.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/devices/wwan/tests/test-service-providers.c b/src/core/devices/wwan/tests/test-service-providers.c index 2c54a76401..f95cccf8b0 100644 --- a/src/core/devices/wwan/tests/test-service-providers.c +++ b/src/core/devices/wwan/tests/test-service-providers.c @@ -3,7 +3,7 @@ * Copyright (C) 2019 Red Hat */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-service-providers.h" diff --git a/src/core/dhcp/meson.build b/src/core/dhcp/meson.build index ea0d056265..1bb004cd20 100644 --- a/src/core/dhcp/meson.build +++ b/src/core/dhcp/meson.build @@ -1,17 +1,12 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -name = 'nm-dhcp-helper' - -c_flags = [ - '-DG_LOG_DOMAIN="@0@"'.format(name), - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB', -] - executable( - name, - name + '.c', + 'nm-dhcp-helper', + 'nm-dhcp-helper.c', dependencies: glib_nm_default_dep, - c_args: c_flags, + c_args: [ + '-DG_LOG_DOMAIN="nm-dhcp-helper"', + ], link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, install: true, diff --git a/src/core/dhcp/nm-dhcp-client.c b/src/core/dhcp/nm-dhcp-client.c index 3ee8510b58..f5047244ed 100644 --- a/src/core/dhcp/nm-dhcp-client.c +++ b/src/core/dhcp/nm-dhcp-client.c @@ -3,7 +3,7 @@ * Copyright (C) 2005 - 2010 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dhcp-client.h" diff --git a/src/core/dhcp/nm-dhcp-dhclient-utils.c b/src/core/dhcp/nm-dhcp-dhclient-utils.c index 14a2b96e64..ad1e097f39 100644 --- a/src/core/dhcp/nm-dhcp-dhclient-utils.c +++ b/src/core/dhcp/nm-dhcp-dhclient-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dhcp-dhclient-utils.h" diff --git a/src/core/dhcp/nm-dhcp-dhclient.c b/src/core/dhcp/nm-dhcp-dhclient.c index 431ef4135d..c42a0ba53e 100644 --- a/src/core/dhcp/nm-dhcp-dhclient.c +++ b/src/core/dhcp/nm-dhcp-dhclient.c @@ -10,7 +10,7 @@ #include #undef _XOPEN_SOURCE -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #if WITH_DHCLIENT diff --git a/src/core/dhcp/nm-dhcp-dhcpcanon.c b/src/core/dhcp/nm-dhcp-dhcpcanon.c index db75958f1e..3504a04825 100644 --- a/src/core/dhcp/nm-dhcp-dhcpcanon.c +++ b/src/core/dhcp/nm-dhcp-dhcpcanon.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 juga */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #if WITH_DHCPCANON diff --git a/src/core/dhcp/nm-dhcp-dhcpcd.c b/src/core/dhcp/nm-dhcp-dhcpcd.c index 4f45c3a7e5..cf9fe5c2f6 100644 --- a/src/core/dhcp/nm-dhcp-dhcpcd.c +++ b/src/core/dhcp/nm-dhcp-dhcpcd.c @@ -4,7 +4,7 @@ * Copyright (C) 2010 Dan Williams */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #if WITH_DHCPCD diff --git a/src/core/dhcp/nm-dhcp-helper.c b/src/core/dhcp/nm-dhcp-helper.c index 94ee181e6a..0f98add127 100644 --- a/src/core/dhcp/nm-dhcp-helper.c +++ b/src/core/dhcp/nm-dhcp-helper.c @@ -3,7 +3,7 @@ * Copyright (C) 2007 - 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib.h" #include #include diff --git a/src/core/dhcp/nm-dhcp-listener.c b/src/core/dhcp/nm-dhcp-listener.c index 279ce4984c..1673bbb7a5 100644 --- a/src/core/dhcp/nm-dhcp-listener.c +++ b/src/core/dhcp/nm-dhcp-listener.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 - 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dhcp-listener.h" diff --git a/src/core/dhcp/nm-dhcp-manager.c b/src/core/dhcp/nm-dhcp-manager.c index ca99122ae5..bc114ad80c 100644 --- a/src/core/dhcp/nm-dhcp-manager.c +++ b/src/core/dhcp/nm-dhcp-manager.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dhcp-manager.h" diff --git a/src/core/dhcp/nm-dhcp-nettools.c b/src/core/dhcp/nm-dhcp-nettools.c index 87e17f5cca..d1451a5319 100644 --- a/src/core/dhcp/nm-dhcp-nettools.c +++ b/src/core/dhcp/nm-dhcp-nettools.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 - 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include @@ -13,8 +13,6 @@ #include #include -#include "nm-sd-adapt-shared.h" - #include "nm-glib-aux/nm-dedup-multi.h" #include "nm-std-aux/unaligned.h" diff --git a/src/core/dhcp/nm-dhcp-options.c b/src/core/dhcp/nm-dhcp-options.c index 13d85015d3..09dd6f363f 100644 --- a/src/core/dhcp/nm-dhcp-options.c +++ b/src/core/dhcp/nm-dhcp-options.c @@ -3,7 +3,7 @@ * Copyright (C) 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dhcp-options.h" diff --git a/src/core/dhcp/nm-dhcp-systemd.c b/src/core/dhcp/nm-dhcp-systemd.c index ec4a80e644..d558a62628 100644 --- a/src/core/dhcp/nm-dhcp-systemd.c +++ b/src/core/dhcp/nm-dhcp-systemd.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/dhcp/nm-dhcp-utils.c b/src/core/dhcp/nm-dhcp-utils.c index ed11a6ea30..a6555bce24 100644 --- a/src/core/dhcp/nm-dhcp-utils.c +++ b/src/core/dhcp/nm-dhcp-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2005 - 2010 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/dhcp/tests/test-dhcp-dhclient.c b/src/core/dhcp/tests/test-dhcp-dhclient.c index 6b3ec7a127..77626f6962 100644 --- a/src/core/dhcp/tests/test-dhcp-dhclient.c +++ b/src/core/dhcp/tests/test-dhcp-dhclient.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/dhcp/tests/test-dhcp-utils.c b/src/core/dhcp/tests/test-dhcp-utils.c index dc58688f97..02fe640660 100644 --- a/src/core/dhcp/tests/test-dhcp-utils.c +++ b/src/core/dhcp/tests/test-dhcp-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/dns/nm-dns-dnsmasq.c b/src/core/dns/nm-dns-dnsmasq.c index 82470e02f7..dcff98e913 100644 --- a/src/core/dns/nm-dns-dnsmasq.c +++ b/src/core/dns/nm-dns-dnsmasq.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 Dan Williams */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dns-dnsmasq.h" diff --git a/src/core/dns/nm-dns-manager.c b/src/core/dns/nm-dns-manager.c index 92f0ef3947..f318b9b89b 100644 --- a/src/core/dns/nm-dns-manager.c +++ b/src/core/dns/nm-dns-manager.c @@ -5,7 +5,7 @@ * Copyright (C) 2005 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/dns/nm-dns-plugin.c b/src/core/dns/nm-dns-plugin.c index 3233b6f0d7..74d4eb2bd9 100644 --- a/src/core/dns/nm-dns-plugin.c +++ b/src/core/dns/nm-dns-plugin.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dns-plugin.h" diff --git a/src/core/dns/nm-dns-systemd-resolved.c b/src/core/dns/nm-dns-systemd-resolved.c index 3535d3dcad..f6e116f375 100644 --- a/src/core/dns/nm-dns-systemd-resolved.c +++ b/src/core/dns/nm-dns-systemd-resolved.c @@ -4,7 +4,7 @@ * Copyright (C) 2016 Sjoerd Simons */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dns-systemd-resolved.h" diff --git a/src/core/dns/nm-dns-unbound.c b/src/core/dns/nm-dns-unbound.c index ee162c333b..15df3acf45 100644 --- a/src/core/dns/nm-dns-unbound.c +++ b/src/core/dns/nm-dns-unbound.c @@ -4,7 +4,7 @@ * Author: Pavel Šimerda */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dns-unbound.h" diff --git a/src/core/dnsmasq/nm-dnsmasq-manager.c b/src/core/dnsmasq/nm-dnsmasq-manager.c index 00b02a05aa..82c002b0d0 100644 --- a/src/core/dnsmasq/nm-dnsmasq-manager.c +++ b/src/core/dnsmasq/nm-dnsmasq-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dnsmasq-manager.h" diff --git a/src/core/dnsmasq/nm-dnsmasq-utils.c b/src/core/dnsmasq/nm-dnsmasq-utils.c index 3bd7c93ff9..ea23a78d41 100644 --- a/src/core/dnsmasq/nm-dnsmasq-utils.c +++ b/src/core/dnsmasq/nm-dnsmasq-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/dnsmasq/tests/test-dnsmasq-utils.c b/src/core/dnsmasq/tests/test-dnsmasq-utils.c index 6eadf294ef..4c1279f03d 100644 --- a/src/core/dnsmasq/tests/test-dnsmasq-utils.c +++ b/src/core/dnsmasq/tests/test-dnsmasq-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/initrd/nm-initrd-generator.c b/src/core/initrd/nm-initrd-generator.c index 654adf9497..18c7258a91 100644 --- a/src/core/initrd/nm-initrd-generator.c +++ b/src/core/initrd/nm-initrd-generator.c @@ -3,10 +3,10 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-core-utils.h" #include "nm-core-internal.h" -#include "nm-keyfile/nm-keyfile-internal.h" +#include "nm-keyfile-internal.h" #include "nm-initrd-generator.h" #include "nm-glib-aux/nm-io-utils.h" #include "nm-config.h" diff --git a/src/core/initrd/nmi-cmdline-reader.c b/src/core/initrd/nmi-cmdline-reader.c index 662b98055d..d95b0f9bef 100644 --- a/src/core/initrd/nmi-cmdline-reader.c +++ b/src/core/initrd/nmi-cmdline-reader.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/initrd/nmi-dt-reader.c b/src/core/initrd/nmi-dt-reader.c index 5c406a4963..63e4524b5a 100644 --- a/src/core/initrd/nmi-dt-reader.c +++ b/src/core/initrd/nmi-dt-reader.c @@ -3,7 +3,7 @@ * Copyright (C) 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-initrd-generator.h" diff --git a/src/core/initrd/nmi-ibft-reader.c b/src/core/initrd/nmi-ibft-reader.c index 4080ede5ff..9895cda43f 100644 --- a/src/core/initrd/nmi-ibft-reader.c +++ b/src/core/initrd/nmi-ibft-reader.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-initrd-generator.h" diff --git a/src/core/initrd/tests/meson.build b/src/core/initrd/tests/meson.build index 51650d0f15..e47ff7905d 100644 --- a/src/core/initrd/tests/meson.build +++ b/src/core/initrd/tests/meson.build @@ -1,7 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -c_flags = test_c_flags + ['-DTEST_INITRD_DIR="@0@"'.format(meson.current_source_dir())] - test_units = [ 'test-dt-reader', 'test-ibft-reader', @@ -13,7 +11,7 @@ foreach test_unit : test_units test_unit, test_unit + '.c', dependencies: libNetworkManagerTest_dep, - c_args: c_flags, + c_args: test_c_flags, link_with: libnmi_core, ) diff --git a/src/core/initrd/tests/test-cmdline-reader.c b/src/core/initrd/tests/test-cmdline-reader.c index 1dc0988e38..cb65cd33b1 100644 --- a/src/core/initrd/tests/test-cmdline-reader.c +++ b/src/core/initrd/tests/test-cmdline-reader.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include @@ -19,6 +19,8 @@ #include "nm-test-utils-core.h" +#define TEST_INITRD_DIR NM_BUILD_SRCDIR "/src/core/initrd/tests" + /*****************************************************************************/ #define _parse(ARGV, out_hostname, out_carrier_timeout_sec) \ diff --git a/src/core/initrd/tests/test-dt-reader.c b/src/core/initrd/tests/test-dt-reader.c index 982ccc3ac2..619a4e6fc1 100644 --- a/src/core/initrd/tests/test-dt-reader.c +++ b/src/core/initrd/tests/test-dt-reader.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include @@ -19,6 +19,10 @@ #include "nm-test-utils-core.h" +#define TEST_INITRD_DIR NM_BUILD_SRCDIR "/src/core/initrd/tests" + +/*****************************************************************************/ + static void test_read_dt_ofw(void) { diff --git a/src/core/initrd/tests/test-ibft-reader.c b/src/core/initrd/tests/test-ibft-reader.c index 320153f81c..1d263b9e2e 100644 --- a/src/core/initrd/tests/test-ibft-reader.c +++ b/src/core/initrd/tests/test-ibft-reader.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include @@ -19,6 +19,10 @@ #include "nm-test-utils-core.h" +#define TEST_INITRD_DIR NM_BUILD_SRCDIR "/src/core/initrd/tests" + +/*****************************************************************************/ + static NMConnection * read_connection(const char *sysfs_dir, const char *expected_mac, GError **error) { diff --git a/src/core/main-utils.c b/src/core/main-utils.c index 357f20f6c0..9bc497ca46 100644 --- a/src/core/main-utils.c +++ b/src/core/main-utils.c @@ -4,7 +4,7 @@ * Copyright (C) 2005 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/main.c b/src/core/main.c index 18a6333e6e..9b79bcbb7c 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -4,7 +4,7 @@ * Copyright (C) 2005 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/meson.build b/src/core/meson.build index ada4d7ab01..368a3e8555 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -34,7 +34,9 @@ subdir('systemd') core_plugins = [] -daemon_c_flags = ['-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON'] +daemon_c_flags = [ + '-DG_LOG_DOMAIN="NetworkManager"', +] platform_wifi_wext_source = files() if enable_wext @@ -75,7 +77,6 @@ libNetworkManagerBase = static_library( dependencies: [ core_default_dep, libn_dhcp4_dep, - libnm_keyfile_dep, libnm_core_dep, libnm_systemd_shared_dep, libnm_udev_aux_dep, @@ -224,7 +225,7 @@ executable( ) if enable_tests - test_c_flags = daemon_c_flags + ['-DNETWORKMANAGER_COMPILATION_TEST'] + test_c_flags = daemon_c_flags if require_root_tests test_c_flags += ['-DREQUIRE_ROOT_TESTS=1'] endif diff --git a/src/core/ndisc/nm-fake-ndisc.c b/src/core/ndisc/nm-fake-ndisc.c index 5bcdb0de7a..ffe07ab6b7 100644 --- a/src/core/ndisc/nm-fake-ndisc.c +++ b/src/core/ndisc/nm-fake-ndisc.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-fake-ndisc.h" diff --git a/src/core/ndisc/nm-lndp-ndisc.c b/src/core/ndisc/nm-lndp-ndisc.c index 7abd197c99..d846411e0b 100644 --- a/src/core/ndisc/nm-lndp-ndisc.c +++ b/src/core/ndisc/nm-lndp-ndisc.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-lndp-ndisc.h" diff --git a/src/core/ndisc/nm-ndisc.c b/src/core/ndisc/nm-ndisc.c index 05da8eb7d1..a5c1b935fc 100644 --- a/src/core/ndisc/nm-ndisc.c +++ b/src/core/ndisc/nm-ndisc.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-ndisc.h" diff --git a/src/core/ndisc/tests/test-ndisc-fake.c b/src/core/ndisc/tests/test-ndisc-fake.c index 3c4bc1f2f7..f201bc5641 100644 --- a/src/core/ndisc/tests/test-ndisc-fake.c +++ b/src/core/ndisc/tests/test-ndisc-fake.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/ndisc/tests/test-ndisc-linux.c b/src/core/ndisc/tests/test-ndisc-linux.c index 2517e2b7b4..9a5df60b1c 100644 --- a/src/core/ndisc/tests/test-ndisc-linux.c +++ b/src/core/ndisc/tests/test-ndisc-linux.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/nm-act-request.c b/src/core/nm-act-request.c index 248b57b861..defe3e8c93 100644 --- a/src/core/nm-act-request.c +++ b/src/core/nm-act-request.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-act-request.h" diff --git a/src/core/nm-active-connection.c b/src/core/nm-active-connection.c index 9049eea92f..3c8c472e74 100644 --- a/src/core/nm-active-connection.c +++ b/src/core/nm-active-connection.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-active-connection.h" diff --git a/src/core/nm-audit-manager.c b/src/core/nm-audit-manager.c index 4a67f2eebd..8f41947264 100644 --- a/src/core/nm-audit-manager.c +++ b/src/core/nm-audit-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-audit-manager.h" diff --git a/src/core/nm-auth-manager.c b/src/core/nm-auth-manager.c index 046282c230..9470838c8f 100644 --- a/src/core/nm-auth-manager.c +++ b/src/core/nm-auth-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-auth-manager.h" diff --git a/src/core/nm-auth-utils.c b/src/core/nm-auth-utils.c index 41ddd3a4b8..12da5749a5 100644 --- a/src/core/nm-auth-utils.c +++ b/src/core/nm-auth-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-auth-utils.h" diff --git a/src/core/nm-checkpoint-manager.c b/src/core/nm-checkpoint-manager.c index b4c00f9d8b..b8c9101a6e 100644 --- a/src/core/nm-checkpoint-manager.c +++ b/src/core/nm-checkpoint-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-checkpoint-manager.h" diff --git a/src/core/nm-checkpoint.c b/src/core/nm-checkpoint.c index 0bee16ece5..2088c24760 100644 --- a/src/core/nm-checkpoint.c +++ b/src/core/nm-checkpoint.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-checkpoint.h" diff --git a/src/core/nm-config-data.c b/src/core/nm-config-data.c index b3cd5e986f..c62c677372 100644 --- a/src/core/nm-config-data.c +++ b/src/core/nm-config-data.c @@ -4,15 +4,15 @@ * Copyright (C) 2013 Thomas Bechtold */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-config-data.h" #include "nm-config.h" #include "devices/nm-device.h" #include "nm-core-internal.h" -#include "nm-keyfile/nm-keyfile-internal.h" -#include "nm-keyfile/nm-keyfile-utils.h" +#include "nm-keyfile-internal.h" +#include "nm-keyfile-utils.h" /*****************************************************************************/ diff --git a/src/core/nm-config.c b/src/core/nm-config.c index 3c0c78eb8b..55323919af 100644 --- a/src/core/nm-config.c +++ b/src/core/nm-config.c @@ -4,7 +4,7 @@ * Copyright (C) 2013 Thomas Bechtold */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-config.h" @@ -14,8 +14,8 @@ #include "devices/nm-device.h" #include "NetworkManagerUtils.h" #include "nm-core-internal.h" -#include "nm-keyfile/nm-keyfile-internal.h" -#include "nm-keyfile/nm-keyfile-utils.h" +#include "nm-keyfile-internal.h" +#include "nm-keyfile-utils.h" #define DEFAULT_CONFIG_MAIN_FILE NMCONFDIR "/NetworkManager.conf" #define DEFAULT_CONFIG_DIR NMCONFDIR "/conf.d" diff --git a/src/core/nm-connectivity.c b/src/core/nm-connectivity.c index 4e38e77e82..f847c8f4ef 100644 --- a/src/core/nm-connectivity.c +++ b/src/core/nm-connectivity.c @@ -5,7 +5,7 @@ * Copyright (C) 2016 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-connectivity.h" diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index 660f6f4317..9075c30dd0 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -4,7 +4,7 @@ * Copyright (C) 2005 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-core-utils.h" diff --git a/src/core/nm-dbus-manager.c b/src/core/nm-dbus-manager.c index e05ae39288..4f34ee52af 100644 --- a/src/core/nm-dbus-manager.c +++ b/src/core/nm-dbus-manager.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dbus-manager.h" diff --git a/src/core/nm-dbus-object.c b/src/core/nm-dbus-object.c index 4f6d2af343..6f294fe2ec 100644 --- a/src/core/nm-dbus-object.c +++ b/src/core/nm-dbus-object.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dbus-object.h" diff --git a/src/core/nm-dbus-utils.c b/src/core/nm-dbus-utils.c index 40e10e2811..5890bdf29f 100644 --- a/src/core/nm-dbus-utils.c +++ b/src/core/nm-dbus-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dbus-utils.h" diff --git a/src/core/nm-dcb.c b/src/core/nm-dcb.c index df345434e6..b3958caa51 100644 --- a/src/core/nm-dcb.c +++ b/src/core/nm-dcb.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/nm-default-daemon.h b/src/core/nm-default-daemon.h new file mode 100644 index 0000000000..65ca4b5428 --- /dev/null +++ b/src/core/nm-default-daemon.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEFAULT_DAEMON_H__ +#define __NM_DEFAULT_DAEMON_H__ + +/*****************************************************************************/ + +#include "nm-glib-aux/nm-default-glib-i18n-prog.h" + +#undef NETWORKMANAGER_COMPILATION +#define NETWORKMANAGER_COMPILATION NM_NETWORKMANAGER_COMPILATION_DAEMON + +/*****************************************************************************/ + +#include "nm-version.h" + +#include "nm-core-types.h" +#include "nm-types.h" +#include "nm-log-core/nm-logging.h" + +/*****************************************************************************/ + +#endif /* __NM_DEFAULT_DAEMON_H__ */ diff --git a/src/core/nm-dhcp-config.c b/src/core/nm-dhcp-config.c index 390a73f428..718d3c90ec 100644 --- a/src/core/nm-dhcp-config.c +++ b/src/core/nm-dhcp-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dhcp-config.h" diff --git a/src/core/nm-dispatcher.c b/src/core/nm-dispatcher.c index a848d41d8d..0ab409f5ed 100644 --- a/src/core/nm-dispatcher.c +++ b/src/core/nm-dispatcher.c @@ -4,7 +4,7 @@ * Copyright (C) 2005 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dispatcher.h" diff --git a/src/core/nm-firewall-manager.c b/src/core/nm-firewall-manager.c index ff0c1a0d2b..8f476e511a 100644 --- a/src/core/nm-firewall-manager.c +++ b/src/core/nm-firewall-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2011 - 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-firewall-manager.h" diff --git a/src/core/nm-hostname-manager.c b/src/core/nm-hostname-manager.c index ca23b97ce1..c99c83267c 100644 --- a/src/core/nm-hostname-manager.c +++ b/src/core/nm-hostname-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-hostname-manager.h" diff --git a/src/core/nm-iface-helper.c b/src/core/nm-iface-helper.c index 42483cf756..b6e9981da9 100644 --- a/src/core/nm-iface-helper.c +++ b/src/core/nm-iface-helper.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/nm-ip-config.c b/src/core/nm-ip-config.c index 040483ed53..2426eb4941 100644 --- a/src/core/nm-ip-config.c +++ b/src/core/nm-ip-config.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-ip-config.h" diff --git a/src/core/nm-ip4-config.c b/src/core/nm-ip4-config.c index 8014549f4d..c49dfb4c34 100644 --- a/src/core/nm-ip4-config.c +++ b/src/core/nm-ip4-config.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-ip4-config.h" diff --git a/src/core/nm-ip6-config.c b/src/core/nm-ip6-config.c index d48c6e30c8..1f7def3465 100644 --- a/src/core/nm-ip6-config.c +++ b/src/core/nm-ip6-config.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-ip6-config.h" diff --git a/src/core/nm-keep-alive.c b/src/core/nm-keep-alive.c index d0cce40714..197e30eaf4 100644 --- a/src/core/nm-keep-alive.c +++ b/src/core/nm-keep-alive.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-keep-alive.h" diff --git a/src/core/nm-l3-config-data.c b/src/core/nm-l3-config-data.c index 0f689d409b..5f9af7ac59 100644 --- a/src/core/nm-l3-config-data.c +++ b/src/core/nm-l3-config-data.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-l3-config-data.h" diff --git a/src/core/nm-l3-ipv4ll.c b/src/core/nm-l3-ipv4ll.c index edd6671a9f..28ceb39e91 100644 --- a/src/core/nm-l3-ipv4ll.c +++ b/src/core/nm-l3-ipv4ll.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-l3-ipv4ll.h" diff --git a/src/core/nm-l3cfg.c b/src/core/nm-l3cfg.c index 44023aad57..839213ad51 100644 --- a/src/core/nm-l3cfg.c +++ b/src/core/nm-l3cfg.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-l3cfg.h" diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c index 5e5f4e7ff2..5a6e05a934 100644 --- a/src/core/nm-manager.c +++ b/src/core/nm-manager.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-manager.h" diff --git a/src/core/nm-netns.c b/src/core/nm-netns.c index 9f62643686..88ea09b6ce 100644 --- a/src/core/nm-netns.c +++ b/src/core/nm-netns.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-netns.h" diff --git a/src/core/nm-pacrunner-manager.c b/src/core/nm-pacrunner-manager.c index 50551116f3..b58aef0649 100644 --- a/src/core/nm-pacrunner-manager.c +++ b/src/core/nm-pacrunner-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Atul Anand . */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-pacrunner-manager.h" diff --git a/src/core/nm-policy.c b/src/core/nm-policy.c index 98ff704102..db4983f889 100644 --- a/src/core/nm-policy.c +++ b/src/core/nm-policy.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-policy.h" diff --git a/src/core/nm-proxy-config.c b/src/core/nm-proxy-config.c index 7487afaf00..f41601c900 100644 --- a/src/core/nm-proxy-config.c +++ b/src/core/nm-proxy-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Atul Anand . */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-proxy-config.h" diff --git a/src/core/nm-rfkill-manager.c b/src/core/nm-rfkill-manager.c index 1b1bd9987a..f032851e41 100644 --- a/src/core/nm-rfkill-manager.c +++ b/src/core/nm-rfkill-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2009 - 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-rfkill-manager.h" diff --git a/src/core/nm-session-monitor.c b/src/core/nm-session-monitor.c index 8e66dbe7c9..88de1a0069 100644 --- a/src/core/nm-session-monitor.c +++ b/src/core/nm-session-monitor.c @@ -6,7 +6,7 @@ * Author: Matthias Clasen * Author: Pavel Šimerda */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-session-monitor.h" diff --git a/src/core/nm-sleep-monitor.c b/src/core/nm-sleep-monitor.c index cc3d72ee67..ffb4db4ea8 100644 --- a/src/core/nm-sleep-monitor.c +++ b/src/core/nm-sleep-monitor.c @@ -4,7 +4,7 @@ * Author: Matthias Clasen */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-sleep-monitor.h" diff --git a/src/core/nm-test-utils-core.h b/src/core/nm-test-utils-core.h index 71d19cc152..e655ce22fa 100644 --- a/src/core/nm-test-utils-core.h +++ b/src/core/nm-test-utils-core.h @@ -7,7 +7,7 @@ #define __NM_TEST_UTILS_CORE_H__ #include "NetworkManagerUtils.h" -#include "nm-keyfile/nm-keyfile-internal.h" +#include "nm-keyfile-internal.h" #define _NMTST_INSIDE_CORE 1 diff --git a/src/core/platform/nm-fake-platform.c b/src/core/platform/nm-fake-platform.c index fbd3e3fbc7..81c9f06ca9 100644 --- a/src/core/platform/nm-fake-platform.c +++ b/src/core/platform/nm-fake-platform.c @@ -3,7 +3,7 @@ * Copyright (C) 2012 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-fake-platform.h" diff --git a/src/core/platform/nm-linux-platform.c b/src/core/platform/nm-linux-platform.c index ae6c4f44c2..7bd42bbab5 100644 --- a/src/core/platform/nm-linux-platform.c +++ b/src/core/platform/nm-linux-platform.c @@ -3,7 +3,7 @@ * Copyright (C) 2012 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-linux-platform.h" diff --git a/src/core/platform/nm-platform.c b/src/core/platform/nm-platform.c index 6411abbacc..0e5f8ab548 100644 --- a/src/core/platform/nm-platform.c +++ b/src/core/platform/nm-platform.c @@ -3,7 +3,7 @@ * Copyright (C) 2012 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-platform.h" diff --git a/src/core/platform/nmp-object.c b/src/core/platform/nmp-object.c index 9520013ad7..6a26595e6a 100644 --- a/src/core/platform/nmp-object.c +++ b/src/core/platform/nmp-object.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nmp-object.h" diff --git a/src/core/platform/nmp-rules-manager.c b/src/core/platform/nmp-rules-manager.c index ab329c9578..0c617b8040 100644 --- a/src/core/platform/nmp-rules-manager.c +++ b/src/core/platform/nmp-rules-manager.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nmp-rules-manager.h" diff --git a/src/core/platform/tests/monitor.c b/src/core/platform/tests/monitor.c index b67d50b44b..abdf2cd54b 100644 --- a/src/core/platform/tests/monitor.c +++ b/src/core/platform/tests/monitor.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/platform/tests/test-address.c b/src/core/platform/tests/test-address.c index b9eabbd1db..d4d67105aa 100644 --- a/src/core/platform/tests/test-address.c +++ b/src/core/platform/tests/test-address.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "test-common.h" diff --git a/src/core/platform/tests/test-cleanup.c b/src/core/platform/tests/test-cleanup.c index 2fd6a4e57c..b54eca34b1 100644 --- a/src/core/platform/tests/test-cleanup.c +++ b/src/core/platform/tests/test-cleanup.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "test-common.h" diff --git a/src/core/platform/tests/test-common.c b/src/core/platform/tests/test-common.c index 529100b9f2..87e5329a96 100644 --- a/src/core/platform/tests/test-common.c +++ b/src/core/platform/tests/test-common.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "test-common.h" diff --git a/src/core/platform/tests/test-link.c b/src/core/platform/tests/test-link.c index 895b89a09b..3aaa3759aa 100644 --- a/src/core/platform/tests/test-link.c +++ b/src/core/platform/tests/test-link.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/platform/tests/test-nmp-object.c b/src/core/platform/tests/test-nmp-object.c index 590f41c6d7..310611ee6c 100644 --- a/src/core/platform/tests/test-nmp-object.c +++ b/src/core/platform/tests/test-nmp-object.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/platform/tests/test-platform-general.c b/src/core/platform/tests/test-platform-general.c index 00671cfba0..b426cc658b 100644 --- a/src/core/platform/tests/test-platform-general.c +++ b/src/core/platform/tests/test-platform-general.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/platform/tests/test-route.c b/src/core/platform/tests/test-route.c index 0aa94ecd2d..47587865b3 100644 --- a/src/core/platform/tests/test-route.c +++ b/src/core/platform/tests/test-route.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/platform/tests/test-tc.c b/src/core/platform/tests/test-tc.c index c005b069f0..d15c3d7621 100644 --- a/src/core/platform/tests/test-tc.c +++ b/src/core/platform/tests/test-tc.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/platform/wifi/nm-wifi-utils-nl80211.c b/src/core/platform/wifi/nm-wifi-utils-nl80211.c index aae6af1ec8..ad0672488a 100644 --- a/src/core/platform/wifi/nm-wifi-utils-nl80211.c +++ b/src/core/platform/wifi/nm-wifi-utils-nl80211.c @@ -5,7 +5,7 @@ * Copyright (C) 2011 Intel Corporation. All rights reserved. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-wifi-utils-nl80211.h" diff --git a/src/core/platform/wifi/nm-wifi-utils-wext.c b/src/core/platform/wifi/nm-wifi-utils-wext.c index 2b070b5abe..a44fcf6239 100644 --- a/src/core/platform/wifi/nm-wifi-utils-wext.c +++ b/src/core/platform/wifi/nm-wifi-utils-wext.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-wifi-utils-wext.h" diff --git a/src/core/platform/wifi/nm-wifi-utils.c b/src/core/platform/wifi/nm-wifi-utils.c index 66d6a05a75..49ae1811f6 100644 --- a/src/core/platform/wifi/nm-wifi-utils.c +++ b/src/core/platform/wifi/nm-wifi-utils.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-wifi-utils.h" diff --git a/src/core/platform/wpan/nm-wpan-utils.c b/src/core/platform/wpan/nm-wpan-utils.c index 96897ae04d..efb199794d 100644 --- a/src/core/platform/wpan/nm-wpan-utils.c +++ b/src/core/platform/wpan/nm-wpan-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-wpan-utils.h" diff --git a/src/core/ppp/meson.build b/src/core/ppp/meson.build index 991f0b3dc1..607b471874 100644 --- a/src/core/ppp/meson.build +++ b/src/core/ppp/meson.build @@ -7,7 +7,6 @@ nm_pppd_plugin = shared_module( dependencies: libnm_core_nm_default_dep, c_args: [ '-DG_LOG_DOMAIN="nm-pppd-plugin"', - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB', ], install: true, install_dir: pppd_plugin_dir, diff --git a/src/core/ppp/nm-ppp-manager-call.c b/src/core/ppp/nm-ppp-manager-call.c index b07c3df714..f791e8b028 100644 --- a/src/core/ppp/nm-ppp-manager-call.c +++ b/src/core/ppp/nm-ppp-manager-call.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-ppp-manager-call.h" diff --git a/src/core/ppp/nm-ppp-manager.c b/src/core/ppp/nm-ppp-manager.c index 939eca31d4..396a49aeb5 100644 --- a/src/core/ppp/nm-ppp-manager.c +++ b/src/core/ppp/nm-ppp-manager.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 - 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-ppp-manager.h" diff --git a/src/core/ppp/nm-pppd-plugin.c b/src/core/ppp/nm-pppd-plugin.c index 519e637e20..c9016dac54 100644 --- a/src/core/ppp/nm-pppd-plugin.c +++ b/src/core/ppp/nm-pppd-plugin.c @@ -20,7 +20,7 @@ #include #include -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib.h" #include "nm-dbus-interface.h" diff --git a/src/core/settings/nm-agent-manager.c b/src/core/settings/nm-agent-manager.c index cd96808e7b..7e61790998 100644 --- a/src/core/settings/nm-agent-manager.c +++ b/src/core/settings/nm-agent-manager.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-agent-manager.h" diff --git a/src/core/settings/nm-secret-agent.c b/src/core/settings/nm-secret-agent.c index 7d31272199..7e7c5d7dfd 100644 --- a/src/core/settings/nm-secret-agent.c +++ b/src/core/settings/nm-secret-agent.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-secret-agent.h" diff --git a/src/core/settings/nm-settings-connection.c b/src/core/settings/nm-settings-connection.c index a5761bf635..0ff0718997 100644 --- a/src/core/settings/nm-settings-connection.c +++ b/src/core/settings/nm-settings-connection.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-settings-connection.h" diff --git a/src/core/settings/nm-settings-plugin.c b/src/core/settings/nm-settings-plugin.c index 74ae314df6..9e81caabb5 100644 --- a/src/core/settings/nm-settings-plugin.c +++ b/src/core/settings/nm-settings-plugin.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-settings-plugin.h" diff --git a/src/core/settings/nm-settings-storage.c b/src/core/settings/nm-settings-storage.c index bea440cb5a..c56ba075de 100644 --- a/src/core/settings/nm-settings-storage.c +++ b/src/core/settings/nm-settings-storage.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-settings-storage.h" diff --git a/src/core/settings/nm-settings-utils.c b/src/core/settings/nm-settings-utils.c index f6c2f60810..775d0396e6 100644 --- a/src/core/settings/nm-settings-utils.c +++ b/src/core/settings/nm-settings-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-settings-utils.h" diff --git a/src/core/settings/nm-settings.c b/src/core/settings/nm-settings.c index eda3789f40..3d31fb8b7b 100644 --- a/src/core/settings/nm-settings.c +++ b/src/core/settings/nm-settings.c @@ -7,7 +7,7 @@ * Copyright (C) 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-settings.h" @@ -22,7 +22,7 @@ #include "nm-libnm-core-intern/nm-common-macros.h" #include "nm-glib-aux/nm-keyfile-aux.h" -#include "nm-keyfile/nm-keyfile-internal.h" +#include "nm-keyfile-internal.h" #include "nm-dbus-interface.h" #include "nm-connection.h" #include "nm-setting-8021x.h" diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c index b5c205c2fd..d114db0f82 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c @@ -5,7 +5,7 @@ * Copyright (C) 2007 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-ifcfg-rh-plugin.h" diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index bce47efc8e..209957d9b8 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-ifcfg-rh-reader.h" diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-storage.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-storage.c index 3c2682830f..3f674deab3 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-storage.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-storage.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-ifcfg-rh-storage.h" diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-utils.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-utils.c index b4a23d448b..8da5de473b 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-utils.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-ifcfg-rh-utils.h" diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index a268c58c58..a968fce0ba 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -3,7 +3,7 @@ * Copyright (C) 2009 - 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-ifcfg-rh-writer.h" @@ -34,7 +34,6 @@ #include "nm-utils.h" #include "nm-core-internal.h" #include "NetworkManagerUtils.h" -#include "nm-meta-setting.h" #include "nm-base/nm-ethtool-base.h" #include "nms-ifcfg-rh-common.h" diff --git a/src/core/settings/plugins/ifcfg-rh/shvar.c b/src/core/settings/plugins/ifcfg-rh/shvar.c index 6c1cd41837..386bcac707 100644 --- a/src/core/settings/plugins/ifcfg-rh/shvar.c +++ b/src/core/settings/plugins/ifcfg-rh/shvar.c @@ -3,7 +3,7 @@ * Copyright (C) 1999, 2000 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "shvar.h" diff --git a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 10d498edac..59127d0103 100644 --- a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/settings/plugins/ifupdown/nms-ifupdown-interface-parser.c b/src/core/settings/plugins/ifupdown/nms-ifupdown-interface-parser.c index c766a358e0..a8a9c40a9f 100644 --- a/src/core/settings/plugins/ifupdown/nms-ifupdown-interface-parser.c +++ b/src/core/settings/plugins/ifupdown/nms-ifupdown-interface-parser.c @@ -4,7 +4,7 @@ * Copyright (C) 2004 Tom Parker */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-ifupdown-interface-parser.h" diff --git a/src/core/settings/plugins/ifupdown/nms-ifupdown-parser.c b/src/core/settings/plugins/ifupdown/nms-ifupdown-parser.c index 767e0daa09..a4974a9600 100644 --- a/src/core/settings/plugins/ifupdown/nms-ifupdown-parser.c +++ b/src/core/settings/plugins/ifupdown/nms-ifupdown-parser.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 Canonical Ltd. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-ifupdown-parser.h" diff --git a/src/core/settings/plugins/ifupdown/nms-ifupdown-plugin.c b/src/core/settings/plugins/ifupdown/nms-ifupdown-plugin.c index 8c22e3b6d7..34523f8d5a 100644 --- a/src/core/settings/plugins/ifupdown/nms-ifupdown-plugin.c +++ b/src/core/settings/plugins/ifupdown/nms-ifupdown-plugin.c @@ -5,7 +5,7 @@ * Copyright (C) 2009 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-ifupdown-plugin.h" diff --git a/src/core/settings/plugins/ifupdown/tests/test-ifupdown.c b/src/core/settings/plugins/ifupdown/tests/test-ifupdown.c index c3c5bb5432..6e3eb0e74b 100644 --- a/src/core/settings/plugins/ifupdown/tests/test-ifupdown.c +++ b/src/core/settings/plugins/ifupdown/tests/test-ifupdown.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-core-internal.h" diff --git a/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c b/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c index 400c175191..789bfc1ad2 100644 --- a/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c +++ b/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-keyfile-plugin.h" @@ -23,7 +23,7 @@ #include "nm-utils.h" #include "nm-config.h" #include "nm-core-internal.h" -#include "nm-keyfile/nm-keyfile-internal.h" +#include "nm-keyfile-internal.h" #include "systemd/nm-sd-utils-shared.h" diff --git a/src/core/settings/plugins/keyfile/nms-keyfile-reader.c b/src/core/settings/plugins/keyfile/nms-keyfile-reader.c index 6978c10596..70b047f32f 100644 --- a/src/core/settings/plugins/keyfile/nms-keyfile-reader.c +++ b/src/core/settings/plugins/keyfile/nms-keyfile-reader.c @@ -3,13 +3,13 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-keyfile-reader.h" #include -#include "nm-keyfile/nm-keyfile-internal.h" +#include "nm-keyfile-internal.h" #include "NetworkManagerUtils.h" #include "nms-keyfile-utils.h" diff --git a/src/core/settings/plugins/keyfile/nms-keyfile-storage.c b/src/core/settings/plugins/keyfile/nms-keyfile-storage.c index 8fb9861cd2..89be817a7e 100644 --- a/src/core/settings/plugins/keyfile/nms-keyfile-storage.c +++ b/src/core/settings/plugins/keyfile/nms-keyfile-storage.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-keyfile-storage.h" diff --git a/src/core/settings/plugins/keyfile/nms-keyfile-utils.c b/src/core/settings/plugins/keyfile/nms-keyfile-utils.c index a62e0ae018..f3dffdae49 100644 --- a/src/core/settings/plugins/keyfile/nms-keyfile-utils.c +++ b/src/core/settings/plugins/keyfile/nms-keyfile-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 - 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-keyfile-utils.h" @@ -11,7 +11,7 @@ #include #include "nm-glib-aux/nm-io-utils.h" -#include "nm-keyfile/nm-keyfile-internal.h" +#include "nm-keyfile-internal.h" #include "nm-utils.h" #include "nm-setting-wired.h" #include "nm-setting-wireless.h" diff --git a/src/core/settings/plugins/keyfile/nms-keyfile-writer.c b/src/core/settings/plugins/keyfile/nms-keyfile-writer.c index be1bf158b3..0e2c94b533 100644 --- a/src/core/settings/plugins/keyfile/nms-keyfile-writer.c +++ b/src/core/settings/plugins/keyfile/nms-keyfile-writer.c @@ -4,7 +4,7 @@ * Copyright (C) 2008 - 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nms-keyfile-writer.h" @@ -12,7 +12,7 @@ #include #include -#include "nm-keyfile/nm-keyfile-internal.h" +#include "nm-keyfile-internal.h" #include "nms-keyfile-utils.h" #include "nms-keyfile-reader.h" diff --git a/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c b/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c index 4d9c86c3d1..348b0ed6ad 100644 --- a/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c +++ b/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2017 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/supplicant/nm-supplicant-config.c b/src/core/supplicant/nm-supplicant-config.c index 1754bfff59..eab494b022 100644 --- a/src/core/supplicant/nm-supplicant-config.c +++ b/src/core/supplicant/nm-supplicant-config.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-supplicant-config.h" diff --git a/src/core/supplicant/nm-supplicant-interface.c b/src/core/supplicant/nm-supplicant-interface.c index ec278c31fc..6d9c604f80 100644 --- a/src/core/supplicant/nm-supplicant-interface.c +++ b/src/core/supplicant/nm-supplicant-interface.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-supplicant-interface.h" diff --git a/src/core/supplicant/nm-supplicant-manager.c b/src/core/supplicant/nm-supplicant-manager.c index 30b15cc010..325541876c 100644 --- a/src/core/supplicant/nm-supplicant-manager.c +++ b/src/core/supplicant/nm-supplicant-manager.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-supplicant-manager.h" diff --git a/src/core/supplicant/nm-supplicant-settings-verify.c b/src/core/supplicant/nm-supplicant-settings-verify.c index fe4cb1c1b0..3f0a33e0af 100644 --- a/src/core/supplicant/nm-supplicant-settings-verify.c +++ b/src/core/supplicant/nm-supplicant-settings-verify.c @@ -3,7 +3,7 @@ * Copyright (C) 2006 - 2012 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-supplicant-settings-verify.h" diff --git a/src/core/supplicant/tests/test-supplicant-config.c b/src/core/supplicant/tests/test-supplicant-config.c index 1dde90bd18..99729c18e5 100644 --- a/src/core/supplicant/tests/test-supplicant-config.c +++ b/src/core/supplicant/tests/test-supplicant-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2008 - 2011 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/systemd/meson.build b/src/core/systemd/meson.build index 4f3a63eda4..70f6b54295 100644 --- a/src/core/systemd/meson.build +++ b/src/core/systemd/meson.build @@ -45,7 +45,9 @@ libnm_systemd_core = static_library( libnm_core_dep, libnm_systemd_shared_dep, ], - c_args: '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD', + c_args: [ + '-DG_LOG_DOMAIN="NetworkManager"', + ], link_with: libc_siphash, ) diff --git a/src/core/systemd/nm-default-systemd.h b/src/core/systemd/nm-default-systemd.h new file mode 100644 index 0000000000..1979d9c990 --- /dev/null +++ b/src/core/systemd/nm-default-systemd.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEFAULT_SYSTEMD_H__ +#define __NM_DEFAULT_SYSTEMD_H__ + +/*****************************************************************************/ + +#include "nm-default-daemon.h" + +#undef NETWORKMANAGER_COMPILATION +#define NETWORKMANAGER_COMPILATION NM_NETWORKMANAGER_COMPILATION_SYSTEMD + +/*****************************************************************************/ + +#endif /* __NM_DEFAULT_SYSTEMD_H__ */ diff --git a/src/core/systemd/nm-sd-utils-core.c b/src/core/systemd/nm-sd-utils-core.c index c7d4aadafa..af68603ec0 100644 --- a/src/core/systemd/nm-sd-utils-core.c +++ b/src/core/systemd/nm-sd-utils-core.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/systemd/nm-default-systemd.h" #include "nm-sd-utils-core.h" diff --git a/src/core/systemd/nm-sd-utils-dhcp.c b/src/core/systemd/nm-sd-utils-dhcp.c index bafc8fcc68..b5aa315a97 100644 --- a/src/core/systemd/nm-sd-utils-dhcp.c +++ b/src/core/systemd/nm-sd-utils-dhcp.c @@ -3,7 +3,7 @@ * Copyright (C) 2019 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/systemd/nm-default-systemd.h" #include "nm-sd-utils-dhcp.h" diff --git a/src/core/systemd/nm-sd.c b/src/core/systemd/nm-sd.c index 6543321312..11f3abbd36 100644 --- a/src/core/systemd/nm-sd.c +++ b/src/core/systemd/nm-sd.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 - 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/systemd/nm-default-systemd.h" #include "nm-sd.h" diff --git a/src/core/systemd/sd-adapt-core/nm-sd-adapt-core.c b/src/core/systemd/sd-adapt-core/nm-sd-adapt-core.c index c03d4d97bd..9339b33dc8 100644 --- a/src/core/systemd/sd-adapt-core/nm-sd-adapt-core.c +++ b/src/core/systemd/sd-adapt-core/nm-sd-adapt-core.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 - 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/systemd/nm-default-systemd.h" #include "nm-sd-adapt-core.h" diff --git a/src/core/systemd/sd-adapt-core/nm-sd-adapt-core.h b/src/core/systemd/sd-adapt-core/nm-sd-adapt-core.h index a7332914f0..f627d7d471 100644 --- a/src/core/systemd/sd-adapt-core/nm-sd-adapt-core.h +++ b/src/core/systemd/sd-adapt-core/nm-sd-adapt-core.h @@ -6,13 +6,16 @@ #ifndef __NM_SD_ADAPT_CORE_H__ #define __NM_SD_ADAPT_CORE_H__ -#include "nm-default.h" +#include "src/core/systemd/nm-default-systemd.h" #include #include #include +#undef NETWORKMANAGER_COMPILATION #include "systemd/sd-adapt-shared/nm-sd-adapt-shared.h" +#undef NETWORKMANAGER_COMPILATION +#define NETWORKMANAGER_COMPILATION NM_NETWORKMANAGER_COMPILATION_SYSTEMD #ifndef HAVE_SYS_AUXV_H #define HAVE_SYS_AUXV_H 0 diff --git a/src/core/tests/config/nm-test-device.c b/src/core/tests/config/nm-test-device.c index c6b894d429..f724b03a5d 100644 --- a/src/core/tests/config/nm-test-device.c +++ b/src/core/tests/config/nm-test-device.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-test-device.h" diff --git a/src/core/tests/config/test-config.c b/src/core/tests/config/test-config.c index 526c713852..3bb148152b 100644 --- a/src/core/tests/config/test-config.c +++ b/src/core/tests/config/test-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/tests/meson.build b/src/core/tests/meson.build index f4125396c2..994563c42c 100644 --- a/src/core/tests/meson.build +++ b/src/core/tests/meson.build @@ -41,8 +41,7 @@ exe = executable( libnm_systemd_shared_dep, ], c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD', + '-DG_LOG_DOMAIN="test"', ], ) diff --git a/src/core/tests/test-core-with-expect.c b/src/core/tests/test-core-with-expect.c index d9750cd676..022cf8f39e 100644 --- a/src/core/tests/test-core-with-expect.c +++ b/src/core/tests/test-core-with-expect.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/tests/test-core.c b/src/core/tests/test-core.c index 87136dc3f1..8698c40607 100644 --- a/src/core/tests/test-core.c +++ b/src/core/tests/test-core.c @@ -3,7 +3,7 @@ * Copyright (C) 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/tests/test-dcb.c b/src/core/tests/test-dcb.c index 9ee1fda6fb..fc591fcbc4 100644 --- a/src/core/tests/test-dcb.c +++ b/src/core/tests/test-dcb.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-dcb.h" diff --git a/src/core/tests/test-ip4-config.c b/src/core/tests/test-ip4-config.c index 008201a2bf..27b1d61139 100644 --- a/src/core/tests/test-ip4-config.c +++ b/src/core/tests/test-ip4-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 - 2014 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include diff --git a/src/core/tests/test-ip6-config.c b/src/core/tests/test-ip6-config.c index 7ba79731c4..3b48fb7f38 100644 --- a/src/core/tests/test-ip6-config.c +++ b/src/core/tests/test-ip6-config.c @@ -3,7 +3,7 @@ * Copyright (C) 2013 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/tests/test-l3cfg.c b/src/core/tests/test-l3cfg.c index 92e596a09e..43132c6d93 100644 --- a/src/core/tests/test-l3cfg.c +++ b/src/core/tests/test-l3cfg.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-l3cfg.h" #include "nm-l3-ipv4ll.h" diff --git a/src/core/tests/test-systemd.c b/src/core/tests/test-systemd.c index aa87660c98..03576c133c 100644 --- a/src/core/tests/test-systemd.c +++ b/src/core/tests/test-systemd.c @@ -3,7 +3,7 @@ * Copyright (C) 2016 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/systemd/nm-default-systemd.h" #include "systemd/nm-sd.h" #include "systemd/nm-sd-utils-shared.h" diff --git a/src/core/tests/test-utils.c b/src/core/tests/test-utils.c index 7750109279..1d562bde09 100644 --- a/src/core/tests/test-utils.c +++ b/src/core/tests/test-utils.c @@ -3,7 +3,7 @@ * Copyright (C) 2015 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include #include diff --git a/src/core/tests/test-wired-defname.c b/src/core/tests/test-wired-defname.c index 7fb8cbab99..f810c56f17 100644 --- a/src/core/tests/test-wired-defname.c +++ b/src/core/tests/test-wired-defname.c @@ -3,7 +3,7 @@ * Copyright (C) 2010 Red Hat, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-simple-connection.h" #include "nm-setting-connection.h" diff --git a/src/core/vpn/nm-vpn-connection.c b/src/core/vpn/nm-vpn-connection.c index b6513497a0..02831b0838 100644 --- a/src/core/vpn/nm-vpn-connection.c +++ b/src/core/vpn/nm-vpn-connection.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-vpn-connection.h" diff --git a/src/core/vpn/nm-vpn-manager.c b/src/core/vpn/nm-vpn-manager.c index 65f9e56918..53fe58dd36 100644 --- a/src/core/vpn/nm-vpn-manager.c +++ b/src/core/vpn/nm-vpn-manager.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 - 2008 Novell, Inc. */ -#include "nm-default.h" +#include "src/core/nm-default-daemon.h" #include "nm-vpn-manager.h" diff --git a/tools/check-tree.sh b/tools/check-tree.sh new file mode 100755 index 0000000000..cff85c3e16 --- /dev/null +++ b/tools/check-tree.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +TOP_DIR="$(dirname "$0")/.." + +die() { + printf 'FAIL: %s\n' "$*" >&2 + exit 1 +} + +check_cmp() { + local a="$1" + local b="$2" + + cmp "$TOP_DIR/$a" "$TOP_DIR/$b" && return 0 + + diff "$TOP_DIR/$a" "$TOP_DIR/$b" || : + die "files \"$a\" and \"$b\" differ!" +} + +check_cmp shared/nm-base/nm-ethtool-utils-base.h libnm/nm-ethtool-utils.h +check_cmp libnm-core/nm-meta-setting-base-impl.h clients/common/nm-meta-setting-base-impl.h +check_cmp libnm-core/nm-meta-setting-base-impl.c clients/common/nm-meta-setting-base-impl.c