From b2eb64a4390e1d565a3193c7fe076b295670e577 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 17 Aug 2016 15:49:17 +0200 Subject: [PATCH 01/35] release: bump version to 1.5.0 (development) --- configure.ac | 4 ++-- libnm-core/nm-version.h | 14 ++++++++++++++ libnm-util/nm-version.h | 14 ++++++++++++++ shared/nm-version-macros.h.in | 5 +++-- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index fd768a1c38..bfaa5ff552 100644 --- a/configure.ac +++ b/configure.ac @@ -2,8 +2,8 @@ AC_PREREQ([2.63]) dnl The NM version number m4_define([nm_major_version], [1]) -m4_define([nm_minor_version], [3]) -m4_define([nm_micro_version], [90]) +m4_define([nm_minor_version], [5]) +m4_define([nm_micro_version], [0]) m4_define([nm_version], [nm_major_version.nm_minor_version.nm_micro_version]) m4_define([nm_git_sha], [m4_esyscmd([ ( [ -d ./.git/ ] && [ "$(readlink -f ./.git/)" = "$(readlink -f "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" ] && git rev-parse --verify -q HEAD 2>/dev/null ) || true ])]) diff --git a/libnm-core/nm-version.h b/libnm-core/nm-version.h index d7f112bf93..aa92c3f813 100644 --- a/libnm-core/nm-version.h +++ b/libnm-core/nm-version.h @@ -104,4 +104,18 @@ # define NM_AVAILABLE_IN_1_4 #endif +#if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_6 +# define NM_DEPRECATED_IN_1_6 G_DEPRECATED +# define NM_DEPRECATED_IN_1_6_FOR(f) G_DEPRECATED_FOR(f) +#else +# define NM_DEPRECATED_IN_1_6 +# define NM_DEPRECATED_IN_1_6_FOR(f) +#endif + +#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_6 +# define NM_AVAILABLE_IN_1_6 G_UNAVAILABLE(1,6) +#else +# define NM_AVAILABLE_IN_1_6 +#endif + #endif /* NM_VERSION_H */ diff --git a/libnm-util/nm-version.h b/libnm-util/nm-version.h index 760151a68f..b8b32306e0 100644 --- a/libnm-util/nm-version.h +++ b/libnm-util/nm-version.h @@ -104,4 +104,18 @@ # define NM_AVAILABLE_IN_1_4 #endif +#if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_6 +# define NM_DEPRECATED_IN_1_6 G_DEPRECATED +# define NM_DEPRECATED_IN_1_6_FOR(f) G_DEPRECATED_FOR(f) +#else +# define NM_DEPRECATED_IN_1_6 +# define NM_DEPRECATED_IN_1_6_FOR(f) +#endif + +#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_6 +# define NM_AVAILABLE_IN_1_6 G_UNAVAILABLE(1,6) +#else +# define NM_AVAILABLE_IN_1_6 +#endif + #endif /* NM_VERSION_H */ diff --git a/shared/nm-version-macros.h.in b/shared/nm-version-macros.h.in index d67aab4cc7..bc76812793 100644 --- a/shared/nm-version-macros.h.in +++ b/shared/nm-version-macros.h.in @@ -69,8 +69,9 @@ #define NM_VERSION_1_0 (NM_ENCODE_VERSION (1, 0, 0)) #define NM_VERSION_1_2 (NM_ENCODE_VERSION (1, 2, 0)) #define NM_VERSION_1_4 (NM_ENCODE_VERSION (1, 4, 0)) +#define NM_VERSION_1_6 (NM_ENCODE_VERSION (1, 6, 0)) -#define NM_VERSION_CUR_STABLE NM_VERSION_1_2 -#define NM_VERSION_NEXT_STABLE NM_VERSION_1_4 +#define NM_VERSION_CUR_STABLE NM_VERSION_1_4 +#define NM_VERSION_NEXT_STABLE NM_VERSION_1_6 #endif /* __NM_VERSION_MACROS_H__ */ From f19aff89095ca192b8b2e37534b7a899aecd82f9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 17 Aug 2016 18:19:00 +0200 Subject: [PATCH 02/35] all: cleanup includes in header files - don't include "nm-default.h" in header files. Every source file must include as first header "nm-default.h", thus our headers get the default include already implicitly. - we don't support compiling NetworkManager itself with a C++ compiler. Remove G_BEGIN_DECLS/G_END_DECLS from internal headers. We do however support users of libnm to use C++, thus they stay in public headers. --- callouts/nm-dispatcher-utils.h | 2 -- clients/cli/nmcli.c | 1 - clients/cli/polkit-agent.c | 1 - clients/cli/utils.c | 2 -- clients/common/nm-polkit-listener.h | 6 ------ clients/common/nm-secret-agent-simple.h | 4 ---- clients/common/nm-vpn-helpers.h | 2 -- clients/tui/newt/nmt-newt-button-box.h | 4 ---- clients/tui/newt/nmt-newt-button.h | 4 ---- clients/tui/newt/nmt-newt-checkbox.h | 4 ---- clients/tui/newt/nmt-newt-component.h | 4 ---- clients/tui/newt/nmt-newt-container.h | 4 ---- clients/tui/newt/nmt-newt-entry-numeric.h | 4 ---- clients/tui/newt/nmt-newt-entry.h | 4 ---- clients/tui/newt/nmt-newt-form.h | 4 ---- clients/tui/newt/nmt-newt-grid.h | 4 ---- clients/tui/newt/nmt-newt-label.h | 4 ---- clients/tui/newt/nmt-newt-listbox.h | 4 ---- clients/tui/newt/nmt-newt-popup.h | 4 ---- clients/tui/newt/nmt-newt-section.h | 4 ---- clients/tui/newt/nmt-newt-separator.h | 4 ---- clients/tui/newt/nmt-newt-stack.h | 4 ---- clients/tui/newt/nmt-newt-textbox.h | 4 ---- clients/tui/newt/nmt-newt-toggle-button.h | 4 ---- clients/tui/newt/nmt-newt-types.h | 6 ------ clients/tui/newt/nmt-newt-utils.h | 6 ------ clients/tui/newt/nmt-newt-widget.h | 4 ---- clients/tui/nm-editor-bindings.h | 4 ---- clients/tui/nm-editor-utils.h | 4 ---- clients/tui/nmt-address-list.h | 4 ---- clients/tui/nmt-connect-connection-list.h | 4 ---- clients/tui/nmt-device-entry.h | 4 ---- clients/tui/nmt-edit-connection-list.h | 4 ---- clients/tui/nmt-editor-grid.h | 4 ---- clients/tui/nmt-editor-page-device.h | 4 ---- clients/tui/nmt-editor-page.h | 4 ---- clients/tui/nmt-editor-section.h | 4 ---- clients/tui/nmt-editor.h | 4 ---- clients/tui/nmt-ip-entry.h | 4 ---- clients/tui/nmt-mac-entry.h | 5 ----- clients/tui/nmt-mtu-entry.h | 4 ---- clients/tui/nmt-page-bond.h | 4 ---- clients/tui/nmt-page-bridge-port.h | 4 ---- clients/tui/nmt-page-bridge.h | 4 ---- clients/tui/nmt-page-dsl.h | 5 ----- clients/tui/nmt-page-ethernet.h | 4 ---- clients/tui/nmt-page-infiniband.h | 4 ---- clients/tui/nmt-page-ip4.h | 4 ---- clients/tui/nmt-page-ip6.h | 4 ---- clients/tui/nmt-page-ppp.h | 4 ---- clients/tui/nmt-page-team-port.h | 4 ---- clients/tui/nmt-page-team.h | 5 ----- clients/tui/nmt-page-vlan.h | 4 ---- clients/tui/nmt-page-wifi.h | 4 ---- clients/tui/nmt-password-dialog.h | 4 ---- clients/tui/nmt-password-fields.h | 4 ---- clients/tui/nmt-route-editor.h | 4 ---- clients/tui/nmt-route-entry.h | 4 ---- clients/tui/nmt-route-table.h | 4 ---- clients/tui/nmt-slave-list.h | 4 ---- clients/tui/nmt-utils.h | 6 ------ clients/tui/nmt-widget-list.h | 4 ---- clients/tui/nmtui-connect.h | 4 ---- clients/tui/nmtui-edit.h | 4 ---- clients/tui/nmtui-hostname.h | 4 ---- clients/tui/nmtui.h | 4 ---- libnm-core/crypto.h | 2 -- libnm-core/nm-core-internal.h | 1 - libnm-core/nm-keyfile-internal.h | 1 - libnm-core/nm-property-compare.h | 2 -- libnm-core/nm-setting-private.h | 1 - libnm-glib/nm-dbus-helpers-private.h | 2 -- libnm-glib/nm-object-cache.h | 1 - libnm-glib/nm-object-private.h | 1 - libnm-util/crypto.h | 2 -- libnm-util/nm-param-spec-specialized.h | 2 -- libnm-util/nm-setting-private.h | 2 -- libnm/nm-dbus-helpers.h | 2 -- libnm/nm-object-cache.h | 1 - libnm/nm-object-private.h | 1 - src/devices/adsl/nm-atm-manager.h | 4 ---- src/devices/adsl/nm-device-adsl.h | 7 +------ src/devices/bluetooth/nm-bluez4-manager.h | 4 ---- src/devices/bluetooth/nm-bluez5-dun.h | 2 -- src/devices/bluetooth/nm-device-bt.h | 4 ---- src/devices/nm-arping-manager.h | 4 ---- src/devices/nm-device-bond.h | 6 +----- src/devices/nm-device-bridge.h | 7 +------ src/devices/nm-device-ethernet.h | 6 +----- src/devices/nm-device-generic.h | 6 +----- src/devices/nm-device-infiniband.h | 6 +----- src/devices/nm-device-ip-tunnel.h | 6 +----- src/devices/nm-device-logging.h | 1 - src/devices/nm-device-macvlan.h | 6 +----- src/devices/nm-device-private.h | 2 -- src/devices/nm-device-tun.h | 6 +----- src/devices/nm-device-veth.h | 6 +----- src/devices/nm-device-vlan.h | 6 +----- src/devices/nm-device-vxlan.h | 6 +----- src/devices/nm-device.h | 6 +----- src/devices/nm-lldp-listener.h | 4 ---- src/devices/team/nm-device-team.h | 6 +----- src/devices/team/nm-team-factory.h | 2 -- src/devices/wifi/nm-device-olpc-mesh.h | 6 +----- src/devices/wwan/Makefile.am | 2 +- src/devices/wwan/nm-modem-broadband.h | 4 ---- src/devices/wwan/nm-modem.h | 5 ----- src/devices/wwan/nm-wwan-factory.h | 2 -- src/dhcp-manager/nm-dhcp-client-logging.h | 1 - src/dhcp-manager/nm-dhcp-client.h | 2 -- src/dhcp-manager/nm-dhcp-dhclient.h | 1 - src/dhcp-manager/nm-dhcp-listener.h | 2 -- src/dhcp-manager/nm-dhcp-manager.h | 2 -- src/dhcp-manager/nm-dhcp-utils.h | 2 -- src/dns-manager/nm-dns-manager.h | 5 ----- src/dns-manager/nm-dns-plugin.h | 2 -- src/dnsmasq-manager/nm-dnsmasq-manager.h | 2 -- src/dnsmasq-manager/nm-dnsmasq-utils.h | 1 - src/main-utils.h | 2 -- src/nm-activation-request.h | 2 -- src/nm-audit-manager.h | 7 ------- src/nm-auth-manager.h | 7 ------- src/nm-bus-manager.h | 4 ---- src/nm-connectivity.h | 2 -- src/nm-core-utils.h | 1 - src/nm-dcb.h | 1 - src/nm-default-route-manager.h | 5 +---- src/nm-dispatcher.h | 1 - src/nm-firewall-manager.h | 5 ----- src/nm-multi-index.h | 7 ------- src/nm-policy.h | 2 -- src/nm-rfkill-manager.h | 3 --- src/nm-route-manager.h | 3 --- src/nm-session-monitor.h | 7 ------- src/nm-sleep-monitor.h | 4 ---- src/platform/wifi/wifi-utils-private.h | 2 -- src/platform/wifi/wifi-utils.h | 1 - src/settings/nm-inotify-helper.h | 2 -- src/settings/nm-secret-agent.h | 1 - src/settings/nm-settings-connection.h | 5 ----- src/settings/nm-settings-plugin.h | 8 +------- src/settings/plugins/ibft/nm-ibft-connection.h | 4 ---- src/settings/plugins/ibft/plugin.h | 2 -- src/settings/plugins/ibft/reader.h | 2 -- src/settings/plugins/ifnet/net_parser.h | 3 +-- src/settings/plugins/ifnet/net_utils.h | 5 ++++- src/settings/plugins/ifnet/nm-ifnet-connection.h | 5 +---- src/settings/plugins/ifnet/plugin.h | 2 -- src/settings/plugins/ifnet/wpa_parser.h | 2 -- src/settings/plugins/ifupdown/interface_parser.h | 2 -- src/settings/plugins/ifupdown/nm-ifupdown-connection.h | 6 +----- src/settings/plugins/ifupdown/parser.h | 7 ++++--- src/settings/plugins/ifupdown/plugin.h | 2 -- src/settings/plugins/keyfile/nm-keyfile-connection.h | 4 ---- src/settings/plugins/keyfile/plugin.h | 2 -- src/settings/plugins/keyfile/reader.h | 2 -- src/settings/plugins/keyfile/utils.h | 1 - src/settings/plugins/keyfile/writer.h | 2 -- src/supplicant-manager/nm-supplicant-config.h | 8 ++------ src/supplicant-manager/nm-supplicant-interface.h | 1 - src/supplicant-manager/nm-supplicant-manager.h | 3 --- src/tests/config/nm-test-device.h | 6 +----- src/vpn-manager/nm-vpn-manager.h | 1 - 163 files changed, 32 insertions(+), 558 deletions(-) diff --git a/callouts/nm-dispatcher-utils.h b/callouts/nm-dispatcher-utils.h index 034898e4b1..6a10d4c311 100644 --- a/callouts/nm-dispatcher-utils.h +++ b/callouts/nm-dispatcher-utils.h @@ -21,8 +21,6 @@ #ifndef __NETWORKMANAGER_DISPATCHER_UTILS_H__ #define __NETWORKMANAGER_DISPATCHER_UTILS_H__ -#include "nm-default.h" - char ** nm_dispatcher_utils_construct_envp (const char *action, GVariant *connection_dict, diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c index 9bfa05fade..8bc8828b41 100644 --- a/clients/cli/nmcli.c +++ b/clients/cli/nmcli.c @@ -19,7 +19,6 @@ * Copyright 2010 - 2015 Red Hat, Inc. */ -/* Generated configuration file */ #include "nm-default.h" #include diff --git a/clients/cli/polkit-agent.c b/clients/cli/polkit-agent.c index 8b56e9534a..086851de9b 100644 --- a/clients/cli/polkit-agent.c +++ b/clients/cli/polkit-agent.c @@ -126,7 +126,6 @@ nmc_start_polkit_agent_start_try (NmCli *nmc) #else /* polkit agent is not avalable; implement stub functions. */ -#include "nm-default.h" #include "nmcli.h" #include "polkit-agent.h" diff --git a/clients/cli/utils.c b/clients/cli/utils.c index 361a98aafd..ff98276ab0 100644 --- a/clients/cli/utils.c +++ b/clients/cli/utils.c @@ -17,8 +17,6 @@ * Copyright 2010 - 2015 Red Hat, Inc. */ -/* Generated configuration file */ - #include "nm-default.h" #include diff --git a/clients/common/nm-polkit-listener.h b/clients/common/nm-polkit-listener.h index 22c436c17c..a8256460fd 100644 --- a/clients/common/nm-polkit-listener.h +++ b/clients/common/nm-polkit-listener.h @@ -22,10 +22,6 @@ #define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE #include -#include "nm-default.h" - -G_BEGIN_DECLS - #define NM_TYPE_POLKIT_LISTENER (nm_polkit_listener_get_type ()) #define NM_POLKIT_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_POLKIT_LISTENER, NMPolkitListener)) #define NM_POLKIT_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_POLKIT_LISTENER, NMPolkitListenerClass)) @@ -99,6 +95,4 @@ void nm_polkit_listener_set_show_error_callback (NMPolkitListener *self, void nm_polkit_listener_set_completed_callback (NMPolkitListener *self, NMPolkitListenerOnCompletedFunc completed_callback); -G_END_DECLS - #endif /* __NM_POLKIT_LISTENER_H__ */ diff --git a/clients/common/nm-secret-agent-simple.h b/clients/common/nm-secret-agent-simple.h index d2c58822a0..ba819ae362 100644 --- a/clients/common/nm-secret-agent-simple.h +++ b/clients/common/nm-secret-agent-simple.h @@ -22,8 +22,6 @@ #include #include -G_BEGIN_DECLS - #define NM_TYPE_SECRET_AGENT_SIMPLE (nm_secret_agent_simple_get_type ()) #define NM_SECRET_AGENT_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimple)) #define NM_SECRET_AGENT_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimpleClass)) @@ -59,6 +57,4 @@ void nm_secret_agent_simple_response (NMSecretAgentSimpl void nm_secret_agent_simple_enable (NMSecretAgentSimple *self, const char *path); -G_END_DECLS - #endif /* __NM_SECRET_AGENT_SIMPLE_H__ */ diff --git a/clients/common/nm-vpn-helpers.h b/clients/common/nm-vpn-helpers.h index 873753b614..9c23f37c5d 100644 --- a/clients/common/nm-vpn-helpers.h +++ b/clients/common/nm-vpn-helpers.h @@ -21,8 +21,6 @@ #include -#include "nm-default.h" - struct { const char *name; const char *ui_name; diff --git a/clients/tui/newt/nmt-newt-button-box.h b/clients/tui/newt/nmt-newt-button-box.h index 970588a4d0..dec2c34753 100644 --- a/clients/tui/newt/nmt-newt-button-box.h +++ b/clients/tui/newt/nmt-newt-button-box.h @@ -21,8 +21,6 @@ #include "nmt-newt-grid.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_BUTTON_BOX (nmt_newt_button_box_get_type ()) #define NMT_NEWT_BUTTON_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_BUTTON_BOX, NmtNewtButtonBox)) #define NMT_NEWT_BUTTON_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_BUTTON_BOX, NmtNewtButtonBoxClass)) @@ -60,6 +58,4 @@ void nmt_newt_button_box_add_widget_end (NmtNewtButtonBox *bbox, NmtNewtWidget *widget); -G_END_DECLS - #endif /* NMT_NEWT_BUTTON_BOX_H */ diff --git a/clients/tui/newt/nmt-newt-button.h b/clients/tui/newt/nmt-newt-button.h index 52e95c5d13..646d005314 100644 --- a/clients/tui/newt/nmt-newt-button.h +++ b/clients/tui/newt/nmt-newt-button.h @@ -21,8 +21,6 @@ #include "nmt-newt-component.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_BUTTON (nmt_newt_button_get_type ()) #define NMT_NEWT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_BUTTON, NmtNewtButton)) #define NMT_NEWT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_BUTTON, NmtNewtButtonClass)) @@ -48,6 +46,4 @@ void nmt_newt_button_set_label (NmtNewtButton *button, const char *label); const char *nmt_newt_button_get_label (NmtNewtButton *button); -G_END_DECLS - #endif /* NMT_NEWT_BUTTON_H */ diff --git a/clients/tui/newt/nmt-newt-checkbox.h b/clients/tui/newt/nmt-newt-checkbox.h index c277386b18..e46e3ec2dd 100644 --- a/clients/tui/newt/nmt-newt-checkbox.h +++ b/clients/tui/newt/nmt-newt-checkbox.h @@ -21,8 +21,6 @@ #include "nmt-newt-component.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_CHECKBOX (nmt_newt_checkbox_get_type ()) #define NMT_NEWT_CHECKBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_CHECKBOX, NmtNewtCheckbox)) #define NMT_NEWT_CHECKBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_CHECKBOX, NmtNewtCheckboxClass)) @@ -48,6 +46,4 @@ void nmt_newt_checkbox_set_active (NmtNewtCheckbox *checkbox, gboolean active); gboolean nmt_newt_checkbox_get_active (NmtNewtCheckbox *checkbox); -G_END_DECLS - #endif /* NMT_NEWT_CHECKBOX_H */ diff --git a/clients/tui/newt/nmt-newt-component.h b/clients/tui/newt/nmt-newt-component.h index 2ffa018e1a..bf8f2bb8d8 100644 --- a/clients/tui/newt/nmt-newt-component.h +++ b/clients/tui/newt/nmt-newt-component.h @@ -21,8 +21,6 @@ #include "nmt-newt-widget.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_COMPONENT (nmt_newt_component_get_type ()) #define NMT_NEWT_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_COMPONENT, NmtNewtComponent)) #define NMT_NEWT_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_COMPONENT, NmtNewtComponentClass)) @@ -52,6 +50,4 @@ gboolean nmt_newt_component_get_sensitive (NmtNewtComponent *component); void nmt_newt_component_set_sensitive (NmtNewtComponent *component, gboolean sensitive); -G_END_DECLS - #endif /* NMT_NEWT_COMPONENT_H */ diff --git a/clients/tui/newt/nmt-newt-container.h b/clients/tui/newt/nmt-newt-container.h index 6f182925d5..32d6abccda 100644 --- a/clients/tui/newt/nmt-newt-container.h +++ b/clients/tui/newt/nmt-newt-container.h @@ -21,8 +21,6 @@ #include "nmt-newt-widget.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_CONTAINER (nmt_newt_container_get_type ()) #define NMT_NEWT_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_CONTAINER, NmtNewtContainer)) #define NMT_NEWT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_CONTAINER, NmtNewtContainerClass)) @@ -56,6 +54,4 @@ void nmt_newt_container_remove (NmtNewtContainer *container, GSList *nmt_newt_container_get_children (NmtNewtContainer *container); -G_END_DECLS - #endif /* NMT_NEWT_CONTAINER_H */ diff --git a/clients/tui/newt/nmt-newt-entry-numeric.h b/clients/tui/newt/nmt-newt-entry-numeric.h index 43ac34490a..00e1973963 100644 --- a/clients/tui/newt/nmt-newt-entry-numeric.h +++ b/clients/tui/newt/nmt-newt-entry-numeric.h @@ -21,8 +21,6 @@ #include "nmt-newt-entry.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_ENTRY_NUMERIC (nmt_newt_entry_numeric_get_type ()) #define NMT_NEWT_ENTRY_NUMERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_ENTRY_NUMERIC, NmtNewtEntryNumeric)) #define NMT_NEWT_ENTRY_NUMERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_ENTRY_NUMERIC, NmtNewtEntryNumericClass)) @@ -46,6 +44,4 @@ NmtNewtWidget *nmt_newt_entry_numeric_new (int width, int min, int max); -G_END_DECLS - #endif /* NMT_NEWT_ENTRY_NUMERIC_H */ diff --git a/clients/tui/newt/nmt-newt-entry.h b/clients/tui/newt/nmt-newt-entry.h index 8df0b13701..36bd9d5199 100644 --- a/clients/tui/newt/nmt-newt-entry.h +++ b/clients/tui/newt/nmt-newt-entry.h @@ -21,8 +21,6 @@ #include "nmt-newt-component.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_ENTRY (nmt_newt_entry_get_type ()) #define NMT_NEWT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_ENTRY, NmtNewtEntry)) #define NMT_NEWT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_ENTRY, NmtNewtEntryClass)) @@ -69,6 +67,4 @@ void nmt_newt_entry_set_width (NmtNewtEntry *entry, int width); int nmt_newt_entry_get_width (NmtNewtEntry *entry); -G_END_DECLS - #endif /* NMT_NEWT_ENTRY_H */ diff --git a/clients/tui/newt/nmt-newt-form.h b/clients/tui/newt/nmt-newt-form.h index be95eb68ad..2cae5b5e48 100644 --- a/clients/tui/newt/nmt-newt-form.h +++ b/clients/tui/newt/nmt-newt-form.h @@ -21,8 +21,6 @@ #include "nmt-newt-container.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_FORM (nmt_newt_form_get_type ()) #define NMT_NEWT_FORM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_FORM, NmtNewtForm)) #define NMT_NEWT_FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_FORM, NmtNewtFormClass)) @@ -61,6 +59,4 @@ void nmt_newt_form_quit (NmtNewtForm *form); void nmt_newt_form_set_focus (NmtNewtForm *form, NmtNewtWidget *widget); -G_END_DECLS - #endif /* NMT_NEWT_FORM_H */ diff --git a/clients/tui/newt/nmt-newt-grid.h b/clients/tui/newt/nmt-newt-grid.h index f36a38ee8f..11bfdec392 100644 --- a/clients/tui/newt/nmt-newt-grid.h +++ b/clients/tui/newt/nmt-newt-grid.h @@ -21,8 +21,6 @@ #include "nmt-newt-container.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_GRID (nmt_newt_grid_get_type ()) #define NMT_NEWT_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_GRID, NmtNewtGrid)) #define NMT_NEWT_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_GRID, NmtNewtGridClass)) @@ -67,6 +65,4 @@ void nmt_newt_grid_set_flags (NmtNewtGrid *grid, NmtNewtWidget *widget, NmtNewtGridFlags flags); -G_END_DECLS - #endif /* NMT_NEWT_GRID_H */ diff --git a/clients/tui/newt/nmt-newt-label.h b/clients/tui/newt/nmt-newt-label.h index a4e0dcca5c..ef894d9164 100644 --- a/clients/tui/newt/nmt-newt-label.h +++ b/clients/tui/newt/nmt-newt-label.h @@ -21,8 +21,6 @@ #include "nmt-newt-component.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_LABEL (nmt_newt_label_get_type ()) #define NMT_NEWT_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_LABEL, NmtNewtLabel)) #define NMT_NEWT_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_LABEL, NmtNewtLabelClass)) @@ -61,6 +59,4 @@ void nmt_newt_label_set_highlight (NmtNewtLabel *label, gboolean highlight); gboolean nmt_newt_label_get_highlight (NmtNewtLabel *label); -G_END_DECLS - #endif /* NMT_NEWT_LABEL_H */ diff --git a/clients/tui/newt/nmt-newt-listbox.h b/clients/tui/newt/nmt-newt-listbox.h index c18c9f8e65..eba17a7c8d 100644 --- a/clients/tui/newt/nmt-newt-listbox.h +++ b/clients/tui/newt/nmt-newt-listbox.h @@ -21,8 +21,6 @@ #include "nmt-newt-component.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_LISTBOX (nmt_newt_listbox_get_type ()) #define NMT_NEWT_LISTBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_LISTBOX, NmtNewtListbox)) #define NMT_NEWT_LISTBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_LISTBOX, NmtNewtListboxClass)) @@ -66,6 +64,4 @@ void nmt_newt_listbox_set_active_key (NmtNewtListbox *listbox, int nmt_newt_listbox_get_active (NmtNewtListbox *listbox); gpointer nmt_newt_listbox_get_active_key (NmtNewtListbox *listbox); -G_END_DECLS - #endif /* NMT_NEWT_LISTBOX_H */ diff --git a/clients/tui/newt/nmt-newt-popup.h b/clients/tui/newt/nmt-newt-popup.h index 643ea2d8c4..be2bc34c07 100644 --- a/clients/tui/newt/nmt-newt-popup.h +++ b/clients/tui/newt/nmt-newt-popup.h @@ -21,8 +21,6 @@ #include "nmt-newt-button.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_POPUP (nmt_newt_popup_get_type ()) #define NMT_NEWT_POPUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_POPUP, NmtNewtPopup)) #define NMT_NEWT_POPUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_POPUP, NmtNewtPopupClass)) @@ -57,6 +55,4 @@ const char *nmt_newt_popup_get_active_id (NmtNewtPopup *popup); void nmt_newt_popup_set_active_id (NmtNewtPopup *popup, const char *active_id); -G_END_DECLS - #endif /* NMT_NEWT_POPUP_H */ diff --git a/clients/tui/newt/nmt-newt-section.h b/clients/tui/newt/nmt-newt-section.h index 6bf59ebbbd..569e86e59e 100644 --- a/clients/tui/newt/nmt-newt-section.h +++ b/clients/tui/newt/nmt-newt-section.h @@ -21,8 +21,6 @@ #include "nmt-newt-container.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_SECTION (nmt_newt_section_get_type ()) #define NMT_NEWT_SECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_SECTION, NmtNewtSection)) #define NMT_NEWT_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_SECTION, NmtNewtSectionClass)) @@ -52,6 +50,4 @@ void nmt_newt_section_set_body (NmtNewtSection *section, NmtNewtWidget *body); NmtNewtWidget *nmt_newt_section_get_body (NmtNewtSection *section); -G_END_DECLS - #endif /* NMT_NEWT_SECTION_H */ diff --git a/clients/tui/newt/nmt-newt-separator.h b/clients/tui/newt/nmt-newt-separator.h index 3f4183d588..715030992f 100644 --- a/clients/tui/newt/nmt-newt-separator.h +++ b/clients/tui/newt/nmt-newt-separator.h @@ -21,8 +21,6 @@ #include "nmt-newt-component.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_SEPARATOR (nmt_newt_separator_get_type ()) #define NMT_NEWT_SEPARATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_SEPARATOR, NmtNewtSeparator)) #define NMT_NEWT_SEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_SEPARATOR, NmtNewtSeparatorClass)) @@ -44,6 +42,4 @@ GType nmt_newt_separator_get_type (void); NmtNewtWidget *nmt_newt_separator_new (void); -G_END_DECLS - #endif /* NMT_NEWT_SEPARATOR_H */ diff --git a/clients/tui/newt/nmt-newt-stack.h b/clients/tui/newt/nmt-newt-stack.h index 09afe4baf6..c9bb5a077f 100644 --- a/clients/tui/newt/nmt-newt-stack.h +++ b/clients/tui/newt/nmt-newt-stack.h @@ -21,8 +21,6 @@ #include "nmt-newt-container.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_STACK (nmt_newt_stack_get_type ()) #define NMT_NEWT_STACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_STACK, NmtNewtStack)) #define NMT_NEWT_STACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_STACK, NmtNewtStackClass)) @@ -56,6 +54,4 @@ void nmt_newt_stack_set_active_id (NmtNewtStack *stack, const char *id); const char * nmt_newt_stack_get_active_id (NmtNewtStack *stack); -G_END_DECLS - #endif /* NMT_NEWT_STACK_H */ diff --git a/clients/tui/newt/nmt-newt-textbox.h b/clients/tui/newt/nmt-newt-textbox.h index b3743aea05..31a159e2ea 100644 --- a/clients/tui/newt/nmt-newt-textbox.h +++ b/clients/tui/newt/nmt-newt-textbox.h @@ -21,8 +21,6 @@ #include "nmt-newt-component.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_TEXTBOX (nmt_newt_textbox_get_type ()) #define NMT_NEWT_TEXTBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_TEXTBOX, NmtNewtTextbox)) #define NMT_NEWT_TEXTBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_TEXTBOX, NmtNewtTextboxClass)) @@ -54,6 +52,4 @@ void nmt_newt_textbox_set_text (NmtNewtTextbox *textbox, const char *text); const char *nmt_newt_textbox_get_text (NmtNewtTextbox *textbox); -G_END_DECLS - #endif /* NMT_NEWT_TEXTBOX_H */ diff --git a/clients/tui/newt/nmt-newt-toggle-button.h b/clients/tui/newt/nmt-newt-toggle-button.h index e54c6d3fa1..69c0b7d134 100644 --- a/clients/tui/newt/nmt-newt-toggle-button.h +++ b/clients/tui/newt/nmt-newt-toggle-button.h @@ -21,8 +21,6 @@ #include "nmt-newt-button.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_TOGGLE_BUTTON (nmt_newt_toggle_button_get_type ()) #define NMT_NEWT_TOGGLE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_TOGGLE_BUTTON, NmtNewtToggleButton)) #define NMT_NEWT_TOGGLE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_TOGGLE_BUTTON, NmtNewtToggleButtonClass)) @@ -49,6 +47,4 @@ gboolean nmt_newt_toggle_button_get_active (NmtNewtToggleButton *button); void nmt_newt_toggle_button_set_active (NmtNewtToggleButton *button, gboolean active); -G_END_DECLS - #endif /* NMT_NEWT_TOGGLE_BUTTON_H */ diff --git a/clients/tui/newt/nmt-newt-types.h b/clients/tui/newt/nmt-newt-types.h index 4ea0a7b8c7..af550ca055 100644 --- a/clients/tui/newt/nmt-newt-types.h +++ b/clients/tui/newt/nmt-newt-types.h @@ -21,10 +21,6 @@ #include -#include "nm-default.h" - -G_BEGIN_DECLS - typedef struct _NmtNewtButton NmtNewtButton; typedef struct _NmtNewtButtonBox NmtNewtButtonBox; typedef struct _NmtNewtCheckbox NmtNewtCheckbox; @@ -45,6 +41,4 @@ typedef struct _NmtNewtTextbox NmtNewtTextbox; typedef struct _NmtNewtToggleButton NmtNewtToggleButton; typedef struct _NmtNewtWidget NmtNewtWidget; -G_END_DECLS - #endif /* NMT_NEWT_COMPONENT_H */ diff --git a/clients/tui/newt/nmt-newt-utils.h b/clients/tui/newt/nmt-newt-utils.h index 430c2ec1db..49d717d2e4 100644 --- a/clients/tui/newt/nmt-newt-utils.h +++ b/clients/tui/newt/nmt-newt-utils.h @@ -21,10 +21,6 @@ #include -#include "nm-default.h" - -G_BEGIN_DECLS - void nmt_newt_init (void); void nmt_newt_finished (void); @@ -49,6 +45,4 @@ int nmt_newt_choice_dialog (const char *button1, char *nmt_newt_edit_string (const char *data); -G_END_DECLS - #endif /* NMT_NEWT_UTILS_H */ diff --git a/clients/tui/newt/nmt-newt-widget.h b/clients/tui/newt/nmt-newt-widget.h index a526a674c3..34ce943c2d 100644 --- a/clients/tui/newt/nmt-newt-widget.h +++ b/clients/tui/newt/nmt-newt-widget.h @@ -21,8 +21,6 @@ #include "nmt-newt-types.h" -G_BEGIN_DECLS - #define NMT_TYPE_NEWT_WIDGET (nmt_newt_widget_get_type ()) #define NMT_NEWT_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_NEWT_WIDGET, NmtNewtWidget)) #define NMT_NEWT_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_NEWT_WIDGET, NmtNewtWidgetClass)) @@ -113,6 +111,4 @@ void nmt_newt_widget_needs_rebuild (NmtNewtWidget *widget); void nmt_newt_widget_set_valid (NmtNewtWidget *widget, gboolean valid); -G_END_DECLS - #endif /* NMT_NEWT_WIDGET_H */ diff --git a/clients/tui/nm-editor-bindings.h b/clients/tui/nm-editor-bindings.h index c4ed95d53e..fd4fcd30cf 100644 --- a/clients/tui/nm-editor-bindings.h +++ b/clients/tui/nm-editor-bindings.h @@ -21,8 +21,6 @@ #include -G_BEGIN_DECLS - void nm_editor_bindings_init (void); void nm_editor_bind_ip_addresses_with_prefix_to_strv (int family, @@ -71,6 +69,4 @@ void nm_editor_bind_wireless_security_wep_key (NMSettingWirelessSecurity void nm_editor_bind_vlan_name (NMSettingVlan *s_vlan, NMSettingConnection *s_con); -G_END_DECLS - #endif /* NM_EDITOR_BINDINGS_H */ diff --git a/clients/tui/nm-editor-utils.h b/clients/tui/nm-editor-utils.h index 5e402ce715..15a16cd269 100644 --- a/clients/tui/nm-editor-utils.h +++ b/clients/tui/nm-editor-utils.h @@ -21,8 +21,6 @@ #include -G_BEGIN_DECLS - typedef struct { const char *name; GType setting_type; @@ -38,6 +36,4 @@ NMConnection *nm_editor_utils_create_connection (GType type, NMConnection *master, NMClient *client); -G_END_DECLS - #endif /* NM_EDITOR_UTILS_H */ diff --git a/clients/tui/nmt-address-list.h b/clients/tui/nmt-address-list.h index df7a4f7962..f82f218186 100644 --- a/clients/tui/nmt-address-list.h +++ b/clients/tui/nmt-address-list.h @@ -21,8 +21,6 @@ #include "nmt-widget-list.h" -G_BEGIN_DECLS - #define NMT_TYPE_ADDRESS_LIST (nmt_address_list_get_type ()) #define NMT_ADDRESS_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_ADDRESS_LIST, NmtAddressList)) #define NMT_ADDRESS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_ADDRESS_LIST, NmtAddressListClass)) @@ -52,6 +50,4 @@ typedef enum { NmtNewtWidget *nmt_address_list_new (NmtAddressListType list_type); -G_END_DECLS - #endif /* NMT_ADDRESS_LIST_H */ diff --git a/clients/tui/nmt-connect-connection-list.h b/clients/tui/nmt-connect-connection-list.h index d47900437d..bf4721b9c5 100644 --- a/clients/tui/nmt-connect-connection-list.h +++ b/clients/tui/nmt-connect-connection-list.h @@ -21,8 +21,6 @@ #include "nmt-newt.h" -G_BEGIN_DECLS - #define NMT_TYPE_CONNECT_CONNECTION_LIST (nmt_connect_connection_list_get_type ()) #define NMT_CONNECT_CONNECTION_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_CONNECT_CONNECTION_LIST, NmtConnectConnectionList)) #define NMT_CONNECT_CONNECTION_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_CONNECT_CONNECTION_LIST, NmtConnectConnectionListClass)) @@ -56,6 +54,4 @@ gboolean nmt_connect_connection_list_get_selection (NmtConnectConnectionList * NMObject **specific_object, NMActiveConnection **active); -G_END_DECLS - #endif /* NMT_CONNECT_CONNECTION_LIST_H */ diff --git a/clients/tui/nmt-device-entry.h b/clients/tui/nmt-device-entry.h index 05d5d40f7d..4945e7c2a5 100644 --- a/clients/tui/nmt-device-entry.h +++ b/clients/tui/nmt-device-entry.h @@ -23,8 +23,6 @@ #include -G_BEGIN_DECLS - #define NMT_TYPE_DEVICE_ENTRY (nmt_device_entry_get_type ()) #define NMT_DEVICE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_DEVICE_ENTRY, NmtDeviceEntry)) #define NMT_DEVICE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_DEVICE_ENTRY, NmtDeviceEntryClass)) @@ -55,6 +53,4 @@ void nmt_device_entry_set_device_filter (NmtDeviceEntry *deventry, NmtDeviceEntryDeviceFilter filter, gpointer user_data); -G_END_DECLS - #endif /* NMT_DEVICE_ENTRY_H */ diff --git a/clients/tui/nmt-edit-connection-list.h b/clients/tui/nmt-edit-connection-list.h index c31c0a8cb5..fd492bce73 100644 --- a/clients/tui/nmt-edit-connection-list.h +++ b/clients/tui/nmt-edit-connection-list.h @@ -23,8 +23,6 @@ #include -G_BEGIN_DECLS - #define NMT_TYPE_EDIT_CONNECTION_LIST (nmt_edit_connection_list_get_type ()) #define NMT_EDIT_CONNECTION_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDIT_CONNECTION_LIST, NmtEditConnectionList)) #define NMT_EDIT_CONNECTION_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDIT_CONNECTION_LIST, NmtEditConnectionListClass)) @@ -54,6 +52,4 @@ typedef gboolean (*NmtEditConnectionListFilter) (NmtEditConnectionList *list, NMConnection *connection, gpointer user_data); -G_END_DECLS - #endif /* NMT_EDIT_CONNECTION_LIST_H */ diff --git a/clients/tui/nmt-editor-grid.h b/clients/tui/nmt-editor-grid.h index 2ae01d71d5..4867689611 100644 --- a/clients/tui/nmt-editor-grid.h +++ b/clients/tui/nmt-editor-grid.h @@ -21,8 +21,6 @@ #include "nmt-newt.h" -G_BEGIN_DECLS - #define NMT_TYPE_EDITOR_GRID (nmt_editor_grid_get_type ()) #define NMT_EDITOR_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDITOR_GRID, NmtEditorGrid)) #define NMT_EDITOR_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDITOR_GRID, NmtEditorGridClass)) @@ -57,6 +55,4 @@ void nmt_editor_grid_set_row_flags (NmtEditorGrid *grid, NmtNewtWidget *widget, NmtEditorGridRowFlags flags); -G_END_DECLS - #endif /* NMT_EDITOR_GRID_H */ diff --git a/clients/tui/nmt-editor-page-device.h b/clients/tui/nmt-editor-page-device.h index f911602cc8..75aecd017e 100644 --- a/clients/tui/nmt-editor-page-device.h +++ b/clients/tui/nmt-editor-page-device.h @@ -22,8 +22,6 @@ #include "nmt-editor-page.h" #include "nmt-device-entry.h" -G_BEGIN_DECLS - #define NMT_TYPE_EDITOR_PAGE_DEVICE (nmt_editor_page_device_get_type ()) #define NMT_EDITOR_PAGE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDITOR_PAGE_DEVICE, NmtEditorPageDevice)) #define NMT_EDITOR_PAGE_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDITOR_PAGE_DEVICE, NmtEditorPageDeviceClass)) @@ -45,6 +43,4 @@ GType nmt_editor_page_device_get_type (void); NmtDeviceEntry *nmt_editor_page_device_get_device_entry (NmtEditorPageDevice *page); -G_END_DECLS - #endif /* NMT_EDITOR_PAGE_DEVICE_H */ diff --git a/clients/tui/nmt-editor-page.h b/clients/tui/nmt-editor-page.h index bbc0d9e351..8da5ea9f51 100644 --- a/clients/tui/nmt-editor-page.h +++ b/clients/tui/nmt-editor-page.h @@ -24,8 +24,6 @@ #include "nmt-editor-grid.h" #include "nmt-editor-section.h" -G_BEGIN_DECLS - #define NMT_TYPE_EDITOR_PAGE (nmt_editor_page_get_type ()) #define NMT_EDITOR_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDITOR_PAGE, NmtEditorPage)) #define NMT_EDITOR_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDITOR_PAGE, NmtEditorPageClass)) @@ -53,6 +51,4 @@ GSList *nmt_editor_page_get_sections (NmtEditorPage *page); void nmt_editor_page_add_section (NmtEditorPage *page, NmtEditorSection *section); -G_END_DECLS - #endif /* NMT_EDITOR_PAGE_H */ diff --git a/clients/tui/nmt-editor-section.h b/clients/tui/nmt-editor-section.h index 67410c7174..3c2537be04 100644 --- a/clients/tui/nmt-editor-section.h +++ b/clients/tui/nmt-editor-section.h @@ -22,8 +22,6 @@ #include "nmt-newt-section.h" #include "nmt-editor-grid.h" -G_BEGIN_DECLS - #define NMT_TYPE_EDITOR_SECTION (nmt_editor_section_get_type ()) #define NMT_EDITOR_SECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDITOR_SECTION, NmtEditorSection)) #define NMT_EDITOR_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDITOR_SECTION, NmtEditorSectionClass)) @@ -51,6 +49,4 @@ const char *nmt_editor_section_get_title (NmtEditorSection *sectio NmtNewtWidget *nmt_editor_section_get_header_widget (NmtEditorSection *section); NmtEditorGrid *nmt_editor_section_get_body (NmtEditorSection *section); -G_END_DECLS - #endif /* NMT_EDITOR_SECTION_H */ diff --git a/clients/tui/nmt-editor.h b/clients/tui/nmt-editor.h index db10b82a18..b000f64e4e 100644 --- a/clients/tui/nmt-editor.h +++ b/clients/tui/nmt-editor.h @@ -23,8 +23,6 @@ #include "nmt-newt.h" -G_BEGIN_DECLS - #define NMT_TYPE_EDITOR (nmt_editor_get_type ()) #define NMT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDITOR, NmtEditor)) #define NMT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDITOR, NmtEditorClass)) @@ -46,6 +44,4 @@ GType nmt_editor_get_type (void); NmtNewtForm *nmt_editor_new (NMConnection *connection); -G_END_DECLS - #endif /* NMT_EDITOR_H */ diff --git a/clients/tui/nmt-ip-entry.h b/clients/tui/nmt-ip-entry.h index ceb355efcf..2338a87359 100644 --- a/clients/tui/nmt-ip-entry.h +++ b/clients/tui/nmt-ip-entry.h @@ -21,8 +21,6 @@ #include "nmt-newt.h" -G_BEGIN_DECLS - #define NMT_TYPE_IP_ENTRY (nmt_ip_entry_get_type ()) #define NMT_IP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_IP_ENTRY, NmtIPEntry)) #define NMT_IP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_IP_ENTRY, NmtIPEntryClass)) @@ -47,6 +45,4 @@ NmtNewtWidget *nmt_ip_entry_new (int width, gboolean prefix, gboolean optional); -G_END_DECLS - #endif /* NMT_IP_ENTRY_H */ diff --git a/clients/tui/nmt-mac-entry.h b/clients/tui/nmt-mac-entry.h index b318911767..68d9a208c2 100644 --- a/clients/tui/nmt-mac-entry.h +++ b/clients/tui/nmt-mac-entry.h @@ -19,12 +19,9 @@ #ifndef NMT_MAC_ENTRY_H #define NMT_MAC_ENTRY_H -#include "nm-default.h" #include "nm-utils.h" #include "nmt-newt.h" -G_BEGIN_DECLS - typedef enum { /*< skip >*/ NMT_MAC_ENTRY_TYPE_MAC, NMT_MAC_ENTRY_TYPE_CLONED, @@ -53,6 +50,4 @@ NmtNewtWidget *nmt_mac_entry_new (int width, int mac_length, NmtMacEntryType type); -G_END_DECLS - #endif /* NMT_MAC_ENTRY_H */ diff --git a/clients/tui/nmt-mtu-entry.h b/clients/tui/nmt-mtu-entry.h index dfe416d0e7..b7b2cf46c0 100644 --- a/clients/tui/nmt-mtu-entry.h +++ b/clients/tui/nmt-mtu-entry.h @@ -21,8 +21,6 @@ #include "nmt-newt.h" -G_BEGIN_DECLS - #define NMT_TYPE_MTU_ENTRY (nmt_mtu_entry_get_type ()) #define NMT_MTU_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_MTU_ENTRY, NmtMtuEntry)) #define NMT_MTU_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_MTU_ENTRY, NmtMtuEntryClass)) @@ -44,6 +42,4 @@ GType nmt_mtu_entry_get_type (void); NmtNewtWidget *nmt_mtu_entry_new (void); -G_END_DECLS - #endif /* NMT_MTU_ENTRY_H */ diff --git a/clients/tui/nmt-page-bond.h b/clients/tui/nmt-page-bond.h index b77477db28..d9b071efc4 100644 --- a/clients/tui/nmt-page-bond.h +++ b/clients/tui/nmt-page-bond.h @@ -21,8 +21,6 @@ #include "nmt-editor-page-device.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_BOND (nmt_page_bond_get_type ()) #define NMT_PAGE_BOND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_BOND, NmtPageBond)) #define NMT_PAGE_BOND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_BOND, NmtPageBondClass)) @@ -45,6 +43,4 @@ GType nmt_page_bond_get_type (void); NmtEditorPage *nmt_page_bond_new (NMConnection *conn, NmtDeviceEntry *deventry); -G_END_DECLS - #endif /* NMT_PAGE_BOND_H */ diff --git a/clients/tui/nmt-page-bridge-port.h b/clients/tui/nmt-page-bridge-port.h index c566dbc095..95689fff72 100644 --- a/clients/tui/nmt-page-bridge-port.h +++ b/clients/tui/nmt-page-bridge-port.h @@ -21,8 +21,6 @@ #include "nmt-editor-page.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_BRIDGE_PORT (nmt_page_bridge_port_get_type ()) #define NMT_PAGE_BRIDGE_PORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_BRIDGE_PORT, NmtPageBridgePort)) #define NMT_PAGE_BRIDGE_PORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_BRIDGE_PORT, NmtPageBridgePortClass)) @@ -44,6 +42,4 @@ GType nmt_page_bridge_port_get_type (void); NmtEditorPage *nmt_page_bridge_port_new (NMConnection *conn); -G_END_DECLS - #endif /* NMT_PAGE_BRIDGE_PORT_H */ diff --git a/clients/tui/nmt-page-bridge.h b/clients/tui/nmt-page-bridge.h index 60cbdea23f..21d850afb8 100644 --- a/clients/tui/nmt-page-bridge.h +++ b/clients/tui/nmt-page-bridge.h @@ -21,8 +21,6 @@ #include "nmt-editor-page-device.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_BRIDGE (nmt_page_bridge_get_type ()) #define NMT_PAGE_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_BRIDGE, NmtPageBridge)) #define NMT_PAGE_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_BRIDGE, NmtPageBridgeClass)) @@ -45,6 +43,4 @@ GType nmt_page_bridge_get_type (void); NmtEditorPage *nmt_page_bridge_new (NMConnection *conn, NmtDeviceEntry *deventry); -G_END_DECLS - #endif /* NMT_PAGE_BRIDGE_H */ diff --git a/clients/tui/nmt-page-dsl.h b/clients/tui/nmt-page-dsl.h index dc84ca072c..aa436e716b 100644 --- a/clients/tui/nmt-page-dsl.h +++ b/clients/tui/nmt-page-dsl.h @@ -19,11 +19,8 @@ #ifndef NMT_PAGE_DSL_H #define NMT_PAGE_DSL_H -#include "nm-default.h" #include "nmt-editor-page-device.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_DSL (nmt_page_dsl_get_type ()) #define NMT_PAGE_DSL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_DSL, NmtPageDsl)) #define NMT_PAGE_DSL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_DSL, NmtPageDslClass)) @@ -46,6 +43,4 @@ GType nmt_page_dsl_get_type (void); NmtEditorPage *nmt_page_dsl_new (NMConnection *conn, NmtDeviceEntry *deventry); -G_END_DECLS - #endif /* NMT_PAGE_DSL_H */ diff --git a/clients/tui/nmt-page-ethernet.h b/clients/tui/nmt-page-ethernet.h index bdf3d67731..56d917e1ef 100644 --- a/clients/tui/nmt-page-ethernet.h +++ b/clients/tui/nmt-page-ethernet.h @@ -21,8 +21,6 @@ #include "nmt-editor-page-device.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_ETHERNET (nmt_page_ethernet_get_type ()) #define NMT_PAGE_ETHERNET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_ETHERNET, NmtPageEthernet)) #define NMT_PAGE_ETHERNET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_ETHERNET, NmtPageEthernetClass)) @@ -45,6 +43,4 @@ GType nmt_page_ethernet_get_type (void); NmtEditorPage *nmt_page_ethernet_new (NMConnection *conn, NmtDeviceEntry *deventry); -G_END_DECLS - #endif /* NMT_PAGE_ETHERNET_H */ diff --git a/clients/tui/nmt-page-infiniband.h b/clients/tui/nmt-page-infiniband.h index f51e0874ec..e2e0fbbcb4 100644 --- a/clients/tui/nmt-page-infiniband.h +++ b/clients/tui/nmt-page-infiniband.h @@ -21,8 +21,6 @@ #include "nmt-editor-page-device.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_INFINIBAND (nmt_page_infiniband_get_type ()) #define NMT_PAGE_INFINIBAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_INFINIBAND, NmtPageInfiniband)) #define NMT_PAGE_INFINIBAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_INFINIBAND, NmtPageInfinibandClass)) @@ -45,6 +43,4 @@ GType nmt_page_infiniband_get_type (void); NmtEditorPage *nmt_page_infiniband_new (NMConnection *conn, NmtDeviceEntry *deventry); -G_END_DECLS - #endif /* NMT_PAGE_INFINIBAND_H */ diff --git a/clients/tui/nmt-page-ip4.h b/clients/tui/nmt-page-ip4.h index e3c5a00345..f120e57d70 100644 --- a/clients/tui/nmt-page-ip4.h +++ b/clients/tui/nmt-page-ip4.h @@ -21,8 +21,6 @@ #include "nmt-editor-page.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_IP4 (nmt_page_ip4_get_type ()) #define NMT_PAGE_IP4(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_IP4, NmtPageIP4)) #define NMT_PAGE_IP4_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_IP4, NmtPageIP4Class)) @@ -44,6 +42,4 @@ GType nmt_page_ip4_get_type (void); NmtEditorPage *nmt_page_ip4_new (NMConnection *conn); -G_END_DECLS - #endif /* NMT_PAGE_IP4_H */ diff --git a/clients/tui/nmt-page-ip6.h b/clients/tui/nmt-page-ip6.h index 498261e16c..3a471447ca 100644 --- a/clients/tui/nmt-page-ip6.h +++ b/clients/tui/nmt-page-ip6.h @@ -21,8 +21,6 @@ #include "nmt-editor-page.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_IP6 (nmt_page_ip6_get_type ()) #define NMT_PAGE_IP6(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_IP6, NmtPageIP6)) #define NMT_PAGE_IP6_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_IP6, NmtPageIP6Class)) @@ -44,6 +42,4 @@ GType nmt_page_ip6_get_type (void); NmtEditorPage *nmt_page_ip6_new (NMConnection *conn); -G_END_DECLS - #endif /* NMT_PAGE_IP6_H */ diff --git a/clients/tui/nmt-page-ppp.h b/clients/tui/nmt-page-ppp.h index 79103232f0..634323d468 100644 --- a/clients/tui/nmt-page-ppp.h +++ b/clients/tui/nmt-page-ppp.h @@ -21,8 +21,6 @@ #include "nmt-editor-page.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_PPP (nmt_page_ppp_get_type ()) #define NMT_PAGE_PPP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_PPP, NmtPagePpp)) #define NMT_PAGE_PPP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_PPP, NmtPagePppClass)) @@ -44,6 +42,4 @@ GType nmt_page_ppp_get_type (void); NmtEditorPage *nmt_page_ppp_new (NMConnection *conn); -G_END_DECLS - #endif /* NMT_PAGE_PPP_H */ diff --git a/clients/tui/nmt-page-team-port.h b/clients/tui/nmt-page-team-port.h index 2d8fa12183..75c4284962 100644 --- a/clients/tui/nmt-page-team-port.h +++ b/clients/tui/nmt-page-team-port.h @@ -21,8 +21,6 @@ #include "nmt-editor-page-device.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_TEAM_PORT (nmt_page_team_port_get_type ()) #define NMT_PAGE_TEAM_PORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_TEAM_PORT, NmtPageTeamPort)) #define NMT_PAGE_TEAM_PORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_TEAM_PORT, NmtPageTeamPortClass)) @@ -44,6 +42,4 @@ GType nmt_page_team_port_get_type (void); NmtEditorPage *nmt_page_team_port_new (NMConnection *conn); -G_END_DECLS - #endif /* NMT_PAGE_TEAM_PORT_H */ diff --git a/clients/tui/nmt-page-team.h b/clients/tui/nmt-page-team.h index 994b63d327..a04c2a95ff 100644 --- a/clients/tui/nmt-page-team.h +++ b/clients/tui/nmt-page-team.h @@ -19,11 +19,8 @@ #ifndef NMT_PAGE_TEAM_H #define NMT_PAGE_TEAM_H -#include "nm-default.h" #include "nmt-editor-page-device.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_TEAM (nmt_page_team_get_type ()) #define NMT_PAGE_TEAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_TEAM, NmtPageTeam)) #define NMT_PAGE_TEAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_TEAM, NmtPageTeamClass)) @@ -46,6 +43,4 @@ GType nmt_page_team_get_type (void); NmtEditorPage *nmt_page_team_new (NMConnection *conn, NmtDeviceEntry *deventry); -G_END_DECLS - #endif /* NMT_PAGE_TEAM_H */ diff --git a/clients/tui/nmt-page-vlan.h b/clients/tui/nmt-page-vlan.h index db7c40981b..043c3bc03b 100644 --- a/clients/tui/nmt-page-vlan.h +++ b/clients/tui/nmt-page-vlan.h @@ -21,8 +21,6 @@ #include "nmt-editor-page-device.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_VLAN (nmt_page_vlan_get_type ()) #define NMT_PAGE_VLAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_VLAN, NmtPageVlan)) #define NMT_PAGE_VLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_VLAN, NmtPageVlanClass)) @@ -45,6 +43,4 @@ GType nmt_page_vlan_get_type (void); NmtEditorPage *nmt_page_vlan_new (NMConnection *conn, NmtDeviceEntry *deventry); -G_END_DECLS - #endif /* NMT_PAGE_VLAN_H */ diff --git a/clients/tui/nmt-page-wifi.h b/clients/tui/nmt-page-wifi.h index 7ce5058462..ed16bdc5c5 100644 --- a/clients/tui/nmt-page-wifi.h +++ b/clients/tui/nmt-page-wifi.h @@ -21,8 +21,6 @@ #include "nmt-editor-page-device.h" -G_BEGIN_DECLS - #define NMT_TYPE_PAGE_WIFI (nmt_page_wifi_get_type ()) #define NMT_PAGE_WIFI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_WIFI, NmtPageWifi)) #define NMT_PAGE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_WIFI, NmtPageWifiClass)) @@ -45,6 +43,4 @@ GType nmt_page_wifi_get_type (void); NmtEditorPage *nmt_page_wifi_new (NMConnection *conn, NmtDeviceEntry *deventry); -G_END_DECLS - #endif /* NMT_PAGE_WIFI_H */ diff --git a/clients/tui/nmt-password-dialog.h b/clients/tui/nmt-password-dialog.h index 36c9f51e19..efdab7ec59 100644 --- a/clients/tui/nmt-password-dialog.h +++ b/clients/tui/nmt-password-dialog.h @@ -21,8 +21,6 @@ #include "nmt-newt.h" -G_BEGIN_DECLS - #define NMT_TYPE_PASSWORD_DIALOG (nmt_password_dialog_get_type ()) #define NMT_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PASSWORD_DIALOG, NmtPasswordDialog)) #define NMT_PASSWORD_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PASSWORD_DIALOG, NmtPasswordDialogClass)) @@ -52,6 +50,4 @@ gboolean nmt_password_dialog_succeeded (NmtPasswordDialog *dialog); const char *nmt_password_dialog_get_request_id (NmtPasswordDialog *dialog); GPtrArray *nmt_password_dialog_get_secrets (NmtPasswordDialog *dialog); -G_END_DECLS - #endif /* NMT_PASSWORD_DIALOG_H */ diff --git a/clients/tui/nmt-password-fields.h b/clients/tui/nmt-password-fields.h index 2ef830aa24..6a6017ba71 100644 --- a/clients/tui/nmt-password-fields.h +++ b/clients/tui/nmt-password-fields.h @@ -21,8 +21,6 @@ #include "nmt-newt.h" -G_BEGIN_DECLS - #define NMT_TYPE_PASSWORD_FIELDS (nmt_password_fields_get_type ()) #define NMT_PASSWORD_FIELDS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PASSWORD_FIELDS, NmtPasswordFields)) #define NMT_PASSWORD_FIELDS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PASSWORD_FIELDS, NmtPasswordFieldsClass)) @@ -50,6 +48,4 @@ typedef enum { NmtNewtWidget *nmt_password_fields_new (int width, NmtPasswordFieldsExtras extras); -G_END_DECLS - #endif /* NMT_PASSWORD_FIELDS_H */ diff --git a/clients/tui/nmt-route-editor.h b/clients/tui/nmt-route-editor.h index 9882c71389..febcb402f2 100644 --- a/clients/tui/nmt-route-editor.h +++ b/clients/tui/nmt-route-editor.h @@ -23,8 +23,6 @@ #include "nmt-newt.h" -G_BEGIN_DECLS - #define NMT_TYPE_ROUTE_EDITOR (nmt_route_editor_get_type ()) #define NMT_ROUTE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_ROUTE_EDITOR, NmtRouteEditor)) #define NMT_ROUTE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_ROUTE_EDITOR, NmtRouteEditorClass)) @@ -46,6 +44,4 @@ GType nmt_route_editor_get_type (void); NmtNewtForm *nmt_route_editor_new (NMSetting *setting); -G_END_DECLS - #endif /* NMT_ROUTE_EDITOR_H */ diff --git a/clients/tui/nmt-route-entry.h b/clients/tui/nmt-route-entry.h index d37b14cd5b..fa76fa7b77 100644 --- a/clients/tui/nmt-route-entry.h +++ b/clients/tui/nmt-route-entry.h @@ -21,8 +21,6 @@ #include "nmt-newt.h" -G_BEGIN_DECLS - #define NMT_TYPE_ROUTE_ENTRY (nmt_route_entry_get_type ()) #define NMT_ROUTE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_ROUTE_ENTRY, NmtRouteEntry)) #define NMT_ROUTE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_ROUTE_ENTRY, NmtRouteEntryClass)) @@ -46,6 +44,4 @@ NmtNewtWidget *nmt_route_entry_new (int family, int ip_entry_width, int metric_entry_width); -G_END_DECLS - #endif /* NMT_ROUTE_ENTRY_H */ diff --git a/clients/tui/nmt-route-table.h b/clients/tui/nmt-route-table.h index 217bf40da0..1aa92e6bd7 100644 --- a/clients/tui/nmt-route-table.h +++ b/clients/tui/nmt-route-table.h @@ -21,8 +21,6 @@ #include "nmt-newt.h" -G_BEGIN_DECLS - #define NMT_TYPE_ROUTE_TABLE (nmt_route_table_get_type ()) #define NMT_ROUTE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_ROUTE_TABLE, NmtRouteTable)) #define NMT_ROUTE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_ROUTE_TABLE, NmtRouteTableClass)) @@ -44,6 +42,4 @@ GType nmt_route_table_get_type (void); NmtNewtWidget *nmt_route_table_new (int family); -G_END_DECLS - #endif /* NMT_ROUTE_TABLE_H */ diff --git a/clients/tui/nmt-slave-list.h b/clients/tui/nmt-slave-list.h index d10cd3a73a..e0d836c733 100644 --- a/clients/tui/nmt-slave-list.h +++ b/clients/tui/nmt-slave-list.h @@ -22,8 +22,6 @@ #include "nmt-edit-connection-list.h" #include "nmtui-edit.h" -G_BEGIN_DECLS - #define NMT_TYPE_SLAVE_LIST (nmt_slave_list_get_type ()) #define NMT_SLAVE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_SLAVE_LIST, NmtSlaveList)) #define NMT_SLAVE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_SLAVE_LIST, NmtSlaveListClass)) @@ -47,6 +45,4 @@ NmtNewtWidget *nmt_slave_list_new (NMConnection *master, NmtAddConnectionTypeFilter type_filter, gpointer type_filter_data); -G_END_DECLS - #endif /* NMT_SLAVE_LIST_H */ diff --git a/clients/tui/nmt-utils.h b/clients/tui/nmt-utils.h index 5531dbeb62..067c6512eb 100644 --- a/clients/tui/nmt-utils.h +++ b/clients/tui/nmt-utils.h @@ -19,10 +19,6 @@ #ifndef NMT_UTILS_H #define NMT_UTILS_H -#include "nm-default.h" - -G_BEGIN_DECLS - typedef struct { gpointer private[3]; } NmtSyncOp; @@ -41,6 +37,4 @@ void nmt_sync_op_complete_pointer (NmtSyncOp *op, gpointer result, GError *error); -G_END_DECLS - #endif /* NMT_UTILS_H */ diff --git a/clients/tui/nmt-widget-list.h b/clients/tui/nmt-widget-list.h index 7dbeb21588..b7bf0151e6 100644 --- a/clients/tui/nmt-widget-list.h +++ b/clients/tui/nmt-widget-list.h @@ -21,8 +21,6 @@ #include "nmt-newt-grid.h" -G_BEGIN_DECLS - #define NMT_TYPE_WIDGET_LIST (nmt_widget_list_get_type ()) #define NMT_WIDGET_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_WIDGET_LIST, NmtWidgetList)) #define NMT_WIDGET_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_WIDGET_LIST, NmtWidgetListClass)) @@ -64,6 +62,4 @@ int nmt_widget_list_get_length (NmtWidgetList *list); void nmt_widget_list_set_length (NmtWidgetList *list, int length); -G_END_DECLS - #endif /* NMT_WIDGET_LIST_H */ diff --git a/clients/tui/nmtui-connect.h b/clients/tui/nmtui-connect.h index 89cb3916da..569d191a57 100644 --- a/clients/tui/nmtui-connect.h +++ b/clients/tui/nmtui-connect.h @@ -19,10 +19,6 @@ #ifndef NMTUI_CONNECT_H #define NMTUI_CONNECT_H -G_BEGIN_DECLS - NmtNewtForm *nmtui_connect (gboolean is_top, int argc, char **argv); -G_END_DECLS - #endif /* NMTUI_CONNECT_H */ diff --git a/clients/tui/nmtui-edit.h b/clients/tui/nmtui-edit.h index 459011e10b..041e78598e 100644 --- a/clients/tui/nmtui-edit.h +++ b/clients/tui/nmtui-edit.h @@ -21,8 +21,6 @@ #include "nmt-newt.h" -G_BEGIN_DECLS - typedef gboolean (*NmtAddConnectionTypeFilter) (GType connection_type, gpointer user_data); @@ -39,6 +37,4 @@ void nmt_edit_connection (NMConnection *connection); void nmt_remove_connection (NMRemoteConnection *connection); -G_END_DECLS - #endif /* NMTUI_EDIT_H */ diff --git a/clients/tui/nmtui-hostname.h b/clients/tui/nmtui-hostname.h index 1af711f9bb..772d9a725b 100644 --- a/clients/tui/nmtui-hostname.h +++ b/clients/tui/nmtui-hostname.h @@ -19,10 +19,6 @@ #ifndef NMTUI_HOSTNAME_H #define NMTUI_HOSTNAME_H -G_BEGIN_DECLS - NmtNewtForm *nmtui_hostname (gboolean is_top, int argc, char **argv); -G_END_DECLS - #endif /* NMTUI_HOSTNAME_H */ diff --git a/clients/tui/nmtui.h b/clients/tui/nmtui.h index aada9719f7..53c20cb47e 100644 --- a/clients/tui/nmtui.h +++ b/clients/tui/nmtui.h @@ -21,12 +21,8 @@ #include -G_BEGIN_DECLS - extern NMClient *nm_client; void nmtui_quit (void); -G_END_DECLS - #endif /* NMTUI_H */ diff --git a/libnm-core/crypto.h b/libnm-core/crypto.h index c77ada5a7f..8c4cfefe22 100644 --- a/libnm-core/crypto.h +++ b/libnm-core/crypto.h @@ -24,8 +24,6 @@ #ifndef __CRYPTO_H__ #define __CRYPTO_H__ -#include "nm-default.h" - #define MD5_HASH_LEN 20 #define CIPHER_DES_EDE3_CBC "DES-EDE3-CBC" #define CIPHER_DES_CBC "DES-CBC" diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h index e3c5bcc3dd..94e473d3c6 100644 --- a/libnm-core/nm-core-internal.h +++ b/libnm-core/nm-core-internal.h @@ -34,7 +34,6 @@ **/ -#include "nm-default.h" #include "nm-connection.h" #include "nm-core-enum-types.h" #include "nm-setting-8021x.h" diff --git a/libnm-core/nm-keyfile-internal.h b/libnm-core/nm-keyfile-internal.h index 7873aa7cdb..41bec0cf8a 100644 --- a/libnm-core/nm-keyfile-internal.h +++ b/libnm-core/nm-keyfile-internal.h @@ -24,7 +24,6 @@ #include -#include "nm-default.h" #include "nm-connection.h" #include "nm-setting-8021x.h" diff --git a/libnm-core/nm-property-compare.h b/libnm-core/nm-property-compare.h index 3f10581807..b859989f80 100644 --- a/libnm-core/nm-property-compare.h +++ b/libnm-core/nm-property-compare.h @@ -23,8 +23,6 @@ #ifndef __NM_PROPERTY_COMPARE_H__ #define __NM_PROPERTY_COMPARE_H__ -#include "nm-default.h" - int nm_property_compare (GVariant *value1, GVariant *value2); #endif /* __NM_PROPERTY_COMPARE_H__ */ diff --git a/libnm-core/nm-setting-private.h b/libnm-core/nm-setting-private.h index 6560c4a296..8d09e3d759 100644 --- a/libnm-core/nm-setting-private.h +++ b/libnm-core/nm-setting-private.h @@ -21,7 +21,6 @@ #ifndef __NM_SETTING_PRIVATE_H__ #define __NM_SETTING_PRIVATE_H__ -#include "nm-default.h" #include "nm-setting.h" #include "nm-connection.h" #include "nm-core-enum-types.h" diff --git a/libnm-glib/nm-dbus-helpers-private.h b/libnm-glib/nm-dbus-helpers-private.h index c78bf1dae5..1d98e77d9d 100644 --- a/libnm-glib/nm-dbus-helpers-private.h +++ b/libnm-glib/nm-dbus-helpers-private.h @@ -24,8 +24,6 @@ #include #include -#include "nm-default.h" - DBusGConnection *_nm_dbus_new_connection (GError **error); DBusGProxy * _nm_dbus_new_proxy_for_connection (DBusGConnection *connection, diff --git a/libnm-glib/nm-object-cache.h b/libnm-glib/nm-object-cache.h index 30b62f08ce..03229d566b 100644 --- a/libnm-glib/nm-object-cache.h +++ b/libnm-glib/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-glib/nm-object-private.h b/libnm-glib/nm-object-private.h index 8878354f55..2d3d8f9cb0 100644 --- a/libnm-glib/nm-object-private.h +++ b/libnm-glib/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" void _nm_object_ensure_inited (NMObject *object); diff --git a/libnm-util/crypto.h b/libnm-util/crypto.h index 74d1adbf6a..29e1c3dc37 100644 --- a/libnm-util/crypto.h +++ b/libnm-util/crypto.h @@ -24,8 +24,6 @@ #ifndef __CRYPTO_H__ #define __CRYPTO_H__ -#include "nm-default.h" - #define MD5_HASH_LEN 20 #define CIPHER_DES_EDE3_CBC "DES-EDE3-CBC" #define CIPHER_DES_CBC "DES-CBC" diff --git a/libnm-util/nm-param-spec-specialized.h b/libnm-util/nm-param-spec-specialized.h index 0f1228f69b..0c4b07e616 100644 --- a/libnm-util/nm-param-spec-specialized.h +++ b/libnm-util/nm-param-spec-specialized.h @@ -23,8 +23,6 @@ #ifndef NM_PARAM_SPEC_SPECIALIZED_H #define NM_PARAM_SPEC_SPECIALIZED_H -#include "nm-default.h" - typedef struct _NMParamSpecSpecialized NMParamSpecSpecialized; #define NM_TYPE_PARAM_SPEC_SPECIALIZED (_nm_param_spec_specialized_get_type ()) diff --git a/libnm-util/nm-setting-private.h b/libnm-util/nm-setting-private.h index beb87484f0..ba15a238da 100644 --- a/libnm-util/nm-setting-private.h +++ b/libnm-util/nm-setting-private.h @@ -21,8 +21,6 @@ #ifndef NM_SETTING_PRIVATE_H #define NM_SETTING_PRIVATE_H -#include "nm-default.h" - #include "nm-connection.h" #define NM_SETTING_SECRET_FLAGS_ALL \ diff --git a/libnm/nm-dbus-helpers.h b/libnm/nm-dbus-helpers.h index 497739f0ac..4ec8988a17 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-object-cache.h b/libnm/nm-object-cache.h index c0f70f21cc..b29692faa1 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 7e8066f4ee..ad78f92ba0 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/src/devices/adsl/nm-atm-manager.h b/src/devices/adsl/nm-atm-manager.h index fe0bc14c4e..bcbc6c77bc 100644 --- a/src/devices/adsl/nm-atm-manager.h +++ b/src/devices/adsl/nm-atm-manager.h @@ -22,10 +22,6 @@ #ifndef __NETWORKMANAGER_ATM_MANAGER_H__ #define __NETWORKMANAGER_ATM_MANAGER_H__ -#include "nm-default.h" - -G_BEGIN_DECLS - #define NM_TYPE_ATM_MANAGER (nm_atm_manager_get_type ()) #define NM_ATM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ATM_MANAGER, NMAtmManager)) diff --git a/src/devices/adsl/nm-device-adsl.h b/src/devices/adsl/nm-device-adsl.h index efcdaf6980..cfde2b3529 100644 --- a/src/devices/adsl/nm-device-adsl.h +++ b/src/devices/adsl/nm-device-adsl.h @@ -23,11 +23,8 @@ #define __NETWORKMANAGER_DEVICE_ADSL_H__ // Parent class -#include "nm-default.h" #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_ADSL (nm_device_adsl_get_type ()) #define NM_DEVICE_ADSL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_ADSL, NMDeviceAdsl)) #define NM_DEVICE_ADSL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_ADSL, NMDeviceAdslClass)) @@ -52,6 +49,4 @@ NMDevice *nm_device_adsl_new (const char *udi, const char *driver, int atm_index); -G_END_DECLS - -#endif /* NM_DEVICE_ADSL_H */ +#endif /* NM_DEVICE_ADSL_H */ diff --git a/src/devices/bluetooth/nm-bluez4-manager.h b/src/devices/bluetooth/nm-bluez4-manager.h index dbf7688940..8afe6924c7 100644 --- a/src/devices/bluetooth/nm-bluez4-manager.h +++ b/src/devices/bluetooth/nm-bluez4-manager.h @@ -21,10 +21,6 @@ #ifndef __NETWORKMANAGER_BLUEZ4_MANAGER_H__ #define __NETWORKMANAGER_BLUEZ4_MANAGER_H__ -#include "nm-default.h" - -G_BEGIN_DECLS - #define NM_TYPE_BLUEZ4_MANAGER (nm_bluez4_manager_get_type ()) #define NM_BLUEZ4_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_BLUEZ4_MANAGER, NMBluez4Manager)) #define NM_BLUEZ4_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_BLUEZ4_MANAGER, NMBluez4ManagerClass)) diff --git a/src/devices/bluetooth/nm-bluez5-dun.h b/src/devices/bluetooth/nm-bluez5-dun.h index c59cbb80f8..124c1a05b0 100644 --- a/src/devices/bluetooth/nm-bluez5-dun.h +++ b/src/devices/bluetooth/nm-bluez5-dun.h @@ -21,8 +21,6 @@ #ifndef _NM_BLUEZ5_UTILS_H_ #define _NM_BLUEZ5_UTILS_H_ -#include "nm-default.h" - typedef struct _NMBluez5DunContext NMBluez5DunContext; typedef void (*NMBluez5DunFunc) (NMBluez5DunContext *context, diff --git a/src/devices/bluetooth/nm-device-bt.h b/src/devices/bluetooth/nm-device-bt.h index c565745ff3..c97cca0137 100644 --- a/src/devices/bluetooth/nm-device-bt.h +++ b/src/devices/bluetooth/nm-device-bt.h @@ -25,8 +25,6 @@ #include "nm-bluez-device.h" #include "nm-modem.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_BT (nm_device_bt_get_type ()) #define NM_DEVICE_BT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_BT, NMDeviceBt)) #define NM_DEVICE_BT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_BT, NMDeviceBtClass)) @@ -63,6 +61,4 @@ gboolean nm_device_bt_modem_added (NMDeviceBt *device, NMModem *modem, const char *driver); -G_END_DECLS - #endif /* __NETWORKMANAGER_DEVICE_BT_H__ */ diff --git a/src/devices/nm-arping-manager.h b/src/devices/nm-arping-manager.h index 4a4f8d4b01..78965a0df2 100644 --- a/src/devices/nm-arping-manager.h +++ b/src/devices/nm-arping-manager.h @@ -19,8 +19,6 @@ #include -G_BEGIN_DECLS - #define NM_TYPE_ARPING_MANAGER (nm_arping_manager_get_type ()) #define NM_ARPING_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ARPING_MANAGER, NMArpingManager)) #define NM_ARPING_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_ARPING_MANAGER, NMArpingManagerClass)) @@ -48,6 +46,4 @@ gboolean nm_arping_manager_check_address (NMArpingManager *self, in_addr_t addre void nm_arping_manager_announce_addresses (NMArpingManager *self); void nm_arping_manager_reset (NMArpingManager *self); -G_END_DECLS - #endif /* __NM_ARPING_MANAGER__ */ diff --git a/src/devices/nm-device-bond.h b/src/devices/nm-device-bond.h index 9e86719e3c..02b6c8e540 100644 --- a/src/devices/nm-device-bond.h +++ b/src/devices/nm-device-bond.h @@ -23,8 +23,6 @@ #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_BOND (nm_device_bond_get_type ()) #define NM_DEVICE_BOND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_BOND, NMDeviceBond)) #define NM_DEVICE_BOND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_BOND, NMDeviceBondClass)) @@ -37,6 +35,4 @@ typedef NMDeviceClass NMDeviceBondClass; GType nm_device_bond_get_type (void); -G_END_DECLS - -#endif /* NM_DEVICE_BOND_H */ +#endif /* NM_DEVICE_BOND_H */ diff --git a/src/devices/nm-device-bridge.h b/src/devices/nm-device-bridge.h index 4648267525..05da9ed751 100644 --- a/src/devices/nm-device-bridge.h +++ b/src/devices/nm-device-bridge.h @@ -21,11 +21,8 @@ #ifndef __NETWORKMANAGER_DEVICE_BRIDGE_H__ #define __NETWORKMANAGER_DEVICE_BRIDGE_H__ -#include "nm-default.h" #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_BRIDGE (nm_device_bridge_get_type ()) #define NM_DEVICE_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_BRIDGE, NMDeviceBridge)) #define NM_DEVICE_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_BRIDGE, NMDeviceBridgeClass)) @@ -38,6 +35,4 @@ typedef NMDeviceClass NMDeviceBridgeClass; GType nm_device_bridge_get_type (void); -G_END_DECLS - -#endif /* NM_DEVICE_BRIDGE_H */ +#endif /* __NETWORKMANAGER_DEVICE_BRIDGE_H__ */ diff --git a/src/devices/nm-device-ethernet.h b/src/devices/nm-device-ethernet.h index 8f7b7124be..3ce6f0ca4b 100644 --- a/src/devices/nm-device-ethernet.h +++ b/src/devices/nm-device-ethernet.h @@ -24,8 +24,6 @@ #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_ETHERNET (nm_device_ethernet_get_type ()) #define NM_DEVICE_ETHERNET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernet)) #define NM_DEVICE_ETHERNET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetClass)) @@ -49,6 +47,4 @@ typedef struct { GType nm_device_ethernet_get_type (void); -G_END_DECLS - -#endif /* NM_DEVICE_ETHERNET_H */ +#endif /* __NETWORKMANAGER_DEVICE_ETHERNET_H__ */ diff --git a/src/devices/nm-device-generic.h b/src/devices/nm-device-generic.h index 9303a27891..9a5ff09122 100644 --- a/src/devices/nm-device-generic.h +++ b/src/devices/nm-device-generic.h @@ -23,8 +23,6 @@ #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_GENERIC (nm_device_generic_get_type ()) #define NM_DEVICE_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_GENERIC, NMDeviceGeneric)) #define NM_DEVICE_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_GENERIC, NMDeviceGenericClass)) @@ -47,6 +45,4 @@ GType nm_device_generic_get_type (void); NMDevice *nm_device_generic_new (const NMPlatformLink *plink); -G_END_DECLS - -#endif /* NM_DEVICE_GENERIC_H */ +#endif /* __NETWORKMANAGER_DEVICE_GENERIC_H__ */ diff --git a/src/devices/nm-device-infiniband.h b/src/devices/nm-device-infiniband.h index cac9a79d37..a74d07a51f 100644 --- a/src/devices/nm-device-infiniband.h +++ b/src/devices/nm-device-infiniband.h @@ -23,8 +23,6 @@ #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_INFINIBAND (nm_device_infiniband_get_type ()) #define NM_DEVICE_INFINIBAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_INFINIBAND, NMDeviceInfiniband)) #define NM_DEVICE_INFINIBAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_INFINIBAND, NMDeviceInfinibandClass)) @@ -37,6 +35,4 @@ typedef NMDeviceClass NMDeviceInfinibandClass; GType nm_device_infiniband_get_type (void); -G_END_DECLS - -#endif /* NM_DEVICE_INFINIBAND_H */ +#endif /* __NETWORKMANAGER_DEVICE_INFINIBAND_H__ */ diff --git a/src/devices/nm-device-ip-tunnel.h b/src/devices/nm-device-ip-tunnel.h index 11cb5bce3b..94cc737526 100644 --- a/src/devices/nm-device-ip-tunnel.h +++ b/src/devices/nm-device-ip-tunnel.h @@ -24,8 +24,6 @@ #include "nm-core-types.h" #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_IP_TUNNEL (nm_device_ip_tunnel_get_type ()) #define NM_DEVICE_IP_TUNNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_IP_TUNNEL, NMDeviceIPTunnel)) #define NM_DEVICE_IP_TUNNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_IP_TUNNEL, NMDeviceIPTunnelClass)) @@ -55,6 +53,4 @@ typedef struct { GType nm_device_ip_tunnel_get_type (void); -G_END_DECLS - -#endif /* NM_DEVICE_IP_TUNNEL_H */ +#endif /* __NETWORKMANAGER_DEVICE_IP_TUNNEL_H__ */ diff --git a/src/devices/nm-device-logging.h b/src/devices/nm-device-logging.h index 1be17073b6..fac92eaca8 100644 --- a/src/devices/nm-device-logging.h +++ b/src/devices/nm-device-logging.h @@ -21,7 +21,6 @@ #ifndef __NETWORKMANAGER_DEVICE_LOGGING_H__ #define __NETWORKMANAGER_DEVICE_LOGGING_H__ -#include "nm-default.h" #include "nm-device.h" #define _LOG_DECLARE_SELF(t) \ diff --git a/src/devices/nm-device-macvlan.h b/src/devices/nm-device-macvlan.h index 89f670bd82..5756f696fd 100644 --- a/src/devices/nm-device-macvlan.h +++ b/src/devices/nm-device-macvlan.h @@ -23,8 +23,6 @@ #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_MACVLAN (nm_device_macvlan_get_type ()) #define NM_DEVICE_MACVLAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_MACVLAN, NMDeviceMacvlan)) #define NM_DEVICE_MACVLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_MACVLAN, NMDeviceMacvlanClass)) @@ -42,6 +40,4 @@ typedef NMDeviceClass NMDeviceMacvlanClass; GType nm_device_macvlan_get_type (void); -G_END_DECLS - -#endif /* NM_DEVICE_MACVLAN_H */ +#endif /* __NETWORKMANAGER_DEVICE_MACVLAN_H__ */ diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-private.h index 7381fd930f..c85cb969ba 100644 --- a/src/devices/nm-device-private.h +++ b/src/devices/nm-device-private.h @@ -24,8 +24,6 @@ #include "nm-device.h" -#include "nm-default.h" - /* This file should only be used by subclasses of NMDevice */ enum NMActStageReturn { diff --git a/src/devices/nm-device-tun.h b/src/devices/nm-device-tun.h index 32dcfd47b5..d62b0c373e 100644 --- a/src/devices/nm-device-tun.h +++ b/src/devices/nm-device-tun.h @@ -23,8 +23,6 @@ #include "nm-device-generic.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_TUN (nm_device_tun_get_type ()) #define NM_DEVICE_TUN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_TUN, NMDeviceTun)) #define NM_DEVICE_TUN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_TUN, NMDeviceTunClass)) @@ -44,6 +42,4 @@ typedef NMDeviceClass NMDeviceTunClass; GType nm_device_tun_get_type (void); -G_END_DECLS - -#endif /* NM_DEVICE_TUN_H */ +#endif /* __NETWORKMANAGER_DEVICE_TUN_H__ */ diff --git a/src/devices/nm-device-veth.h b/src/devices/nm-device-veth.h index 3ba5af6939..53ccf9253d 100644 --- a/src/devices/nm-device-veth.h +++ b/src/devices/nm-device-veth.h @@ -23,8 +23,6 @@ #include "nm-device-ethernet.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_VETH (nm_device_veth_get_type ()) #define NM_DEVICE_VETH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_VETH, NMDeviceVeth)) #define NM_DEVICE_VETH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_VETH, NMDeviceVethClass)) @@ -39,6 +37,4 @@ typedef struct _NMDeviceVethClass NMDeviceVethClass; GType nm_device_veth_get_type (void); -G_END_DECLS - -#endif /* NM_DEVICE_VETH_H */ +#endif /* __NETWORKMANAGER_DEVICE_VETH_H__ */ diff --git a/src/devices/nm-device-vlan.h b/src/devices/nm-device-vlan.h index e31e171d04..71ca80307a 100644 --- a/src/devices/nm-device-vlan.h +++ b/src/devices/nm-device-vlan.h @@ -23,8 +23,6 @@ #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_VLAN (nm_device_vlan_get_type ()) #define NM_DEVICE_VLAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_VLAN, NMDeviceVlan)) #define NM_DEVICE_VLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_VLAN, NMDeviceVlanClass)) @@ -47,6 +45,4 @@ typedef NMDeviceClass NMDeviceVlanClass; GType nm_device_vlan_get_type (void); -G_END_DECLS - -#endif /* NM_DEVICE_VLAN_H */ +#endif /* __NETWORKMANAGER_DEVICE_VLAN_H__ */ diff --git a/src/devices/nm-device-vxlan.h b/src/devices/nm-device-vxlan.h index 7de04a1242..71204d3beb 100644 --- a/src/devices/nm-device-vxlan.h +++ b/src/devices/nm-device-vxlan.h @@ -23,8 +23,6 @@ #include "nm-device-generic.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_VXLAN (nm_device_vxlan_get_type ()) #define NM_DEVICE_VXLAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_VXLAN, NMDeviceVxlan)) #define NM_DEVICE_VXLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_VXLAN, NMDeviceVxlanClass)) @@ -54,6 +52,4 @@ typedef NMDeviceClass NMDeviceVxlanClass; GType nm_device_vxlan_get_type (void); -G_END_DECLS - -#endif /* NM_DEVICE_VXLAN_H */ +#endif /* __NETWORKMANAGER_DEVICE_VXLAN_H__ */ diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index 433448565d..34d31cadbf 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -92,8 +92,6 @@ #define NM_DEVICE_STATISTICS_TX_BYTES "tx-bytes" #define NM_DEVICE_STATISTICS_RX_BYTES "rx-bytes" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE (nm_device_get_type ()) #define NM_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE, NMDevice)) #define NM_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE, NMDeviceClass)) @@ -595,6 +593,4 @@ void nm_device_update_initial_hw_address (NMDevice *self); void nm_device_update_permanent_hw_address (NMDevice *self); void nm_device_update_dynamic_ip_setup (NMDevice *self); -G_END_DECLS - -#endif /* NM_DEVICE_H */ +#endif /* __NETWORKMANAGER_DEVICE_H__ */ diff --git a/src/devices/nm-lldp-listener.h b/src/devices/nm-lldp-listener.h index df02fd6305..870ca8a5b5 100644 --- a/src/devices/nm-lldp-listener.h +++ b/src/devices/nm-lldp-listener.h @@ -21,8 +21,6 @@ #ifndef __NM_LLDP_LISTENER__ #define __NM_LLDP_LISTENER__ -G_BEGIN_DECLS - #define NM_TYPE_LLDP_LISTENER (nm_lldp_listener_get_type ()) #define NM_LLDP_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_LLDP_LISTENER, NMLldpListener)) #define NM_LLDP_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_LLDP_LISTENER, NMLldpListenerClass)) @@ -48,6 +46,4 @@ gboolean nm_lldp_listener_is_running (NMLldpListener *self); GVariant *nm_lldp_listener_get_neighbors (NMLldpListener *self); -G_END_DECLS - #endif /* __NM_LLDP_LISTENER__ */ diff --git a/src/devices/team/nm-device-team.h b/src/devices/team/nm-device-team.h index 27bd8227db..43e8aab408 100644 --- a/src/devices/team/nm-device-team.h +++ b/src/devices/team/nm-device-team.h @@ -23,8 +23,6 @@ #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_TEAM (nm_device_team_get_type ()) #define NM_DEVICE_TEAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_TEAM, NMDeviceTeam)) #define NM_DEVICE_TEAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_TEAM, NMDeviceTeamClass)) @@ -42,6 +40,4 @@ GType nm_device_team_get_type (void); NMDevice *nm_device_team_new (const char *iface); -G_END_DECLS - -#endif /* NM_DEVICE_TEAM_H */ +#endif /* __NETWORKMANAGER_DEVICE_TEAM_H__ */ diff --git a/src/devices/team/nm-team-factory.h b/src/devices/team/nm-team-factory.h index 9049478dc1..4155870c2a 100644 --- a/src/devices/team/nm-team-factory.h +++ b/src/devices/team/nm-team-factory.h @@ -21,8 +21,6 @@ #ifndef __NETWORKMANAGER_TEAM_FACTORY_H__ #define __NETWORKMANAGER_TEAM_FACTORY_H__ -#include "nm-default.h" - #define NM_TYPE_TEAM_FACTORY (nm_team_factory_get_type ()) #define NM_TEAM_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_TEAM_FACTORY, NMTeamFactory)) diff --git a/src/devices/wifi/nm-device-olpc-mesh.h b/src/devices/wifi/nm-device-olpc-mesh.h index 63895a88fd..135226d5af 100644 --- a/src/devices/wifi/nm-device-olpc-mesh.h +++ b/src/devices/wifi/nm-device-olpc-mesh.h @@ -30,8 +30,6 @@ #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_DEVICE_OLPC_MESH (nm_device_olpc_mesh_get_type ()) #define NM_DEVICE_OLPC_MESH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMesh)) #define NM_DEVICE_OLPC_MESH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMeshClass)) @@ -67,6 +65,4 @@ GType nm_device_olpc_mesh_get_type (void); NMDevice *nm_device_olpc_mesh_new (const char *iface); -G_END_DECLS - -#endif /* NM_DEVICE_OLPC_MESH_H */ +#endif /* __NETWORKMANAGER_DEVICE_OLPC_MESH_H__ */ diff --git a/src/devices/wwan/Makefile.am b/src/devices/wwan/Makefile.am index 1d3c7c851d..44d0f1e24a 100644 --- a/src/devices/wwan/Makefile.am +++ b/src/devices/wwan/Makefile.am @@ -27,7 +27,7 @@ pkglib_LTLIBRARIES = libnm-wwan.la libnm-device-plugin-wwan.la GLIB_GENERATED = nm-modem-enum-types.h nm-modem-enum-types.c GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM -GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM +GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "nm-default.h"\n' nm_modem_enum_types_sources = $(srcdir)/nm-modem.h BUILT_SOURCES += $(GLIB_GENERATED) diff --git a/src/devices/wwan/nm-modem-broadband.h b/src/devices/wwan/nm-modem-broadband.h index 371607782b..6607f7f553 100644 --- a/src/devices/wwan/nm-modem-broadband.h +++ b/src/devices/wwan/nm-modem-broadband.h @@ -23,8 +23,6 @@ #include "nm-modem.h" -G_BEGIN_DECLS - #define NM_TYPE_MODEM_BROADBAND (nm_modem_broadband_get_type ()) #define NM_MODEM_BROADBAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MODEM_BROADBAND, NMModemBroadband)) #define NM_MODEM_BROADBAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MODEM_BROADBAND, NMModemBroadbandClass)) @@ -49,6 +47,4 @@ GType nm_modem_broadband_get_type (void); NMModem *nm_modem_broadband_new (GObject *object, GError **error); -G_END_DECLS - #endif /* __NETWORKMANAGER_MODEM_BROADBAND_H__ */ diff --git a/src/devices/wwan/nm-modem.h b/src/devices/wwan/nm-modem.h index 60e5589b55..8f797d4400 100644 --- a/src/devices/wwan/nm-modem.h +++ b/src/devices/wwan/nm-modem.h @@ -22,12 +22,9 @@ #ifndef __NETWORKMANAGER_MODEM_H__ #define __NETWORKMANAGER_MODEM_H__ -#include "nm-default.h" #include "ppp-manager/nm-ppp-manager.h" #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_MODEM (nm_modem_get_type ()) #define NM_MODEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MODEM, NMModem)) #define NM_MODEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MODEM, NMModemClass)) @@ -268,6 +265,4 @@ void nm_modem_emit_ip6_config_result (NMModem *self, const gchar *nm_modem_ip_type_to_string (NMModemIPType ip_type); -G_END_DECLS - #endif /* __NETWORKMANAGER_MODEM_H__ */ diff --git a/src/devices/wwan/nm-wwan-factory.h b/src/devices/wwan/nm-wwan-factory.h index 78031e60f6..61bdcb1e4b 100644 --- a/src/devices/wwan/nm-wwan-factory.h +++ b/src/devices/wwan/nm-wwan-factory.h @@ -21,8 +21,6 @@ #ifndef __NETWORKMANAGER_WWAN_FACTORY_H__ #define __NETWORKMANAGER_WWAN_FACTORY_H__ -#include "nm-default.h" - #define NM_TYPE_WWAN_FACTORY (nm_wwan_factory_get_type ()) #define NM_WWAN_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_WWAN_FACTORY, NMWwanFactory)) diff --git a/src/dhcp-manager/nm-dhcp-client-logging.h b/src/dhcp-manager/nm-dhcp-client-logging.h index 96b6358033..8dd18bf233 100644 --- a/src/dhcp-manager/nm-dhcp-client-logging.h +++ b/src/dhcp-manager/nm-dhcp-client-logging.h @@ -21,7 +21,6 @@ #ifndef __NETWORKMANAGER_DHCP_CLIENT_LOGGING_H__ #define __NETWORKMANAGER_DHCP_CLIENT_LOGGING_H__ -#include "nm-default.h" #include "nm-dhcp-client.h" #define _NMLOG_PREFIX_NAME "dhcp" diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h index 1c78c5b124..5779d4eddf 100644 --- a/src/dhcp-manager/nm-dhcp-client.h +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -24,8 +24,6 @@ #include #include -#include "nm-default.h" - #define NM_TYPE_DHCP_CLIENT (nm_dhcp_client_get_type ()) #define NM_DHCP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_CLIENT, NMDhcpClient)) #define NM_DHCP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_CLIENT, NMDhcpClientClass)) diff --git a/src/dhcp-manager/nm-dhcp-dhclient.h b/src/dhcp-manager/nm-dhcp-dhclient.h index 3e8d9c5d8e..7f0c855a75 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.h +++ b/src/dhcp-manager/nm-dhcp-dhclient.h @@ -19,7 +19,6 @@ #ifndef __NETWORKMANAGER_DHCP_DHCLIENT_H__ #define __NETWORKMANAGER_DHCP_DHCLIENT_H__ -#include "nm-default.h" #include "nm-dhcp-client.h" #define NM_TYPE_DHCP_DHCLIENT (nm_dhcp_dhclient_get_type ()) diff --git a/src/dhcp-manager/nm-dhcp-listener.h b/src/dhcp-manager/nm-dhcp-listener.h index b2631acc5e..ff31fe3476 100644 --- a/src/dhcp-manager/nm-dhcp-listener.h +++ b/src/dhcp-manager/nm-dhcp-listener.h @@ -19,8 +19,6 @@ #ifndef __NETWORKMANAGER_DHCP_LISTENER_H__ #define __NETWORKMANAGER_DHCP_LISTENER_H__ -#include "nm-default.h" - #define NM_TYPE_DHCP_LISTENER (nm_dhcp_listener_get_type ()) #define NM_DHCP_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_LISTENER, NMDhcpListener)) #define NM_IS_DHCP_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP_LISTENER)) diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h index 42d968ab25..df92c91c3b 100644 --- a/src/dhcp-manager/nm-dhcp-manager.h +++ b/src/dhcp-manager/nm-dhcp-manager.h @@ -22,8 +22,6 @@ #ifndef __NETWORKMANAGER_DHCP_MANAGER_H__ #define __NETWORKMANAGER_DHCP_MANAGER_H__ - -#include "nm-default.h" #include "nm-dhcp-client.h" #include "nm-ip4-config.h" #include "nm-dhcp4-config.h" diff --git a/src/dhcp-manager/nm-dhcp-utils.h b/src/dhcp-manager/nm-dhcp-utils.h index 056982c382..6540b1ff80 100644 --- a/src/dhcp-manager/nm-dhcp-utils.h +++ b/src/dhcp-manager/nm-dhcp-utils.h @@ -24,8 +24,6 @@ #include #include -#include "nm-default.h" - NMIP4Config *nm_dhcp_utils_ip4_config_from_options (int ifindex, const char *iface, GHashTable *options, diff --git a/src/dns-manager/nm-dns-manager.h b/src/dns-manager/nm-dns-manager.h index 50f050e544..3deda58237 100644 --- a/src/dns-manager/nm-dns-manager.h +++ b/src/dns-manager/nm-dns-manager.h @@ -24,12 +24,9 @@ #ifndef __NETWORKMANAGER_DNS_MANAGER_H__ #define __NETWORKMANAGER_DNS_MANAGER_H__ -#include "nm-default.h" #include "nm-ip4-config.h" #include "nm-ip6-config.h" -G_BEGIN_DECLS - typedef enum { NM_DNS_IP_CONFIG_TYPE_DEFAULT = 0, NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE, @@ -117,6 +114,4 @@ typedef enum { gboolean nm_dns_manager_get_resolv_conf_explicit (NMDnsManager *self); -G_END_DECLS - #endif /* __NETWORKMANAGER_DNS_MANAGER_H__ */ diff --git a/src/dns-manager/nm-dns-plugin.h b/src/dns-manager/nm-dns-plugin.h index 4c84b1457d..e24bc1732a 100644 --- a/src/dns-manager/nm-dns-plugin.h +++ b/src/dns-manager/nm-dns-plugin.h @@ -19,9 +19,7 @@ #ifndef __NETWORKMANAGER_DNS_PLUGIN_H__ #define __NETWORKMANAGER_DNS_PLUGIN_H__ -#include "nm-default.h" #include "nm-dns-manager.h" - #include "nm-config-data.h" #define NM_TYPE_DNS_PLUGIN (nm_dns_plugin_get_type ()) diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.h b/src/dnsmasq-manager/nm-dnsmasq-manager.h index cc095d66c8..b610b4987b 100644 --- a/src/dnsmasq-manager/nm-dnsmasq-manager.h +++ b/src/dnsmasq-manager/nm-dnsmasq-manager.h @@ -21,8 +21,6 @@ #ifndef __NETWORKMANAGER_DNSMASQ_MANAGER_H__ #define __NETWORKMANAGER_DNSMASQ_MANAGER_H__ - -#include "nm-default.h" #include "nm-ip4-config.h" #define NM_TYPE_DNSMASQ_MANAGER (nm_dnsmasq_manager_get_type ()) diff --git a/src/dnsmasq-manager/nm-dnsmasq-utils.h b/src/dnsmasq-manager/nm-dnsmasq-utils.h index 43d0b9a30b..459dda0475 100644 --- a/src/dnsmasq-manager/nm-dnsmasq-utils.h +++ b/src/dnsmasq-manager/nm-dnsmasq-utils.h @@ -21,7 +21,6 @@ #ifndef __NETWORKMANAGER_DNSMASQ_UTILS_H__ #define __NETWORKMANAGER_DNSMASQ_UTILS_H__ -#include "nm-default.h" #include "nm-platform.h" gboolean nm_dnsmasq_utils_get_range (const NMPlatformIP4Address *addr, diff --git a/src/main-utils.h b/src/main-utils.h index 10ba3135f9..dbbdb85f2f 100644 --- a/src/main-utils.h +++ b/src/main-utils.h @@ -21,8 +21,6 @@ #ifndef __MAIN_UTILS_H__ #define __MAIN_UTILS_H__ -#include "nm-default.h" - void nm_main_utils_ensure_root (void); void nm_main_utils_setup_signals (GMainLoop *main_loop); diff --git a/src/nm-activation-request.h b/src/nm-activation-request.h index 929ce195f2..1bd004994e 100644 --- a/src/nm-activation-request.h +++ b/src/nm-activation-request.h @@ -21,8 +21,6 @@ #ifndef __NETWORKMANAGER_ACTIVATION_REQUEST_H__ #define __NETWORKMANAGER_ACTIVATION_REQUEST_H__ - -#include "nm-default.h" #include "nm-connection.h" #include "nm-active-connection.h" diff --git a/src/nm-audit-manager.h b/src/nm-audit-manager.h index 2d44c2ca52..af8a2037c7 100644 --- a/src/nm-audit-manager.h +++ b/src/nm-audit-manager.h @@ -21,15 +21,10 @@ #ifndef __NM_AUDIT_MANAGER_H__ #define __NM_AUDIT_MANAGER_H__ -#include -#include - #include "nm-connection.h" #include "nm-device.h" #include "nm-types.h" -G_BEGIN_DECLS - #define NM_TYPE_AUDIT_MANAGER (nm_audit_manager_get_type ()) #define NM_AUDIT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_AUDIT_MANAGER, NMAuditManager)) #define NM_AUDIT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_AUDIT_MANAGER, NMAuditManagerClass)) @@ -127,6 +122,4 @@ void _nm_audit_manager_log_device_op (NMAuditManager *self, const char *file const char *func, const char *op, NMDevice *device, gboolean result, gpointer subject_context, const char *reason); -G_END_DECLS - #endif /* __NM_AUDIT_MANAGER_H__ */ diff --git a/src/nm-auth-manager.h b/src/nm-auth-manager.h index 2875cccbaa..9251b3347c 100644 --- a/src/nm-auth-manager.h +++ b/src/nm-auth-manager.h @@ -21,13 +21,8 @@ #ifndef NM_AUTH_MANAGER_H #define NM_AUTH_MANAGER_H - -#include "nm-default.h" #include "nm-auth-subject.h" -G_BEGIN_DECLS - - #define NM_TYPE_AUTH_MANAGER (nm_auth_manager_get_type ()) #define NM_AUTH_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_AUTH_MANAGER, NMAuthManager)) #define NM_AUTH_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_AUTH_MANAGER, NMAuthManagerClass)) @@ -72,7 +67,5 @@ gboolean nm_auth_manager_polkit_authority_check_authorization_finish (NMAuthMana #endif -G_END_DECLS - #endif /* NM_AUTH_MANAGER_H */ diff --git a/src/nm-bus-manager.h b/src/nm-bus-manager.h index f8a2cb6b5b..f49901db2c 100644 --- a/src/nm-bus-manager.h +++ b/src/nm-bus-manager.h @@ -22,8 +22,6 @@ #ifndef __NM_BUS_MANAGER_H__ #define __NM_BUS_MANAGER_H__ -G_BEGIN_DECLS - #define NM_TYPE_BUS_MANAGER (nm_bus_manager_get_type ()) #define NM_BUS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_BUS_MANAGER, NMBusManager)) #define NM_BUS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NM_TYPE_BUS_MANAGER, NMBusManagerClass)) @@ -107,6 +105,4 @@ GDBusProxy *nm_bus_manager_new_proxy (NMBusManager *self, const char *path, const char *iface); -G_END_DECLS - #endif /* __NM_BUS_MANAGER_H__ */ diff --git a/src/nm-connectivity.h b/src/nm-connectivity.h index f037403ce8..10fcef97af 100644 --- a/src/nm-connectivity.h +++ b/src/nm-connectivity.h @@ -21,8 +21,6 @@ #ifndef __NETWORKMANAGER_CONNECTIVITY_H__ #define __NETWORKMANAGER_CONNECTIVITY_H__ - -#include "nm-default.h" #include "nm-dbus-interface.h" #define NM_TYPE_CONNECTIVITY (nm_connectivity_get_type ()) diff --git a/src/nm-core-utils.h b/src/nm-core-utils.h index 90a4c23e6d..3ef960bb6d 100644 --- a/src/nm-core-utils.h +++ b/src/nm-core-utils.h @@ -25,7 +25,6 @@ #include #include -#include "nm-default.h" #include "nm-connection.h" /*****************************************************************************/ diff --git a/src/nm-dcb.h b/src/nm-dcb.h index 86e6153d67..8bc084706c 100644 --- a/src/nm-dcb.h +++ b/src/nm-dcb.h @@ -21,7 +21,6 @@ #ifndef __NETWORKMANAGER_DCB_H__ #define __NETWORKMANAGER_DCB_H__ -#include "nm-default.h" #include "nm-setting-dcb.h" gboolean nm_dcb_enable (const char *iface, gboolean enable, GError **error); diff --git a/src/nm-default-route-manager.h b/src/nm-default-route-manager.h index ca92814c34..30f130a476 100644 --- a/src/nm-default-route-manager.h +++ b/src/nm-default-route-manager.h @@ -18,13 +18,10 @@ * Copyright (C) 2014 Red Hat, Inc. */ - -#include "nm-default.h" -#include "nm-connection.h" - #ifndef __NETWORKMANAGER_DEFAULT_ROUTE_MANAGER_H__ #define __NETWORKMANAGER_DEFAULT_ROUTE_MANAGER_H__ +#include "nm-connection.h" #define NM_TYPE_DEFAULT_ROUTE_MANAGER (nm_default_route_manager_get_type ()) #define NM_DEFAULT_ROUTE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEFAULT_ROUTE_MANAGER, NMDefaultRouteManager)) diff --git a/src/nm-dispatcher.h b/src/nm-dispatcher.h index 47cb64816b..62818c4563 100644 --- a/src/nm-dispatcher.h +++ b/src/nm-dispatcher.h @@ -24,7 +24,6 @@ #include -#include "nm-default.h" #include "nm-connection.h" typedef enum { diff --git a/src/nm-firewall-manager.h b/src/nm-firewall-manager.h index a08ac8b843..92fac8e2fc 100644 --- a/src/nm-firewall-manager.h +++ b/src/nm-firewall-manager.h @@ -21,16 +21,11 @@ #ifndef __NETWORKMANAGER_FIREWALL_MANAGER_H__ #define __NETWORKMANAGER_FIREWALL_MANAGER_H__ -#include "nm-default.h" - #define FIREWALL_DBUS_SERVICE "org.fedoraproject.FirewallD1" #define FIREWALL_DBUS_PATH "/org/fedoraproject/FirewallD1" #define FIREWALL_DBUS_INTERFACE "org.fedoraproject.FirewallD1" #define FIREWALL_DBUS_INTERFACE_ZONE "org.fedoraproject.FirewallD1.zone" - -G_BEGIN_DECLS - #define NM_TYPE_FIREWALL_MANAGER (nm_firewall_manager_get_type ()) #define NM_FIREWALL_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_FIREWALL_MANAGER, NMFirewallManager)) #define NM_FIREWALL_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_FIREWALL_MANAGER, NMFirewallManagerClass)) diff --git a/src/nm-multi-index.h b/src/nm-multi-index.h index 1e1e8fdaee..fb102574a1 100644 --- a/src/nm-multi-index.h +++ b/src/nm-multi-index.h @@ -21,11 +21,6 @@ #ifndef __NM_MULTI_INDEX__ #define __NM_MULTI_INDEX__ -#include "nm-default.h" - -G_BEGIN_DECLS - - typedef struct { char _dummy; } NMMultiIndexId; @@ -106,7 +101,5 @@ void nm_multi_index_id_iter_init (NMMultiIndexIdIter *iter, gboolean nm_multi_index_id_iter_next (NMMultiIndexIdIter *iter, void **out_value); -G_END_DECLS - #endif /* __NM_MULTI_INDEX__ */ diff --git a/src/nm-policy.h b/src/nm-policy.h index 476ddf1dbe..ce900ba641 100644 --- a/src/nm-policy.h +++ b/src/nm-policy.h @@ -22,8 +22,6 @@ #ifndef __NETWORKMANAGER_POLICY_H__ #define __NETWORKMANAGER_POLICY_H__ -#include "nm-default.h" - #define NM_TYPE_POLICY (nm_policy_get_type ()) #define NM_POLICY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_POLICY, NMPolicy)) #define NM_POLICY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_POLICY, NMPolicyClass)) diff --git a/src/nm-rfkill-manager.h b/src/nm-rfkill-manager.h index 0084364cc7..d9937dafc3 100644 --- a/src/nm-rfkill-manager.h +++ b/src/nm-rfkill-manager.h @@ -19,9 +19,6 @@ * Copyright (C) 2007 - 2013 Red Hat, Inc. */ - -#include "nm-default.h" - #ifndef __NETWORKMANAGER_RFKILL_MANAGER_H__ #define __NETWORKMANAGER_RFKILL_MANAGER_H__ diff --git a/src/nm-route-manager.h b/src/nm-route-manager.h index 1f4b81744f..8e2746d93e 100644 --- a/src/nm-route-manager.h +++ b/src/nm-route-manager.h @@ -18,9 +18,6 @@ * Copyright (C) 2015 Red Hat, Inc. */ - -#include "nm-default.h" - #ifndef __NETWORKMANAGER_ROUTE_MANAGER_H__ #define __NETWORKMANAGER_ROUTE_MANAGER_H__ diff --git a/src/nm-session-monitor.h b/src/nm-session-monitor.h index e776ef25ab..3751d7db4c 100644 --- a/src/nm-session-monitor.h +++ b/src/nm-session-monitor.h @@ -21,11 +21,6 @@ #ifndef __NETWORKMANAGER_SESSION_MONITOR_H__ #define __NETWORKMANAGER_SESSION_MONITOR_H__ - -#include "nm-default.h" - -G_BEGIN_DECLS - #define NM_TYPE_SESSION_MONITOR (nm_session_monitor_get_type ()) #define NM_SESSION_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_SESSION_MONITOR, NMSessionMonitor)) #define NM_SESSION_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), NM_TYPE_SESSION_MONITOR, NMSessionMonitorClass)) @@ -49,7 +44,5 @@ gboolean nm_session_monitor_session_exists (NMSessionMonitor *self, uid_t uid, gboolean active); -G_END_DECLS - #endif /* __NETWORKMANAGER_SESSION_MONITOR_H__ */ diff --git a/src/nm-sleep-monitor.h b/src/nm-sleep-monitor.h index 140f964f06..d54aebbcf1 100644 --- a/src/nm-sleep-monitor.h +++ b/src/nm-sleep-monitor.h @@ -20,8 +20,6 @@ #ifndef __NETWORKMANAGER_SLEEP_MONITOR_H__ #define __NETWORKMANAGER_SLEEP_MONITOR_H__ -G_BEGIN_DECLS - #define NM_TYPE_SLEEP_MONITOR (nm_sleep_monitor_get_type ()) #define NM_SLEEP_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_SLEEP_MONITOR, NMSleepMonitor)) #define NM_SLEEP_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), NM_TYPE_SLEEP_MONITOR, NMSleepMonitorClass)) @@ -42,7 +40,5 @@ NMSleepMonitorInhibitorHandle *nm_sleep_monitor_inhibit_take (NMSleepMonitor void nm_sleep_monitor_inhibit_release (NMSleepMonitor *self, NMSleepMonitorInhibitorHandle *handle); -G_END_DECLS - #endif /* __NETWORKMANAGER_SLEEP_MONITOR_H__ */ diff --git a/src/platform/wifi/wifi-utils-private.h b/src/platform/wifi/wifi-utils-private.h index 21a4c57b62..ebe76f1b6a 100644 --- a/src/platform/wifi/wifi-utils-private.h +++ b/src/platform/wifi/wifi-utils-private.h @@ -21,8 +21,6 @@ #ifndef __WIFI_UTILS_PRIVATE_H__ #define __WIFI_UTILS_PRIVATE_H__ - -#include "nm-default.h" #include "nm-dbus-interface.h" #include "wifi-utils.h" diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h index 3a4f996d68..8e2b93f1f0 100644 --- a/src/platform/wifi/wifi-utils.h +++ b/src/platform/wifi/wifi-utils.h @@ -24,7 +24,6 @@ #include -#include "nm-default.h" #include "nm-dbus-interface.h" typedef struct WifiData WifiData; diff --git a/src/settings/nm-inotify-helper.h b/src/settings/nm-inotify-helper.h index b4e2c61225..2ac9376cd8 100644 --- a/src/settings/nm-inotify-helper.h +++ b/src/settings/nm-inotify-helper.h @@ -23,8 +23,6 @@ #include -#include "nm-default.h" - /* NOTE: this code should be killed once we depend on a new enough glib to * include the patches from https://bugzilla.gnome.org/show_bug.cgi?id=532815 */ diff --git a/src/settings/nm-secret-agent.h b/src/settings/nm-secret-agent.h index 333aa461c1..916623a7d6 100644 --- a/src/settings/nm-secret-agent.h +++ b/src/settings/nm-secret-agent.h @@ -22,7 +22,6 @@ #define __NETWORKMANAGER_SECRET_AGENT_H__ #include -#include "nm-default.h" #define NM_TYPE_SECRET_AGENT (nm_secret_agent_get_type ()) #define NM_SECRET_AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SECRET_AGENT, NMSecretAgent)) diff --git a/src/settings/nm-settings-connection.h b/src/settings/nm-settings-connection.h index c45505d9f0..761203ead6 100644 --- a/src/settings/nm-settings-connection.h +++ b/src/settings/nm-settings-connection.h @@ -26,9 +26,6 @@ #include "nm-exported-object.h" #include -#include "nm-default.h" - -G_BEGIN_DECLS #define NM_TYPE_SETTINGS_CONNECTION (nm_settings_connection_get_type ()) #define NM_SETTINGS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS_CONNECTION, NMSettingsConnection)) @@ -230,6 +227,4 @@ const char *nm_settings_connection_get_filename (NMSettingsConnection *self); const char *nm_settings_connection_get_id (NMSettingsConnection *connection); const char *nm_settings_connection_get_uuid (NMSettingsConnection *connection); -G_END_DECLS - #endif /* __NETWORKMANAGER_SETTINGS_CONNECTION_H__ */ diff --git a/src/settings/nm-settings-plugin.h b/src/settings/nm-settings-plugin.h index ab88e7c2b5..8abd72eaeb 100644 --- a/src/settings/nm-settings-plugin.h +++ b/src/settings/nm-settings-plugin.h @@ -22,11 +22,7 @@ #ifndef __NETWORKMANAGER_SETTINGS_PLUGIN_H__ #define __NETWORKMANAGER_SETTINGS_PLUGIN_H__ - #include -#include "nm-default.h" - -G_BEGIN_DECLS /* Plugin's factory function that returns a GObject that implements * NMSettingsPlugin. @@ -156,6 +152,4 @@ NMSettingsConnection *nm_settings_plugin_add_connection (NMSettingsPlugin *confi gboolean save_to_disk, GError **error); -G_END_DECLS - -#endif /* NM_SETTINGS_PLUGIN_H */ +#endif /* __NETWORKMANAGER_SETTINGS_PLUGIN_H__ */ diff --git a/src/settings/plugins/ibft/nm-ibft-connection.h b/src/settings/plugins/ibft/nm-ibft-connection.h index 4ccebc3cec..a4ee17ac7c 100644 --- a/src/settings/plugins/ibft/nm-ibft-connection.h +++ b/src/settings/plugins/ibft/nm-ibft-connection.h @@ -21,8 +21,6 @@ #ifndef NM_IBFT_CONNECTION_H #define NM_IBFT_CONNECTION_H -G_BEGIN_DECLS - #include #define NM_TYPE_IBFT_CONNECTION (nm_ibft_connection_get_type ()) @@ -45,6 +43,4 @@ GType nm_ibft_connection_get_type (void); NMIbftConnection *nm_ibft_connection_new (const GPtrArray *block, GError **error); -G_END_DECLS - #endif /* NM_IBFT_CONNECTION_H */ diff --git a/src/settings/plugins/ibft/plugin.h b/src/settings/plugins/ibft/plugin.h index 3fc58c7f1d..4867e07daa 100644 --- a/src/settings/plugins/ibft/plugin.h +++ b/src/settings/plugins/ibft/plugin.h @@ -21,8 +21,6 @@ #ifndef _PLUGIN_H_ #define _PLUGIN_H_ -#include "nm-default.h" - #define SETTINGS_TYPE_PLUGIN_IBFT (settings_plugin_ibft_get_type ()) #define SETTINGS_PLUGIN_IBFT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SETTINGS_TYPE_PLUGIN_IBFT, SettingsPluginIbft)) #define SETTINGS_PLUGIN_IBFT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SETTINGS_TYPE_PLUGIN_IBFT, SettingsPluginIbftClass)) diff --git a/src/settings/plugins/ibft/reader.h b/src/settings/plugins/ibft/reader.h index 42969ae0f3..97ef0c71a8 100644 --- a/src/settings/plugins/ibft/reader.h +++ b/src/settings/plugins/ibft/reader.h @@ -23,8 +23,6 @@ #include -#include "nm-default.h" - gboolean read_ibft_blocks (const char *iscsiadm_path, GSList **out_blocks, GError **error); diff --git a/src/settings/plugins/ifnet/net_parser.h b/src/settings/plugins/ifnet/net_parser.h index 968feaf508..31fc9ead0c 100644 --- a/src/settings/plugins/ifnet/net_parser.h +++ b/src/settings/plugins/ifnet/net_parser.h @@ -22,8 +22,6 @@ #ifndef _NET_PARSER_H #define _NET_PARSER_H -#include "nm-default.h" - #define CONF_NET_FILE SYSCONFDIR "/conf.d/net" gboolean ifnet_init (gchar * config_file); @@ -40,4 +38,5 @@ gboolean ifnet_flush_to_file (const char *config_file, gchar **out_backup); void ifnet_set_data (const char *conn_name, const char *key, const char *value); gboolean ifnet_add_network (const char *name, const char *type); gboolean ifnet_delete_network (const char *conn_name); + #endif diff --git a/src/settings/plugins/ifnet/net_utils.h b/src/settings/plugins/ifnet/net_utils.h index 459693692b..85a5cb1ca2 100644 --- a/src/settings/plugins/ifnet/net_utils.h +++ b/src/settings/plugins/ifnet/net_utils.h @@ -21,12 +21,15 @@ #ifndef _IFNET_UTILS_H #define _IFNET_UTILS_H + #define IFNET_PLUGIN_NAME "SettingsPlugin-Ifnet" + #include + #include #include -#include "nm-default.h" #include "net_parser.h" + #define has_default_ip4_route(conn_name) has_default_route((conn_name), &is_ip4_address) #define has_default_ip6_route(conn_name) has_default_route((conn_name), &is_ip6_address) diff --git a/src/settings/plugins/ifnet/nm-ifnet-connection.h b/src/settings/plugins/ifnet/nm-ifnet-connection.h index baa4c07ed5..856996e070 100644 --- a/src/settings/plugins/ifnet/nm-ifnet-connection.h +++ b/src/settings/plugins/ifnet/nm-ifnet-connection.h @@ -25,8 +25,6 @@ #include #include "net_parser.h" -G_BEGIN_DECLS - #define NM_TYPE_IFNET_CONNECTION (nm_ifnet_connection_get_type ()) #define NM_IFNET_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IFNET_CONNECTION, NMIfnetConnection)) #define NM_IFNET_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IFNET_CONNECTION, NMIfnetConnectionClass)) @@ -49,5 +47,4 @@ NMIfnetConnection *nm_ifnet_connection_new (NMConnection *source, const char *nm_ifnet_connection_get_conn_name (NMIfnetConnection *connection); -G_END_DECLS -#endif /* NM_IFNET_CONNECTION_H */ +#endif /* __NETWORKMANAGER_IFNET_CONNECTION_H__ */ diff --git a/src/settings/plugins/ifnet/plugin.h b/src/settings/plugins/ifnet/plugin.h index 33dcc2017f..09640968ba 100644 --- a/src/settings/plugins/ifnet/plugin.h +++ b/src/settings/plugins/ifnet/plugin.h @@ -23,8 +23,6 @@ #ifndef _PLUGIN_H_ #define _PLUGIN_H_ -#include "nm-default.h" - #define SETTINGS_TYPE_PLUGIN_IFNET (settings_plugin_ifnet_get_type ()) #define SETTINGS_PLUGIN_IFNET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SETTINGS_TYPE_PLUGIN_IFNET, SettingsPluginIfnet)) #define SETTINGS_PLUGIN_IFNET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SETTINGS_TYPE_PLUGIN_IFNET, SettingsPluginIfnetClass)) diff --git a/src/settings/plugins/ifnet/wpa_parser.h b/src/settings/plugins/ifnet/wpa_parser.h index 8099d19c62..d096f468db 100644 --- a/src/settings/plugins/ifnet/wpa_parser.h +++ b/src/settings/plugins/ifnet/wpa_parser.h @@ -22,8 +22,6 @@ #ifndef _WPA_PARSER_H #define _WPA_PARSER_H -#include "nm-default.h" - #define WPA_SUPPLICANT_CONF SYSCONFDIR "/wpa_supplicant/wpa_supplicant.conf" void wpa_parser_init (const char *wpa_supplicant_conf); diff --git a/src/settings/plugins/ifupdown/interface_parser.h b/src/settings/plugins/ifupdown/interface_parser.h index d4bb85150e..bf9c4465d2 100644 --- a/src/settings/plugins/ifupdown/interface_parser.h +++ b/src/settings/plugins/ifupdown/interface_parser.h @@ -24,8 +24,6 @@ #ifndef _INTERFACE_PARSER_H #define _INTERFACE_PARSER_H -#include "nm-default.h" - typedef struct _if_data { char *key; diff --git a/src/settings/plugins/ifupdown/nm-ifupdown-connection.h b/src/settings/plugins/ifupdown/nm-ifupdown-connection.h index 8085b8316d..e1999bef5c 100644 --- a/src/settings/plugins/ifupdown/nm-ifupdown-connection.h +++ b/src/settings/plugins/ifupdown/nm-ifupdown-connection.h @@ -25,10 +25,8 @@ #define __NETWORKMANAGER_IFUPDOWN_CONNECTION_H__ #include -#include "nm-default.h" -#include "interface_parser.h" -G_BEGIN_DECLS +#include "interface_parser.h" #define NM_TYPE_IFUPDOWN_CONNECTION (nm_ifupdown_connection_get_type ()) #define NM_IFUPDOWN_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IFUPDOWN_CONNECTION, NMIfupdownConnection)) @@ -49,6 +47,4 @@ GType nm_ifupdown_connection_get_type (void); NMIfupdownConnection *nm_ifupdown_connection_new (if_block *block); -G_END_DECLS - #endif /* __NETWORKMANAGER_IFUPDOWN_CONNECTION_H__ */ diff --git a/src/settings/plugins/ifupdown/parser.h b/src/settings/plugins/ifupdown/parser.h index ee88c50064..549f1ad3fb 100644 --- a/src/settings/plugins/ifupdown/parser.h +++ b/src/settings/plugins/ifupdown/parser.h @@ -21,14 +21,15 @@ * (C) Copyright 2008 Canonical Ltd. */ +#ifndef __PARSER_H__ +#define __PARSER_H__ + #include #include "interface_parser.h" -G_BEGIN_DECLS - gboolean ifupdown_update_connection_from_if_block (NMConnection *connection, if_block *block, GError **error); -G_END_DECLS +#endif /* __PARSER_H__ */ diff --git a/src/settings/plugins/ifupdown/plugin.h b/src/settings/plugins/ifupdown/plugin.h index 10ba228765..b568ea78b6 100644 --- a/src/settings/plugins/ifupdown/plugin.h +++ b/src/settings/plugins/ifupdown/plugin.h @@ -24,8 +24,6 @@ #ifndef _PLUGIN_H_ #define _PLUGIN_H_ -#include "nm-default.h" - #define PLUGIN_NAME "ifupdown" #define SETTINGS_TYPE_PLUGIN_IFUPDOWN (settings_plugin_ifupdown_get_type ()) diff --git a/src/settings/plugins/keyfile/nm-keyfile-connection.h b/src/settings/plugins/keyfile/nm-keyfile-connection.h index f6fa432b65..31dbe754a8 100644 --- a/src/settings/plugins/keyfile/nm-keyfile-connection.h +++ b/src/settings/plugins/keyfile/nm-keyfile-connection.h @@ -24,8 +24,6 @@ #include -G_BEGIN_DECLS - #define NM_TYPE_KEYFILE_CONNECTION (nm_keyfile_connection_get_type ()) #define NM_KEYFILE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnection)) #define NM_KEYFILE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnectionClass)) @@ -47,6 +45,4 @@ NMKeyfileConnection *nm_keyfile_connection_new (NMConnection *source, const char *filename, GError **error); -G_END_DECLS - #endif /* __NETWORKMANAGER_KEYFILE_CONNECTION_H__ */ diff --git a/src/settings/plugins/keyfile/plugin.h b/src/settings/plugins/keyfile/plugin.h index 07403270ba..a22b9c494a 100644 --- a/src/settings/plugins/keyfile/plugin.h +++ b/src/settings/plugins/keyfile/plugin.h @@ -22,8 +22,6 @@ #ifndef _PLUGIN_H_ #define _PLUGIN_H_ -#include "nm-default.h" - #define SETTINGS_TYPE_PLUGIN_KEYFILE (settings_plugin_keyfile_get_type ()) #define SETTINGS_PLUGIN_KEYFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SETTINGS_TYPE_PLUGIN_KEYFILE, SettingsPluginKeyfile)) #define SETTINGS_PLUGIN_KEYFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SETTINGS_TYPE_PLUGIN_KEYFILE, SettingsPluginKeyfileClass)) diff --git a/src/settings/plugins/keyfile/reader.h b/src/settings/plugins/keyfile/reader.h index a8021cb744..7bbc6005c2 100644 --- a/src/settings/plugins/keyfile/reader.h +++ b/src/settings/plugins/keyfile/reader.h @@ -24,8 +24,6 @@ #include -#include "nm-default.h" - NMConnection *nm_keyfile_plugin_connection_from_file (const char *filename, GError **error); #endif /* _KEYFILE_PLUGIN_READER_H */ diff --git a/src/settings/plugins/keyfile/utils.h b/src/settings/plugins/keyfile/utils.h index c18fb2bcce..85aa545842 100644 --- a/src/settings/plugins/keyfile/utils.h +++ b/src/settings/plugins/keyfile/utils.h @@ -21,7 +21,6 @@ #ifndef _UTILS_H_ #define _UTILS_H_ -#include "nm-default.h" #include "NetworkManagerUtils.h" #define KEYFILE_PLUGIN_NAME "keyfile" diff --git a/src/settings/plugins/keyfile/writer.h b/src/settings/plugins/keyfile/writer.h index 25f44e941e..894356518d 100644 --- a/src/settings/plugins/keyfile/writer.h +++ b/src/settings/plugins/keyfile/writer.h @@ -24,8 +24,6 @@ #include -#include "nm-default.h" - gboolean nm_keyfile_plugin_write_connection (NMConnection *connection, const char *existing_path, gboolean force_rename, diff --git a/src/supplicant-manager/nm-supplicant-config.h b/src/supplicant-manager/nm-supplicant-config.h index 32589930c7..bf3e64c5c2 100644 --- a/src/supplicant-manager/nm-supplicant-config.h +++ b/src/supplicant-manager/nm-supplicant-config.h @@ -25,10 +25,8 @@ #include #include #include -#include "nm-default.h" -#include "nm-supplicant-types.h" -G_BEGIN_DECLS +#include "nm-supplicant-types.h" #define NM_TYPE_SUPPLICANT_CONFIG (nm_supplicant_config_get_type ()) #define NM_SUPPLICANT_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SUPPLICANT_CONFIG, NMSupplicantConfig)) @@ -82,6 +80,4 @@ gboolean nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, gboolean wired, GError **error); -G_END_DECLS - -#endif /* NM_SUPPLICANT_CONFIG_H */ +#endif /* __NETWORKMANAGER_SUPPLICANT_CONFIG_H__ */ diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h index d514c53bc9..a586e7ea79 100644 --- a/src/supplicant-manager/nm-supplicant-interface.h +++ b/src/supplicant-manager/nm-supplicant-interface.h @@ -22,7 +22,6 @@ #ifndef __NETWORKMANAGER_SUPPLICANT_INTERFACE_H__ #define __NETWORKMANAGER_SUPPLICANT_INTERFACE_H__ -#include "nm-default.h" #include "nm-supplicant-types.h" /* diff --git a/src/supplicant-manager/nm-supplicant-manager.h b/src/supplicant-manager/nm-supplicant-manager.h index b0ce6a523f..4cd7a0bdc4 100644 --- a/src/supplicant-manager/nm-supplicant-manager.h +++ b/src/supplicant-manager/nm-supplicant-manager.h @@ -22,12 +22,9 @@ #ifndef __NETWORKMANAGER_SUPPLICANT_MANAGER_H__ #define __NETWORKMANAGER_SUPPLICANT_MANAGER_H__ -#include "nm-default.h" #include "nm-supplicant-types.h" #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_SUPPLICANT_MANAGER (nm_supplicant_manager_get_type ()) #define NM_SUPPLICANT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SUPPLICANT_MANAGER, NMSupplicantManager)) #define NM_SUPPLICANT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SUPPLICANT_MANAGER, NMSupplicantManagerClass)) diff --git a/src/tests/config/nm-test-device.h b/src/tests/config/nm-test-device.h index c3532c9cc0..dfb8ff7813 100644 --- a/src/tests/config/nm-test-device.h +++ b/src/tests/config/nm-test-device.h @@ -23,8 +23,6 @@ #include "nm-device.h" -G_BEGIN_DECLS - #define NM_TYPE_TEST_DEVICE (nm_test_device_get_type ()) #define NM_TEST_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_TEST_DEVICE, NMTestDevice)) #define NM_TEST_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_TEST_DEVICE, NMTestDeviceClass)) @@ -45,6 +43,4 @@ GType nm_test_device_get_type (void); NMDevice *nm_test_device_new (const char *hwaddr); -G_END_DECLS - -#endif /* NM_DEVICE_H */ +#endif /* __NETWORKMANAGER_TEST_DEVICE_H__ */ diff --git a/src/vpn-manager/nm-vpn-manager.h b/src/vpn-manager/nm-vpn-manager.h index f557e27acb..9ccd882d1c 100644 --- a/src/vpn-manager/nm-vpn-manager.h +++ b/src/vpn-manager/nm-vpn-manager.h @@ -22,7 +22,6 @@ #ifndef __NETWORKMANAGER_VPN_MANAGER_H__ #define __NETWORKMANAGER_VPN_MANAGER_H__ -#include "nm-default.h" #include "nm-vpn-connection.h" #define NM_TYPE_VPN_MANAGER (nm_vpn_manager_get_type ()) From 5e41e1634d1c2495629616a3d7bd42f5fc33ee9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Dr=C4=85g?= Date: Wed, 17 Aug 2016 17:18:55 +0200 Subject: [PATCH 03/35] po: update Polish (pl) translation (bgo #769463) https://bugzilla.gnome.org/show_bug.cgi?id=769463 --- po/pl.po | 131 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 75 insertions(+), 56 deletions(-) diff --git a/po/pl.po b/po/pl.po index 4a798d9e07..6569054d6c 100644 --- a/po/pl.po +++ b/po/pl.po @@ -11,8 +11,8 @@ msgid "" msgstr "" "Project-Id-Version: NetworkManager\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-08-15 11:40+0200\n" -"PO-Revision-Date: 2016-08-15 11:44+0200\n" +"POT-Creation-Date: 2016-08-17 17:15+0200\n" +"PO-Revision-Date: 2016-08-17 17:17+0200\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Polish \n" "Language: pl\n" @@ -109,7 +109,7 @@ msgstr "Pomyślnie zarejestrowano program nmcli jako agenta polkit.\n" #: ../clients/cli/agent.c:223 ../clients/cli/connections.c:8748 #: ../clients/cli/devices.c:3894 ../clients/cli/general.c:346 -#: ../clients/cli/general.c:492 ../clients/cli/general.c:1157 +#: ../clients/cli/general.c:496 ../clients/cli/general.c:1161 #, c-format msgid "Error: NetworkManager is not running." msgstr "Błąd: usługa NetworkManager nie jest uruchomiona." @@ -242,7 +242,7 @@ msgstr "połączenie się nie powiodło" #: ../clients/cli/connections.c:2121 ../clients/cli/devices.c:1190 #: ../clients/cli/devices.c:1231 ../clients/cli/devices.c:1233 #: ../clients/cli/general.c:251 ../clients/cli/general.c:289 -#: ../clients/cli/general.c:441 ../clients/cli/general.c:456 +#: ../clients/cli/general.c:445 ../clients/cli/general.c:460 #: ../clients/cli/settings.c:853 ../clients/cli/settings.c:939 #: ../clients/cli/settings.c:1324 ../clients/cli/settings.c:1965 #: ../clients/cli/settings.c:3349 @@ -265,7 +265,7 @@ msgstr "nieznane" #: ../clients/cli/devices.c:1226 ../clients/cli/devices.c:1227 #: ../clients/cli/devices.c:1228 ../clients/cli/devices.c:1229 #: ../clients/cli/devices.c:1230 ../clients/cli/devices.c:1232 -#: ../clients/cli/devices.c:1234 ../clients/cli/general.c:450 +#: ../clients/cli/devices.c:1234 ../clients/cli/general.c:454 #: ../clients/cli/settings.c:3344 msgid "yes" msgstr "tak" @@ -284,7 +284,7 @@ msgstr "tak" #: ../clients/cli/devices.c:1227 ../clients/cli/devices.c:1228 #: ../clients/cli/devices.c:1229 ../clients/cli/devices.c:1230 #: ../clients/cli/devices.c:1232 ../clients/cli/devices.c:1234 -#: ../clients/cli/general.c:452 ../clients/cli/settings.c:3346 +#: ../clients/cli/general.c:456 ../clients/cli/settings.c:3346 msgid "no" msgstr "nie" @@ -590,7 +590,7 @@ msgstr "Błąd: polecenie openconnect się nie powiodło ze stanem %d\n" msgid "Error: openconnect failed with signal %d\n" msgstr "Błąd: polecenie openconnect się nie powiodło z sygnałem %d\n" -#: ../clients/cli/common.c:1067 +#: ../clients/cli/common.c:1068 #, c-format msgid "" "Warning: password for '%s' not given in 'passwd-file' and nmcli cannot ask " @@ -599,13 +599,13 @@ msgstr "" "Ostrzeżenie: w „passwd-file” nie podano hasła dla „%s”, a program nmcli nie " "może zapytać bez opcji „--ask”.\n" -#: ../clients/cli/common.c:1464 +#: ../clients/cli/common.c:1465 #, c-format msgid "Error: argument '%s' not understood. Try passing --help instead." msgstr "Błąd: nie zrozumiano parametru „%s”. Można użyć „--help” zamiast tego." #. No command and no default handler. -#: ../clients/cli/common.c:1472 +#: ../clients/cli/common.c:1473 #, c-format msgid "Error: missing argument. Try passing --help." msgstr "Błąd: brak parametru. Można użyć „--help” zamiast tego." @@ -815,7 +815,7 @@ msgstr "KONKRETNY-OBIEKT" #. 7 #. 4 #: ../clients/cli/connections.c:215 ../clients/cli/connections.c:253 -#: ../clients/cli/general.c:1083 ../clients/tui/nm-editor-utils.c:233 +#: ../clients/cli/general.c:1087 ../clients/tui/nm-editor-utils.c:233 #: ../clients/tui/nmt-connect-connection-list.c:405 msgid "VPN" msgstr "VPN" @@ -1717,9 +1717,9 @@ msgstr "Błąd: %s — nie ma takiego profilu połączenia." #: ../clients/cli/devices.c:2113 ../clients/cli/devices.c:2301 #: ../clients/cli/devices.c:3506 ../clients/cli/devices.c:3616 #: ../clients/cli/devices.c:3728 ../clients/cli/devices.c:3786 -#: ../clients/cli/general.c:399 ../clients/cli/general.c:520 -#: ../clients/cli/general.c:564 ../clients/cli/general.c:591 -#: ../clients/cli/general.c:788 ../clients/cli/general.c:837 +#: ../clients/cli/general.c:399 ../clients/cli/general.c:524 +#: ../clients/cli/general.c:568 ../clients/cli/general.c:595 +#: ../clients/cli/general.c:792 ../clients/cli/general.c:841 #, c-format msgid "Error: %s." msgstr "Błąd: %s." @@ -2352,7 +2352,7 @@ msgstr "Urządzenie mostka" msgid "Bridge port" msgstr "Port mostka" -#: ../clients/cli/connections.c:4711 ../src/nm-manager.c:3713 +#: ../clients/cli/connections.c:4711 ../src/nm-manager.c:3717 msgid "VPN connection" msgstr "Połączenie VPN" @@ -5007,171 +5007,171 @@ msgstr "włączone" msgid "disabled" msgstr "wyłączone" -#: ../clients/cli/general.c:454 +#: ../clients/cli/general.c:458 msgid "auth" msgstr "uwierzytelnianie" -#: ../clients/cli/general.c:483 +#: ../clients/cli/general.c:487 #, c-format msgid "Error: 'general permissions': %s" msgstr "Błąd: „general permissions”: %s" -#: ../clients/cli/general.c:497 +#: ../clients/cli/general.c:501 msgid "NetworkManager permissions" msgstr "Uprawnienia usługi NetworkManager" -#: ../clients/cli/general.c:555 +#: ../clients/cli/general.c:559 #, c-format msgid "Error: 'general logging': %s" msgstr "Błąd: „general logging”: %s" -#: ../clients/cli/general.c:570 +#: ../clients/cli/general.c:574 msgid "NetworkManager logging" msgstr "Dziennik usługi NetworkManager" -#: ../clients/cli/general.c:620 +#: ../clients/cli/general.c:624 #, c-format msgid "Error: failed to set logging: %s" msgstr "Błąd: ustawienie zapisywania w dzienniku się nie powiodło: %s" -#: ../clients/cli/general.c:637 +#: ../clients/cli/general.c:641 #, c-format msgid "Error: failed to set hostname: %s" msgstr "Błąd: ustawienie nazwy komputera się nie powiodło: %s" -#: ../clients/cli/general.c:703 +#: ../clients/cli/general.c:707 #, c-format msgid "Error: '--fields' value '%s' is not valid here (allowed field: %s)" msgstr "Błąd: wartość „--fields” „%s” jest nieprawidłowa (dozwolone pola: %s)" -#: ../clients/cli/general.c:728 +#: ../clients/cli/general.c:732 #, c-format msgid "Error: invalid '%s' argument: '%s' (use on/off)." msgstr "Błąd: nieprawidłowy parametr „%s”: „%s” (należy użyć on/off)." -#: ../clients/cli/general.c:739 +#: ../clients/cli/general.c:743 msgid "Connectivity" msgstr "Łączność" -#: ../clients/cli/general.c:756 +#: ../clients/cli/general.c:760 msgid "Networking" msgstr "Sieć" -#: ../clients/cli/general.c:795 +#: ../clients/cli/general.c:799 #, c-format msgid "Error: 'networking connectivity' command '%s' is not valid." msgstr "Błąd: polecenie „networking connectivity” „%s” jest nieprawidłowe." -#: ../clients/cli/general.c:815 +#: ../clients/cli/general.c:819 #, c-format msgid "Error: 'networking' command '%s' is not valid." msgstr "Błąd: polecenie „networking” „%s” jest nieprawidłowe." -#: ../clients/cli/general.c:840 +#: ../clients/cli/general.c:844 msgid "Radio switches" msgstr "Przełączniki radiowe" #. no argument, show current WiFi state -#: ../clients/cli/general.c:870 +#: ../clients/cli/general.c:874 msgid "Wi-Fi radio switch" msgstr "Przełącznik radiowy Wi-Fi" #. no argument, show current WWAN (mobile broadband) state -#: ../clients/cli/general.c:897 +#: ../clients/cli/general.c:901 msgid "WWAN radio switch" msgstr "Przełącznik radiowy WWAN" -#: ../clients/cli/general.c:943 +#: ../clients/cli/general.c:947 msgid "NetworkManager has started" msgstr "Uruchomiono usługę NetworkManager" -#: ../clients/cli/general.c:943 +#: ../clients/cli/general.c:947 msgid "NetworkManager has stopped" msgstr "Zatrzymano usługę NetworkManager" -#: ../clients/cli/general.c:954 +#: ../clients/cli/general.c:958 #, c-format msgid "Hostname set to '%s'\n" msgstr "Ustawiono nazwę komputera na „%s”\n" -#: ../clients/cli/general.c:969 +#: ../clients/cli/general.c:973 #, c-format msgid "'%s' is now the primary connection\n" msgstr "„%s” jest teraz głównym połączeniem\n" -#: ../clients/cli/general.c:971 +#: ../clients/cli/general.c:975 #, c-format msgid "There's no primary connection\n" msgstr "Brak głównego połączenia\n" -#: ../clients/cli/general.c:983 +#: ../clients/cli/general.c:987 #, c-format msgid "Connectivity is now '%s'\n" msgstr "Łączność wynosi teraz „%s”\n" -#: ../clients/cli/general.c:996 +#: ../clients/cli/general.c:1000 #, c-format msgid "Networkmanager is now in the '%s' state\n" msgstr "Usługa NetworkManager jest teraz w stanie „%s”\n" -#: ../clients/cli/general.c:1017 +#: ../clients/cli/general.c:1021 msgid "connection available" msgstr "połączenie jest dostępne" -#: ../clients/cli/general.c:1019 +#: ../clients/cli/general.c:1023 msgid "connections available" msgstr "połączenia są dostępne" -#: ../clients/cli/general.c:1037 +#: ../clients/cli/general.c:1041 msgid "autoconnect" msgstr "łączenie automatyczne" -#: ../clients/cli/general.c:1039 +#: ../clients/cli/general.c:1043 msgid "fw missing" msgstr "brak oprogramowana sprzętowego" -#: ../clients/cli/general.c:1044 +#: ../clients/cli/general.c:1048 msgid "plugin missing" msgstr "brak wtyczki" -#: ../clients/cli/general.c:1049 +#: ../clients/cli/general.c:1053 msgid "sw" msgstr "oprogramowanie" -#: ../clients/cli/general.c:1051 +#: ../clients/cli/general.c:1055 msgid "hw" msgstr "sprzęt" -#: ../clients/cli/general.c:1056 +#: ../clients/cli/general.c:1060 msgid "iface" msgstr "interfejs" -#: ../clients/cli/general.c:1059 +#: ../clients/cli/general.c:1063 msgid "port" msgstr "port" -#: ../clients/cli/general.c:1062 +#: ../clients/cli/general.c:1066 msgid "mtu" msgstr "MTU" -#: ../clients/cli/general.c:1079 +#: ../clients/cli/general.c:1083 msgid "master" msgstr "master" -#: ../clients/cli/general.c:1085 +#: ../clients/cli/general.c:1089 msgid "ip4 default" msgstr "domyślne IPv4" -#: ../clients/cli/general.c:1087 +#: ../clients/cli/general.c:1091 msgid "ip6 default" msgstr "domyślne IPv6" -#: ../clients/cli/general.c:1173 +#: ../clients/cli/general.c:1177 #, c-format msgid "%s VPN connection" msgstr "Połączenie VPN %s" -#: ../clients/cli/general.c:1210 +#: ../clients/cli/general.c:1214 #, c-format msgid "" "Use \"nmcli device show\" to get complete information about known devices " @@ -5188,12 +5188,12 @@ msgstr "" "Strony podręcznika nmcli(1) i nmcli-examples(5) zawierają pełne informacje\n" "o użyciu.\n" -#: ../clients/cli/general.c:1229 +#: ../clients/cli/general.c:1233 #, c-format msgid "Error: 'monitor' command '%s' is not valid." msgstr "Błąd: polecenie „monitor” „%s” jest nieprawidłowe." -#: ../clients/cli/general.c:1243 +#: ../clients/cli/general.c:1247 msgid "Networkmanager is not running (waiting for it)\n" msgstr "" "Usługa NetworkManager nie jest uruchomiona (oczekiwanie na uruchomienie)\n" @@ -9105,11 +9105,11 @@ msgstr "Połączenie jest nieprawidłowe: %s" msgid "The interface names of the device and the connection didn't match." msgstr "Nazwy interfejsu urządzenia i połączenia się nie zgadzają." -#: ../libnm/nm-manager.c:867 +#: ../libnm/nm-manager.c:871 msgid "Active connection could not be attached to the device" msgstr "Nie można podłączyć aktywnego połączenia do urządzenia" -#: ../libnm/nm-manager.c:1091 +#: ../libnm/nm-manager.c:1095 msgid "Active connection removed before it was initialized" msgstr "Usunięto aktywne połączenie przed jego inicjacją" @@ -9251,6 +9251,25 @@ msgid "" msgstr "" "Polityka systemu powstrzymuje modyfikację trwałej globalnej konfiguracji DNS" +#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:27 +msgid "Perform a checkpoint or rollback of interfaces configuration" +msgstr "Wykonanie punktu kontrolnego lub przywrócenie konfiguracji interfejsów" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:28 +msgid "System policy prevents the the creation of a checkpoint or its rollback" +msgstr "" +"Polityka systemu powstrzymuje utworzenie punktu kontrolnego lub jego " +"przywrócenie" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:29 +msgid "Enable or disable device statistics" +msgstr "Włączenie lub wyłączenie statystyk urządzenia" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.in.h:30 +msgid "System policy prevents enabling or disabling device statistics" +msgstr "" +"Polityka systemu powstrzymuje włączanie lub wyłączanie statystyk urządzenia" + #: ../shared/nm-utils/nm-shared-utils.c:185 #, c-format msgid "object class '%s' has no property named '%s'" From ac5dc1a9510c086c54c365b1160a51cc25402010 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 17 Aug 2016 21:55:23 +0200 Subject: [PATCH 04/35] core: don't suppress routes inside the subnet of the interface It's not clear why a route should be suppressed if it is contained in the subnet of one of the interface's addresses. I think it is wrong to do this. For example, imagine an ethernet and a Wi-Fi device both connected to the same subnet 10.0.0.0/8. By default, ethernet gets higher priority and a better metric of 100. If the user wants to configure a route "10.0.0.1/32 metric 99" to reach a certain host explicitly via Wi-Fi, this check will forbid that. This condition was added a long time ago (38dbdae26606f984f1d12c8a56ed27bc1b4d9c20), but it's unclear what the original intent was. See also commit 4f7b1cabc063bfda96cb5c129d6a233e5d5cff68, which already relaxed this suppression of routes for non-direct routes. --- src/nm-ip4-config.c | 8 -------- src/nm-ip6-config.c | 8 -------- 2 files changed, 16 deletions(-) diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index c52d7cd937..7ef9fc5bb5 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -420,14 +420,6 @@ nm_ip4_config_commit (const NMIP4Config *config, int ifindex, gboolean routes_fu const NMPlatformIP4Route *route; route = nm_ip4_config_get_route (config, i); - - /* Don't add the route if it's more specific than one of the subnets - * the device already has an IP address on. - */ - if ( route->gateway == 0 - && nm_ip4_config_destination_is_direct (config, route->network, route->plen)) - continue; - /* duplicates in @routes are no problem as route-manager handles them * gracefully (by ignoring them). */ g_array_append_vals (routes, route, 1); diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 7077a5354c..83cd8af0c2 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -412,14 +412,6 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex, gboolean routes_fu for (i = 0; i < count; i++) { route = nm_ip6_config_get_route (config, i); - - /* Don't add the route if it's more specific than one of the subnets - * the device already has an IP address on. - */ - if ( IN6_IS_ADDR_UNSPECIFIED (&route->gateway) - && nm_ip6_config_destination_is_direct (config, &route->network, route->plen)) - continue; - g_array_append_vals (routes, route, 1); } From aff491b6f319f41d9c812400f8f561a138580bb7 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 18 Aug 2016 11:26:29 +0200 Subject: [PATCH 05/35] contrib/rpm: update spec file to make it more similar to RHEL's version --- contrib/fedora/rpm/NetworkManager.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index 1d74eb28c7..47ead36a30 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -18,6 +18,7 @@ %global snapshot %{nil} %global git_sha __COMMIT__ + %global rpm_version __VERSION__ %global real_version __VERSION__ %global release_version __RELEASE_VERSION__ @@ -363,7 +364,9 @@ by nm-connection-editor and nm-applet in a non-graphical environment. #%patch1 -p1 %build +%if %{with regen_docs} gtkdocize +%endif autoreconf --install --force intltoolize --automake --copy --force %configure \ @@ -419,7 +422,10 @@ intltoolize --automake --copy --force --with-system-libndp=yes \ --with-pppd-plugin-dir=%{_libdir}/pppd/%{ppp_version} \ --with-dist-version=%{version}-%{release} \ - --with-setting-plugins-default='ifcfg-rh,ibft' + --with-setting-plugins-default='ifcfg-rh,ibft' \ + --with-config-dns-rc-manager-default=symlink \ + --with-logging-backend-default=journal \ + --enable-json-validation make %{?_smp_mflags} From 5d09d45b422415b58f3f9f280c87b53a3d199454 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 18 Aug 2016 14:53:42 +0200 Subject: [PATCH 06/35] contrib/rpm: fix wrong argument to configure script Fixes: aff491b6f319f41d9c812400f8f561a138580bb7 --- contrib/fedora/rpm/NetworkManager.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index 47ead36a30..f79697f429 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -424,7 +424,7 @@ intltoolize --automake --copy --force --with-dist-version=%{version}-%{release} \ --with-setting-plugins-default='ifcfg-rh,ibft' \ --with-config-dns-rc-manager-default=symlink \ - --with-logging-backend-default=journal \ + --with-config-logging-backend-default=journal \ --enable-json-validation make %{?_smp_mflags} From bdd0f722b8d3cceb8b4e85c26c4129759bb6931b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 18 Aug 2016 15:20:14 +0200 Subject: [PATCH 07/35] platform/tests: relax condition for test Got a test failure for /link/software/bond --- src/platform/tests/test-link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c index 9bf8aca831..9987362044 100644 --- a/src/platform/tests/test-link.c +++ b/src/platform/tests/test-link.c @@ -221,7 +221,7 @@ test_slave (int master, int type, SignalData *master_changed) g_assert_cmpint (nm_platform_link_get_master (NM_PLATFORM_GET, ifindex), ==, master); accept_signals (link_changed, 1, 3); - accept_signals (master_changed, 0, 1); + accept_signals (master_changed, 0, 2); /* enslaveing brings put the slave */ if (NM_IN_SET (link_type, NM_LINK_TYPE_BOND, NM_LINK_TYPE_TEAM)) From 51b2cef04f7e929f012ae49a6c6d94e60bc68c16 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 17 Aug 2016 18:40:17 +0200 Subject: [PATCH 08/35] policy: always try to update kernel hostname Even if we know that the new hostname being set is equal to the cached old one, the user may have manually changed the kernel hostname in the meanwhile. For example: # hostname host123 # hostname localhost # nmcli connection up eth1 # (now NM receives 'host123' from DHCP, but # believes it's already set and doesn't update it) # hostname localhost Let's always try to update the kernel (transient) hostname, unless it is really already set (as returned by gethostname()). https://bugzilla.redhat.com/show_bug.cgi?id=1356015 --- src/nm-policy.c | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index eefbf1c7eb..5fa46259cd 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -180,38 +180,35 @@ _set_hostname (NMPolicy *self, if (new_hostname) g_clear_object (&priv->lookup_addr); - /* Don't change the hostname or update DNS this is the first time we're - * trying to change the hostname, and it's not actually changing. - */ if ( priv->orig_hostname && (priv->hostname_changed == FALSE) - && g_strcmp0 (priv->orig_hostname, new_hostname) == 0) - return; + && g_strcmp0 (priv->orig_hostname, new_hostname) == 0) { + /* Don't change the hostname or update DNS this is the first time we're + * trying to change the hostname, and it's not actually changing. + */ + } else if (g_strcmp0 (priv->cur_hostname, new_hostname) == 0) { + /* Don't change the hostname or update DNS if the hostname isn't actually + * going to change. + */ + } else { + g_free (priv->cur_hostname); + priv->cur_hostname = g_strdup (new_hostname); + priv->hostname_changed = TRUE; - /* Don't change the hostname or update DNS if the hostname isn't actually - * going to change. - */ - if (g_strcmp0 (priv->cur_hostname, new_hostname) == 0) - return; - - g_free (priv->cur_hostname); - priv->cur_hostname = g_strdup (new_hostname); - priv->hostname_changed = TRUE; - - /* Notify the DNS manager of the hostname change so that the domain part, if - * present, can be added to the search list. - */ - nm_dns_manager_set_hostname (priv->dns_manager, priv->cur_hostname); + /* Notify the DNS manager of the hostname change so that the domain part, if + * present, can be added to the search list. + */ + nm_dns_manager_set_hostname (priv->dns_manager, priv->cur_hostname); + } /* Finally, set kernel hostname */ - - if (!priv->cur_hostname) + if (!new_hostname) name = FALLBACK_HOSTNAME4; - else if (!priv->cur_hostname[0]) { + else if (!new_hostname[0]) { g_warn_if_reached (); name = FALLBACK_HOSTNAME4; } else - name = priv->cur_hostname; + name = new_hostname; old_hostname[HOST_NAME_MAX] = '\0'; errno = 0; From cc828431b89340fc204e98e147ec1e065fca2fa6 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 19 Aug 2016 12:06:23 +0200 Subject: [PATCH 09/35] logging: remove unused formatting options Previously, we logged also the location (file:line func). nm-logging.c supported format flags to control the timestamp, the location, and alignment of the timestamp. We want that all our logging backends log the same messages. That is, both syslog and journal should have our ~default~ logging format, that is with timestamp but without location. Drop the unused code. --- src/nm-logging.c | 109 +++++------------------------------------------ 1 file changed, 11 insertions(+), 98 deletions(-) diff --git a/src/nm-logging.c b/src/nm-logging.c index 8e5a44b603..3db8d20cde 100644 --- a/src/nm-logging.c +++ b/src/nm-logging.c @@ -40,38 +40,6 @@ #include "nm-errors.h" #include "nm-core-utils.h" -typedef enum { - LOG_FORMAT_FLAG_NONE = 0, - LOG_FORMAT_FLAG_TIMESTAMP_DEBUG = (1LL << 0), - LOG_FORMAT_FLAG_TIMESTAMP_INFO = (1LL << 1), - LOG_FORMAT_FLAG_TIMESTAMP_ERROR = (1LL << 2), - LOG_FORMAT_FLAG_LOCATION_DEBUG = (1LL << 3), - LOG_FORMAT_FLAG_LOCATION_INFO = (1LL << 4), - LOG_FORMAT_FLAG_LOCATION_ERROR = (1LL << 5), - LOG_FORMAT_FLAG_ALIGN_LOCATION = (1LL << 6), - - _LOG_FORMAT_FLAG_TIMESTAMP = LOG_FORMAT_FLAG_TIMESTAMP_DEBUG | - LOG_FORMAT_FLAG_TIMESTAMP_INFO | - LOG_FORMAT_FLAG_TIMESTAMP_ERROR, - _LOG_FORMAT_FLAG_LOCATION = LOG_FORMAT_FLAG_LOCATION_DEBUG | - LOG_FORMAT_FLAG_LOCATION_INFO | - LOG_FORMAT_FLAG_LOCATION_ERROR, - - _LOG_FORMAT_FLAG_LEVEL_DEBUG = LOG_FORMAT_FLAG_TIMESTAMP_DEBUG | - LOG_FORMAT_FLAG_LOCATION_DEBUG, - _LOG_FORMAT_FLAG_LEVEL_INFO = LOG_FORMAT_FLAG_TIMESTAMP_INFO | - LOG_FORMAT_FLAG_LOCATION_INFO, - _LOG_FORMAT_FLAG_LEVEL_ERROR = LOG_FORMAT_FLAG_TIMESTAMP_ERROR | - LOG_FORMAT_FLAG_LOCATION_ERROR, - - _LOG_FORMAT_FLAG_SYSLOG = _LOG_FORMAT_FLAG_TIMESTAMP | - LOG_FORMAT_FLAG_LOCATION_DEBUG | - LOG_FORMAT_FLAG_LOCATION_ERROR | - LOG_FORMAT_FLAG_ALIGN_LOCATION, - - _LOG_FORMAT_FLAG_DEFAULT = _LOG_FORMAT_FLAG_TIMESTAMP, -} LogFormatFlags; - void (*_nm_logging_clear_platform_logging_cache) (void); static void @@ -99,7 +67,6 @@ typedef struct { int syslog_level; GLogLevelFlags g_log_level; - LogFormatFlags log_format_level; } LogLevelDesc; NMLogDomain _nm_logging_enabled_state[_LOGL_N_REAL] = { @@ -114,7 +81,6 @@ NMLogDomain _nm_logging_enabled_state[_LOGL_N_REAL] = { static struct { NMLogLevel log_level; - LogFormatFlags log_format_flags; bool uses_syslog:1; enum { LOG_BACKEND_GLIB, @@ -132,15 +98,14 @@ static struct { /* nm_logging_setup ("INFO", LOGD_DEFAULT_STRING, NULL, NULL); */ .log_level = LOGL_INFO, .log_backend = LOG_BACKEND_GLIB, - .log_format_flags = _LOG_FORMAT_FLAG_DEFAULT, .level_desc = { - [LOGL_TRACE] = { "TRACE", "", LOG_DEBUG, G_LOG_LEVEL_DEBUG, _LOG_FORMAT_FLAG_LEVEL_DEBUG }, - [LOGL_DEBUG] = { "DEBUG", "", LOG_DEBUG, G_LOG_LEVEL_DEBUG, _LOG_FORMAT_FLAG_LEVEL_DEBUG }, - [LOGL_INFO] = { "INFO", "", LOG_INFO, G_LOG_LEVEL_INFO, _LOG_FORMAT_FLAG_LEVEL_INFO }, - [LOGL_WARN] = { "WARN", "", LOG_WARNING, G_LOG_LEVEL_MESSAGE, _LOG_FORMAT_FLAG_LEVEL_INFO }, - [LOGL_ERR] = { "ERR", "", LOG_ERR, G_LOG_LEVEL_MESSAGE, _LOG_FORMAT_FLAG_LEVEL_ERROR }, - [_LOGL_OFF] = { "OFF", NULL, 0, 0, 0 }, - [_LOGL_KEEP] = { "KEEP", NULL, 0, 0, 0 }, + [LOGL_TRACE] = { "TRACE", "", LOG_DEBUG, G_LOG_LEVEL_DEBUG, }, + [LOGL_DEBUG] = { "DEBUG", "", LOG_DEBUG, G_LOG_LEVEL_DEBUG, }, + [LOGL_INFO] = { "INFO", "", LOG_INFO, G_LOG_LEVEL_INFO, }, + [LOGL_WARN] = { "WARN", "", LOG_WARNING, G_LOG_LEVEL_MESSAGE, }, + [LOGL_ERR] = { "ERR", "", LOG_ERR, G_LOG_LEVEL_MESSAGE, }, + [_LOGL_OFF] = { "OFF", NULL, 0, 0, }, + [_LOGL_KEEP] = { "KEEP", NULL, 0, 0, }, }, .domain_desc = { { LOGD_PLATFORM, "PLATFORM" }, @@ -527,7 +492,6 @@ _nm_log_impl (const char *file, char *msg; char *fullmsg; char s_buf_timestamp[64]; - char s_buf_location[1024]; GTimeVal tv; if ((guint) level >= G_N_ELEMENTS (_nm_logging_enabled_state)) @@ -547,51 +511,8 @@ _nm_log_impl (const char *file, msg = g_strdup_vprintf (fmt, args); va_end (args); - if (NM_FLAGS_ANY (global.log_format_flags, global.level_desc[level].log_format_level & _LOG_FORMAT_FLAG_TIMESTAMP)) { - g_get_current_time (&tv); - nm_sprintf_buf (s_buf_timestamp, " [%ld.%04ld]", tv.tv_sec, (tv.tv_usec + 50) / 100); - } else - s_buf_timestamp[0] = '\0'; - - s_buf_location[0] = '\0'; - if (NM_FLAGS_ANY (global.log_format_flags, global.level_desc[level].log_format_level & _LOG_FORMAT_FLAG_LOCATION)) { -#define MAX_LEN_FILE 37 -#define MAX_LEN_FUNC 26 - gsize l = sizeof (s_buf_location); - char *p = s_buf_location, *p_buf; - gsize len; - char s_buf[MAX (MAX_LEN_FILE, MAX_LEN_FUNC) + 30]; - - if (file) { - if (NM_FLAGS_HAS (global.log_format_flags, LOG_FORMAT_FLAG_ALIGN_LOCATION)) { - /* left-align the "[file:line]" string, but truncate from left to MAX_LEN_FILE chars. */ - len = strlen (file); - nm_sprintf_buf (s_buf, "[%s:%u]", - len > MAX_LEN_FILE ? &file[len - MAX_LEN_FILE] : file, - line); - len = strlen (s_buf); - if (len > MAX_LEN_FILE) { - p_buf = &s_buf[len - MAX_LEN_FILE]; - p_buf[0] = '['; - } else - p_buf = s_buf; - nm_utils_strbuf_append (&p, &l, " %-"G_STRINGIFY (MAX_LEN_FILE)"s", p_buf); - } else - nm_utils_strbuf_append (&p, &l, " [%s:%u]", file, line); - } - if (func) { - if (NM_FLAGS_HAS (global.log_format_flags, LOG_FORMAT_FLAG_ALIGN_LOCATION)) { - /* left-align the "func():" string, but truncate from left to MAX_LEN_FUNC chars. */ - len = strlen (func); - nm_sprintf_buf (s_buf, "%s():", - len > MAX_LEN_FUNC ? &func[len - MAX_LEN_FUNC] : func); - len = strlen (s_buf); - nm_utils_strbuf_append (&p, &l, " %-"G_STRINGIFY (MAX_LEN_FUNC)"s", - len > MAX_LEN_FUNC ? &s_buf[len - MAX_LEN_FUNC] : s_buf); - } else - nm_utils_strbuf_append (&p, &l, " %s():", func); - } - } + g_get_current_time (&tv); + nm_sprintf_buf (s_buf_timestamp, " [%ld.%04ld]", tv.tv_sec, (tv.tv_usec + 50) / 100); switch (global.log_backend) { #if SYSTEMD_JOURNAL @@ -609,10 +530,9 @@ _nm_log_impl (const char *file, _iovec_set_format (iov, iov_free, i_field++, "PRIORITY=%d", global.level_desc[level].syslog_level); _iovec_set_format (iov, iov_free, i_field++, "MESSAGE=" - "%-7s%s%s %s", + "%-7s%s %s", global.level_desc[level].level_str, s_buf_timestamp, - s_buf_location, msg); _iovec_set_literal_string (iov, iov_free, i_field++, "SYSLOG_IDENTIFIER=" G_LOG_DOMAIN); _iovec_set_format (iov, iov_free, i_field++, "SYSLOG_PID=%ld", (long) getpid ()); @@ -681,10 +601,9 @@ _nm_log_impl (const char *file, break; #endif default: - fullmsg = g_strdup_printf ("%-7s%s%s %s", + fullmsg = g_strdup_printf ("%-7s%s %s", global.level_desc[level].level_str, s_buf_timestamp, - s_buf_location, msg); if (global.log_backend == LOG_BACKEND_SYSLOG) @@ -767,16 +686,12 @@ nm_logging_syslog_enabled (void) void nm_logging_syslog_openlog (const char *logging_backend) { - LogFormatFlags log_format_flags; - if (global.log_backend != LOG_BACKEND_GLIB) g_return_if_reached (); if (!logging_backend) logging_backend = ""NM_CONFIG_LOGGING_BACKEND_DEFAULT; - log_format_flags = _LOG_FORMAT_FLAG_DEFAULT; - if (strcmp (logging_backend, "debug") == 0) { global.log_backend = LOG_BACKEND_SYSLOG; openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR | LOG_PID, LOG_USER); @@ -795,8 +710,6 @@ nm_logging_syslog_openlog (const char *logging_backend) openlog (G_LOG_DOMAIN, LOG_PID, LOG_DAEMON); } - global.log_format_flags = log_format_flags; - g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, nm_log_handler, From 87fcbb491d4f0d9491b438ed5ae0096c3e8e06a0 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 19 Aug 2016 13:36:16 +0200 Subject: [PATCH 10/35] vpn: fix out-of-range access reading route.plen in nm_vpn_connection_ip4_config_get() Also, skip over routes with plen zero. Fixes: 44768f0311deb9082c69e3525693091a59788ebb https://bugzilla.redhat.com/show_bug.cgi?id=1368355 --- src/vpn-manager/nm-vpn-connection.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index 53789093cb..ad4c6a2446 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -1437,6 +1437,7 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict) } else if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_ROUTES, "aau", &iter)) { while (g_variant_iter_next (iter, "@au", &v)) { NMPlatformIP4Route route = { 0, }; + guint32 plen; switch (g_variant_n_children (v)) { case 5: @@ -1444,14 +1445,15 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict) /* fallthrough */ case 4: g_variant_get_child (v, 0, "u", &route.network); - g_variant_get_child (v, 1, "u", &route.plen); + g_variant_get_child (v, 1, "u", &plen); g_variant_get_child (v, 2, "u", &route.gateway); /* 4th item is unused route metric */ route.metric = route_metric; route.rt_source = NM_IP_CONFIG_SOURCE_VPN; - if (route.plen > 32) + if (plen > 32 || plen == 0) break; + route.plen = plen; /* Ignore host routes to the VPN gateway since NM adds one itself * below. Since NM knows more about the routing situation than From 45cd3302dc2485bcf773c3e7144632a03a4d5d4e Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 9 Aug 2016 15:34:34 +0200 Subject: [PATCH 11/35] device: don't flush addresses when unmanaging assumed devices When a assumed software device is brought down externally, it becomes UNMANAGED_EXTERNAL_DOWN and its state goes from ACTIVATED directly to UNMANAGED. In such case, we shouldn't flush the IP configuration (addresses and routes) present on the device. To fix this, clean up the device with CLEANUP_TYPE_KEEP and modify nm_device_cleanup() not to flush addresses and devices with such flag. https://bugzilla.redhat.com/show_bug.cgi?id=1363995 --- src/devices/nm-device.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 7e41e9e743..44e22ff9c0 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -163,9 +163,9 @@ typedef struct { } ActivationHandleData; typedef enum { - CLEANUP_TYPE_DECONFIGURE, CLEANUP_TYPE_KEEP, CLEANUP_TYPE_REMOVED, + CLEANUP_TYPE_DECONFIGURE, } CleanupType; typedef enum { @@ -10790,19 +10790,21 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason, CleanupType clean if (NM_DEVICE_GET_CLASS (self)->deactivate) NM_DEVICE_GET_CLASS (self)->deactivate (self); - /* master: release slaves */ - nm_device_master_release_slaves (self); + if (cleanup_type != CLEANUP_TYPE_KEEP) { + /* master: release slaves */ + nm_device_master_release_slaves (self); - /* slave: mark no longer enslaved */ - if ( priv->master - && nm_platform_link_get_master (NM_PLATFORM_GET, priv->ifindex) <= 0) - nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + /* slave: mark no longer enslaved */ + if ( priv->master + && nm_platform_link_get_master (NM_PLATFORM_GET, priv->ifindex) <= 0) + nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); - /* Take out any entries in the routing table and any IP address the device had. */ - ifindex = nm_device_get_ip_ifindex (self); - if (ifindex > 0) { - nm_route_manager_route_flush (nm_route_manager_get (), ifindex); - nm_platform_address_flush (NM_PLATFORM_GET, ifindex); + /* Take out any entries in the routing table and any IP address the device had. */ + ifindex = nm_device_get_ip_ifindex (self); + if (ifindex > 0) { + nm_route_manager_route_flush (nm_route_manager_get (), ifindex); + nm_platform_address_flush (NM_PLATFORM_GET, ifindex); + } } if (priv->lldp_listener) @@ -10810,7 +10812,6 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason, CleanupType clean nm_device_update_metered (self); - /* during device cleanup, we want to reset the MAC address of the device * to the initial state. * @@ -11180,6 +11181,8 @@ _set_state_full (NMDevice *self, if (old_state > NM_DEVICE_STATE_UNMANAGED) { if (reason == NM_DEVICE_STATE_REASON_REMOVED) { nm_device_cleanup (self, reason, CLEANUP_TYPE_REMOVED); + } else if (reason == NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) { + nm_device_cleanup (self, reason, CLEANUP_TYPE_KEEP); } else { /* Clean up if the device is now unmanaged but was activated */ if (nm_device_get_act_request (self)) From 2750714802eb5f45fe381711991c6066c0270ce5 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 4 Aug 2016 12:04:06 +0200 Subject: [PATCH 12/35] ifcfg-rh: ensure master is cleared when updating a connection If the connection is not a slave we must clear any existing variable indicating the connection's master. https://bugzilla.redhat.com/show_bug.cgi?id=1355656 --- .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 64 +++++++++++++++++++ src/settings/plugins/ifcfg-rh/writer.c | 26 ++++++-- 2 files changed, 84 insertions(+), 6 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index c7e741f996..60938f6e00 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -1733,6 +1733,69 @@ test_read_dns_options (void) g_object_unref (connection); } +static void +test_clear_master (void) +{ + NMSettingConnection *s_con; + NMConnection *connection; + char *unmanaged = NULL; + char *testfile = NULL, *keyfile; + GError *error = NULL; + gboolean success; + shvarFile *f; + char *val; + + /* 1. load the bridge slave connection from disk */ + connection = _connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-test-bridge-component", + NULL, TYPE_ETHERNET, &unmanaged); + g_assert_cmpstr (unmanaged, ==, NULL); + + s_con = nm_connection_get_setting_connection (connection); + g_assert (s_con); + + g_assert_cmpstr (nm_setting_connection_get_master (s_con), ==, "br0"); + g_assert_cmpstr (nm_setting_connection_get_slave_type (s_con), ==, "bridge"); + + /* 2. write the connection to a new file */ + _writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile); + + /* 3. clear master and slave-type */ + g_object_set (s_con, + NM_SETTING_CONNECTION_MASTER, NULL, + NM_SETTING_CONNECTION_SLAVE_TYPE, NULL, + NULL); + + g_assert_cmpstr (nm_setting_connection_get_master (s_con), ==, NULL); + g_assert_cmpstr (nm_setting_connection_get_slave_type (s_con), ==, NULL); + + /* 4. update the connection on disk */ + keyfile = utils_get_keys_path (testfile); + success = writer_update_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + testfile, + keyfile, + &error); + g_assert_no_error (error); + g_assert (success); + unlink (keyfile); + g_free (keyfile); + + /* 5. check that BRIDGE variable has been removed */ + f = svOpenFile (testfile, &error); + g_assert_no_error (error); + g_assert (f); + + val = svGetValue (f, "BRIDGE", FALSE); + g_assert (!val); + svCloseFile (f); + + unlink (testfile); + g_free (testfile); + g_object_unref (connection); +} + static void test_write_dns_options (void) { @@ -8781,6 +8844,7 @@ int main (int argc, char **argv) g_test_add_data_func (TPATH "static-ip6-only-gw/2001:db8:8:4::2", "2001:db8:8:4::2", test_write_wired_static_ip6_only_gw); g_test_add_data_func (TPATH "static-ip6-only-gw/::ffff:255.255.255.255", "::ffff:255.255.255.255", test_write_wired_static_ip6_only_gw); g_test_add_func (TPATH "read-dns-options", test_read_dns_options); + g_test_add_func (TPATH "clear-master", test_clear_master); nmtst_add_test_func (TPATH "read-static", test_read_wired_static, TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static", "System test-wired-static", GINT_TO_POINTER (TRUE)); nmtst_add_test_func (TPATH "read-static-bootproto", test_read_wired_static, TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static-bootproto", "System test-wired-static-bootproto", GINT_TO_POINTER (FALSE)); diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c index 3682640077..4817549e58 100644 --- a/src/settings/plugins/ifcfg-rh/writer.c +++ b/src/settings/plugins/ifcfg-rh/writer.c @@ -1430,7 +1430,6 @@ write_team_setting (NMConnection *connection, shvarFile *ifcfg, gboolean *wired, svSetValue (ifcfg, "DEVICE", iface, FALSE); config = nm_setting_team_get_config (s_team); svSetValue (ifcfg, "TEAM_CONFIG", config, FALSE); - svSetValue (ifcfg, "DEVICETYPE", TYPE_TEAM, FALSE); *wired = write_wired_for_virtual (connection, ifcfg); @@ -1808,6 +1807,10 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg) const char *master, *type; char *tmp; gint i_int; + const char *v_master = NULL; + const char *v_slave = NULL; + const char *v_bridge = NULL; + const char *v_team_master = NULL; svSetValue (ifcfg, "NAME", nm_setting_connection_get_id (s_con), FALSE); svSetValue (ifcfg, "UUID", nm_setting_connection_get_uuid (s_con), FALSE); @@ -1876,17 +1879,28 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg) master = nm_setting_connection_get_master (s_con); if (master) { if (nm_setting_connection_is_slave_type (s_con, NM_SETTING_BOND_SETTING_NAME)) { - svSetValue (ifcfg, "MASTER", master, FALSE); - svSetValue (ifcfg, "SLAVE", "yes", FALSE); + v_master = master; + v_slave = "yes"; } else if (nm_setting_connection_is_slave_type (s_con, NM_SETTING_BRIDGE_SETTING_NAME)) - svSetValue (ifcfg, "BRIDGE", master, FALSE); + v_bridge = master; else if (nm_setting_connection_is_slave_type (s_con, NM_SETTING_TEAM_SETTING_NAME)) { - svSetValue (ifcfg, "TEAM_MASTER", master, FALSE); - svSetValue (ifcfg, "DEVICETYPE", TYPE_TEAM_PORT, FALSE); + v_team_master = master; svSetValue (ifcfg, "TYPE", NULL, FALSE); } } + svSetValue (ifcfg, "MASTER", v_master, FALSE); + svSetValue (ifcfg, "SLAVE", v_slave, FALSE); + svSetValue (ifcfg, "BRIDGE", v_bridge, FALSE); + svSetValue (ifcfg, "TEAM_MASTER", v_team_master, FALSE); + + if (nm_streq0 (type, NM_SETTING_TEAM_SETTING_NAME)) + svSetValue (ifcfg, "DEVICETYPE", TYPE_TEAM, FALSE); + else if (master && nm_setting_connection_is_slave_type (s_con, NM_SETTING_TEAM_SETTING_NAME)) + svSetValue (ifcfg, "DEVICETYPE", TYPE_TEAM_PORT, FALSE); + else + svSetValue (ifcfg, "DEVICETYPE", NULL, FALSE); + /* secondary connection UUIDs */ svSetValue (ifcfg, "SECONDARY_UUIDS", NULL, FALSE); n = nm_setting_connection_get_num_secondaries (s_con); From 4c7fa8dfdcbf13f3633b565af53896ac79366912 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 19 Aug 2016 11:51:00 +0200 Subject: [PATCH 13/35] core: drop root requirement for load_connection(s)/set_logging D-Bus calls The D-Bus configuration already ensures that only root can do that; enforcing the permission at policy level seems better than doing it in the daemon itself because it allows users to change the policy and also because callers can exit immediately after issuing the request. --- src/nm-manager.c | 17 ----------------- src/settings/nm-settings.c | 8 -------- 2 files changed, 25 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 89dc736044..237a45537d 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -4474,30 +4474,13 @@ impl_manager_set_logging (NMManager *self, const char *level, const char *domains) { - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); GError *error = NULL; - gulong caller_uid = G_MAXULONG; - - if (!nm_bus_manager_get_caller_info (priv->dbus_mgr, context, NULL, &caller_uid, NULL)) { - error = g_error_new_literal (NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - "Failed to get request UID."); - goto done; - } - - if (0 != caller_uid) { - error = g_error_new_literal (NM_MANAGER_ERROR, - NM_MANAGER_ERROR_PERMISSION_DENIED, - "Permission denied"); - goto done; - } if (nm_logging_setup (level, domains, NULL, &error)) { _LOGI (LOGD_CORE, "logging: level '%s' domains '%s'", nm_logging_level_to_string (), nm_logging_domains_to_string ()); } -done: if (error) g_dbus_method_invocation_take_error (context, error); else diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index 529d7581de..59a4aa07e6 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -1522,10 +1522,6 @@ impl_settings_load_connections (NMSettings *self, GSList *iter; int i; - if (!nm_bus_manager_ensure_root (nm_bus_manager_get (), context, - NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_PERMISSION_DENIED)) - return; - failures = g_ptr_array_new (); for (i = 0; filenames[i]; i++) { @@ -1559,10 +1555,6 @@ impl_settings_reload_connections (NMSettings *self, NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self); GSList *iter; - if (!nm_bus_manager_ensure_root (nm_bus_manager_get (), context, - NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_PERMISSION_DENIED)) - return; - for (iter = priv->plugins; iter; iter = g_slist_next (iter)) { NMSettingsPlugin *plugin = NM_SETTINGS_PLUGIN (iter->data); From 805925f9efbc910975104bebe1050f0c663b61f7 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 19 Aug 2016 11:56:58 +0200 Subject: [PATCH 14/35] cli: return sane error message for D-Bus policy permission errors The error returned to users when a load_connection(s)/set_logging call fails due to D-Bus policy denial is a bit obscure: $ nmcli general logging level debug Error: failed to set logging: Rejected send message, 4 matched rules; type="method_call", sender=":1.233" (uid=1001 pid=27225 comm="nmcli general logging level debug ") interface="org.freedesktop.NetworkManager" member="SetLogging" error name="(unset)" requested_reply="0" destination=":1.207" (uid=0 pid=25793 comm="/usr/sbin/NetworkManager --no-daemon ") Convert it to a more comprehensible: $ nmcli general logging level debug Error: failed to set logging: access denied https://bugzilla.redhat.com/show_bug.cgi?id=1362542 --- clients/cli/common.c | 16 ++++++++++++++++ clients/cli/common.h | 2 ++ clients/cli/connections.c | 4 ++-- clients/cli/general.c | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/clients/cli/common.c b/clients/cli/common.c index 42ee1c88c3..f1ec46a11e 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -1512,3 +1512,19 @@ nmc_complete_bool (const char *prefix) nmc_complete_strings (prefix, "true", "yes", "on", "false", "no", "off", NULL); } + +/** + * nmc_error_get_simple_message: + * @error: a GError + * + * Returns a simplified message for some errors hard to understand. + */ +const char * +nmc_error_get_simple_message (GError *error) +{ + /* Return a clear message instead of the obscure D-Bus policy error */ + if (g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_ACCESS_DENIED)) + return _("access denied"); + else + return error->message; +} diff --git a/clients/cli/common.h b/clients/cli/common.h index 2450cdb950..579c44a7d0 100644 --- a/clients/cli/common.h +++ b/clients/cli/common.h @@ -86,6 +86,8 @@ void nmc_complete_strings (const char *prefix, ...) G_GNUC_NULL_TERMINATED; void nmc_complete_bool (const char *prefix); +const char *nmc_error_get_simple_message (GError *error); + extern NmcOutputField nmc_fields_ip4_config[]; extern NmcOutputField nmc_fields_dhcp4_config[]; extern NmcOutputField nmc_fields_ip6_config[]; diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 7888523eda..bb4c51cb8c 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -8336,7 +8336,7 @@ do_connection_reload (NmCli *nmc, int argc, char **argv) if (!nm_client_reload_connections (nmc->client, NULL, &error)) { g_string_printf (nmc->return_text, _("Error: failed to reload connections: %s."), - error->message); + nmc_error_get_simple_message (error)); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; g_clear_error (&error); } @@ -8368,7 +8368,7 @@ do_connection_load (NmCli *nmc, int argc, char **argv) g_free (filenames); if (error) { g_string_printf (nmc->return_text, _("Error: failed to load connection: %s."), - error->message); + nmc_error_get_simple_message (error)); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; g_error_free (error); } diff --git a/clients/cli/general.c b/clients/cli/general.c index ccf2292af8..e97091251f 100644 --- a/clients/cli/general.c +++ b/clients/cli/general.c @@ -622,7 +622,7 @@ do_general_logging (NmCli *nmc, int argc, char **argv) nm_client_set_logging (nmc->client, level, domains, &error); if (error) { g_string_printf (nmc->return_text, _("Error: failed to set logging: %s"), - error->message); + nmc_error_get_simple_message (error)); return NMC_RESULT_ERROR_UNKNOWN; } } From 534b0360c1a7fa50f82e1941a43bd8311722d1ea Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 22 Aug 2016 13:40:36 +0200 Subject: [PATCH 15/35] device: emit NM_DEVICE_STATE_CHANGED signal by id This saves a lookup of the ID by name. We already have the signal-id, use it. --- src/devices/nm-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 44e22ff9c0..9d677e0a9d 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -11259,7 +11259,7 @@ _set_state_full (NMDevice *self, _notify (self, PROP_STATE); _notify (self, PROP_STATE_REASON); - g_signal_emit_by_name (self, NM_DEVICE_STATE_CHANGED, state, old_state, reason); + g_signal_emit (self, signals[STATE_CHANGED], 0, state, old_state, reason); /* Post-process the event after internal notification */ From 598bea3481b1216e16007057777ce1235593a6d8 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 22 Aug 2016 13:45:04 +0200 Subject: [PATCH 16/35] core: use define for signal name in nm_active_connection_set_device() --- src/nm-active-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c index 8b1824225f..1844587c67 100644 --- a/src/nm-active-connection.c +++ b/src/nm-active-connection.c @@ -546,7 +546,7 @@ nm_active_connection_set_device (NMActiveConnection *self, NMDevice *device) g_signal_connect (device, NM_DEVICE_STATE_CHANGED, G_CALLBACK (device_state_changed), self); - g_signal_connect (device, "notify::master", + g_signal_connect (device, "notify::" NM_DEVICE_MASTER, G_CALLBACK (device_master_changed), self); g_signal_connect (device, "notify::" NM_DEVICE_METERED, G_CALLBACK (device_metered_changed), self); From 4cb845558e501bddff5b359295f64ea2906be181 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 22 Aug 2016 18:32:56 +0200 Subject: [PATCH 17/35] platform: disable debug logging for NMPObject ref-couting These logging lines are already disabled by default as _LOGt() is a NOP unless configured --with-more-logging. However, the logging is still very verbose also for debug-builds and currently there are no known issues there. Disable the logging statements (but leave them in so they can easily be enabled). --- src/platform/nmp-object.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/platform/nmp-object.c b/src/platform/nmp-object.c index 55ffd7cffb..30a52c259b 100644 --- a/src/platform/nmp-object.c +++ b/src/platform/nmp-object.c @@ -47,6 +47,10 @@ } \ } G_STMT_END +/* logging to trace object lifetime and references. + * Disabled by default. */ +#define _LOGr(...) G_STMT_START { if (FALSE) { _LOGt (__VA_ARGS__); } } G_STMT_END + /*********************************************************************************************/ struct _NMPCache { @@ -211,7 +215,7 @@ nmp_object_ref (NMPObject *obj) g_return_val_if_fail (obj->_ref_count != NMP_REF_COUNT_STACKINIT, NULL); obj->_ref_count++; - _LOGt (obj, "ref: %d", obj->_ref_count); + _LOGr (obj, "ref: %d", obj->_ref_count); return obj; } @@ -222,7 +226,7 @@ nmp_object_unref (NMPObject *obj) if (obj) { g_return_if_fail (obj->_ref_count > 0); g_return_if_fail (obj->_ref_count != NMP_REF_COUNT_STACKINIT); - _LOGt (obj, "%s: %d", + _LOGr (obj, "%s: %d", obj->_ref_count <= 1 ? "destroy" : "unref", obj->_ref_count - 1); if (--obj->_ref_count <= 0) { @@ -262,7 +266,7 @@ _nmp_object_new_from_class (const NMPClass *klass) obj = g_slice_alloc0 (klass->sizeof_data + G_STRUCT_OFFSET (NMPObject, object)); obj->_class = klass; obj->_ref_count = 1; - _LOGt (obj, "new"); + _LOGr (obj, "new"); return obj; } From d4e9b30320184f0f9e09da375bb6ec549d6ab337 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 22 Aug 2016 17:37:20 +0200 Subject: [PATCH 18/35] device: fix queued activation failure due to link disconnected When activating a connection, it may fail with nmcli reporting: $ nmcli connection up id "Wired Connection 1" Error: Connection activation failed: Active connection removed before it was initialized This should be easily reproducible by having a connection "Wired Connection 1" with cloned-mac-address set to random. When the connection is already active on a device, re-activating with $ nmcli connection up id "Wired Connection 1" fails. We first create a queued-activation and tear down the existing connection: device (enp0s25): state change: deactivating -> disconnected (reason 'new-activation') Shortly after we see: device[0x557d02cdb0c0] (enp0s25): set-hw-addr: setting MAC address to 'AA:BB:CC:DD:EE:FF' (reset, deactivate)... device[0x557d02cdb0c0] (enp0s25): taking down device later, we get: device (enp0s25): link disconnected device[0x557d02cdb0c0] (enp0s25): queued state change to unavailable due to carrier-changed (id 17290) in the meantime, the queued activation request starts: device (enp0s25): Activation: starting connection 'my-wired' (ca058ec5-8a47-4e1e-b38e-962b71c4699e) but the device already transitions to unavailable device[0x557d02cdb0c0] (enp0s25): running queued state change to unavailable (id 17290) device (enp0s25): state change: disconnected -> unavailable (reason 'carrier-changed') [30 20 40] which kills the new activation request: active-connection[0x557d02c10e40]: set state deactivated (was unknown) Just delay a carrier-lost handling if we have any queued activation requests. --- src/devices/nm-device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 9d677e0a9d..4807a9ba15 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -1726,7 +1726,8 @@ nm_device_set_carrier (NMDevice *self, gboolean carrier) nm_device_remove_pending_action (self, "carrier wait", TRUE); _carrier_wait_check_queued_act_request (self); } - } else if (state <= NM_DEVICE_STATE_DISCONNECTED) { + } else if ( state <= NM_DEVICE_STATE_DISCONNECTED + && !priv->queued_act_request) { _LOGI (LOGD_DEVICE, "link disconnected"); klass->carrier_changed (self, FALSE); } else { From ed7f832c40350cce0a33c29d36c84781b4ac9434 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 22 Aug 2016 18:40:38 +0200 Subject: [PATCH 19/35] device: silence logging about "link disconnected" logging is just too verbose for something that happens frequently. --- src/devices/nm-device.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 4807a9ba15..199acc66b6 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -1685,8 +1685,6 @@ link_disconnect_action_cb (gpointer user_data) priv->carrier_defer_id = 0; - _LOGI (LOGD_DEVICE, "link disconnected (calling deferred action)"); - NM_DEVICE_GET_CLASS (self)->carrier_changed (self, FALSE); return FALSE; @@ -1728,10 +1726,9 @@ nm_device_set_carrier (NMDevice *self, gboolean carrier) } } else if ( state <= NM_DEVICE_STATE_DISCONNECTED && !priv->queued_act_request) { - _LOGI (LOGD_DEVICE, "link disconnected"); + _LOGD (LOGD_DEVICE, "link disconnected"); klass->carrier_changed (self, FALSE); } else { - _LOGI (LOGD_DEVICE, "link disconnected (deferring action for %d seconds)", LINK_DISCONNECT_DELAY); priv->carrier_defer_id = g_timeout_add_seconds (LINK_DISCONNECT_DELAY, link_disconnect_action_cb, self); _LOGD (LOGD_DEVICE, "link disconnected (deferring action for %d seconds) (id=%u)", From c5682d601b14da72db1ad01f9e2a426d716d7265 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 19 Aug 2016 14:46:52 +0200 Subject: [PATCH 20/35] core: downgrade assertion in nm-ip[46]-config.c to g_critical --- src/nm-ip4-config.c | 4 ++-- src/nm-ip6-config.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 7ef9fc5bb5..22d1d0775c 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -1614,7 +1614,7 @@ nm_ip4_config_add_route (NMIP4Config *config, const NMPlatformIP4Route *new) g_return_if_fail (new != NULL); g_return_if_fail (new->plen > 0 && new->plen <= 32); - g_assert (priv->ifindex); + g_return_if_fail (priv->ifindex > 0); for (i = 0; i < priv->routes->len; i++ ) { NMPlatformIP4Route *item = &g_array_index (priv->routes, NMPlatformIP4Route, i); @@ -2293,7 +2293,7 @@ finalize (GObject *object) static void get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) + GValue *value, GParamSpec *pspec) { NMIP4Config *config = NM_IP4_CONFIG (object); NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config); diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 83cd8af0c2..ac9e6cd130 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -1487,7 +1487,7 @@ nm_ip6_config_add_route (NMIP6Config *config, const NMPlatformIP6Route *new) g_return_if_fail (new != NULL); g_return_if_fail (new->plen > 0 && new->plen <= 128); - g_assert (priv->ifindex); + g_return_if_fail (priv->ifindex > 0); for (i = 0; i < priv->routes->len; i++ ) { NMPlatformIP6Route *item = &g_array_index (priv->routes, NMPlatformIP6Route, i); @@ -2037,7 +2037,7 @@ nameservers_to_gvalue (GArray *array, GValue *value) static void get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) + GValue *value, GParamSpec *pspec) { NMIP6Config *config = NM_IP6_CONFIG (object); NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (config); From d52195475bf8a0b06b8050e8b38a4bbad1ad97c5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 19 Aug 2016 14:55:58 +0200 Subject: [PATCH 21/35] vpn: embed private data in NMVpnConnection structure --- src/vpn-manager/nm-vpn-connection.c | 81 ++++++++++++++++++++--------- src/vpn-manager/nm-vpn-connection.h | 22 +------- 2 files changed, 58 insertions(+), 45 deletions(-) diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index ad4c6a2446..5bf53daf99 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -50,8 +50,6 @@ #include "nmdbus-vpn-connection.h" -G_DEFINE_TYPE (NMVpnConnection, nm_vpn_connection, NM_TYPE_ACTIVE_CONNECTION) - typedef enum { /* Only system secrets */ SECRETS_REQ_SYSTEM = 0, @@ -80,6 +78,27 @@ typedef enum { STATE_FAILED, } VpnState; +enum { + VPN_STATE_CHANGED, + INTERNAL_STATE_CHANGED, + INTERNAL_RETRY_AFTER_FAILURE, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_VPN_STATE, + PROP_BANNER, + PROP_IP4_CONFIG, + PROP_IP6_CONFIG, + PROP_MASTER = 2000, + + LAST_PROP +}; + typedef struct { gboolean service_can_persist; gboolean connection_can_persist; @@ -128,29 +147,45 @@ typedef struct { guint32 mtu; } NMVpnConnectionPrivate; -#define NM_VPN_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_CONNECTION, NMVpnConnectionPrivate)) - -enum { - VPN_STATE_CHANGED, - INTERNAL_STATE_CHANGED, - INTERNAL_RETRY_AFTER_FAILURE, - - LAST_SIGNAL +struct _NMVpnConnection { + NMActiveConnection parent; + NMVpnConnectionPrivate _priv; }; -static guint signals[LAST_SIGNAL] = { 0 }; +struct _NMVpnConnectionClass { + NMActiveConnectionClass parent; -enum { - PROP_0, - PROP_VPN_STATE, - PROP_BANNER, - PROP_IP4_CONFIG, - PROP_IP6_CONFIG, - PROP_MASTER = 2000, + /* Signals */ + void (*vpn_state_changed) (NMVpnConnection *self, + NMVpnConnectionState new_state, + NMVpnConnectionStateReason reason); - LAST_PROP + /* not exported over D-Bus */ + void (*internal_state_changed) (NMVpnConnection *self, + NMVpnConnectionState new_state, + NMVpnConnectionState old_state, + NMVpnConnectionStateReason reason); + + void (*internal_failed_retry) (NMVpnConnection *self); }; +G_DEFINE_TYPE (NMVpnConnection, nm_vpn_connection, NM_TYPE_ACTIVE_CONNECTION) + +#define NM_VPN_CONNECTION_GET_PRIVATE(self) \ + ({ \ + /* preserve the const-ness of self. Unfortunately, that + * way, @self cannot be a void pointer */ \ + typeof (self) _self = (self); \ + \ + /* Get compiler error if variable is of wrong type */ \ + _nm_unused const NMVpnConnection *_self2 = (_self); \ + \ + nm_assert (NM_IS_VPN_CONNECTION (_self)); \ + &_self->_priv; \ + }) + +/*****************************************************************************/ + static NMSettingsConnection *_get_settings_connection (NMVpnConnection *self, gboolean allow_missing); @@ -2504,7 +2539,7 @@ device_changed (NMActiveConnection *active, NMDevice *new_device, NMDevice *old_device) { - NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (active); + NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE ((NMVpnConnection *) active); if (!_service_and_connection_can_persist (NM_VPN_CONNECTION (active))) return; @@ -2577,7 +2612,7 @@ dispose (GObject *object) static void finalize (GObject *object) { - NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (object); + NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE ((NMVpnConnection *) object); g_free (priv->banner); g_free (priv->ip_iface); @@ -2598,7 +2633,7 @@ static void get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (object); + NMVpnConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE ((NMVpnConnection *) object); NMDevice *parent_dev; switch (prop_id) { @@ -2630,8 +2665,6 @@ nm_vpn_connection_class_init (NMVpnConnectionClass *connection_class) GObjectClass *object_class = G_OBJECT_CLASS (connection_class); NMActiveConnectionClass *active_class = NM_ACTIVE_CONNECTION_CLASS (connection_class); - g_type_class_add_private (connection_class, sizeof (NMVpnConnectionPrivate)); - /* virtual methods */ object_class->get_property = get_property; object_class->dispose = dispose; diff --git a/src/vpn-manager/nm-vpn-connection.h b/src/vpn-manager/nm-vpn-connection.h index 6837432926..3fe5605467 100644 --- a/src/vpn-manager/nm-vpn-connection.h +++ b/src/vpn-manager/nm-vpn-connection.h @@ -47,27 +47,7 @@ #define NM_VPN_ROUTE_METRIC_DEFAULT 50 - -struct _NMVpnConnection { - NMActiveConnection parent; -}; - -typedef struct { - NMActiveConnectionClass parent; - - /* Signals */ - void (*vpn_state_changed) (NMVpnConnection *self, - NMVpnConnectionState new_state, - NMVpnConnectionStateReason reason); - - /* not exported over D-Bus */ - void (*internal_state_changed) (NMVpnConnection *self, - NMVpnConnectionState new_state, - NMVpnConnectionState old_state, - NMVpnConnectionStateReason reason); - - void (*internal_failed_retry) (NMVpnConnection *self); -} NMVpnConnectionClass; +typedef struct _NMVpnConnectionClass NMVpnConnectionClass; GType nm_vpn_connection_get_type (void); From 9d6f613df41081e10ca4a5813f1c2b4d57406c1a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 19 Aug 2016 15:02:28 +0200 Subject: [PATCH 22/35] vpn: refactor property implementation in NMVpnConnection --- src/vpn-manager/nm-vpn-connection.c | 83 ++++++++++++++--------------- 1 file changed, 39 insertions(+), 44 deletions(-) diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index 5bf53daf99..3c9b057106 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -88,16 +88,13 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; -enum { - PROP_0, +NM_GOBJECT_PROPERTIES_DEFINE (NMVpnConnection, PROP_VPN_STATE, PROP_BANNER, - PROP_IP4_CONFIG, - PROP_IP6_CONFIG, - PROP_MASTER = 2000, - - LAST_PROP -}; +#define PROP_IP4_CONFIG 2000 +#define PROP_IP6_CONFIG 2001 +#define PROP_MASTER 2002 +); typedef struct { gboolean service_can_persist; @@ -530,7 +527,7 @@ _set_vpn_state (NMVpnConnection *self, new_external_state, old_external_state, reason); - g_object_notify (G_OBJECT (self), NM_VPN_CONNECTION_VPN_STATE); + _notify (self, PROP_VPN_STATE); } switch (vpn_state) { @@ -1283,7 +1280,7 @@ process_generic_config (NMVpnConnection *self, GVariant *dict) g_clear_pointer (&priv->banner, g_free); if (g_variant_lookup (dict, NM_VPN_PLUGIN_CONFIG_BANNER, "&s", &str)) { priv->banner = g_strdup (str); - g_object_notify (G_OBJECT (self), NM_VPN_CONNECTION_BANNER); + _notify (self, PROP_BANNER); } /* External world-visible address of the VPN server */ @@ -1520,7 +1517,7 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict) } else { priv->ip4_config = config; nm_exported_object_export (NM_EXPORTED_OBJECT (config)); - g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_IP4_CONFIG); + g_object_notify ((GObject *) self, NM_ACTIVE_CONNECTION_IP4_CONFIG); } nm_vpn_connection_config_maybe_complete (self, TRUE); @@ -1670,7 +1667,7 @@ next: } else { priv->ip6_config = config; nm_exported_object_export (NM_EXPORTED_OBJECT (config)); - g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_IP6_CONFIG); + g_object_notify ((GObject *) self, NM_ACTIVE_CONNECTION_IP6_CONFIG); } nm_vpn_connection_config_maybe_complete (self, TRUE); @@ -2672,51 +2669,49 @@ nm_vpn_connection_class_init (NMVpnConnectionClass *connection_class) active_class->device_state_changed = device_state_changed; active_class->device_changed = device_changed; - g_object_class_override_property (object_class, PROP_MASTER, NM_ACTIVE_CONNECTION_MASTER); + obj_properties[PROP_VPN_STATE] = + g_param_spec_uint (NM_VPN_CONNECTION_VPN_STATE, "", "", + NM_VPN_CONNECTION_STATE_UNKNOWN, + NM_VPN_CONNECTION_STATE_DISCONNECTED, + NM_VPN_CONNECTION_STATE_UNKNOWN, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS); - /* properties */ - g_object_class_install_property - (object_class, PROP_VPN_STATE, - g_param_spec_uint (NM_VPN_CONNECTION_VPN_STATE, "", "", - NM_VPN_CONNECTION_STATE_UNKNOWN, - NM_VPN_CONNECTION_STATE_DISCONNECTED, - NM_VPN_CONNECTION_STATE_UNKNOWN, - G_PARAM_READABLE | - G_PARAM_STATIC_STRINGS)); + obj_properties[PROP_BANNER] = + g_param_spec_string (NM_VPN_CONNECTION_BANNER, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS); - g_object_class_install_property - (object_class, PROP_BANNER, - g_param_spec_string (NM_VPN_CONNECTION_BANNER, "", "", - NULL, - G_PARAM_READABLE | - G_PARAM_STATIC_STRINGS)); + g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties); + g_object_class_override_property (object_class, PROP_MASTER, + NM_ACTIVE_CONNECTION_MASTER); g_object_class_override_property (object_class, PROP_IP4_CONFIG, NM_ACTIVE_CONNECTION_IP4_CONFIG); g_object_class_override_property (object_class, PROP_IP6_CONFIG, NM_ACTIVE_CONNECTION_IP6_CONFIG); - /* signals */ signals[VPN_STATE_CHANGED] = - g_signal_new ("vpn-state-changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - 0, NULL, NULL, NULL, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + g_signal_new ("vpn-state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); signals[INTERNAL_STATE_CHANGED] = - g_signal_new (NM_VPN_CONNECTION_INTERNAL_STATE_CHANGED, - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - 0, NULL, NULL, NULL, - G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); + g_signal_new (NM_VPN_CONNECTION_INTERNAL_STATE_CHANGED, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); signals[INTERNAL_RETRY_AFTER_FAILURE] = - g_signal_new (NM_VPN_CONNECTION_INTERNAL_RETRY_AFTER_FAILURE, - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - 0, NULL, NULL, NULL, - G_TYPE_NONE, 0); + g_signal_new (NM_VPN_CONNECTION_INTERNAL_RETRY_AFTER_FAILURE, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 0); nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (connection_class), NMDBUS_TYPE_VPN_CONNECTION_SKELETON, From 2da35ddfe80346d4aee2510e830a59f62fc9434f Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 19 Aug 2016 15:18:26 +0200 Subject: [PATCH 23/35] vpn: fix nm_vpn_connection_ip6_config_get() for VPNs without own interface We need an ifindex for the NMIP4Config/NMIP6Config instance. For interface-less VPN types, we need to lookup the parent device, as already done for IPv4. Fix IPv6 case too. https://bugzilla.redhat.com/show_bug.cgi?id=1368354 --- src/vpn-manager/nm-vpn-connection.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index 3c9b057106..f9c4f01e68 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -1373,6 +1373,7 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict) GVariant *v; gboolean b; guint i, n; + int ip_ifindex; g_return_if_fail (dict && g_variant_is_of_type (dict, G_VARIANT_TYPE_VARDICT)); @@ -1400,7 +1401,11 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict) priv->has_ip6 = FALSE; } - config = nm_ip4_config_new (nm_vpn_connection_get_ip_ifindex (self, TRUE)); + ip_ifindex = nm_vpn_connection_get_ip_ifindex (self, TRUE); + if (ip_ifindex <= 0) + g_return_if_reached (); + + config = nm_ip4_config_new (ip_ifindex); nm_ip4_config_set_dns_priority (config, NM_DNS_PRIORITY_DEFAULT_VPN); memset (&address, 0, sizeof (address)); @@ -1535,6 +1540,7 @@ nm_vpn_connection_ip6_config_get (NMVpnConnection *self, GVariant *dict) GVariant *v; gboolean b; guint i, n; + int ip_ifindex; g_return_if_fail (dict && g_variant_is_of_type (dict, G_VARIANT_TYPE_VARDICT)); @@ -1549,7 +1555,11 @@ nm_vpn_connection_ip6_config_get (NMVpnConnection *self, GVariant *dict) return; } - config = nm_ip6_config_new (priv->ip_ifindex); + ip_ifindex = nm_vpn_connection_get_ip_ifindex (self, TRUE); + if (ip_ifindex <= 0) + g_return_if_reached (); + + config = nm_ip6_config_new (ip_ifindex); nm_ip6_config_set_dns_priority (config, NM_DNS_PRIORITY_DEFAULT_VPN); memset (&address, 0, sizeof (address)); From 071103b172929ee4d9f897affb4b15400932d1d9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sat, 20 Aug 2016 10:22:22 +0200 Subject: [PATCH 24/35] vpn: ignore unexpected default-route for nm_vpn_connection_ip6_config_get() The VPN data comes from an external source, it may be bogus. Default-routes are not allowed on this point and would trigger an assertion afterwards. Skip over them. --- src/vpn-manager/nm-vpn-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index f9c4f01e68..92c5bd8fa3 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -1640,7 +1640,7 @@ nm_vpn_connection_ip6_config_get (NMVpnConnection *self, GVariant *dict) if (!ip6_addr_from_variant (dest, &route.network)) goto next; - if (prefix > 128) + if (prefix > 128 || prefix == 0) goto next; route.plen = prefix; From dd27b79c4e726fca4a192b27453221d6942e4717 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 23 Aug 2016 09:38:40 +0200 Subject: [PATCH 25/35] core: check valid uid for D-Bus load_connection(s)/set_logging calls Commit 4c7fa8dfdcbf ("core: drop root requirement for load_connection(s)/set_logging D-Bus calls") removed the enforcing of permission in the daemon for such methods since the D-Bus daemon configuration already does that. That change also allows clients to send a request and not wait for a response, since we don't have to check the caller credentials in the daemon. In the future we might switch to polkit for these methods, breaking clients that don't wait for a reponse, so it seems better to prevent from beginning such behavior. Fixes: 4c7fa8dfdcbf13f3633b565af53896ac79366912 --- src/nm-bus-manager.c | 28 +++++++++++++++++++++++----- src/nm-bus-manager.h | 9 +++++---- src/nm-manager.c | 11 +++++++++++ src/settings/nm-settings.c | 22 ++++++++++++++++++++++ 4 files changed, 61 insertions(+), 9 deletions(-) diff --git a/src/nm-bus-manager.c b/src/nm-bus-manager.c index 5894d7570d..449de4e68a 100644 --- a/src/nm-bus-manager.c +++ b/src/nm-bus-manager.c @@ -533,11 +533,28 @@ nm_bus_manager_get_caller_info_from_message (NMBusManager *self, return _get_caller_info (self, NULL, connection, message, out_sender, out_uid, out_pid); } +/** + * nm_bus_manager_ensure_uid: + * + * @self: bus manager instance + * @context: D-Bus method invocation + * @uid: a user-id + * @error_domain: error domain to return on failure + * @error_code: error code to return on failure + * + * Retrieves the uid of the D-Bus method caller and + * checks that it matches @uid, unless @uid is G_MAXULONG. + * In case of failure the function returns FALSE and finishes + * handling the D-Bus method with an error. + * + * Returns: %TRUE if the check succeeded, %FALSE otherwise + */ gboolean -nm_bus_manager_ensure_root (NMBusManager *self, - GDBusMethodInvocation *context, - GQuark error_domain, - int error_code) +nm_bus_manager_ensure_uid (NMBusManager *self, + GDBusMethodInvocation *context, + gulong uid, + GQuark error_domain, + int error_code) { gulong caller_uid; GError *error = NULL; @@ -552,7 +569,8 @@ nm_bus_manager_ensure_root (NMBusManager *self, g_dbus_method_invocation_take_error (context, error); return FALSE; } - if (caller_uid != 0) { + + if (uid != G_MAXULONG && caller_uid != uid) { error = g_error_new_literal (error_domain, error_code, "Permission denied"); diff --git a/src/nm-bus-manager.h b/src/nm-bus-manager.h index f49901db2c..bc23d2ce38 100644 --- a/src/nm-bus-manager.h +++ b/src/nm-bus-manager.h @@ -66,10 +66,11 @@ gboolean nm_bus_manager_get_caller_info (NMBusManager *self, gulong *out_uid, gulong *out_pid); -gboolean nm_bus_manager_ensure_root (NMBusManager *self, - GDBusMethodInvocation *context, - GQuark error_domain, - int error_code); +gboolean nm_bus_manager_ensure_uid (NMBusManager *self, + GDBusMethodInvocation *context, + gulong uid, + GQuark error_domain, + int error_code); const char *nm_bus_manager_connection_get_private_name (NMBusManager *self, GDBusConnection *connection); diff --git a/src/nm-manager.c b/src/nm-manager.c index 237a45537d..667c08c2c2 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -4476,6 +4476,17 @@ impl_manager_set_logging (NMManager *self, { GError *error = NULL; + /* The permission is already enforced by the D-Bus daemon, but we ensure + * that the caller is still alive so that clients are forced to wait and + * we'll be able to switch to polkit without breaking behavior. + */ + if (!nm_bus_manager_ensure_uid (nm_bus_manager_get (), + context, + G_MAXULONG, + NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED)) + return; + if (nm_logging_setup (level, domains, NULL, &error)) { _LOGI (LOGD_CORE, "logging: level '%s' domains '%s'", nm_logging_level_to_string (), nm_logging_domains_to_string ()); diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index 59a4aa07e6..1f691c0bd5 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -1522,6 +1522,17 @@ impl_settings_load_connections (NMSettings *self, GSList *iter; int i; + /* The permission is already enforced by the D-Bus daemon, but we ensure + * that the caller is still alive so that clients are forced to wait and + * we'll be able to switch to polkit without breaking behavior. + */ + if (!nm_bus_manager_ensure_uid (nm_bus_manager_get (), + context, + G_MAXULONG, + NM_SETTINGS_ERROR, + NM_SETTINGS_ERROR_PERMISSION_DENIED)) + return; + failures = g_ptr_array_new (); for (i = 0; filenames[i]; i++) { @@ -1555,6 +1566,17 @@ impl_settings_reload_connections (NMSettings *self, NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self); GSList *iter; + /* The permission is already enforced by the D-Bus daemon, but we ensure + * that the caller is still alive so that clients are forced to wait and + * we'll be able to switch to polkit without breaking behavior. + */ + if (!nm_bus_manager_ensure_uid (nm_bus_manager_get (), + context, + G_MAXULONG, + NM_SETTINGS_ERROR, + NM_SETTINGS_ERROR_PERMISSION_DENIED)) + return; + for (iter = priv->plugins; iter; iter = g_slist_next (iter)) { NMSettingsPlugin *plugin = NM_SETTINGS_PLUGIN (iter->data); From 640fbec855907b19952c8f0411f8500f1008fd7d Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 23 Aug 2016 11:45:51 +0200 Subject: [PATCH 26/35] core: use #define for "rfkill-changed" signal name --- src/nm-manager.c | 2 +- src/nm-rfkill-manager.c | 4 ++-- src/nm-rfkill-manager.h | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 667c08c2c2..5794bb9ab9 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -5545,7 +5545,7 @@ constructed (GObject *object) priv->rfkill_mgr = nm_rfkill_manager_new (); g_signal_connect (priv->rfkill_mgr, - "rfkill-changed", + NM_RFKILL_MANAGER_SIGNAL_RFKILL_CHANGED, G_CALLBACK (rfkill_manager_rfkill_changed_cb), self); diff --git a/src/nm-rfkill-manager.c b/src/nm-rfkill-manager.c index 1674265631..453a3b9bbb 100644 --- a/src/nm-rfkill-manager.c +++ b/src/nm-rfkill-manager.c @@ -395,7 +395,7 @@ dispose (GObject *object) priv->killswitches = NULL; } - G_OBJECT_CLASS (nm_rfkill_manager_parent_class)->dispose (object); + G_OBJECT_CLASS (nm_rfkill_manager_parent_class)->dispose (object); } static void @@ -410,7 +410,7 @@ nm_rfkill_manager_class_init (NMRfkillManagerClass *klass) /* Signals */ signals[RFKILL_CHANGED] = - g_signal_new ("rfkill-changed", + g_signal_new (NM_RFKILL_MANAGER_SIGNAL_RFKILL_CHANGED, G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMRfkillManagerClass, rfkill_changed), diff --git a/src/nm-rfkill-manager.h b/src/nm-rfkill-manager.h index d9937dafc3..3aca8f50b9 100644 --- a/src/nm-rfkill-manager.h +++ b/src/nm-rfkill-manager.h @@ -22,6 +22,8 @@ #ifndef __NETWORKMANAGER_RFKILL_MANAGER_H__ #define __NETWORKMANAGER_RFKILL_MANAGER_H__ +#define NM_RFKILL_MANAGER_SIGNAL_RFKILL_CHANGED "rfkill-changed" + typedef enum { /*< skip >*/ RFKILL_UNBLOCKED = 0, RFKILL_SOFT_BLOCKED = 1, From 680b3d1037059e57f538c24c1b8b26c15d33906a Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 23 Aug 2016 13:42:13 +0200 Subject: [PATCH 27/35] tests: try to resolve the .so file symbols At some point, linker on ppc64le would throw away useful symbols along with the garbage: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1c9177d9a5c3e06d3344347c8068acfb7d8ecc8b Add a post-build check so that the distributors running broken binutils would catch this early and fix their toolchain (or disable the garbage collecting at the expense of larger and slower binaries). --- src/devices/adsl/Makefile.am | 1 + src/devices/bluetooth/Makefile.am | 1 + src/devices/team/Makefile.am | 1 + src/devices/wifi/Makefile.am | 1 + src/devices/wwan/Makefile.am | 2 ++ src/settings/plugins/ibft/tests/Makefile.am | 3 +++ src/settings/plugins/ifcfg-rh/tests/Makefile.am | 3 +++ src/settings/plugins/ifnet/tests/Makefile.am | 3 +++ src/settings/plugins/ifupdown/tests/Makefile.am | 3 +++ 9 files changed, 18 insertions(+) diff --git a/src/devices/adsl/Makefile.am b/src/devices/adsl/Makefile.am index 5f981740a7..9075021c3e 100644 --- a/src/devices/adsl/Makefile.am +++ b/src/devices/adsl/Makefile.am @@ -40,6 +40,7 @@ if ENABLE_TESTS check-local: $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-device-plugin-adsl.so $(SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-device-plugin-adsl.so $(top_builddir)/src/NetworkManager --version >/dev/null endif diff --git a/src/devices/bluetooth/Makefile.am b/src/devices/bluetooth/Makefile.am index 2ff9a57244..8454702e5f 100644 --- a/src/devices/bluetooth/Makefile.am +++ b/src/devices/bluetooth/Makefile.am @@ -76,6 +76,7 @@ if ENABLE_TESTS check-local: $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-device-plugin-bluetooth.so $(SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-device-plugin-bluetooth.so $(top_builddir)/src/NetworkManager --version >/dev/null endif diff --git a/src/devices/team/Makefile.am b/src/devices/team/Makefile.am index 3609ace420..db756b4c60 100644 --- a/src/devices/team/Makefile.am +++ b/src/devices/team/Makefile.am @@ -49,6 +49,7 @@ if ENABLE_TESTS check-local: $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-device-plugin-team.so $(SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-device-plugin-team.so $(top_builddir)/src/NetworkManager --version >/dev/null endif diff --git a/src/devices/wifi/Makefile.am b/src/devices/wifi/Makefile.am index e35a84b439..add0a007c4 100644 --- a/src/devices/wifi/Makefile.am +++ b/src/devices/wifi/Makefile.am @@ -52,6 +52,7 @@ if ENABLE_TESTS check-local: $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-device-plugin-wifi.so $(SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-device-plugin-wifi.so $(top_builddir)/src/NetworkManager --version >/dev/null endif diff --git a/src/devices/wwan/Makefile.am b/src/devices/wwan/Makefile.am index 44d0f1e24a..0d061a792e 100644 --- a/src/devices/wwan/Makefile.am +++ b/src/devices/wwan/Makefile.am @@ -88,7 +88,9 @@ if ENABLE_TESTS check-local: $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-device-plugin-wwan.so $(SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-device-plugin-wwan.so $(top_builddir)/src/NetworkManager --version >/dev/null $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-wwan.so $(WWAN_SYMBOL_VIS_FILE) + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/.libs/libnm-wwan.so $(top_builddir)/src/NetworkManager --version >/dev/null endif diff --git a/src/settings/plugins/ibft/tests/Makefile.am b/src/settings/plugins/ibft/tests/Makefile.am index 939947ca5c..e5cff73f58 100644 --- a/src/settings/plugins/ibft/tests/Makefile.am +++ b/src/settings/plugins/ibft/tests/Makefile.am @@ -34,6 +34,9 @@ test_ibft_LDADD = \ @VALGRIND_RULES@ TESTS = test-ibft +check-local: + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/../.libs/libnm-settings-plugin-ibft.so $(top_builddir)/src/NetworkManager --version >/dev/null + endif EXTRA_DIST = \ diff --git a/src/settings/plugins/ifcfg-rh/tests/Makefile.am b/src/settings/plugins/ifcfg-rh/tests/Makefile.am index 73ddfeefd1..fedbd93fa2 100644 --- a/src/settings/plugins/ifcfg-rh/tests/Makefile.am +++ b/src/settings/plugins/ifcfg-rh/tests/Makefile.am @@ -49,5 +49,8 @@ test_ifcfg_rh_utils_LDADD = \ @VALGRIND_RULES@ TESTS = test-ifcfg-rh-utils test-ifcfg-rh +check-local: + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/../.libs/libnm-settings-plugin-ifcfg-rh.so $(top_builddir)/src/NetworkManager --version >/dev/null + endif diff --git a/src/settings/plugins/ifnet/tests/Makefile.am b/src/settings/plugins/ifnet/tests/Makefile.am index eb813ab29d..8ece14c64b 100644 --- a/src/settings/plugins/ifnet/tests/Makefile.am +++ b/src/settings/plugins/ifnet/tests/Makefile.am @@ -37,6 +37,9 @@ test_ifnet_LDADD = $(top_builddir)/src/libNetworkManager.la @VALGRIND_RULES@ TESTS = test-ifnet +check-local: + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/../.libs/libnm-settings-plugin-ifnet.so $(top_builddir)/src/NetworkManager --version >/dev/null + endif EXTRA_DIST = \ diff --git a/src/settings/plugins/ifupdown/tests/Makefile.am b/src/settings/plugins/ifupdown/tests/Makefile.am index 4f01fc0c9b..1287a7167a 100644 --- a/src/settings/plugins/ifupdown/tests/Makefile.am +++ b/src/settings/plugins/ifupdown/tests/Makefile.am @@ -26,6 +26,9 @@ test_ifupdown_LDADD = \ @VALGRIND_RULES@ TESTS = test-ifupdown +check-local: + LD_BIND_NOW=1 LD_PRELOAD=$(builddir)/../.libs/libnm-settings-plugin-ifupdown.so $(top_builddir)/src/NetworkManager --version >/dev/null + endif EXTRA_DIST = \ From 154c86efc6711f2a8285cc7e74011c972f3b6c92 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 23 Aug 2016 22:43:50 +0200 Subject: [PATCH 28/35] NEWS: fix spelling --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3b67282f7e..98847c1626 100644 --- a/NEWS +++ b/NEWS @@ -18,7 +18,7 @@ This is a new stable release of NetworkManager. Notable changes include: * NetworkManager now follows symlinks when accessing resolv.conf and rc-manager is set to 'file' * Added support for oFono as modem manager -* Tre devices now expose counters of transferred data. +* The devices now exposes counters of transferred data. * The 'may-fail' property of ipv4 and ipv6 settings is now respected more accurately * The timeout for requests of secrets to agents has been increased From 0a04b55491d98a3450cf1750ec96d4c4c819fa5b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 23 Aug 2016 22:46:35 +0200 Subject: [PATCH 29/35] NEWS: update --- NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 98847c1626..c5950d390b 100644 --- a/NEWS +++ b/NEWS @@ -18,7 +18,7 @@ This is a new stable release of NetworkManager. Notable changes include: * NetworkManager now follows symlinks when accessing resolv.conf and rc-manager is set to 'file' * Added support for oFono as modem manager -* The devices now exposes counters of transferred data. +* The devices now exposes counters of transferred data * The 'may-fail' property of ipv4 and ipv6 settings is now respected more accurately * The timeout for requests of secrets to agents has been increased @@ -38,7 +38,7 @@ This is a new stable release of NetworkManager. Notable changes include: executable size * Added a new 'VPN_PLUGIN' logging domain * It is now possible to change the configuration currently applied on - a device with 'nmcli device modify' + a device with 'nmcli device modify' and 'nmcli device reapply' * nmcli invoked without parameters shows an overview of the current network configuration * The 'nmcli connection add' syntax has been extended and is now From 4f6fd1bf0ed57abe3e208664a4de23ee11c67f57 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 24 Aug 2016 10:30:24 +0200 Subject: [PATCH 30/35] device/team: fix assuming non-NULL team-config in NMDeviceTeam::act_stage1_prepare() --- src/devices/team/nm-device-team.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c index d32d3cc9b0..09eefe7014 100644 --- a/src/devices/team/nm-device-team.c +++ b/src/devices/team/nm-device-team.c @@ -575,7 +575,7 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) * have a PID, then we must fail. */ cfg = teamdctl_config_get_raw (priv->tdc); - if (cfg && strcmp (cfg, nm_setting_team_get_config (s_team)) == 0) { + if (cfg && nm_streq0 (cfg, nm_setting_team_get_config (s_team))) { _LOGD (LOGD_TEAM, "using existing matching teamd config"); return NM_ACT_STAGE_RETURN_SUCCESS; } From 0fc8b856c37374daaf3ec4d95e25e2e670d8d3f5 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 1 Aug 2016 18:48:15 +0200 Subject: [PATCH 31/35] libnm-core/team: treat "" team config as no config https://bugzilla.redhat.com/show_bug.cgi?id=1366300 --- libnm-core/nm-connection.c | 34 +++++++++++++++++++++++++++++++ libnm-core/nm-setting-team-port.c | 22 +++++++++++--------- libnm-core/nm-setting-team.c | 3 ++- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c index 2fd3401c0c..57f964095e 100644 --- a/libnm-core/nm-connection.c +++ b/libnm-core/nm-connection.c @@ -907,6 +907,38 @@ _normalize_wireless_mac_address_randomization (NMConnection *self, GHashTable *p return FALSE; } +static gboolean +_normalize_team_config (NMConnection *self, GHashTable *parameters) +{ + NMSettingTeam *s_team = nm_connection_get_setting_team (self); + + if (s_team) { + const char *config = nm_setting_team_get_config (s_team); + + if (config && !*config) { + g_object_set (s_team, NM_SETTING_TEAM_CONFIG, NULL, NULL); + return TRUE; + } + } + return FALSE; +} + +static gboolean +_normalize_team_port_config (NMConnection *self, GHashTable *parameters) +{ + NMSettingTeamPort *s_team_port = nm_connection_get_setting_team_port (self); + + if (s_team_port) { + const char *config = nm_setting_team_port_get_config (s_team_port); + + if (config && !*config) { + g_object_set (s_team_port, NM_SETTING_TEAM_PORT_CONFIG, NULL, NULL); + return TRUE; + } + } + return FALSE; +} + /** * nm_connection_verify: * @connection: the #NMConnection to verify @@ -1150,6 +1182,8 @@ nm_connection_normalize (NMConnection *connection, was_modified |= _normalize_infiniband_mtu (connection, parameters); was_modified |= _normalize_bond_mode (connection, parameters); was_modified |= _normalize_wireless_mac_address_randomization (connection, parameters); + was_modified |= _normalize_team_config (connection, parameters); + was_modified |= _normalize_team_port_config (connection, parameters); /* Verify anew. */ success = _nm_connection_verify (connection, error); diff --git a/libnm-core/nm-setting-team-port.c b/libnm-core/nm-setting-team-port.c index 8d570c9e1c..123304fee6 100644 --- a/libnm-core/nm-setting-team-port.c +++ b/libnm-core/nm-setting-team-port.c @@ -87,16 +87,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) { NMSettingTeamPortPrivate *priv = NM_SETTING_TEAM_PORT_GET_PRIVATE (setting); - if (priv->config) { - if (!_nm_utils_check_valid_json (priv->config, error)) { - g_prefix_error (error, - "%s.%s: ", - NM_SETTING_TEAM_PORT_SETTING_NAME, - NM_SETTING_TEAM_PORT_CONFIG); - return FALSE; - } - } - if (connection) { NMSettingConnection *s_con; const char *slave_type; @@ -125,6 +115,18 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } } + + if (priv->config) { + if (!_nm_utils_check_valid_json (priv->config, error)) { + g_prefix_error (error, + "%s.%s: ", + NM_SETTING_TEAM_PORT_SETTING_NAME, + NM_SETTING_TEAM_PORT_CONFIG); + /* We treat an empty string as no config for compatibility. */ + return *priv->config ? FALSE : NM_SETTING_VERIFY_NORMALIZABLE; + } + } + return TRUE; } diff --git a/libnm-core/nm-setting-team.c b/libnm-core/nm-setting-team.c index 36cd312b6e..df89694f66 100644 --- a/libnm-core/nm-setting-team.c +++ b/libnm-core/nm-setting-team.c @@ -94,7 +94,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) "%s.%s: ", NM_SETTING_TEAM_SETTING_NAME, NM_SETTING_TEAM_CONFIG); - return FALSE; + /* We treat an empty string as no config for compatibility. */ + return *priv->config ? FALSE : NM_SETTING_VERIFY_NORMALIZABLE; } } From 476810c29016d569ac3885542a6c91e7af8a7f6d Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 24 Aug 2016 09:59:06 +0200 Subject: [PATCH 32/35] libnm-core/team: normalize invalid config to NULL A user may very well have connections on disk with bogus json. Such connections may have failed to activate before, but rejecting them now as invalid means that we stop loading them from disk. That is, they disappear after upgrade. Instead of doing that, also accept invalid json (beside "") and normalize/coerce it to NULL. https://bugzilla.redhat.com/show_bug.cgi?id=1366300 --- libnm-core/nm-connection.c | 5 +++-- libnm-core/nm-setting-team-port.c | 12 ++++++++++-- libnm-core/nm-setting-team.c | 12 ++++++++++-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c index 57f964095e..f39d41c58e 100644 --- a/libnm-core/nm-connection.c +++ b/libnm-core/nm-connection.c @@ -28,6 +28,7 @@ #include "nm-connection.h" #include "nm-connection-private.h" #include "nm-utils.h" +#include "nm-utils-private.h" #include "nm-setting-private.h" #include "nm-core-internal.h" @@ -915,7 +916,7 @@ _normalize_team_config (NMConnection *self, GHashTable *parameters) if (s_team) { const char *config = nm_setting_team_get_config (s_team); - if (config && !*config) { + if (config && !_nm_utils_check_valid_json (config, NULL)) { g_object_set (s_team, NM_SETTING_TEAM_CONFIG, NULL, NULL); return TRUE; } @@ -931,7 +932,7 @@ _normalize_team_port_config (NMConnection *self, GHashTable *parameters) if (s_team_port) { const char *config = nm_setting_team_port_get_config (s_team_port); - if (config && !*config) { + if (config && !_nm_utils_check_valid_json (config, NULL)) { g_object_set (s_team_port, NM_SETTING_TEAM_PORT_CONFIG, NULL, NULL); return TRUE; } diff --git a/libnm-core/nm-setting-team-port.c b/libnm-core/nm-setting-team-port.c index 123304fee6..0d175d5ebd 100644 --- a/libnm-core/nm-setting-team-port.c +++ b/libnm-core/nm-setting-team-port.c @@ -122,11 +122,19 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) "%s.%s: ", NM_SETTING_TEAM_PORT_SETTING_NAME, NM_SETTING_TEAM_PORT_CONFIG); - /* We treat an empty string as no config for compatibility. */ - return *priv->config ? FALSE : NM_SETTING_VERIFY_NORMALIZABLE; + /* for backward compatibility, we accept invalid json and normalize it */ + if (!priv->config[0]) { + /* be more forgiving to "" and let it verify() as valid because + * at least anaconda used to write such configs */ + return NM_SETTING_VERIFY_NORMALIZABLE; + } + return NM_SETTING_VERIFY_NORMALIZABLE_ERROR; } } + /* NOTE: normalizable/normalizable-errors must appear at the end with decreasing severity. + * Take care to properly order statements with priv->config above. */ + return TRUE; } diff --git a/libnm-core/nm-setting-team.c b/libnm-core/nm-setting-team.c index df89694f66..a559e0db78 100644 --- a/libnm-core/nm-setting-team.c +++ b/libnm-core/nm-setting-team.c @@ -94,11 +94,19 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) "%s.%s: ", NM_SETTING_TEAM_SETTING_NAME, NM_SETTING_TEAM_CONFIG); - /* We treat an empty string as no config for compatibility. */ - return *priv->config ? FALSE : NM_SETTING_VERIFY_NORMALIZABLE; + /* for backward compatibility, we accept invalid json and normalize it */ + if (!priv->config[0]) { + /* be more forgiving to "" and let it verify() as valid because + * at least anaconda used to write such configs */ + return NM_SETTING_VERIFY_NORMALIZABLE; + } + return NM_SETTING_VERIFY_NORMALIZABLE_ERROR; } } + /* NOTE: normalizable/normalizable-errors must appear at the end with decreasing severity. + * Take care to properly order statements with priv->config above. */ + return TRUE; } From 195ad4ec976bc017b80bfbec80b2cd67d7b8dbdc Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 24 Aug 2016 15:33:34 +0200 Subject: [PATCH 33/35] cli: default to method=manual when adding an address This restores accidentally changed behavior for "nmcli c add ... ip[46]
" Fixes: c5324ed285aff7d6d58212e4b030a0fc556eb43b --- clients/cli/connections.c | 45 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/clients/cli/connections.c b/clients/cli/connections.c index bb4c51cb8c..f659b12cb0 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -4117,6 +4117,45 @@ set_yes_no (NmCli *nmc, NMConnection *con, OptionInfo *option, const char *value return set_property (con, option->setting_name, option->property, value, '\0', error); } +static gboolean +set_ip4_address (NmCli *nmc, NMConnection *con, OptionInfo *option, const char *value, GError **error) +{ + NMSettingIPConfig *s_ip4; + + if (!value) + return TRUE; + + s_ip4 = nm_connection_get_setting_ip4_config (con); + if (!s_ip4) { + s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new (); + nm_connection_add_setting (con, NM_SETTING (s_ip4)); + g_object_set (s_ip4, + NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, + NULL); + } + return set_property (con, option->setting_name, option->property, value, '\0', error); +} + +static gboolean +set_ip6_address (NmCli *nmc, NMConnection *con, OptionInfo *option, const char *value, GError **error) +{ + NMSettingIPConfig *s_ip6; + + if (!value) + return TRUE; + + s_ip6 = nm_connection_get_setting_ip6_config (con); + if (!s_ip6) { + s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new (); + nm_connection_add_setting (con, NM_SETTING (s_ip6)); + g_object_set (s_ip6, + NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL, + NULL); + } + return set_property (con, option->setting_name, option->property, value, '\0', error); +} + + /*----------------------------------------------------------------------------*/ static OptionInfo option_info[] = { @@ -4230,9 +4269,11 @@ static OptionInfo option_info[] = { { NM_SETTING_IP_TUNNEL_SETTING_NAME, NM_SETTING_IP_TUNNEL_LOCAL, "local", OPTION_NONE, N_("Local endpoint [none]"), NULL, NULL, NULL }, { NM_SETTING_IP_TUNNEL_SETTING_NAME, NM_SETTING_IP_TUNNEL_REMOTE, "remote", OPTION_REQD, N_("Remote"), NULL, NULL, NULL }, { NM_SETTING_IP_TUNNEL_SETTING_NAME, NM_SETTING_IP_TUNNEL_PARENT, "dev", OPTION_NONE, N_("Parent device [none]"), NULL, NULL, NULL }, - { NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES, "ip4", OPTION_MULTI, N_("IPv4 address (IP[/plen]) [none]"), NULL, NULL, NULL }, + { NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES, "ip4", OPTION_MULTI, N_("IPv4 address (IP[/plen]) [none]"), NULL, + set_ip4_address, NULL }, { NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_GATEWAY, "gw4", OPTION_NONE, N_("IPv4 gateway [none]"), NULL, NULL, NULL }, - { NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES, "ip6", OPTION_MULTI, N_("IPv6 address (IP[/plen]) [none]"), NULL, NULL, NULL }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES, "ip6", OPTION_MULTI, N_("IPv6 address (IP[/plen]) [none]"), NULL, + set_ip6_address, NULL }, { NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_GATEWAY, "gw6", OPTION_NONE, N_("IPv6 gateway [none]"), NULL, NULL, NULL }, { NULL, NULL, NULL, OPTION_NONE, NULL, NULL, NULL, NULL }, }; From 79c81bbb8cf5903462caf9f60e1bca4a22f3280f Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 24 Aug 2016 15:01:03 +0200 Subject: [PATCH 34/35] cli: only connect handlers for property changes in interactive edit Fixes: c5324ed285aff7d6d58212e4b030a0fc556eb43b --- clients/cli/connections.c | 8 ++++++++ clients/cli/settings.c | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/clients/cli/connections.c b/clients/cli/connections.c index f659b12cb0..ea7c8a79df 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -7045,6 +7045,14 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t break; } nmc_setting_custom_init (setting); + + if (NM_IS_SETTING_WIRELESS (setting)) + nmc_setting_wireless_connect_handlers (NM_SETTING_WIRELESS (setting)); + else if (NM_IS_SETTING_IP4_CONFIG (setting)) + nmc_setting_ip4_connect_handlers (NM_SETTING_IP_CONFIG (setting)); + else if (NM_IS_SETTING_IP6_CONFIG (setting)) + nmc_setting_ip6_connect_handlers (NM_SETTING_IP_CONFIG (setting)); + nm_connection_add_setting (connection, setting); } /* Set global variable for use in TAB completion */ diff --git a/clients/cli/settings.c b/clients/cli/settings.c index feed51ce7e..ee167d2c6a 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -2447,7 +2447,6 @@ nmc_setting_custom_init (NMSetting *setting) g_object_set (NM_SETTING_WIRELESS (setting), NM_SETTING_WIRELESS_MODE, NM_SETTING_WIRELESS_MODE_INFRA, NULL); - nmc_setting_wireless_connect_handlers (NM_SETTING_WIRELESS (setting)); } else if (NM_IS_SETTING_ADSL (setting)) { /* Initialize a protocol */ g_object_set (NM_SETTING_ADSL (setting), @@ -2457,12 +2456,10 @@ nmc_setting_custom_init (NMSetting *setting) g_object_set (NM_SETTING_IP_CONFIG (setting), NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); - nmc_setting_ip4_connect_handlers (NM_SETTING_IP_CONFIG (setting)); } else if (NM_IS_SETTING_IP6_CONFIG (setting)) { g_object_set (NM_SETTING_IP_CONFIG (setting), NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL); - nmc_setting_ip6_connect_handlers (NM_SETTING_IP_CONFIG (setting)); } else if (NM_IS_SETTING_TUN (setting)) { g_object_set (NM_SETTING_TUN (setting), NM_SETTING_TUN_MODE, NM_SETTING_TUN_MODE_TUN, From bdaa3acfc30b789e45f79934e1c3c8c3428d7864 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 24 Aug 2016 14:57:35 +0200 Subject: [PATCH 35/35] dhcp/systemd: honor timeout for DHCPv6 https://bugzilla.gnome.org/show_bug.cgi?id=770329 --- src/dhcp-manager/nm-dhcp-systemd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dhcp-manager/nm-dhcp-systemd.c b/src/dhcp-manager/nm-dhcp-systemd.c index a28cb8a5a7..ac8eb60a3a 100644 --- a/src/dhcp-manager/nm-dhcp-systemd.c +++ b/src/dhcp-manager/nm-dhcp-systemd.c @@ -960,6 +960,8 @@ ip6_start (NMDhcpClient *client, goto error; } + nm_dhcp_client_start_timeout (client); + return TRUE; error: