diff options
Diffstat (limited to 'libnm')
| -rw-r--r-- | libnm/Makefile.am | 21 | ||||
| -rw-r--r-- | libnm/Makefile.in | 38 | ||||
| -rw-r--r-- | libnm/libnm.ver | 21 | ||||
| -rw-r--r-- | libnm/nm-client.c | 60 | ||||
| -rw-r--r-- | libnm/nm-client.h | 9 | ||||
| -rw-r--r-- | libnm/nm-dbus-helpers.h | 2 | ||||
| -rw-r--r-- | libnm/nm-device-ethernet.c | 9 | ||||
| -rw-r--r-- | libnm/nm-device-team.c | 40 | ||||
| -rw-r--r-- | libnm/nm-device-team.h | 3 | ||||
| -rw-r--r-- | libnm/nm-enum-types.c | 2 | ||||
| -rw-r--r-- | libnm/nm-ifcfg-rh-docs.xml | 14 | ||||
| -rw-r--r-- | libnm/nm-manager.c | 4 | ||||
| -rw-r--r-- | libnm/nm-object-cache.h | 1 | ||||
| -rw-r--r-- | libnm/nm-object-private.h | 1 | ||||
| -rw-r--r-- | libnm/nm-property-docs.xml | 10 | ||||
| -rw-r--r-- | libnm/nm-setting-docs-overrides.xml | 14 | ||||
| -rw-r--r-- | libnm/nm-setting-docs.xml | 12 | ||||
| -rw-r--r-- | libnm/nm-vpn-editor.h | 2 | ||||
| -rw-r--r-- | libnm/nm-vpn-service-plugin.c | 8 | ||||
| -rw-r--r-- | libnm/tests/Makefile.am | 24 | ||||
| -rw-r--r-- | libnm/tests/Makefile.in | 117 |
21 files changed, 357 insertions, 55 deletions
diff --git a/libnm/Makefile.am b/libnm/Makefile.am index 184bdbdc..ee64d4eb 100644 --- a/libnm/Makefile.am +++ b/libnm/Makefile.am @@ -137,17 +137,15 @@ GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "nm-default.h"\ libnm_la_LIBADD = \ $(top_builddir)/libnm-core/libnm-core.la \ $(top_builddir)/introspection/libnmdbus.la \ - $(LIBDL) \ + $(DL_LIBS) \ $(GLIB_LIBS) \ $(UUID_LIBS) \ $(GUDEV_LIBS) -libnm_la_LDFLAGS = \ - $(CODE_COVERAGE_LDFLAGS) - SYMBOL_VIS_FILE=$(srcdir)/libnm.ver libnm_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \ + $(CODE_COVERAGE_LDFLAGS) \ -version-info "1:0:1" ### @@ -171,6 +169,10 @@ INTROSPECTION_COMPILER_ARGS = \ --includedir=$(top_srcdir)/libnm \ --includedir=$(top_builddir)/libnm +# Pass SANITIZER_ENV where a command that uses built libraries is +# executed, to suppress possible errors +INTROSPECTION_SCANNER_ENV = $(SANITIZER_ENV) + if HAVE_INTROSPECTION introspection_sources = \ $(libnm_core_headers) \ @@ -214,9 +216,16 @@ docs_sources = $(filter-out %/nm-core-enum-types.c,$(libnm_core_sources)) nm-setting-docs-overrides.xml: generate-plugin-docs.pl $(docs_sources) $(srcdir)/generate-plugin-docs.pl dbus $(top_srcdir)/libnm-core $@ +# When the python scripts loads libnm and the address sanitizers is +# enabled, we must LD_PRELOAD libasan otherwise it will complain that +# it was not loaded as initial library. nm-property-docs.xml: generate-setting-docs.py $(docs_sources) | NM-1.0.gir NM-1.0.typelib libnm.la export GI_TYPELIB_PATH=$(abs_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \ export LD_LIBRARY_PATH=$(abs_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \ + if echo $(CFLAGS) | grep -e -fsanitize=address; then \ + export LD_PRELOAD="$${LD_PRELOAD} $$(ldd $(abs_builddir)/.libs/libnm.so | grep libasan\.so\.. -o | head -n 1)"; \ + fi; \ + [ -n "$(SANITIZER_ENV)" ] && export $(SANITIZER_ENV) ; \ $(srcdir)/generate-setting-docs.py \ --gir $(builddir)/NM-1.0.gir \ --output $@ @@ -224,6 +233,10 @@ nm-property-docs.xml: generate-setting-docs.py $(docs_sources) | NM-1.0.gir NM-1 nm-setting-docs.xml: generate-setting-docs.py $(docs_sources) nm-setting-docs-overrides.xml | NM-1.0.gir NM-1.0.typelib libnm.la export GI_TYPELIB_PATH=$(abs_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \ export LD_LIBRARY_PATH=$(abs_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \ + if echo $(CFLAGS) | grep -e -fsanitize=address; then \ + export LD_PRELOAD="$${LD_PRELOAD} $$(ldd $(abs_builddir)/.libs/libnm.so | grep libasan\.so\.. -o | head -n 1)"; \ + fi; \ + [ -n "$(SANITIZER_ENV)" ] && export $(SANITIZER_ENV) ; \ $(srcdir)/generate-setting-docs.py \ --gir $(builddir)/NM-1.0.gir \ --overrides $(builddir)/nm-setting-docs-overrides.xml \ diff --git a/libnm/Makefile.in b/libnm/Makefile.in index f6ce85de..119a03f7 100644 --- a/libnm/Makefile.in +++ b/libnm/Makefile.in @@ -100,8 +100,9 @@ host_triplet = @host@ @BUILD_SETTING_DOCS_TRUE@am__append_4 = $(noinst_DATA) subdir = libnm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \ - $(top_srcdir)/m4/compiler_warnings.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \ + $(top_srcdir)/m4/ax_lib_readline.m4 \ + $(top_srcdir)/m4/compiler_options.m4 \ $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gnome-code-coverage.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ @@ -324,6 +325,7 @@ DHCLIENT_PATH = @DHCLIENT_PATH@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ +DL_LIBS = @DL_LIBS@ DNSMASQ_PATH = @DNSMASQ_PATH@ DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ @@ -380,13 +382,14 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ +JANSSON_CFLAGS = @JANSSON_CFLAGS@ +JANSSON_LIBS = @JANSSON_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ -LIBDL = @LIBDL@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -398,6 +401,8 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ LIBSOUP_LIBS = @LIBSOUP_LIBS@ +LIBSYSTEMD_CFLAGS = @LIBSYSTEMD_CFLAGS@ +LIBSYSTEMD_LIBS = @LIBSYSTEMD_LIBS@ LIBTEAMDCTL_CFLAGS = @LIBTEAMDCTL_CFLAGS@ LIBTEAMDCTL_LIBS = @LIBTEAMDCTL_LIBS@ LIBTOOL = @LIBTOOL@ @@ -458,6 +463,8 @@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ +SANITIZERS = @SANITIZERS@ +SANITIZER_ENV = @SANITIZER_ENV@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ SELINUX_LIBS = @SELINUX_LIBS@ @@ -493,6 +500,7 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_RANLIB = @ac_ct_RANLIB@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -619,7 +627,7 @@ libnm_core_headers = \ $(core)/nm-vpn-plugin-info.h libnm_core_private_headers = \ - $(top_builddir)/shared/nm-shared-utils.h \ + $(top_builddir)/shared/nm-utils/nm-shared-utils.h \ $(core)/crypto.h \ $(core)/nm-connection-private.h \ $(core)/nm-core-internal.h \ @@ -631,7 +639,7 @@ libnm_core_private_headers = \ $(core)/nm-utils-private.h libnm_core_sources = \ - $(top_builddir)/shared/nm-shared-utils.c \ + $(top_builddir)/shared/nm-utils/nm-shared-utils.c \ $(core_build)/nm-core-enum-types.c \ $(core)/crypto.c \ $(core)/nm-connection.c \ @@ -791,15 +799,16 @@ GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "nm-default.h"\ libnm_la_LIBADD = \ $(top_builddir)/libnm-core/libnm-core.la \ $(top_builddir)/introspection/libnmdbus.la \ - $(LIBDL) \ + $(DL_LIBS) \ $(GLIB_LIBS) \ $(UUID_LIBS) \ $(GUDEV_LIBS) +SYMBOL_VIS_FILE = $(srcdir)/libnm.ver libnm_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \ + $(CODE_COVERAGE_LDFLAGS) \ -version-info "1:0:1" -SYMBOL_VIS_FILE = $(srcdir)/libnm.ver ### BUILT_SOURCES = $(GLIB_GENERATED) @@ -816,6 +825,10 @@ INTROSPECTION_COMPILER_ARGS = \ --includedir=$(top_srcdir)/libnm \ --includedir=$(top_builddir)/libnm + +# Pass SANITIZER_ENV where a command that uses built libraries is +# executed, to suppress possible errors +INTROSPECTION_SCANNER_ENV = $(SANITIZER_ENV) @HAVE_INTROSPECTION_TRUE@introspection_sources = \ @HAVE_INTROSPECTION_TRUE@ $(libnm_core_headers) \ @HAVE_INTROSPECTION_TRUE@ $(libnminclude_hfiles) \ @@ -1384,9 +1397,16 @@ check-local: @BUILD_SETTING_DOCS_TRUE@nm-setting-docs-overrides.xml: generate-plugin-docs.pl $(docs_sources) @BUILD_SETTING_DOCS_TRUE@ $(srcdir)/generate-plugin-docs.pl dbus $(top_srcdir)/libnm-core $@ +# When the python scripts loads libnm and the address sanitizers is +# enabled, we must LD_PRELOAD libasan otherwise it will complain that +# it was not loaded as initial library. @BUILD_SETTING_DOCS_TRUE@nm-property-docs.xml: generate-setting-docs.py $(docs_sources) | NM-1.0.gir NM-1.0.typelib libnm.la @BUILD_SETTING_DOCS_TRUE@ export GI_TYPELIB_PATH=$(abs_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \ @BUILD_SETTING_DOCS_TRUE@ export LD_LIBRARY_PATH=$(abs_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \ +@BUILD_SETTING_DOCS_TRUE@ if echo $(CFLAGS) | grep -e -fsanitize=address; then \ +@BUILD_SETTING_DOCS_TRUE@ export LD_PRELOAD="$${LD_PRELOAD} $$(ldd $(abs_builddir)/.libs/libnm.so | grep libasan\.so\.. -o | head -n 1)"; \ +@BUILD_SETTING_DOCS_TRUE@ fi; \ +@BUILD_SETTING_DOCS_TRUE@ [ -n "$(SANITIZER_ENV)" ] && export $(SANITIZER_ENV) ; \ @BUILD_SETTING_DOCS_TRUE@ $(srcdir)/generate-setting-docs.py \ @BUILD_SETTING_DOCS_TRUE@ --gir $(builddir)/NM-1.0.gir \ @BUILD_SETTING_DOCS_TRUE@ --output $@ @@ -1394,6 +1414,10 @@ check-local: @BUILD_SETTING_DOCS_TRUE@nm-setting-docs.xml: generate-setting-docs.py $(docs_sources) nm-setting-docs-overrides.xml | NM-1.0.gir NM-1.0.typelib libnm.la @BUILD_SETTING_DOCS_TRUE@ export GI_TYPELIB_PATH=$(abs_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \ @BUILD_SETTING_DOCS_TRUE@ export LD_LIBRARY_PATH=$(abs_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \ +@BUILD_SETTING_DOCS_TRUE@ if echo $(CFLAGS) | grep -e -fsanitize=address; then \ +@BUILD_SETTING_DOCS_TRUE@ export LD_PRELOAD="$${LD_PRELOAD} $$(ldd $(abs_builddir)/.libs/libnm.so | grep libasan\.so\.. -o | head -n 1)"; \ +@BUILD_SETTING_DOCS_TRUE@ fi; \ +@BUILD_SETTING_DOCS_TRUE@ [ -n "$(SANITIZER_ENV)" ] && export $(SANITIZER_ENV) ; \ @BUILD_SETTING_DOCS_TRUE@ $(srcdir)/generate-setting-docs.py \ @BUILD_SETTING_DOCS_TRUE@ --gir $(builddir)/NM-1.0.gir \ @BUILD_SETTING_DOCS_TRUE@ --overrides $(builddir)/nm-setting-docs-overrides.xml \ diff --git a/libnm/libnm.ver b/libnm/libnm.ver index 4fd8027c..cc2fc7df 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -1060,5 +1060,26 @@ global: } libnm_1_0_0; libnm_1_2_4 { + #nm_setting_ip_config_get_dns_priority@libnm_1_2_4; +} libnm_1_2_0; + +libnm_1_4_0 { +global: + nm_device_team_get_config; + nm_setting_connection_get_stable_id; + nm_setting_ip6_config_get_token; nm_setting_ip_config_get_dns_priority; + nm_setting_wired_get_generate_mac_address_mask; + nm_setting_wireless_get_generate_mac_address_mask; + nm_vpn_editor_plugin_get_plugin_info; + nm_vpn_editor_plugin_get_vt; + nm_vpn_editor_plugin_load; + nm_vpn_editor_plugin_set_plugin_info; + nm_vpn_plugin_info_get_aliases; + nm_vpn_plugin_info_get_auth_dialog; + nm_vpn_plugin_info_get_service; + nm_vpn_plugin_info_list_get_service_types; + nm_vpn_plugin_info_list_find_service_type; + nm_vpn_plugin_info_new_search_file; + nm_vpn_plugin_info_supports_hints; } libnm_1_2_0; diff --git a/libnm/nm-client.c b/libnm/nm-client.c index a7ecdb55..64c0d9de 100644 --- a/libnm/nm-client.c +++ b/libnm/nm-client.c @@ -89,6 +89,8 @@ enum { PERMISSION_CHANGED, CONNECTION_ADDED, CONNECTION_REMOVED, + ACTIVE_CONNECTION_ADDED, + ACTIVE_CONNECTION_REMOVED, LAST_SIGNAL }; @@ -1368,7 +1370,7 @@ nm_client_add_connection_finish (NMClient *client, /** * nm_client_load_connections: * @client: the %NMClient - * @filenames: %NULL-terminated array of filenames to load + * @filenames: (array zero-terminated=1): %NULL-terminated array of filenames to load * @failures: (out) (transfer full): on return, a %NULL-terminated array of * filenames that failed to load * @cancellable: a #GCancellable, or %NULL @@ -1427,7 +1429,7 @@ load_connections_cb (GObject *object, GAsyncResult *result, gpointer user_data) /** * nm_client_load_connections_async: * @client: the %NMClient - * @filenames: %NULL-terminated array of filenames to load + * @filenames: (array zero-terminated=1): %NULL-terminated array of filenames to load * @cancellable: a #GCancellable, or %NULL * @callback: (scope async): callback to be called when the operation completes * @user_data: (closure): caller-specific data passed to @callback @@ -1465,8 +1467,8 @@ nm_client_load_connections_async (NMClient *client, /** * nm_client_load_connections_finish: * @client: the %NMClient - * @failures: (out) (transfer full): on return, a %NULL-terminated array of - * filenames that failed to load + * @failures: (out) (transfer full) (array zero-terminated=1): on return, a + * %NULL-terminated array of filenames that failed to load * @result: the result passed to the #GAsyncReadyCallback * @error: location for a #GError, or %NULL * @@ -1752,6 +1754,22 @@ settings_connection_removed (NMRemoteSettings *manager, } static void +manager_active_connection_added (NMManager *manager, + NMActiveConnection *active_connection, + gpointer client) +{ + g_signal_emit (client, signals[ACTIVE_CONNECTION_ADDED], 0, active_connection); +} + +static void +manager_active_connection_removed (NMManager *manager, + NMActiveConnection *active_connection, + gpointer client) +{ + g_signal_emit (client, signals[ACTIVE_CONNECTION_REMOVED], 0, active_connection); +} + +static void constructed (GObject *object) { NMClient *client = NM_CLIENT (object); @@ -1772,6 +1790,10 @@ constructed (GObject *object) G_CALLBACK (manager_any_device_removed), client); g_signal_connect (priv->manager, "permission-changed", G_CALLBACK (manager_permission_changed), client); + g_signal_connect (priv->manager, "active-connection-added", + G_CALLBACK (manager_active_connection_added), client); + g_signal_connect (priv->manager, "active-connection-removed", + G_CALLBACK (manager_active_connection_removed), client); priv->settings = g_object_new (NM_TYPE_REMOTE_SETTINGS, NM_OBJECT_PATH, NM_DBUS_PATH_SETTINGS, @@ -2353,6 +2375,36 @@ nm_client_class_init (NMClientClass *client_class) NULL, NULL, NULL, G_TYPE_NONE, 1, NM_TYPE_REMOTE_CONNECTION); + + /** + * NMClient::active-connection-added: + * @client: the settings object that received the signal + * @active_connection: the new active connection + * + * Notifies that a #NMActiveConnection has been added. + **/ + signals[ACTIVE_CONNECTION_ADDED] = + g_signal_new (NM_CLIENT_ACTIVE_CONNECTION_ADDED, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 1, + NM_TYPE_ACTIVE_CONNECTION); + + /** + * NMClient::active-connection-removed: + * @client: the settings object that received the signal + * @active_connection: the removed active connection + * + * Notifies that a #NMActiveConnection has been removed. + **/ + signals[ACTIVE_CONNECTION_REMOVED] = + g_signal_new (NM_CLIENT_ACTIVE_CONNECTION_REMOVED, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 1, + NM_TYPE_ACTIVE_CONNECTION); } static void diff --git a/libnm/nm-client.h b/libnm/nm-client.h index 6bae78fa..5358ded4 100644 --- a/libnm/nm-client.h +++ b/libnm/nm-client.h @@ -66,6 +66,8 @@ G_BEGIN_DECLS #define NM_CLIENT_PERMISSION_CHANGED "permission-changed" #define NM_CLIENT_CONNECTION_ADDED "connection-added" #define NM_CLIENT_CONNECTION_REMOVED "connection-removed" +#define NM_CLIENT_ACTIVE_CONNECTION_ADDED "active-connection-added" +#define NM_CLIENT_ACTIVE_CONNECTION_REMOVED "active-connection-removed" /** * NMClientPermission: @@ -95,6 +97,9 @@ G_BEGIN_DECLS * @NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS: modify persistent global * DNS configuration * @NM_CLIENT_PERMISSION_RELOAD: controls access to Reload. + * @NM_CLIENT_PERMISSION_CHECKPOINT_ROLLBACK: permission to create checkpoints. + * @NM_CLIENT_PERMISSION_ENABLE_DISABLE_STATISTICS: controls whether device + * statistics can be globally enabled or disabled * @NM_CLIENT_PERMISSION_LAST: a reserved boundary value * * #NMClientPermission values indicate various permissions that NetworkManager @@ -115,8 +120,10 @@ typedef enum { NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME = 11, NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS = 12, NM_CLIENT_PERMISSION_RELOAD = 13, + NM_CLIENT_PERMISSION_CHECKPOINT_ROLLBACK = 14, + NM_CLIENT_PERMISSION_ENABLE_DISABLE_STATISTICS = 15, - NM_CLIENT_PERMISSION_LAST = 13, + NM_CLIENT_PERMISSION_LAST = 15, } NMClientPermission; /** diff --git a/libnm/nm-dbus-helpers.h b/libnm/nm-dbus-helpers.h index 497739f0..4ec8988a 100644 --- a/libnm/nm-dbus-helpers.h +++ b/libnm/nm-dbus-helpers.h @@ -21,8 +21,6 @@ #ifndef __NM_DBUS_HELPERS_PRIVATE_H__ #define __NM_DBUS_HELPERS_PRIVATE_H__ - -#include "nm-default.h" #include "nm-dbus-compat.h" GBusType _nm_dbus_bus_type (void); diff --git a/libnm/nm-device-ethernet.c b/libnm/nm-device-ethernet.c index 88a7c432..825ed7b3 100644 --- a/libnm/nm-device-ethernet.c +++ b/libnm/nm-device-ethernet.c @@ -227,9 +227,14 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro perm_addr = nm_device_ethernet_get_permanent_hw_address (NM_DEVICE_ETHERNET (device)); s_mac = nm_setting_wired_get_mac_address (s_wired); if (perm_addr) { + /* Virtual devices will have empty permanent addr but they should not be excluded + * from the MAC address check specified in the connection */ + if (*perm_addr == 0) + perm_addr = nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device)); + if (!nm_utils_hwaddr_valid (perm_addr, ETH_ALEN)) { - g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, - _("Invalid device MAC address.")); + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, + _("Invalid device MAC address %s."), perm_addr); return FALSE; } if (try_mac && s_mac && !nm_utils_hwaddr_matches (s_mac, -1, perm_addr, -1)) { diff --git a/libnm/nm-device-team.c b/libnm/nm-device-team.c index b855d5ec..3955e105 100644 --- a/libnm/nm-device-team.c +++ b/libnm/nm-device-team.c @@ -39,6 +39,7 @@ typedef struct { char *hw_address; gboolean carrier; GPtrArray *slaves; + char *config; } NMDeviceTeamPrivate; enum { @@ -46,6 +47,7 @@ enum { PROP_HW_ADDRESS, PROP_CARRIER, PROP_SLAVES, + PROP_CONFIG, LAST_PROP }; @@ -101,6 +103,25 @@ nm_device_team_get_slaves (NMDeviceTeam *device) return NM_DEVICE_TEAM_GET_PRIVATE (device)->slaves; } +/** + * nm_device_team_get_config: + * @device: a #NMDeviceTeam + * + * Gets the current JSON configuration of the #NMDeviceTeam + * + * Returns: the current configuration. This is the internal string used by the + * device, and must not be modified. + * + * Since: 1.4 + **/ +const char * +nm_device_team_get_config (NMDeviceTeam *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_TEAM (device), NULL); + + return NM_DEVICE_TEAM_GET_PRIVATE (device)->config; +} + static const char * get_hw_address (NMDevice *device) { @@ -150,6 +171,7 @@ init_dbus (NMObject *object) { NM_DEVICE_TEAM_HW_ADDRESS, &priv->hw_address }, { NM_DEVICE_TEAM_CARRIER, &priv->carrier }, { NM_DEVICE_TEAM_SLAVES, &priv->slaves, NULL, NM_TYPE_DEVICE }, + { NM_DEVICE_TEAM_CONFIG, &priv->config }, { NULL }, }; @@ -176,6 +198,7 @@ finalize (GObject *object) NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (object); g_free (priv->hw_address); + g_free (priv->config); G_OBJECT_CLASS (nm_device_team_parent_class)->finalize (object); } @@ -198,6 +221,9 @@ get_property (GObject *object, case PROP_SLAVES: g_value_take_boxed (value, _nm_utils_copy_object_array (nm_device_team_get_slaves (device))); break; + case PROP_CONFIG: + g_value_set_string (value, nm_device_team_get_config (device)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -265,4 +291,18 @@ nm_device_team_class_init (NMDeviceTeamClass *team_class) G_TYPE_PTR_ARRAY, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceTeam:config: + * + * The current JSON configuration of the device. + * + * Since: 1.4 + **/ + g_object_class_install_property + (object_class, PROP_CONFIG, + g_param_spec_string (NM_DEVICE_TEAM_CONFIG, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm/nm-device-team.h b/libnm/nm-device-team.h index a9b71c6a..522e3d29 100644 --- a/libnm/nm-device-team.h +++ b/libnm/nm-device-team.h @@ -39,6 +39,7 @@ G_BEGIN_DECLS #define NM_DEVICE_TEAM_HW_ADDRESS "hw-address" #define NM_DEVICE_TEAM_CARRIER "carrier" #define NM_DEVICE_TEAM_SLAVES "slaves" +#define NM_DEVICE_TEAM_CONFIG "config" /** * NMDeviceTeam: @@ -59,6 +60,8 @@ GType nm_device_team_get_type (void); const char *nm_device_team_get_hw_address (NMDeviceTeam *device); gboolean nm_device_team_get_carrier (NMDeviceTeam *device); const GPtrArray *nm_device_team_get_slaves (NMDeviceTeam *device); +NM_AVAILABLE_IN_1_4 +const char *nm_device_team_get_config (NMDeviceTeam *device); G_END_DECLS diff --git a/libnm/nm-enum-types.c b/libnm/nm-enum-types.c index a64e4cf0..eaebcfbe 100644 --- a/libnm/nm-enum-types.c +++ b/libnm/nm-enum-types.c @@ -65,6 +65,8 @@ nm_client_permission_get_type (void) { NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME, "NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME", "settings-modify-hostname" }, { NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS, "NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS", "settings-modify-global-dns" }, { NM_CLIENT_PERMISSION_RELOAD, "NM_CLIENT_PERMISSION_RELOAD", "reload" }, + { NM_CLIENT_PERMISSION_CHECKPOINT_ROLLBACK, "NM_CLIENT_PERMISSION_CHECKPOINT_ROLLBACK", "checkpoint-rollback" }, + { NM_CLIENT_PERMISSION_ENABLE_DISABLE_STATISTICS, "NM_CLIENT_PERMISSION_ENABLE_DISABLE_STATISTICS", "enable-disable-statistics" }, { NM_CLIENT_PERMISSION_LAST, "NM_CLIENT_PERMISSION_LAST", "last" }, { 0, NULL, NULL } }; diff --git a/libnm/nm-ifcfg-rh-docs.xml b/libnm/nm-ifcfg-rh-docs.xml index ef01a16a..36018c21 100644 --- a/libnm/nm-ifcfg-rh-docs.xml +++ b/libnm/nm-ifcfg-rh-docs.xml @@ -71,7 +71,8 @@ MACADDR for bridges is an NM extension."/> <setting name="connection"> <property name="id" variable="NAME(+)" format="" values="" default="" example="" description="User friendly name for the connection profile."/> <property name="uuid" variable="UUID(+)" format="" values="" default="" example="" description="UUID for the connection profile. When missing, NetworkManager -creates the UUID itself (by hashing the file)."/> +creates the UUID itself (by hashing the filename)."/> +<property name="stable-id" variable="STABLE_ID(+)" format="" values="" default="" example="" description="Token to generate stable IDs."/> <property name="interface-name" variable="DEVICE" format="" values="" default="" example="" description="Interface name of the device this profile is bound to. The variable can be left out when the profile should apply for more devices. Note that DEVICE can be required for some connection types."/> @@ -158,6 +159,9 @@ meaning as 'never-default' property."/> <property name="may-fail" variable="IPV4_FAILURE_FATAL(+)" format="" values="" default="no" example="" description="IPV4_FAILURE_FATAL has the opposite meaning as 'may-fail' property."/> <property name="route-metric" variable="IPV4_ROUTE_METRIC(+)" format="" values="" default="-1" example="" description="IPV4_ROUTE_METRIC is the default IPv4 metric for routes on this connection. If set to -1, a default metric based on the device type is used."/> +<property name="dns-priority" variable="IPV4_DNS_PRIORITY(+)" format="" values="" default="0" example="IPV4_DNS_PRIORITY=20" description="The priority for DNS servers of this connection. Lower values have higher priority. +If zero, the default value will be used (50 for VPNs, 100 for other connections). +A negative value prevents DNS from other connections with greater values to be used."/> <property name="dhcp-client-id" variable="DHCP_CLIENT_ID(+)" format="" values="" default="" example="DHCP_CLIENT_ID=ax-srv-1" description="A string sent to the DHCP server to identify the local machine."/> <property name="dad-timeout" variable="ARPING_WAIT" format="" values="" default="missing variable means global default (config override or 3)" example="ARPING_WAIT=2" description="Timeout (in seconds) for performing DAD before configuring IPv4 addresses. 0 turns off the DAD completely, -1 means default value."/> @@ -185,9 +189,13 @@ meaning as 'never-default' property."/> <property name="may-fail" variable="IPV6_FAILURE_FATAL(+)" format="" values="" default="no" example="" description="IPV6_FAILURE_FATAL has the opposite meaning as 'may-fail' property."/> <property name="route-metric" variable="IPV6_ROUTE_METRIC(+)" format="" values="" default="-1" example="" description="IPV6_ROUTE_METRIC is the default IPv6 metric for routes on this connection. If set to -1, a default metric based on the device type is used."/> +<property name="dns-priority" variable="IPV6_DNS_PRIORITY(+)" format="" values="" default="0" example="IPV6_DNS_PRIORITY=20" description="The priority for DNS servers of this connection. Lower values have higher priority. +If zero, the default value will be used (50 for VPNs, 100 for other connections). +A negative value prevents DNS from other connections with greater values to be used."/> <property name="ip6-privacy" variable="IPV6_PRIVACY, IPV6_PRIVACY_PREFER_PUBLIC_IP(+)" format="" values="IPV6_PRIVACY: no, yes (rfc3041 or rfc4941); IPV6_PRIVACY_PREFER_PUBLIC_IP: yes, no" default="no" example="IPV6_PRIVACY=rfc3041 IPV6_PRIVACY_PREFER_PUBLIC_IP=yes" description="Configure IPv6 Privacy Extensions for SLAAC (RFC4941)."/> <property name="addr-gen-mode" variable="IPV6_ADDR_GEN_MODE" format="" values="IPV6_ADDR_GEN_MODE: eui64, stable-privacy" default="eui64" example="IPV6_ADDR_GEN_MODE=stable-privacy" description="Configure IPv6 Stable Privacy addressing for SLAAC (RFC7217)."/> +<property name="token" variable="IPV6_TOKEN" format="" values="" default="" example="IPV6_TOKEN=::53" description="The IPv6 tokenized interface identifier token"/> </setting> <setting name="macvlan"> </setting> @@ -232,6 +240,8 @@ but VLAN id from DEVICE takes precedence over VLAN_ID."/> notation (e.g. 00:22:68:14:5A:05)."/> <property name="cloned-mac-address" variable="MACADDR" format="" values="" default="" example="" description="Cloned (spoofed) MAC address in traditional hex-digits-and-colons notation (e.g. 00:22:68:14:5A:99)."/> +<property name="generate-mac-address-mask" variable="GENERATE_MAC_ADDRESS_MASK" format="" values="" default="" example="" description="the MAC address mask for generating randomized and stable +cloned-mac-address."/> <property name="mac-address-blacklist" variable="HWADDR_BLACKLIST(+)" format="" values="" default="" example="HWADDR_BLACKLIST="00:22:68:11:69:08 00:11:22:11:44:55"" description="It denies usage of the connection for any device whose address is listed."/> <property name="mtu" variable="MTU" format="" values="" default="" example="" description="MTU of the interface."/> @@ -279,6 +289,8 @@ band is "bg"."/> notation (e.g. 00:22:68:14:5A:05)."/> <property name="cloned-mac-address" variable="MACADDR" format="" values="" default="" example="" description="Cloned (spoofed) MAC address in traditional hex-digits-and-colons notation (e.g. 00:22:68:14:5A:99)."/> +<property name="generate-mac-address-mask" variable="GENERATE_MAC_ADDRESS_MASK" format="" values="" default="" example="" description="the MAC address mask for generating randomized and stable +cloned-mac-address."/> <property name="mac-address-blacklist" variable="HWADDR_BLACKLIST(+)" format="" values="" default="" example="" description="It denies usage of the connection for any device whose address is listed."/> <property name="seen-bssids" variable="(none)" format="" values="" default="" example="" description="This property is not handled by ifcfg-rh plugin."/> diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c index 27bd4ca6..c3d0c51d 100644 --- a/libnm/nm-manager.c +++ b/libnm/nm-manager.c @@ -232,6 +232,10 @@ nm_permission_to_client (const char *nm) return NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS; else if (!strcmp (nm, NM_AUTH_PERMISSION_RELOAD)) return NM_CLIENT_PERMISSION_RELOAD; + else if (!strcmp (nm, NM_AUTH_PERMISSION_CHECKPOINT_ROLLBACK)) + return NM_CLIENT_PERMISSION_CHECKPOINT_ROLLBACK; + else if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_STATISTICS)) + return NM_CLIENT_PERMISSION_ENABLE_DISABLE_STATISTICS; return NM_CLIENT_PERMISSION_NONE; } diff --git a/libnm/nm-object-cache.h b/libnm/nm-object-cache.h index c0f70f21..b29692fa 100644 --- a/libnm/nm-object-cache.h +++ b/libnm/nm-object-cache.h @@ -21,7 +21,6 @@ #ifndef __NM_OBJECT_CACHE_H__ #define __NM_OBJECT_CACHE_H__ -#include "nm-default.h" #include "nm-object.h" G_BEGIN_DECLS diff --git a/libnm/nm-object-private.h b/libnm/nm-object-private.h index 7e8066f4..ad78f92b 100644 --- a/libnm/nm-object-private.h +++ b/libnm/nm-object-private.h @@ -21,7 +21,6 @@ #ifndef __NM_OBJECT_PRIVATE_H__ #define __NM_OBJECT_PRIVATE_H__ -#include "nm-default.h" #include "nm-object.h" typedef gboolean (*PropertyMarshalFunc) (NMObject *, GParamSpec *, GVariant *, gpointer); diff --git a/libnm/nm-property-docs.xml b/libnm/nm-property-docs.xml index b4996bef..71cbc35a 100644 --- a/libnm/nm-property-docs.xml +++ b/libnm/nm-property-docs.xml @@ -98,6 +98,7 @@ <property name="read-only" type="boolean" default="FALSE" description="FALSE if the connection can be modified using the provided settings service's D-Bus interface with the right privileges, or TRUE if the connection is read-only and cannot be modified." /> <property name="secondaries" type="array of string" default="[]" description="List of connection UUIDs that should be activated when the base connection itself is activated. Currently only VPN connections are supported." /> <property name="slave-type" type="string" description="Setting name of the device type of this slave's master connection (eg, "bond"), or NULL if this connection is not a slave." /> + <property name="stable-id" type="string" description="This token to generate stable IDs for the connection. If unset, the UUID will be used instead. The stable-id is used instead of the connection UUID for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable." /> <property name="timestamp" type="uint64" default="0" description="The time, in seconds since the Unix Epoch, that the connection was last _successfully_ fully activated. NetworkManager updates the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp. The property is only meant for reading (changes to this property will not be preserved)." /> <property name="type" type="string" description="Base type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, "802-3-ethernet" or "802-11-wireless" or "bluetooth", etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, "vpn" or "bridge", etc)." /> <property name="uuid" type="string" description="A universally unique identifier for the connection, for example generated with libuuid. It should be assigned when the connection is created, and never changed as long as the connection still applies to the same network. For example, it should not be changed when the "id" property or NMSettingIP4Config changes, but might need to be re-created when the Wi-Fi SSID, mobile broadband network provider, or "type" property changes. The UUID must be in the format "2815492f-7e56-435e-b2e9-246bd7cdc664" (ie, contains only hexadecimal characters and "-")." /> @@ -190,6 +191,7 @@ <property name="never-default" type="boolean" default="FALSE" description="If TRUE, this connection will never be the default connection for this IP type, meaning it will never be assigned the default route by NetworkManager." /> <property name="route-metric" type="int64" default="-1" description="The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is choosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric." /> <property name="routes" type="array of legacy IPv6 route struct" default="[]" description="Array of IP routes." /> + <property name="token" type="string" description="Configure the token for draft-chown-6man-tokenised-ipv6-identifiers-02 IPv6 tokenized interface identifiers. Useful with eui64 addr-gen-mode." /> </setting> <setting name="ip-tunnel"> <property name="encapsulation-limit" type="uint32" default="0" description="How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels." /> @@ -315,8 +317,9 @@ </setting> <setting name="802-3-ethernet"> <property name="auto-negotiate" type="boolean" default="TRUE" description="If TRUE, allow auto-negotiation of port speed and duplex mode. If FALSE, do not allow auto-negotiation, in which case the "speed" and "duplex" properties should be set." /> - <property name="cloned-mac-address" type="byte array" description="If specified, request that the device use this MAC address instead of its permanent MAC address. This is known as MAC cloning or spoofing." /> + <property name="cloned-mac-address" type="byte array" description="If specified, request that the device use this MAC address instead of its permanent MAC address. This is known as MAC cloning or spoofing. Beside explicitly specifing a MAC address, the special values "preserve", "permanent", "random" and "stable" are supported. "preserve" means not to touch the MAC address on activation. "permanent" means to use the permanent hardware address of the device. "random" creates a random MAC address on each connect. "stable" creates a hashed MAC address based on connection.stable-id (or the connection's UUID) and a machine dependent key. If unspecified, the value can be overwritten via global defaults, see manual of NetworkManager.conf. If still unspecified, it defaults to "permanent". On D-Bus, this field is expressed as "assigned-mac-address" or the deprecated "cloned-mac-address"." /> <property name="duplex" type="string" description="If specified, request that the device only use the specified duplex mode. Either "half" or "full"." /> + <property name="generate-mac-address-mask" type="string" description="With "cloned-mac-address" setting "random" or "stable", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting "FE:FF:FF:00:00:00" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the "random" or "stable" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of "FE:FF:FF:00:00:00 68:F7:28:00:00:00" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of "02:00:00:00:00:00 00:00:00:00:00:00" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more then one additional MAC addresses, one of them is chosen randomly. For example, "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00" will create a fully scrambled MAC address, randomly locally or globally administered." /> <property name="mac-address" type="byte array" description="If specified, this connection will only apply to the Ethernet device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing)." /> <property name="mac-address-blacklist" type="array of string" default="[]" description="If specified, this connection will never apply to the Ethernet device whose permanent MAC address matches an address in the list. Each MAC address is in the standard hex-digits-and-colons notation (00:11:22:33:44:55)." /> <property name="mtu" type="uint32" default="0" description="If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames." /> @@ -333,11 +336,12 @@ <property name="band" type="string" description="802.11 frequency band of the network. One of "a" for 5GHz 802.11a or "bg" for 2.4GHz 802.11. This will lock associations to the Wi-Fi network to the specific band, i.e. if "a" is specified, the device will not associate with the same network in the 2.4GHz band even if the network's settings are compatible. This setting depends on specific driver capability and may not work with all drivers." /> <property name="bssid" type="byte array" description="If specified, directs the device to only associate with the given access point. This capability is highly driver dependent and not supported by all devices. Note: this property does not control the BSSID used when creating an Ad-Hoc network and is unlikely to in the future." /> <property name="channel" type="uint32" default="0" description="Wireless channel to use for the Wi-Fi connection. The device will only join (or create for Ad-Hoc networks) a Wi-Fi network on the specified channel. Because channel numbers overlap between bands, this property also requires the "band" property to be set." /> - <property name="cloned-mac-address" type="byte array" description="If specified, request that the Wi-Fi device use this MAC address instead of its permanent MAC address. This is known as MAC cloning or spoofing." /> + <property name="cloned-mac-address" type="byte array" description="If specified, request that the device use this MAC address instead of its permanent MAC address. This is known as MAC cloning or spoofing. Beside explicitly specifing a MAC address, the special values "preserve", "permanent", "random" and "stable" are supported. "preserve" means not to touch the MAC address on activation. "permanent" means to use the permanent hardware address of the device. "random" creates a random MAC address on each connect. "stable" creates a hashed MAC address based on connection.stable-id (or the connection's UUID) and a machine dependent key. If unspecified, the value can be overwritten via global defaults, see manual of NetworkManager.conf. If still unspecified, it defaults to "permanent". On D-Bus, this field is expressed as "assigned-mac-address" or the deprecated "cloned-mac-address"." /> + <property name="generate-mac-address-mask" type="string" description="With "cloned-mac-address" setting "random" or "stable", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting "FE:FF:FF:00:00:00" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the "random" or "stable" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of "FE:FF:FF:00:00:00 68:F7:28:00:00:00" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of "02:00:00:00:00:00 00:00:00:00:00:00" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more then one additional MAC addresses, one of them is chosen randomly. For example, "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00" will create a fully scrambled MAC address, randomly locally or globally administered." /> <property name="hidden" type="boolean" default="FALSE" description="If TRUE, indicates this network is a non-broadcasting network that hides its SSID. In this case various workarounds may take place, such as probe-scanning the SSID for more reliable network discovery. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution." /> <property name="mac-address" type="byte array" description="If specified, this connection will only apply to the Wi-Fi device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing)." /> <property name="mac-address-blacklist" type="array of string" default="[]" description="A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg "00:11:22:33:44:55")." /> - <property name="mac-address-randomization" type="uint32" default="0" description="One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address)." /> + <property name="mac-address-randomization" type="uint32" default="0" description="One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address). Deprecated: 1" /> <property name="mode" type="string" description="Wi-Fi network mode; one of "infrastructure", "adhoc" or "ap". If blank, infrastructure is assumed." /> <property name="mtu" type="uint32" default="0" description="If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames." /> <property name="name" type="string" default="802-11-wireless" description="The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired"." /> diff --git a/libnm/nm-setting-docs-overrides.xml b/libnm/nm-setting-docs-overrides.xml index 2f788db8..8cfa2cc0 100644 --- a/libnm/nm-setting-docs-overrides.xml +++ b/libnm/nm-setting-docs-overrides.xml @@ -137,10 +137,24 @@ vlan's interface name."/> <setting name="wimax"> </setting> <setting name="802-3-ethernet"> +<property name="cloned-mac-address" variable="cloned-mac-address" format="byte array" values="" default="" example="" description="This D-Bus field is deprecated in favor of "assigned-mac-address" +which is more flexible and allows specifying special variants like "random"."/> +<property name="assigned-mac-address" variable="assigned-mac-address" format="string" values="" default="" example="" description="The new field for the cloned MAC address. It can be either +a hardware address in ASCII representation, or one of the special values +"preserve", "permanent", "random" or "stable". +This field replaces the deprecated "cloned-mac-address" on D-Bus, which +can only contain explict hardware addresses."/> </setting> <setting name="802-11-wireless-security"> </setting> <setting name="802-11-wireless"> +<property name="cloned-mac-address" variable="cloned-mac-address" format="byte array" values="" default="" example="" description="This D-Bus field is deprecated in favor of "assigned-mac-address" +which is more flexible and allows specifying special variants like "random"."/> +<property name="assigned-mac-address" variable="assigned-mac-address" format="string" values="" default="" example="" description="The new field for the cloned MAC address. It can be either +a hardware address in ASCII representation, or one of the special values +"preserve", "permanent", "random" or "stable". +This field replaces the deprecated "cloned-mac-address" on D-Bus, which +can only contain explict hardware addresses."/> <property name="security" variable="security" format="" values="" default="" example="" description="This property is deprecated, but can be set to the value '802-11-wireless-security' when a wireless security setting is also present in the connection dictionary, for compatibility with very old diff --git a/libnm/nm-setting-docs.xml b/libnm/nm-setting-docs.xml index dd650ef6..0c0c0968 100644 --- a/libnm/nm-setting-docs.xml +++ b/libnm/nm-setting-docs.xml @@ -100,6 +100,7 @@ <property name="read-only" type="boolean" default="FALSE" description="FALSE if the connection can be modified using the provided settings service's D-Bus interface with the right privileges, or TRUE if the connection is read-only and cannot be modified." /> <property name="secondaries" type="array of string" default="[]" description="List of connection UUIDs that should be activated when the base connection itself is activated. Currently only VPN connections are supported." /> <property name="slave-type" type="string" description="Setting name of the device type of this slave's master connection (eg, "bond"), or NULL if this connection is not a slave." /> + <property name="stable-id" type="string" description="This token to generate stable IDs for the connection. If unset, the UUID will be used instead. The stable-id is used instead of the connection UUID for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable." /> <property name="timestamp" type="uint64" default="0" description="The time, in seconds since the Unix Epoch, that the connection was last _successfully_ fully activated. NetworkManager updates the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp. The property is only meant for reading (changes to this property will not be preserved)." /> <property name="type" type="string" description="Base type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, "802-3-ethernet" or "802-11-wireless" or "bluetooth", etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, "vpn" or "bridge", etc)." /> <property name="uuid" type="string" description="A universally unique identifier for the connection, for example generated with libuuid. It should be assigned when the connection is created, and never changed as long as the connection still applies to the same network. For example, it should not be changed when the "id" property or NMSettingIP4Config changes, but might need to be re-created when the Wi-Fi SSID, mobile broadband network provider, or "type" property changes. The UUID must be in the format "2815492f-7e56-435e-b2e9-246bd7cdc664" (ie, contains only hexadecimal characters and "-")." /> @@ -196,6 +197,7 @@ <property name="route-data" type="array of vardict" description="Array of IPv6 routes. Each route dictionary contains at least 'dest' and 'prefix' entries, containing the destination IP address as a string, and the prefix length as a uint32. Most routes will also have a 'next-hop' entry, containing the next hop IP address as a string. If the route has a 'metric' entry (containing a uint32), that will be used as the metric for the route (otherwise NM will pick a default value appropriate to the device). Additional attributes may also exist on some routes." /> <property name="route-metric" type="int64" default="-1" description="The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is choosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric." /> <property name="routes" type="array of legacy IPv6 route struct (a(ayuayu))" default="[]" description="Deprecated in favor of the 'route-data' property, but this can be used for backward-compatibility with older daemons. Note that if you send this property the daemon will ignore 'route-data'. Array of IPv6 route structures. Each IPv6 route structure is composed of an IPv6 address, a prefix length (1 - 128), an IPv6 next hop address (which may be zeroed out if there is no next hop), and a metric. If the metric is 0, NM will choose an appropriate default metric for the device." /> + <property name="token" type="string" description="Configure the token for draft-chown-6man-tokenised-ipv6-identifiers-02 IPv6 tokenized interface identifiers. Useful with eui64 addr-gen-mode." /> </setting> <setting name="ip-tunnel"> <property name="encapsulation-limit" type="uint32" default="0" description="How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels." /> @@ -322,9 +324,11 @@ <property name="network-name" type="string" description="Network Service Provider (NSP) name of the WiMAX network this connection should use. Deprecated: 1" /> </setting> <setting name="802-3-ethernet"> + <property name="assigned-mac-address" type="string" description="The new field for the cloned MAC address. It can be either a hardware address in ASCII representation, or one of the special values "preserve", "permanent", "random" or "stable". This field replaces the deprecated "cloned-mac-address" on D-Bus, which can only contain explict hardware addresses." /> <property name="auto-negotiate" type="boolean" default="TRUE" description="If TRUE, allow auto-negotiation of port speed and duplex mode. If FALSE, do not allow auto-negotiation, in which case the "speed" and "duplex" properties should be set." /> - <property name="cloned-mac-address" type="byte array" description="If specified, request that the device use this MAC address instead of its permanent MAC address. This is known as MAC cloning or spoofing." /> + <property name="cloned-mac-address" type="byte array" description="This D-Bus field is deprecated in favor of "assigned-mac-address" which is more flexible and allows specifying special variants like "random"." /> <property name="duplex" type="string" description="If specified, request that the device only use the specified duplex mode. Either "half" or "full"." /> + <property name="generate-mac-address-mask" type="string" description="With "cloned-mac-address" setting "random" or "stable", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting "FE:FF:FF:00:00:00" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the "random" or "stable" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of "FE:FF:FF:00:00:00 68:F7:28:00:00:00" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of "02:00:00:00:00:00 00:00:00:00:00:00" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more then one additional MAC addresses, one of them is chosen randomly. For example, "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00" will create a fully scrambled MAC address, randomly locally or globally administered." /> <property name="mac-address" type="byte array" description="If specified, this connection will only apply to the Ethernet device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing)." /> <property name="mac-address-blacklist" type="array of string" default="[]" description="If specified, this connection will never apply to the Ethernet device whose permanent MAC address matches an address in the list. Each MAC address is in the standard hex-digits-and-colons notation (00:11:22:33:44:55)." /> <property name="mtu" type="uint32" default="0" description="If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames." /> @@ -338,14 +342,16 @@ <property name="wake-on-lan-password" type="string" description="If specified, the password used with magic-packet-based Wake-on-LAN, represented as an Ethernet MAC address. If NULL, no password will be required." /> </setting> <setting name="802-11-wireless"> + <property name="assigned-mac-address" type="string" description="The new field for the cloned MAC address. It can be either a hardware address in ASCII representation, or one of the special values "preserve", "permanent", "random" or "stable". This field replaces the deprecated "cloned-mac-address" on D-Bus, which can only contain explict hardware addresses." /> <property name="band" type="string" description="802.11 frequency band of the network. One of "a" for 5GHz 802.11a or "bg" for 2.4GHz 802.11. This will lock associations to the Wi-Fi network to the specific band, i.e. if "a" is specified, the device will not associate with the same network in the 2.4GHz band even if the network's settings are compatible. This setting depends on specific driver capability and may not work with all drivers." /> <property name="bssid" type="byte array" description="If specified, directs the device to only associate with the given access point. This capability is highly driver dependent and not supported by all devices. Note: this property does not control the BSSID used when creating an Ad-Hoc network and is unlikely to in the future." /> <property name="channel" type="uint32" default="0" description="Wireless channel to use for the Wi-Fi connection. The device will only join (or create for Ad-Hoc networks) a Wi-Fi network on the specified channel. Because channel numbers overlap between bands, this property also requires the "band" property to be set." /> - <property name="cloned-mac-address" type="byte array" description="If specified, request that the Wi-Fi device use this MAC address instead of its permanent MAC address. This is known as MAC cloning or spoofing." /> + <property name="cloned-mac-address" type="byte array" description="This D-Bus field is deprecated in favor of "assigned-mac-address" which is more flexible and allows specifying special variants like "random"." /> + <property name="generate-mac-address-mask" type="string" description="With "cloned-mac-address" setting "random" or "stable", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting "FE:FF:FF:00:00:00" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the "random" or "stable" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of "FE:FF:FF:00:00:00 68:F7:28:00:00:00" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of "02:00:00:00:00:00 00:00:00:00:00:00" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more then one additional MAC addresses, one of them is chosen randomly. For example, "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00" will create a fully scrambled MAC address, randomly locally or globally administered." /> <property name="hidden" type="boolean" default="FALSE" description="If TRUE, indicates this network is a non-broadcasting network that hides its SSID. In this case various workarounds may take place, such as probe-scanning the SSID for more reliable network discovery. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution." /> <property name="mac-address" type="byte array" description="If specified, this connection will only apply to the Wi-Fi device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing)." /> <property name="mac-address-blacklist" type="array of string" default="[]" description="A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg "00:11:22:33:44:55")." /> - <property name="mac-address-randomization" type="uint32" default="0" description="One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address)." /> + <property name="mac-address-randomization" type="uint32" default="0" description="One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address). Deprecated: 1" /> <property name="mode" type="string" description="Wi-Fi network mode; one of "infrastructure", "adhoc" or "ap". If blank, infrastructure is assumed." /> <property name="mtu" type="uint32" default="0" description="If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames." /> <property name="name" type="string" default="802-11-wireless" description="The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired"." /> diff --git a/libnm/nm-vpn-editor.h b/libnm/nm-vpn-editor.h index a11e9fd1..2ee34525 100644 --- a/libnm/nm-vpn-editor.h +++ b/libnm/nm-vpn-editor.h @@ -30,7 +30,7 @@ #include <glib-object.h> #include <nm-types.h> -#include "nm-vpn-editor-plugin.h" +#include <nm-vpn-editor-plugin.h> G_BEGIN_DECLS diff --git a/libnm/nm-vpn-service-plugin.c b/libnm/nm-vpn-service-plugin.c index bf4369e4..64316296 100644 --- a/libnm/nm-vpn-service-plugin.c +++ b/libnm/nm-vpn-service-plugin.c @@ -1306,3 +1306,11 @@ nm_vpn_service_plugin_initable_iface_init (GInitableIface *iface) { iface->init = init_sync; } + +/*****************************************************************************/ + +/* this header is intended to be copied to users of nm_vpn_editor_plugin_call(), + * to simplify invocation of generic functions. Include it here, to complile + * the code. */ +#include "nm-utils/nm-vpn-editor-plugin-call.h" + diff --git a/libnm/tests/Makefile.am b/libnm/tests/Makefile.am index d2944c4c..1c65f723 100644 --- a/libnm/tests/Makefile.am +++ b/libnm/tests/Makefile.am @@ -39,3 +39,27 @@ test_secret_agent_SOURCES = \ $(top_builddir)/shared/nm-test-libnm-utils.h \ test-secret-agent.c endif + +############################################################################### + +noinst_LTLIBRARIES = \ + libnm-vpn-plugin-utils-test.la + +libnm_vpn_plugin_utils_test_la_SOURCES = \ + $(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.c \ + $(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.h \ + $(NULL) + +libnm_vpn_plugin_utils_test_la_CFLAGS = \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir)/shared \ + -I$(top_srcdir)/libnm-core \ + -I$(top_srcdir)/libnm \ + $(NULL) + +libnm_vpn_plugin_utils_test_la_LIBADD = \ + $(GLIB_LIBS) \ + $(NULL) + +############################################################################### + diff --git a/libnm/tests/Makefile.in b/libnm/tests/Makefile.in index 4592ac6c..35b040f9 100644 --- a/libnm/tests/Makefile.in +++ b/libnm/tests/Makefile.in @@ -14,6 +14,7 @@ @SET_MAKE@ + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -94,8 +95,9 @@ host_triplet = @host@ @ENABLE_TESTS_TRUE@ test-secret-agent$(EXEEXT) subdir = libnm/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \ - $(top_srcdir)/m4/compiler_warnings.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \ + $(top_srcdir)/m4/ax_lib_readline.m4 \ + $(top_srcdir)/m4/compiler_options.m4 \ $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gnome-code-coverage.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ @@ -114,6 +116,21 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libnm_vpn_plugin_utils_test_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libnm_vpn_plugin_utils_test_la_OBJECTS = \ + libnm_vpn_plugin_utils_test_la-nm-vpn-plugin-utils.lo +libnm_vpn_plugin_utils_test_la_OBJECTS = \ + $(am_libnm_vpn_plugin_utils_test_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libnm_vpn_plugin_utils_test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libnm_vpn_plugin_utils_test_la_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_TESTS_TRUE@am__EXEEXT_1 = test-nm-client$(EXEEXT) \ @ENABLE_TESTS_TRUE@ test-remote-settings-client$(EXEEXT) \ @ENABLE_TESTS_TRUE@ test-secret-agent$(EXEEXT) @@ -126,14 +143,9 @@ am__test_nm_client_SOURCES_DIST = \ @ENABLE_TESTS_TRUE@ test-nm-client.$(OBJEXT) test_nm_client_OBJECTS = $(am_test_nm_client_OBJECTS) test_nm_client_LDADD = $(LDADD) -am__DEPENDENCIES_1 = @ENABLE_TESTS_TRUE@test_nm_client_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/libnm/libnm.la \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = am__test_remote_settings_client_SOURCES_DIST = \ $(top_builddir)/shared/nm-test-utils-impl.c \ $(top_builddir)/shared/nm-test-libnm-utils.h \ @@ -193,10 +205,12 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(test_nm_client_SOURCES) \ +SOURCES = $(libnm_vpn_plugin_utils_test_la_SOURCES) \ + $(test_nm_client_SOURCES) \ $(test_remote_settings_client_SOURCES) \ $(test_secret_agent_SOURCES) -DIST_SOURCES = $(am__test_nm_client_SOURCES_DIST) \ +DIST_SOURCES = $(libnm_vpn_plugin_utils_test_la_SOURCES) \ + $(am__test_nm_client_SOURCES_DIST) \ $(am__test_remote_settings_client_SOURCES_DIST) \ $(am__test_secret_agent_SOURCES_DIST) am__can_run_installinfo = \ @@ -464,6 +478,7 @@ DHCLIENT_PATH = @DHCLIENT_PATH@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ +DL_LIBS = @DL_LIBS@ DNSMASQ_PATH = @DNSMASQ_PATH@ DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ @@ -520,13 +535,14 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ +JANSSON_CFLAGS = @JANSSON_CFLAGS@ +JANSSON_LIBS = @JANSSON_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ -LIBDL = @LIBDL@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -538,6 +554,8 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ LIBSOUP_LIBS = @LIBSOUP_LIBS@ +LIBSYSTEMD_CFLAGS = @LIBSYSTEMD_CFLAGS@ +LIBSYSTEMD_LIBS = @LIBSYSTEMD_LIBS@ LIBTEAMDCTL_CFLAGS = @LIBTEAMDCTL_CFLAGS@ LIBTEAMDCTL_LIBS = @LIBTEAMDCTL_LIBS@ LIBTOOL = @LIBTOOL@ @@ -598,6 +616,8 @@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ +SANITIZERS = @SANITIZERS@ +SANITIZER_ENV = @SANITIZER_ENV@ SED = @SED@ SELINUX_CFLAGS = @SELINUX_CFLAGS@ SELINUX_LIBS = @SELINUX_LIBS@ @@ -633,6 +653,7 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_RANLIB = @ac_ct_RANLIB@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -725,6 +746,27 @@ with_valgrind = @with_valgrind@ @ENABLE_TESTS_TRUE@ $(top_builddir)/shared/nm-test-libnm-utils.h \ @ENABLE_TESTS_TRUE@ test-secret-agent.c + +############################################################################### +noinst_LTLIBRARIES = \ + libnm-vpn-plugin-utils-test.la + +libnm_vpn_plugin_utils_test_la_SOURCES = \ + $(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.c \ + $(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.h \ + $(NULL) + +libnm_vpn_plugin_utils_test_la_CFLAGS = \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir)/shared \ + -I$(top_srcdir)/libnm-core \ + -I$(top_srcdir)/libnm \ + $(NULL) + +libnm_vpn_plugin_utils_test_la_LIBADD = \ + $(GLIB_LIBS) \ + $(NULL) + all: all-am .SUFFIXES: @@ -759,6 +801,20 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libnm-vpn-plugin-utils-test.la: $(libnm_vpn_plugin_utils_test_la_OBJECTS) $(libnm_vpn_plugin_utils_test_la_DEPENDENCIES) $(EXTRA_libnm_vpn_plugin_utils_test_la_DEPENDENCIES) + $(AM_V_CCLD)$(libnm_vpn_plugin_utils_test_la_LINK) $(libnm_vpn_plugin_utils_test_la_OBJECTS) $(libnm_vpn_plugin_utils_test_la_LIBADD) $(LIBS) + clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ @@ -786,6 +842,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_vpn_plugin_utils_test_la-nm-vpn-plugin-utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-test-utils-impl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nm-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-remote-settings-client.Po@am__quote@ @@ -812,6 +869,13 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +libnm_vpn_plugin_utils_test_la-nm-vpn-plugin-utils.lo: $(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_vpn_plugin_utils_test_la_CFLAGS) $(CFLAGS) -MT libnm_vpn_plugin_utils_test_la-nm-vpn-plugin-utils.lo -MD -MP -MF $(DEPDIR)/libnm_vpn_plugin_utils_test_la-nm-vpn-plugin-utils.Tpo -c -o libnm_vpn_plugin_utils_test_la-nm-vpn-plugin-utils.lo `test -f '$(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_vpn_plugin_utils_test_la-nm-vpn-plugin-utils.Tpo $(DEPDIR)/libnm_vpn_plugin_utils_test_la-nm-vpn-plugin-utils.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.c' object='libnm_vpn_plugin_utils_test_la-nm-vpn-plugin-utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_vpn_plugin_utils_test_la_CFLAGS) $(CFLAGS) -c -o libnm_vpn_plugin_utils_test_la-nm-vpn-plugin-utils.lo `test -f '$(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.c + nm-test-utils-impl.o: $(top_builddir)/shared/nm-test-utils-impl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-test-utils-impl.o -MD -MP -MF $(DEPDIR)/nm-test-utils-impl.Tpo -c -o nm-test-utils-impl.o `test -f '$(top_builddir)/shared/nm-test-utils-impl.c' || echo '$(srcdir)/'`$(top_builddir)/shared/nm-test-utils-impl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-test-utils-impl.Tpo $(DEPDIR)/nm-test-utils-impl.Po @@ -1094,7 +1158,7 @@ distdir: $(DISTFILES) check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(PROGRAMS) +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am @@ -1131,8 +1195,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1203,24 +1267,27 @@ uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ - clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - recheck tags tags-am uninstall uninstall-am + clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am recheck tags tags-am uninstall \ + uninstall-am .PRECIOUS: Makefile @ENABLE_TESTS_TRUE@@WITH_VALGRIND_TRUE@@VALGRIND_RULES@ --launch-dbus +############################################################################### + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: |