diff options
Diffstat (limited to 'libnm-glib')
| -rw-r--r-- | libnm-glib/Makefile.am | 2 | ||||
| -rw-r--r-- | libnm-glib/Makefile.in | 70 | ||||
| -rw-r--r-- | libnm-glib/libnm-glib.ver | 1 | ||||
| -rw-r--r-- | libnm-glib/nm-device-adsl.c | 2 | ||||
| -rw-r--r-- | libnm-glib/nm-device-bond.c | 49 | ||||
| -rw-r--r-- | libnm-glib/nm-device-bond.h | 6 | ||||
| -rw-r--r-- | libnm-glib/nm-device.c | 43 | ||||
| -rw-r--r-- | libnm-glib/nm-object.c | 2 | ||||
| -rw-r--r-- | libnm-glib/nm-secret-agent.h | 2 | ||||
| -rw-r--r-- | libnm-glib/tests/Makefile.in | 24 |
10 files changed, 168 insertions, 33 deletions
diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index 4d122c17..600b0405 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -146,7 +146,7 @@ libnm_glib_la_LIBADD = \ SYMBOL_VIS_FILE=$(srcdir)/libnm-glib.ver libnm_glib_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \ - -version-info "7:0:3" + -version-info "8:0:4" noinst_PROGRAMS = libnm-glib-test diff --git a/libnm-glib/Makefile.in b/libnm-glib/Makefile.in index 4718b812..c2a76652 100644 --- a/libnm-glib/Makefile.in +++ b/libnm-glib/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -19,6 +19,23 @@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -237,6 +254,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac DATA = $(gir_DATA) $(pkgconfig_DATA) $(typelib_DATA) HEADERS = $(libdeprecated_HEADERS) $(libnminclude_HEADERS) \ $(libnmvpn_HEADERS) @@ -645,7 +667,7 @@ libnm_glib_la_LIBADD = \ SYMBOL_VIS_FILE = $(srcdir)/libnm-glib.ver libnm_glib_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \ - -version-info "7:0:3" + -version-info "8:0:4" libnm_glib_test_SOURCES = libnm-glib-test.c libnm_glib_test_CFLAGS = $(GIO_CFLAGS) $(DBUS_CFLAGS) @@ -742,7 +764,6 @@ libnm-glib-vpn.pc: $(top_builddir)/config.status $(srcdir)/libnm-glib-vpn.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -750,6 +771,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } @@ -1342,8 +1365,11 @@ clean-libtool: -rm -rf .libs _libs install-girDATA: $(gir_DATA) @$(NORMAL_INSTALL) - test -z "$(girdir)" || $(MKDIR_P) "$(DESTDIR)$(girdir)" @list='$(gir_DATA)'; test -n "$(girdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(girdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(girdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1360,8 +1386,11 @@ uninstall-girDATA: dir='$(DESTDIR)$(girdir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1378,8 +1407,11 @@ uninstall-pkgconfigDATA: dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-typelibDATA: $(typelib_DATA) @$(NORMAL_INSTALL) - test -z "$(typelibdir)" || $(MKDIR_P) "$(DESTDIR)$(typelibdir)" @list='$(typelib_DATA)'; test -n "$(typelibdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(typelibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(typelibdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1396,8 +1428,11 @@ uninstall-typelibDATA: dir='$(DESTDIR)$(typelibdir)'; $(am__uninstall_files_from_dir) install-libdeprecatedHEADERS: $(libdeprecated_HEADERS) @$(NORMAL_INSTALL) - test -z "$(libdeprecateddir)" || $(MKDIR_P) "$(DESTDIR)$(libdeprecateddir)" @list='$(libdeprecated_HEADERS)'; test -n "$(libdeprecateddir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdeprecateddir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdeprecateddir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1414,8 +1449,11 @@ uninstall-libdeprecatedHEADERS: dir='$(DESTDIR)$(libdeprecateddir)'; $(am__uninstall_files_from_dir) install-libnmincludeHEADERS: $(libnminclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(libnmincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libnmincludedir)" @list='$(libnminclude_HEADERS)'; test -n "$(libnmincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libnmincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libnmincludedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1432,8 +1470,11 @@ uninstall-libnmincludeHEADERS: dir='$(DESTDIR)$(libnmincludedir)'; $(am__uninstall_files_from_dir) install-libnmvpnHEADERS: $(libnmvpn_HEADERS) @$(NORMAL_INSTALL) - test -z "$(libnmvpndir)" || $(MKDIR_P) "$(DESTDIR)$(libnmvpndir)" @list='$(libnmvpn_HEADERS)'; test -n "$(libnmvpndir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libnmvpndir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libnmvpndir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1616,13 +1657,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index 4bcbfb0d..b063ffac 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -67,6 +67,7 @@ global: nm_device_bond_error_quark; nm_device_bond_get_carrier; nm_device_bond_get_hw_address; + nm_device_bond_get_slaves; nm_device_bond_get_type; nm_device_bond_new; nm_device_bt_error_get_type; diff --git a/libnm-glib/nm-device-adsl.c b/libnm-glib/nm-device-adsl.c index 67aad9e8..bef3ceae 100644 --- a/libnm-glib/nm-device-adsl.c +++ b/libnm-glib/nm-device-adsl.c @@ -72,7 +72,7 @@ nm_device_adsl_error_quark (void) * * Creates a new #NMDeviceAdsl. * - * Returns: a new device + * Returns: (transfer full): a new device **/ GObject * nm_device_adsl_new (DBusGConnection *connection, const char *path) diff --git a/libnm-glib/nm-device-bond.c b/libnm-glib/nm-device-bond.c index d5e33e50..1d163c5e 100644 --- a/libnm-glib/nm-device-bond.c +++ b/libnm-glib/nm-device-bond.c @@ -33,6 +33,7 @@ #include "nm-device-bond.h" #include "nm-device-private.h" #include "nm-object-private.h" +#include "nm-types.h" G_DEFINE_TYPE (NMDeviceBond, nm_device_bond, NM_TYPE_DEVICE) @@ -43,18 +44,21 @@ typedef struct { char *hw_address; gboolean carrier; + GPtrArray *slaves; } NMDeviceBondPrivate; enum { PROP_0, PROP_HW_ADDRESS, PROP_CARRIER, + PROP_SLAVES, LAST_PROP }; #define DBUS_PROP_HW_ADDRESS "HwAddress" #define DBUS_PROP_CARRIER "Carrier" +#define DBUS_PROP_SLAVES "Slaves" /** * nm_device_bond_error_quark: @@ -133,6 +137,27 @@ nm_device_bond_get_carrier (NMDeviceBond *device) return NM_DEVICE_BOND_GET_PRIVATE (device)->carrier; } +/** + * nm_device_bond_get_slaves: + * @device: a #NMDeviceBond + * + * Gets the devices currently slaved to @device. + * + * Returns: (element-type NMClient.Device): the #GPtrArray containing + * #NMDevice<!-- -->s that are slaves of @device. This is the internal + * copy used by the device, and must not be modified. + * + * Since: 0.9.6.4 + **/ +const GPtrArray * +nm_device_bond_get_slaves (NMDeviceBond *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_BOND (device), FALSE); + + _nm_object_ensure_inited (NM_OBJECT (device)); + return handle_ptr_array_return (NM_DEVICE_BOND_GET_PRIVATE (device)->slaves); +} + static gboolean connection_compatible (NMDevice *device, NMConnection *connection, GError **error) { @@ -167,7 +192,7 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro return FALSE; } - /* FIXME: check slaves? But we can't... */ + /* FIXME: check slaves? */ return TRUE; } @@ -187,6 +212,7 @@ register_properties (NMDeviceBond *device) const NMPropertiesInfo property_info[] = { { NM_DEVICE_BOND_HW_ADDRESS, &priv->hw_address }, { NM_DEVICE_BOND_CARRIER, &priv->carrier }, + { NM_DEVICE_BOND_SLAVES, &priv->slaves, NULL, NM_TYPE_DEVICE }, { NULL }, }; @@ -219,6 +245,12 @@ dispose (GObject *object) g_clear_object (&priv->proxy); + if (priv->slaves) { + g_ptr_array_foreach (priv->slaves, (GFunc) g_object_unref, NULL); + g_ptr_array_free (priv->slaves, TRUE); + priv->slaves = NULL; + } + G_OBJECT_CLASS (nm_device_bond_parent_class)->dispose (object); } @@ -249,6 +281,9 @@ get_property (GObject *object, case PROP_CARRIER: g_value_set_boolean (value, nm_device_bond_get_carrier (device)); break; + case PROP_SLAVES: + g_value_set_boxed (value, nm_device_bond_get_slaves (device)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -298,4 +333,16 @@ nm_device_bond_class_init (NMDeviceBondClass *eth_class) FALSE, G_PARAM_READABLE)); + /** + * NMDeviceBond:slaves: + * + * The devices (#NMDevice) slaved to the bond device. + **/ + g_object_class_install_property + (object_class, PROP_SLAVES, + g_param_spec_boxed (NM_DEVICE_BOND_SLAVES, + "Slaves", + "Slaves", + NM_TYPE_OBJECT_ARRAY, + G_PARAM_READABLE)); } diff --git a/libnm-glib/nm-device-bond.h b/libnm-glib/nm-device-bond.h index 61ff3826..a495689a 100644 --- a/libnm-glib/nm-device-bond.h +++ b/libnm-glib/nm-device-bond.h @@ -53,6 +53,7 @@ GQuark nm_device_bond_error_quark (void); #define NM_DEVICE_BOND_HW_ADDRESS "hw-address" #define NM_DEVICE_BOND_CARRIER "carrier" +#define NM_DEVICE_BOND_SLAVES "slaves" typedef struct { NMDevice parent; @@ -74,8 +75,9 @@ GType nm_device_bond_get_type (void); GObject *nm_device_bond_new (DBusGConnection *connection, const char *path); -const char * nm_device_bond_get_hw_address (NMDeviceBond *device); -gboolean nm_device_bond_get_carrier (NMDeviceBond *device); +const char *nm_device_bond_get_hw_address (NMDeviceBond *device); +gboolean nm_device_bond_get_carrier (NMDeviceBond *device); +const GPtrArray *nm_device_bond_get_slaves (NMDeviceBond *device); G_END_DECLS diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index fc334003..865fc088 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -184,6 +184,27 @@ register_properties (NMDevice *device) property_info); } +typedef struct { + NMDeviceState old_state; + NMDeviceState new_state; + NMDeviceStateReason reason; +} StateChangeData; + +static void +device_state_change_reloaded (GObject *object, + GAsyncResult *result, + gpointer user_data) +{ + NMDevice *self = NM_DEVICE (object); + StateChangeData *data = user_data; + + _nm_object_reload_properties_finish (NM_OBJECT (object), result, NULL); + + g_signal_emit (self, signals[STATE_CHANGED], 0, + data->new_state, data->old_state, data->reason); + g_slice_free (StateChangeData, data); +} + static void device_state_changed (DBusGProxy *proxy, NMDeviceState new_state, @@ -191,17 +212,21 @@ device_state_changed (DBusGProxy *proxy, NMDeviceStateReason reason, gpointer user_data) { - NMDevice *self = NM_DEVICE (user_data); - if (old_state != new_state) { - /* Update state here since the PropertyChanged signal for state - * might come in a bit later, but a client might ask for the - * state via nm_device_get_state() as a result of this signal. - * When the PC signal does come in that will trigger the glib - * property notify signal so we don't need to do that here. + StateChangeData *data; + + /* Our object-valued properties (eg, ip4_config) will still + * have their old values at this point, because NMObject is + * in the process of asynchronously reading the new values. + * Wait for that to finish before emitting the signal. */ - NM_DEVICE_GET_PRIVATE (self)->state = new_state; - g_signal_emit (self, signals[STATE_CHANGED], 0, new_state, old_state, reason); + data = g_slice_new (StateChangeData); + data->old_state = old_state; + data->new_state = new_state; + data->reason = reason; + _nm_object_reload_properties_async (NM_OBJECT (user_data), + device_state_change_reloaded, + data); } } diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c index cba38775..af659bd1 100644 --- a/libnm-glib/nm-object.c +++ b/libnm-glib/nm-object.c @@ -1318,7 +1318,7 @@ reload_complete (NMObject *object) priv->reload_error = NULL; for (iter = results; iter; iter = iter->next) { - simple = results->data; + simple = iter->data; if (error) g_simple_async_result_set_from_error (simple, error); diff --git a/libnm-glib/nm-secret-agent.h b/libnm-glib/nm-secret-agent.h index 50fc64ef..6aa72438 100644 --- a/libnm-glib/nm-secret-agent.h +++ b/libnm-glib/nm-secret-agent.h @@ -132,7 +132,7 @@ typedef struct { * NM_SETTING_WIRELESS_SECURITY_PSK, "my really cool PSK", * NULL); * nm_connection_add_setting (secrets, NM_SETTING (s_wsec)); - * secrets_hash = nm_connection_to_hash (secrets); + * secrets_hash = nm_connection_to_hash (secrets, NM_SETTING_HASH_FLAG_ALL); * * (call the NMSecretAgentGetSecretsFunc with secrets_hash) * diff --git a/libnm-glib/tests/Makefile.in b/libnm-glib/tests/Makefile.in index bc876b88..d44c3db1 100644 --- a/libnm-glib/tests/Makefile.in +++ b/libnm-glib/tests/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -16,6 +16,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -95,6 +112,11 @@ am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(test_remote_settings_client_SOURCES) DIST_SOURCES = $(test_remote_settings_client_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |