diff options
Diffstat (limited to 'libnm-glib')
84 files changed, 1893 insertions, 2962 deletions
diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index 623bf45d..20a24811 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -4,7 +4,6 @@ SUBDIRS = . tests AM_CPPFLAGS = \ -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ -I$(top_srcdir)/libnm-util \ -I$(top_builddir)/libnm-util \ -DG_LOG_DOMAIN=\""libnm-glib"\" \ @@ -18,8 +17,7 @@ BUILT_SOURCES = \ noinst_LTLIBRARIES = \ - libdeprecated-nm-glib.la \ - libnm-glib-test.la + libdeprecated-nm-glib.la ##################################################### # Deprecated original libnm_glib bits @@ -153,7 +151,7 @@ libnm_glib_la_LIBADD = \ SYMBOL_VIS_FILE=$(srcdir)/libnm-glib.ver libnm_glib_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \ - -version-info "12:0:8" + -version-info "13:0:9" noinst_PROGRAMS = libnm-glib-test @@ -177,27 +175,6 @@ libnm_glib_vpn_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib-vpn.ver \ BUILT_SOURCES += $(GLIB_GENERATED) ##################################################### -# Test libnm-glib stuff -##################################################### - -libnm_glib_test_la_CFLAGS = \ - $(GLIB_CFLAGS) \ - $(DBUS_CFLAGS) \ - $(GUDEV_CFLAGS) \ - -DLIBNM_GLIB_TEST \ - -DNMRUNDIR=\"$(nmrundir)\" - -libnm_glib_test_la_SOURCES = \ - $(libnminclude_HEADERS) \ - $(libnm_glib_la_SOURCES) - -libnm_glib_test_la_LIBADD = \ - $(top_builddir)/libnm-util/libnm-util.la \ - $(GLIB_LIBS) \ - $(DBUS_LIBS) \ - $(GUDEV_LIBS) - -##################################################### nm-vpn-plugin-glue.h: $(top_srcdir)/introspection/nm-vpn-plugin.xml $(AM_V_GEN) dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-server --output=$@ $< diff --git a/libnm-glib/Makefile.in b/libnm-glib/Makefile.in index 4b169f40..a6c5d03a 100644 --- a/libnm-glib/Makefile.in +++ b/libnm-glib/Makefile.in @@ -152,48 +152,6 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -libnm_glib_test_la_DEPENDENCIES = \ - $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -am__objects_1 = -am__objects_2 = libnm_glib_test_la-nm-object.lo \ - libnm_glib_test_la-nm-dbus-helpers.lo \ - libnm_glib_test_la-nm-client.lo \ - libnm_glib_test_la-nm-device.lo \ - libnm_glib_test_la-nm-device-ethernet.lo \ - libnm_glib_test_la-nm-device-infiniband.lo \ - libnm_glib_test_la-nm-device-adsl.lo \ - libnm_glib_test_la-nm-device-wifi.lo \ - libnm_glib_test_la-nm-device-bt.lo \ - libnm_glib_test_la-nm-device-olpc-mesh.lo \ - libnm_glib_test_la-nm-device-bond.lo \ - libnm_glib_test_la-nm-device-team.lo \ - libnm_glib_test_la-nm-device-bridge.lo \ - libnm_glib_test_la-nm-device-vlan.lo \ - libnm_glib_test_la-nm-device-generic.lo \ - libnm_glib_test_la-nm-access-point.lo \ - libnm_glib_test_la-nm-ip4-config.lo \ - libnm_glib_test_la-nm-device-modem.lo \ - libnm_glib_test_la-nm-vpn-connection.lo \ - libnm_glib_test_la-nm-types.lo \ - libnm_glib_test_la-nm-object-cache.lo \ - libnm_glib_test_la-nm-active-connection.lo \ - libnm_glib_test_la-nm-dhcp4-config.lo \ - libnm_glib_test_la-nm-ip6-config.lo \ - libnm_glib_test_la-nm-dhcp6-config.lo \ - libnm_glib_test_la-nm-remote-connection.lo \ - libnm_glib_test_la-nm-remote-settings.lo \ - libnm_glib_test_la-nm-secret-agent.lo \ - libnm_glib_test_la-nm-device-wimax.lo \ - libnm_glib_test_la-nm-wimax-nsp.lo \ - libnm_glib_test_la-nm-glib-enum-types.lo -am__objects_3 = $(am__objects_2) $(am__objects_1) -am_libnm_glib_test_la_OBJECTS = $(am__objects_1) $(am__objects_3) -libnm_glib_test_la_OBJECTS = $(am_libnm_glib_test_la_OBJECTS) -libnm_glib_test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(libnm_glib_test_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ libnm_glib_vpn_la_DEPENDENCIES = \ $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) @@ -209,7 +167,7 @@ libnm_glib_vpn_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ libnm_glib_la_DEPENDENCIES = $(top_builddir)/libnm-util/libnm-util.la \ $(builddir)/libdeprecated-nm-glib.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -am__objects_4 = libnm_glib_la-nm-object.lo \ +am__objects_1 = libnm_glib_la-nm-object.lo \ libnm_glib_la-nm-dbus-helpers.lo libnm_glib_la-nm-client.lo \ libnm_glib_la-nm-device.lo libnm_glib_la-nm-device-ethernet.lo \ libnm_glib_la-nm-device-infiniband.lo \ @@ -235,7 +193,8 @@ am__objects_4 = libnm_glib_la-nm-object.lo \ libnm_glib_la-nm-secret-agent.lo \ libnm_glib_la-nm-device-wimax.lo libnm_glib_la-nm-wimax-nsp.lo \ libnm_glib_la-nm-glib-enum-types.lo -am_libnm_glib_la_OBJECTS = $(am__objects_4) $(am__objects_1) +am__objects_2 = +am_libnm_glib_la_OBJECTS = $(am__objects_1) $(am__objects_2) libnm_glib_la_OBJECTS = $(am_libnm_glib_la_OBJECTS) libnm_glib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libnm_glib_la_CFLAGS) \ @@ -286,11 +245,11 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libdeprecated_nm_glib_la_SOURCES) \ - $(libnm_glib_test_la_SOURCES) $(libnm_glib_vpn_la_SOURCES) \ - $(libnm_glib_la_SOURCES) $(libnm_glib_test_SOURCES) + $(libnm_glib_vpn_la_SOURCES) $(libnm_glib_la_SOURCES) \ + $(libnm_glib_test_SOURCES) DIST_SOURCES = $(libdeprecated_nm_glib_la_SOURCES) \ - $(libnm_glib_test_la_SOURCES) $(libnm_glib_vpn_la_SOURCES) \ - $(libnm_glib_la_SOURCES) $(libnm_glib_test_SOURCES) + $(libnm_glib_vpn_la_SOURCES) $(libnm_glib_la_SOURCES) \ + $(libnm_glib_test_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -370,6 +329,8 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BLUEZ5_CFLAGS = @BLUEZ5_CFLAGS@ +BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -493,6 +454,7 @@ NEWT_CFLAGS = @NEWT_CFLAGS@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ +NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -512,6 +474,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -538,7 +501,7 @@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ -UDEV_BASE_DIR = @UDEV_BASE_DIR@ +UDEV_DIR = @UDEV_DIR@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ @@ -620,7 +583,6 @@ with_valgrind = @with_valgrind@ SUBDIRS = . tests AM_CPPFLAGS = \ -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ -I$(top_srcdir)/libnm-util \ -I$(top_builddir)/libnm-util \ -DG_LOG_DOMAIN=\""libnm-glib"\" \ @@ -631,8 +593,7 @@ AM_CPPFLAGS = \ BUILT_SOURCES = nm-vpn-plugin-glue.h nm-secret-agent-glue.h \ $(GLIB_GENERATED) noinst_LTLIBRARIES = \ - libdeprecated-nm-glib.la \ - libnm-glib-test.la + libdeprecated-nm-glib.la ##################################################### @@ -762,7 +723,7 @@ libnm_glib_la_LIBADD = \ SYMBOL_VIS_FILE = $(srcdir)/libnm-glib.ver libnm_glib_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \ - -version-info "12:0:8" + -version-info "13:0:9" libnm_glib_test_SOURCES = libnm-glib-test.c libnm_glib_test_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS) @@ -779,27 +740,6 @@ libnm_glib_vpn_la_LIBADD = $(top_builddir)/libnm-util/libnm-util.la $(GLIB_LIBS) libnm_glib_vpn_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib-vpn.ver \ -version-info "3:0:2" - -##################################################### -# Test libnm-glib stuff -##################################################### -libnm_glib_test_la_CFLAGS = \ - $(GLIB_CFLAGS) \ - $(DBUS_CFLAGS) \ - $(GUDEV_CFLAGS) \ - -DLIBNM_GLIB_TEST \ - -DNMRUNDIR=\"$(nmrundir)\" - -libnm_glib_test_la_SOURCES = \ - $(libnminclude_HEADERS) \ - $(libnm_glib_la_SOURCES) - -libnm_glib_test_la_LIBADD = \ - $(top_builddir)/libnm-util/libnm-util.la \ - $(GLIB_LIBS) \ - $(DBUS_LIBS) \ - $(GUDEV_LIBS) - pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libnm-glib.pc libnm-glib-vpn.pc DISTCLEANFILES = libnm-glib.pc libnm-glib.pc @@ -908,9 +848,6 @@ clean-noinstLTLIBRARIES: libdeprecated-nm-glib.la: $(libdeprecated_nm_glib_la_OBJECTS) $(libdeprecated_nm_glib_la_DEPENDENCIES) $(EXTRA_libdeprecated_nm_glib_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libdeprecated_nm_glib_la_OBJECTS) $(libdeprecated_nm_glib_la_LIBADD) $(LIBS) -libnm-glib-test.la: $(libnm_glib_test_la_OBJECTS) $(libnm_glib_test_la_DEPENDENCIES) $(EXTRA_libnm_glib_test_la_DEPENDENCIES) - $(AM_V_CCLD)$(libnm_glib_test_la_LINK) $(libnm_glib_test_la_OBJECTS) $(libnm_glib_test_la_LIBADD) $(LIBS) - libnm-glib-vpn.la: $(libnm_glib_vpn_la_OBJECTS) $(libnm_glib_vpn_la_DEPENDENCIES) $(EXTRA_libnm_glib_vpn_la_DEPENDENCIES) $(AM_V_CCLD)$(libnm_glib_vpn_la_LINK) -rpath $(libdir) $(libnm_glib_vpn_la_OBJECTS) $(libnm_glib_vpn_la_LIBADD) $(LIBS) @@ -969,37 +906,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-vpn-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-wimax-nsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test-libnm-glib-test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-access-point.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-active-connection.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-client.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-dbus-helpers.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-adsl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-bond.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-bridge.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-bt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-ethernet.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-generic.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-infiniband.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-modem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-olpc-mesh.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-team.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-vlan.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-wifi.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device-wimax.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-device.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-dhcp4-config.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-dhcp6-config.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-glib-enum-types.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-ip4-config.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-ip6-config.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-object-cache.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-object.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-remote-connection.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-remote-settings.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-secret-agent.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-types.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-vpn-connection.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test_la-nm-wimax-nsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_vpn_la-nm-vpn-enum-types.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin-ui-interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin-utils.Plo@am__quote@ @@ -1033,223 +939,6 @@ libdeprecated_nm_glib_la-libnm_glib.lo: libnm_glib.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdeprecated_nm_glib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdeprecated_nm_glib_la-libnm_glib.lo `test -f 'libnm_glib.c' || echo '$(srcdir)/'`libnm_glib.c -libnm_glib_test_la-nm-object.lo: nm-object.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-object.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-object.Tpo -c -o libnm_glib_test_la-nm-object.lo `test -f 'nm-object.c' || echo '$(srcdir)/'`nm-object.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-object.Tpo $(DEPDIR)/libnm_glib_test_la-nm-object.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-object.c' object='libnm_glib_test_la-nm-object.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-object.lo `test -f 'nm-object.c' || echo '$(srcdir)/'`nm-object.c - -libnm_glib_test_la-nm-dbus-helpers.lo: nm-dbus-helpers.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-dbus-helpers.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-dbus-helpers.Tpo -c -o libnm_glib_test_la-nm-dbus-helpers.lo `test -f 'nm-dbus-helpers.c' || echo '$(srcdir)/'`nm-dbus-helpers.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-dbus-helpers.Tpo $(DEPDIR)/libnm_glib_test_la-nm-dbus-helpers.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-dbus-helpers.c' object='libnm_glib_test_la-nm-dbus-helpers.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-dbus-helpers.lo `test -f 'nm-dbus-helpers.c' || echo '$(srcdir)/'`nm-dbus-helpers.c - -libnm_glib_test_la-nm-client.lo: nm-client.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-client.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-client.Tpo -c -o libnm_glib_test_la-nm-client.lo `test -f 'nm-client.c' || echo '$(srcdir)/'`nm-client.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-client.Tpo $(DEPDIR)/libnm_glib_test_la-nm-client.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-client.c' object='libnm_glib_test_la-nm-client.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-client.lo `test -f 'nm-client.c' || echo '$(srcdir)/'`nm-client.c - -libnm_glib_test_la-nm-device.lo: nm-device.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device.Tpo -c -o libnm_glib_test_la-nm-device.lo `test -f 'nm-device.c' || echo '$(srcdir)/'`nm-device.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device.c' object='libnm_glib_test_la-nm-device.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device.lo `test -f 'nm-device.c' || echo '$(srcdir)/'`nm-device.c - -libnm_glib_test_la-nm-device-ethernet.lo: nm-device-ethernet.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-ethernet.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-ethernet.Tpo -c -o libnm_glib_test_la-nm-device-ethernet.lo `test -f 'nm-device-ethernet.c' || echo '$(srcdir)/'`nm-device-ethernet.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-ethernet.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-ethernet.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-ethernet.c' object='libnm_glib_test_la-nm-device-ethernet.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-ethernet.lo `test -f 'nm-device-ethernet.c' || echo '$(srcdir)/'`nm-device-ethernet.c - -libnm_glib_test_la-nm-device-infiniband.lo: nm-device-infiniband.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-infiniband.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-infiniband.Tpo -c -o libnm_glib_test_la-nm-device-infiniband.lo `test -f 'nm-device-infiniband.c' || echo '$(srcdir)/'`nm-device-infiniband.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-infiniband.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-infiniband.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-infiniband.c' object='libnm_glib_test_la-nm-device-infiniband.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-infiniband.lo `test -f 'nm-device-infiniband.c' || echo '$(srcdir)/'`nm-device-infiniband.c - -libnm_glib_test_la-nm-device-adsl.lo: nm-device-adsl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-adsl.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-adsl.Tpo -c -o libnm_glib_test_la-nm-device-adsl.lo `test -f 'nm-device-adsl.c' || echo '$(srcdir)/'`nm-device-adsl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-adsl.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-adsl.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-adsl.c' object='libnm_glib_test_la-nm-device-adsl.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-adsl.lo `test -f 'nm-device-adsl.c' || echo '$(srcdir)/'`nm-device-adsl.c - -libnm_glib_test_la-nm-device-wifi.lo: nm-device-wifi.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-wifi.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-wifi.Tpo -c -o libnm_glib_test_la-nm-device-wifi.lo `test -f 'nm-device-wifi.c' || echo '$(srcdir)/'`nm-device-wifi.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-wifi.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-wifi.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-wifi.c' object='libnm_glib_test_la-nm-device-wifi.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-wifi.lo `test -f 'nm-device-wifi.c' || echo '$(srcdir)/'`nm-device-wifi.c - -libnm_glib_test_la-nm-device-bt.lo: nm-device-bt.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-bt.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-bt.Tpo -c -o libnm_glib_test_la-nm-device-bt.lo `test -f 'nm-device-bt.c' || echo '$(srcdir)/'`nm-device-bt.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-bt.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-bt.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-bt.c' object='libnm_glib_test_la-nm-device-bt.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-bt.lo `test -f 'nm-device-bt.c' || echo '$(srcdir)/'`nm-device-bt.c - -libnm_glib_test_la-nm-device-olpc-mesh.lo: nm-device-olpc-mesh.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-olpc-mesh.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-olpc-mesh.Tpo -c -o libnm_glib_test_la-nm-device-olpc-mesh.lo `test -f 'nm-device-olpc-mesh.c' || echo '$(srcdir)/'`nm-device-olpc-mesh.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-olpc-mesh.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-olpc-mesh.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-olpc-mesh.c' object='libnm_glib_test_la-nm-device-olpc-mesh.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-olpc-mesh.lo `test -f 'nm-device-olpc-mesh.c' || echo '$(srcdir)/'`nm-device-olpc-mesh.c - -libnm_glib_test_la-nm-device-bond.lo: nm-device-bond.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-bond.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-bond.Tpo -c -o libnm_glib_test_la-nm-device-bond.lo `test -f 'nm-device-bond.c' || echo '$(srcdir)/'`nm-device-bond.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-bond.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-bond.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-bond.c' object='libnm_glib_test_la-nm-device-bond.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-bond.lo `test -f 'nm-device-bond.c' || echo '$(srcdir)/'`nm-device-bond.c - -libnm_glib_test_la-nm-device-team.lo: nm-device-team.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-team.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-team.Tpo -c -o libnm_glib_test_la-nm-device-team.lo `test -f 'nm-device-team.c' || echo '$(srcdir)/'`nm-device-team.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-team.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-team.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-team.c' object='libnm_glib_test_la-nm-device-team.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-team.lo `test -f 'nm-device-team.c' || echo '$(srcdir)/'`nm-device-team.c - -libnm_glib_test_la-nm-device-bridge.lo: nm-device-bridge.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-bridge.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-bridge.Tpo -c -o libnm_glib_test_la-nm-device-bridge.lo `test -f 'nm-device-bridge.c' || echo '$(srcdir)/'`nm-device-bridge.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-bridge.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-bridge.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-bridge.c' object='libnm_glib_test_la-nm-device-bridge.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-bridge.lo `test -f 'nm-device-bridge.c' || echo '$(srcdir)/'`nm-device-bridge.c - -libnm_glib_test_la-nm-device-vlan.lo: nm-device-vlan.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-vlan.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-vlan.Tpo -c -o libnm_glib_test_la-nm-device-vlan.lo `test -f 'nm-device-vlan.c' || echo '$(srcdir)/'`nm-device-vlan.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-vlan.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-vlan.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-vlan.c' object='libnm_glib_test_la-nm-device-vlan.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-vlan.lo `test -f 'nm-device-vlan.c' || echo '$(srcdir)/'`nm-device-vlan.c - -libnm_glib_test_la-nm-device-generic.lo: nm-device-generic.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-generic.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-generic.Tpo -c -o libnm_glib_test_la-nm-device-generic.lo `test -f 'nm-device-generic.c' || echo '$(srcdir)/'`nm-device-generic.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-generic.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-generic.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-generic.c' object='libnm_glib_test_la-nm-device-generic.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-generic.lo `test -f 'nm-device-generic.c' || echo '$(srcdir)/'`nm-device-generic.c - -libnm_glib_test_la-nm-access-point.lo: nm-access-point.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-access-point.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-access-point.Tpo -c -o libnm_glib_test_la-nm-access-point.lo `test -f 'nm-access-point.c' || echo '$(srcdir)/'`nm-access-point.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-access-point.Tpo $(DEPDIR)/libnm_glib_test_la-nm-access-point.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-access-point.c' object='libnm_glib_test_la-nm-access-point.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-access-point.lo `test -f 'nm-access-point.c' || echo '$(srcdir)/'`nm-access-point.c - -libnm_glib_test_la-nm-ip4-config.lo: nm-ip4-config.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-ip4-config.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-ip4-config.Tpo -c -o libnm_glib_test_la-nm-ip4-config.lo `test -f 'nm-ip4-config.c' || echo '$(srcdir)/'`nm-ip4-config.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-ip4-config.Tpo $(DEPDIR)/libnm_glib_test_la-nm-ip4-config.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-ip4-config.c' object='libnm_glib_test_la-nm-ip4-config.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-ip4-config.lo `test -f 'nm-ip4-config.c' || echo '$(srcdir)/'`nm-ip4-config.c - -libnm_glib_test_la-nm-device-modem.lo: nm-device-modem.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-modem.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-modem.Tpo -c -o libnm_glib_test_la-nm-device-modem.lo `test -f 'nm-device-modem.c' || echo '$(srcdir)/'`nm-device-modem.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-modem.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-modem.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-modem.c' object='libnm_glib_test_la-nm-device-modem.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-modem.lo `test -f 'nm-device-modem.c' || echo '$(srcdir)/'`nm-device-modem.c - -libnm_glib_test_la-nm-vpn-connection.lo: nm-vpn-connection.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-vpn-connection.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-vpn-connection.Tpo -c -o libnm_glib_test_la-nm-vpn-connection.lo `test -f 'nm-vpn-connection.c' || echo '$(srcdir)/'`nm-vpn-connection.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-vpn-connection.Tpo $(DEPDIR)/libnm_glib_test_la-nm-vpn-connection.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-vpn-connection.c' object='libnm_glib_test_la-nm-vpn-connection.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-vpn-connection.lo `test -f 'nm-vpn-connection.c' || echo '$(srcdir)/'`nm-vpn-connection.c - -libnm_glib_test_la-nm-types.lo: nm-types.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-types.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-types.Tpo -c -o libnm_glib_test_la-nm-types.lo `test -f 'nm-types.c' || echo '$(srcdir)/'`nm-types.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-types.Tpo $(DEPDIR)/libnm_glib_test_la-nm-types.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-types.c' object='libnm_glib_test_la-nm-types.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-types.lo `test -f 'nm-types.c' || echo '$(srcdir)/'`nm-types.c - -libnm_glib_test_la-nm-object-cache.lo: nm-object-cache.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-object-cache.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-object-cache.Tpo -c -o libnm_glib_test_la-nm-object-cache.lo `test -f 'nm-object-cache.c' || echo '$(srcdir)/'`nm-object-cache.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-object-cache.Tpo $(DEPDIR)/libnm_glib_test_la-nm-object-cache.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-object-cache.c' object='libnm_glib_test_la-nm-object-cache.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-object-cache.lo `test -f 'nm-object-cache.c' || echo '$(srcdir)/'`nm-object-cache.c - -libnm_glib_test_la-nm-active-connection.lo: nm-active-connection.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-active-connection.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-active-connection.Tpo -c -o libnm_glib_test_la-nm-active-connection.lo `test -f 'nm-active-connection.c' || echo '$(srcdir)/'`nm-active-connection.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-active-connection.Tpo $(DEPDIR)/libnm_glib_test_la-nm-active-connection.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-active-connection.c' object='libnm_glib_test_la-nm-active-connection.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-active-connection.lo `test -f 'nm-active-connection.c' || echo '$(srcdir)/'`nm-active-connection.c - -libnm_glib_test_la-nm-dhcp4-config.lo: nm-dhcp4-config.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-dhcp4-config.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-dhcp4-config.Tpo -c -o libnm_glib_test_la-nm-dhcp4-config.lo `test -f 'nm-dhcp4-config.c' || echo '$(srcdir)/'`nm-dhcp4-config.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-dhcp4-config.Tpo $(DEPDIR)/libnm_glib_test_la-nm-dhcp4-config.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-dhcp4-config.c' object='libnm_glib_test_la-nm-dhcp4-config.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-dhcp4-config.lo `test -f 'nm-dhcp4-config.c' || echo '$(srcdir)/'`nm-dhcp4-config.c - -libnm_glib_test_la-nm-ip6-config.lo: nm-ip6-config.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-ip6-config.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-ip6-config.Tpo -c -o libnm_glib_test_la-nm-ip6-config.lo `test -f 'nm-ip6-config.c' || echo '$(srcdir)/'`nm-ip6-config.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-ip6-config.Tpo $(DEPDIR)/libnm_glib_test_la-nm-ip6-config.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-ip6-config.c' object='libnm_glib_test_la-nm-ip6-config.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-ip6-config.lo `test -f 'nm-ip6-config.c' || echo '$(srcdir)/'`nm-ip6-config.c - -libnm_glib_test_la-nm-dhcp6-config.lo: nm-dhcp6-config.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-dhcp6-config.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-dhcp6-config.Tpo -c -o libnm_glib_test_la-nm-dhcp6-config.lo `test -f 'nm-dhcp6-config.c' || echo '$(srcdir)/'`nm-dhcp6-config.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-dhcp6-config.Tpo $(DEPDIR)/libnm_glib_test_la-nm-dhcp6-config.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-dhcp6-config.c' object='libnm_glib_test_la-nm-dhcp6-config.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-dhcp6-config.lo `test -f 'nm-dhcp6-config.c' || echo '$(srcdir)/'`nm-dhcp6-config.c - -libnm_glib_test_la-nm-remote-connection.lo: nm-remote-connection.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-remote-connection.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-remote-connection.Tpo -c -o libnm_glib_test_la-nm-remote-connection.lo `test -f 'nm-remote-connection.c' || echo '$(srcdir)/'`nm-remote-connection.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-remote-connection.Tpo $(DEPDIR)/libnm_glib_test_la-nm-remote-connection.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-remote-connection.c' object='libnm_glib_test_la-nm-remote-connection.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-remote-connection.lo `test -f 'nm-remote-connection.c' || echo '$(srcdir)/'`nm-remote-connection.c - -libnm_glib_test_la-nm-remote-settings.lo: nm-remote-settings.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-remote-settings.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-remote-settings.Tpo -c -o libnm_glib_test_la-nm-remote-settings.lo `test -f 'nm-remote-settings.c' || echo '$(srcdir)/'`nm-remote-settings.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-remote-settings.Tpo $(DEPDIR)/libnm_glib_test_la-nm-remote-settings.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-remote-settings.c' object='libnm_glib_test_la-nm-remote-settings.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-remote-settings.lo `test -f 'nm-remote-settings.c' || echo '$(srcdir)/'`nm-remote-settings.c - -libnm_glib_test_la-nm-secret-agent.lo: nm-secret-agent.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-secret-agent.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-secret-agent.Tpo -c -o libnm_glib_test_la-nm-secret-agent.lo `test -f 'nm-secret-agent.c' || echo '$(srcdir)/'`nm-secret-agent.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-secret-agent.Tpo $(DEPDIR)/libnm_glib_test_la-nm-secret-agent.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-secret-agent.c' object='libnm_glib_test_la-nm-secret-agent.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-secret-agent.lo `test -f 'nm-secret-agent.c' || echo '$(srcdir)/'`nm-secret-agent.c - -libnm_glib_test_la-nm-device-wimax.lo: nm-device-wimax.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-device-wimax.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-device-wimax.Tpo -c -o libnm_glib_test_la-nm-device-wimax.lo `test -f 'nm-device-wimax.c' || echo '$(srcdir)/'`nm-device-wimax.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-device-wimax.Tpo $(DEPDIR)/libnm_glib_test_la-nm-device-wimax.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-device-wimax.c' object='libnm_glib_test_la-nm-device-wimax.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-device-wimax.lo `test -f 'nm-device-wimax.c' || echo '$(srcdir)/'`nm-device-wimax.c - -libnm_glib_test_la-nm-wimax-nsp.lo: nm-wimax-nsp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-wimax-nsp.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-wimax-nsp.Tpo -c -o libnm_glib_test_la-nm-wimax-nsp.lo `test -f 'nm-wimax-nsp.c' || echo '$(srcdir)/'`nm-wimax-nsp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-wimax-nsp.Tpo $(DEPDIR)/libnm_glib_test_la-nm-wimax-nsp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-wimax-nsp.c' object='libnm_glib_test_la-nm-wimax-nsp.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-wimax-nsp.lo `test -f 'nm-wimax-nsp.c' || echo '$(srcdir)/'`nm-wimax-nsp.c - -libnm_glib_test_la-nm-glib-enum-types.lo: nm-glib-enum-types.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -MT libnm_glib_test_la-nm-glib-enum-types.lo -MD -MP -MF $(DEPDIR)/libnm_glib_test_la-nm-glib-enum-types.Tpo -c -o libnm_glib_test_la-nm-glib-enum-types.lo `test -f 'nm-glib-enum-types.c' || echo '$(srcdir)/'`nm-glib-enum-types.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_test_la-nm-glib-enum-types.Tpo $(DEPDIR)/libnm_glib_test_la-nm-glib-enum-types.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-glib-enum-types.c' object='libnm_glib_test_la-nm-glib-enum-types.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_test_la-nm-glib-enum-types.lo `test -f 'nm-glib-enum-types.c' || echo '$(srcdir)/'`nm-glib-enum-types.c - libnm_glib_vpn_la-nm-vpn-plugin.lo: nm-vpn-plugin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_vpn_la_CFLAGS) $(CFLAGS) -MT libnm_glib_vpn_la-nm-vpn-plugin.lo -MD -MP -MF $(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin.Tpo -c -o libnm_glib_vpn_la-nm-vpn-plugin.lo `test -f 'nm-vpn-plugin.c' || echo '$(srcdir)/'`nm-vpn-plugin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin.Tpo $(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin.Plo diff --git a/libnm-glib/libnm-glib-test.c b/libnm-glib/libnm-glib-test.c index e38457f0..7dc6823e 100644 --- a/libnm-glib/libnm-glib-test.c +++ b/libnm-glib/libnm-glib-test.c @@ -20,6 +20,8 @@ * Copyright (C) 2007 - 2008 Red Hat, Inc. */ +#include "config.h" + #include <stdlib.h> #include <signal.h> #include <string.h> diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index 982288e5..9219c4a2 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -104,6 +104,7 @@ global: nm_device_bt_new; nm_device_connection_compatible; nm_device_connection_valid; + nm_device_delete; nm_device_disambiguate_names; nm_device_disconnect; nm_device_error_get_type; @@ -156,6 +157,7 @@ global: nm_device_infiniband_get_hw_address; nm_device_infiniband_get_type; nm_device_infiniband_new; + nm_device_is_software; nm_device_modem_error_get_type; nm_device_modem_error_quark; nm_device_modem_get_current_capabilities; @@ -181,6 +183,7 @@ global: nm_device_vlan_error_quark; nm_device_vlan_get_carrier; nm_device_vlan_get_hw_address; + nm_device_vlan_get_parent; nm_device_vlan_get_type; nm_device_vlan_get_vlan_id; nm_device_vlan_new; diff --git a/libnm-glib/libnm_glib.c b/libnm-glib/libnm_glib.c index a2a6d26e..fed80160 100644 --- a/libnm-glib/libnm_glib.c +++ b/libnm-glib/libnm_glib.c @@ -21,6 +21,8 @@ * Copyright (C) 2005 - 2008 Novell, Inc. */ +#include "config.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/libnm-glib/nm-access-point.c b/libnm-glib/nm-access-point.c index ca3f1bf2..abf61cc9 100644 --- a/libnm-glib/nm-access-point.c +++ b/libnm-glib/nm-access-point.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,11 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2011 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2011 Red Hat, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include <netinet/ether.h> @@ -88,9 +87,9 @@ nm_access_point_new (DBusGConnection *connection, const char *path) g_return_val_if_fail (path != NULL, NULL); return (GObject *) g_object_new (NM_TYPE_ACCESS_POINT, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); } /** @@ -377,7 +376,7 @@ nm_access_point_connection_valid (NMAccessPoint *ap, NMConnection *connection) /** * nm_access_point_filter_connections: * @ap: an #NMAccessPoint to filter connections for - * @connections: (element-type NetworkManager.Connection): a list of + * @connections: (element-type NMConnection): a list of * #NMConnection objects to filter * * Filters a given list of connections for a given #NMAccessPoint object and @@ -390,7 +389,7 @@ nm_access_point_connection_valid (NMAccessPoint *ap, NMConnection *connection) * for a given #NMDevice using nm_device_filter_connections() and finally * filter that list with this function. * - * Returns: (transfer container) (element-type NetworkManager.Connection): a + * Returns: (transfer container) (element-type NMConnection): a * list of #NMConnection objects that could be activated with the given @ap. * The elements of the list are owned by their creator and should not be freed * by the caller, but the returned list itself is owned by the caller and should @@ -556,13 +555,12 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) **/ g_object_class_install_property (object_class, PROP_FLAGS, - g_param_spec_uint (NM_ACCESS_POINT_FLAGS, - "Flags", - "Flags", + g_param_spec_uint (NM_ACCESS_POINT_FLAGS, "", "", NM_802_11_AP_FLAGS_NONE, NM_802_11_AP_FLAGS_PRIVACY, NM_802_11_AP_FLAGS_NONE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMAccessPoint:wpa-flags: @@ -571,11 +569,10 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) **/ g_object_class_install_property (object_class, PROP_WPA_FLAGS, - g_param_spec_uint (NM_ACCESS_POINT_WPA_FLAGS, - "WPA Flags", - "WPA Flags", + g_param_spec_uint (NM_ACCESS_POINT_WPA_FLAGS, "", "", 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMAccessPoint:rsn-flags: @@ -584,11 +581,10 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) **/ g_object_class_install_property (object_class, PROP_RSN_FLAGS, - g_param_spec_uint (NM_ACCESS_POINT_RSN_FLAGS, - "RSN Flags", - "RSN Flags", + g_param_spec_uint (NM_ACCESS_POINT_RSN_FLAGS, "", "", 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMAccessPoint:ssid: @@ -597,11 +593,10 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) **/ g_object_class_install_property (object_class, PROP_SSID, - g_param_spec_boxed (NM_ACCESS_POINT_SSID, - "SSID", - "SSID", - NM_TYPE_SSID, - G_PARAM_READABLE)); + g_param_spec_boxed (NM_ACCESS_POINT_SSID, "", "", + NM_TYPE_SSID, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMAccessPoint:frequency: @@ -610,11 +605,10 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) **/ g_object_class_install_property (object_class, PROP_FREQUENCY, - g_param_spec_uint (NM_ACCESS_POINT_FREQUENCY, - "Frequency", - "Frequency", - 0, 10000, 0, - G_PARAM_READABLE)); + g_param_spec_uint (NM_ACCESS_POINT_FREQUENCY, "", "", + 0, 10000, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMAccessPoint:bssid: @@ -623,11 +617,10 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) **/ g_object_class_install_property (object_class, PROP_BSSID, - g_param_spec_string (NM_ACCESS_POINT_BSSID, - "BSSID", - "BSSID", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_ACCESS_POINT_BSSID, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMAccessPoint:hw-address: @@ -636,11 +629,10 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_ACCESS_POINT_HW_ADDRESS, - "MAC Address", - "Hardware MAC address", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_ACCESS_POINT_HW_ADDRESS, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMAccessPoint:mode: @@ -651,11 +643,10 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) **/ g_object_class_install_property (object_class, PROP_MODE, - g_param_spec_uint (NM_ACCESS_POINT_MODE, - "Mode", - "Mode", - NM_802_11_MODE_ADHOC, NM_802_11_MODE_INFRA, NM_802_11_MODE_INFRA, - G_PARAM_READABLE)); + g_param_spec_uint (NM_ACCESS_POINT_MODE, "", "", + NM_802_11_MODE_ADHOC, NM_802_11_MODE_INFRA, NM_802_11_MODE_INFRA, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMAccessPoint:max-bitrate: @@ -664,11 +655,10 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) **/ g_object_class_install_property (object_class, PROP_MAX_BITRATE, - g_param_spec_uint (NM_ACCESS_POINT_MAX_BITRATE, - "Max Bitrate", - "Max Bitrate", - 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + g_param_spec_uint (NM_ACCESS_POINT_MAX_BITRATE, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMAccessPoint:strength: @@ -677,9 +667,8 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) **/ g_object_class_install_property (object_class, PROP_STRENGTH, - g_param_spec_uchar (NM_ACCESS_POINT_STRENGTH, - "Strength", - "Strength", - 0, G_MAXUINT8, 0, - G_PARAM_READABLE)); + g_param_spec_uchar (NM_ACCESS_POINT_STRENGTH, "", "", + 0, G_MAXUINT8, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm-glib/nm-access-point.h b/libnm-glib/nm-access-point.h index 4862e6b7..d3150f8e 100644 --- a/libnm-glib/nm-access-point.h +++ b/libnm-glib/nm-access-point.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2011 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2011 Red Hat, Inc. */ #ifndef NM_ACCESS_POINT_H diff --git a/libnm-glib/nm-active-connection.c b/libnm-glib/nm-active-connection.c index bca21b4d..7067a110 100644 --- a/libnm-glib/nm-active-connection.c +++ b/libnm-glib/nm-active-connection.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2014 Red Hat, Inc. - * Copyright (C) 2008 Novell, Inc. + * Copyright 2007 - 2014 Red Hat, Inc. + * Copyright 2008 Novell, Inc. */ +#include "config.h" + #include <string.h> #include "NetworkManager.h" @@ -106,9 +106,9 @@ nm_active_connection_new (DBusGConnection *connection, const char *path) g_return_val_if_fail (path != NULL, NULL); return g_object_new (NM_TYPE_ACTIVE_CONNECTION, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); } static GType @@ -308,7 +308,7 @@ nm_active_connection_get_specific_object (NMActiveConnection *connection) * * Gets the #NMDevices used for the active connections. * - * Returns: (element-type NMClient.Device): the #GPtrArray containing #NMDevices. + * Returns: (element-type NMDevice): the #GPtrArray containing #NMDevices. * This is the internal copy used by the connection, and must not be modified. **/ const GPtrArray * @@ -662,11 +662,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_CONNECTION, - g_param_spec_string (NM_ACTIVE_CONNECTION_CONNECTION, - "Connection", - "Connection", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_ACTIVE_CONNECTION_CONNECTION, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:id: @@ -677,11 +676,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_ID, - g_param_spec_string (NM_ACTIVE_CONNECTION_ID, - "ID", - "ID", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_ACTIVE_CONNECTION_ID, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:uuid: @@ -690,11 +688,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_UUID, - g_param_spec_string (NM_ACTIVE_CONNECTION_UUID, - "UUID", - "UUID", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_ACTIVE_CONNECTION_UUID, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:type: @@ -705,11 +702,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_TYPE, - g_param_spec_string (NM_ACTIVE_CONNECTION_TYPE, - "Type", - "Type", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_ACTIVE_CONNECTION_TYPE, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:specific-object: @@ -718,11 +714,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_SPECIFIC_OBJECT, - g_param_spec_string (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, - "Specific object", - "Specific object", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:device: @@ -731,11 +726,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_DEVICES, - g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES, - "Devices", - "Devices", - NM_TYPE_OBJECT_ARRAY, - G_PARAM_READABLE)); + g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES, "", "", + NM_TYPE_OBJECT_ARRAY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:state: @@ -744,13 +738,12 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_STATE, - g_param_spec_uint (NM_ACTIVE_CONNECTION_STATE, - "State", - "State", - NM_ACTIVE_CONNECTION_STATE_UNKNOWN, - NM_ACTIVE_CONNECTION_STATE_DEACTIVATING, - NM_ACTIVE_CONNECTION_STATE_UNKNOWN, - G_PARAM_READABLE)); + g_param_spec_uint (NM_ACTIVE_CONNECTION_STATE, "", "", + NM_ACTIVE_CONNECTION_STATE_UNKNOWN, + NM_ACTIVE_CONNECTION_STATE_DEACTIVATING, + NM_ACTIVE_CONNECTION_STATE_UNKNOWN, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:default: @@ -759,11 +752,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_DEFAULT, - g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, - "Default", - "Is the default IPv4 active connection", - FALSE, - G_PARAM_READABLE)); + g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:ip4-config: @@ -774,11 +766,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_IP4_CONFIG, - g_param_spec_object (NM_ACTIVE_CONNECTION_IP4_CONFIG, - "IP4 Config", - "IP4 Config", + g_param_spec_object (NM_ACTIVE_CONNECTION_IP4_CONFIG, "", "", NM_TYPE_IP4_CONFIG, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:dhcp4-config: @@ -789,11 +780,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_DHCP4_CONFIG, - g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP4_CONFIG, - "DHCP4 Config", - "DHCP4 Config", + g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP4_CONFIG, "", "", NM_TYPE_DHCP4_CONFIG, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:default6: @@ -802,11 +792,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_DEFAULT6, - g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, - "Default6", - "Is the default IPv6 active connection", - FALSE, - G_PARAM_READABLE)); + g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:ip6-config: @@ -817,11 +806,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_IP6_CONFIG, - g_param_spec_object (NM_ACTIVE_CONNECTION_IP6_CONFIG, - "IP6 Config", - "IP6 Config", + g_param_spec_object (NM_ACTIVE_CONNECTION_IP6_CONFIG, "", "", NM_TYPE_IP6_CONFIG, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:dhcp6-config: @@ -832,11 +820,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_DHCP6_CONFIG, - g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP6_CONFIG, - "DHCP6 Config", - "DHCP6 Config", + g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP6_CONFIG, "", "", NM_TYPE_DHCP6_CONFIG, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:vpn: @@ -847,11 +834,10 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_VPN, - g_param_spec_boolean (NM_ACTIVE_CONNECTION_VPN, - "VPN", - "Is a VPN connection", + g_param_spec_boolean (NM_ACTIVE_CONNECTION_VPN, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMActiveConnection:master: @@ -860,9 +846,8 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class) **/ g_object_class_install_property (object_class, PROP_MASTER, - g_param_spec_string (NM_ACTIVE_CONNECTION_MASTER, - "Master", - "Path of the master device", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_ACTIVE_CONNECTION_MASTER, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm-glib/nm-active-connection.h b/libnm-glib/nm-active-connection.h index b15e8340..e2941564 100644 --- a/libnm-glib/nm-active-connection.h +++ b/libnm-glib/nm-active-connection.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2014 Red Hat, Inc. - * Copyright (C) 2008 Novell, Inc. + * Copyright 2007 - 2014 Red Hat, Inc. + * Copyright 2008 Novell, Inc. */ #ifndef NM_ACTIVE_CONNECTION_H diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index 379c7879..a29664c6 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2013 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2013 Red Hat, Inc. */ +#include "config.h" + #include <dbus/dbus-glib.h> #include <string.h> #include <nm-utils.h> @@ -116,10 +116,10 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; static void proxy_name_owner_changed (DBusGProxy *proxy, - const char *name, - const char *old_owner, - const char *new_owner, - gpointer user_data); + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data); /**********************************************************************/ @@ -360,11 +360,11 @@ client_recheck_permissions (DBusGProxy *proxy, gpointer user_data) * @client: a #NMClient * * Gets all the known network devices. Use nm_device_get_type() or the - * NM_IS_DEVICE_XXXX() functions to determine what kind of device member of the - * returned array is, and then you may use device-specific methods such as - * nm_device_ethernet_get_hw_address(). + * <literal>NM_IS_DEVICE_XXXX</literal> functions to determine what kind of + * device member of the returned array is, and then you may use device-specific + * methods such as nm_device_ethernet_get_hw_address(). * - * Returns: (transfer none) (element-type NMClient.Device): a #GPtrArray + * Returns: (transfer none) (element-type NMDevice): a #GPtrArray * containing all the #NMDevices. The returned array is owned by the * #NMClient object and should not be modified. **/ @@ -607,6 +607,11 @@ activate_nm_not_running (gpointer user_data) * * If @connection is not given for a device-based activation, NetworkManager * picks the best available connection for the device and activates it. + * + * Note that the callback is invoked when NetworkManager has started activating + * the new connection, not when it finishes. You can used the returned + * #NMActiveConnection object (in particular, #NMActiveConnection:state) to + * track the activation to its completion. **/ void nm_client_activate_connection (NMClient *client, @@ -691,6 +696,11 @@ add_activate_cb (DBusGProxy *proxy, * automatically filling in missing settings with the capabilities of the * given device and specific object. The new connection is then activated. * Cannot be used for VPN connections at this time. + * + * Note that the callback is invoked when NetworkManager has started activating + * the new connection, not when it finishes. You can used the returned + * #NMActiveConnection object (in particular, #NMActiveConnection:state) to + * track the activation to its completion. **/ void nm_client_add_and_activate_connection (NMClient *client, @@ -783,11 +793,11 @@ nm_client_deactivate_connection (NMClient *client, NMActiveConnection *active) * * Gets the active connections. * - * Returns: (transfer none) (element-type NMClient.ActiveConnection): a #GPtrArray + * Returns: (transfer none) (element-type NMActiveConnection): a #GPtrArray * containing all the active #NMActiveConnections. * The returned array is owned by the client and should not be modified. **/ -const GPtrArray * +const GPtrArray * nm_client_get_active_connections (NMClient *client) { NMClientPrivate *priv; @@ -1341,10 +1351,10 @@ updated_properties (GObject *object, GAsyncResult *result, gpointer user_data) static void proxy_name_owner_changed (DBusGProxy *proxy, - const char *name, - const char *old_owner, - const char *new_owner, - gpointer user_data) + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data) { NMClient *client = NM_CLIENT (user_data); NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); @@ -1385,7 +1395,7 @@ proxy_name_owner_changed (DBusGProxy *proxy, /* Clear object cache to ensure bad refcounting by clients doesn't * keep objects in the cache. */ - _nm_object_cache_clear (NM_OBJECT (client)); + _nm_object_cache_clear (); } else { _nm_object_suppress_property_updates (NM_OBJECT (client), FALSE); _nm_object_reload_properties_async (NM_OBJECT (client), updated_properties, client); @@ -1483,6 +1493,11 @@ check_connectivity_cb (DBusGProxy *proxy, CheckConnectivityData *ccd = g_simple_async_result_get_op_res_gpointer (simple); GError *error = NULL; + if (ccd->cancellable) { + g_signal_handler_disconnect (ccd->cancellable, ccd->cancelled_id); + ccd->cancelled_id = 0; + } + if (!dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &ccd->connectivity, G_TYPE_INVALID)) @@ -1702,50 +1717,6 @@ nm_client_new_finish (GAsyncResult *result, GError **error) } /* - * Validate D-Bus object path. - * The function is copied and adjusted version of - * g_variant_serialiser_is_object_path() from glib. - * FIXME: The function can be replaced by g_variant_is_object_path() - * when we start using GLib >= 2.24 - */ -static gboolean -_nm_client_is_object_path (const char *string) -{ - gsize i; - - if (!g_utf8_validate (string, -1, NULL)) - return FALSE; - - /* The path must begin with an ASCII '/' (integer 47) character */ - if (string[0] != '/') - return FALSE; - - for (i = 1; string[i]; i++) { - /* Each element must only contain the ASCII characters - * "[A-Z][a-z][0-9]_" - */ - if (g_ascii_isalnum (string[i]) || string[i] == '_') - ; - /* must consist of elements separated by slash characters. */ - else if (string[i] == '/') { - /* No element may be the empty string. */ - /* Multiple '/' characters cannot occur in sequence. */ - if (string[i - 1] == '/') - return FALSE; - } else - return FALSE; - } - - /* A trailing '/' character is not allowed unless the path is the - * root path (a single '/' character). - */ - if (i > 1 && string[i - 1] == '/') - return FALSE; - - return TRUE; -} - -/* * constructor() shouldn't be overriden in most cases, rather constructed() * method is preferred and more useful. * But, this serves as a workaround for bindings (use) calling the constructor() @@ -1782,9 +1753,9 @@ constructor (GType type, if (dbus_path == NULL) { g_value_set_static_string (construct_params[i].value, NM_DBUS_PATH); } else { - if (!_nm_client_is_object_path (dbus_path)) { - g_warning ("Passsed D-Bus object path '%s' is invalid; using default '%s' instead", - dbus_path, NM_DBUS_PATH); + if (!g_variant_is_object_path (dbus_path)) { + g_warning ("Passed D-Bus object path '%s' is invalid; using default '%s' instead", + dbus_path, NM_DBUS_PATH); g_value_set_static_string (construct_params[i].value, NM_DBUS_PATH); } } @@ -1968,8 +1939,8 @@ init_async_got_manager_running (DBusGProxy *proxy, DBusGProxyCall *call, static void init_async (GAsyncInitable *initable, int io_priority, - GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data) + GCancellable *cancellable, GAsyncReadyCallback callback, + gpointer user_data) { NMClientInitData *init_data; NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (initable); @@ -1985,10 +1956,10 @@ init_async (GAsyncInitable *initable, int io_priority, else { /* Check if NM is running */ dbus_g_proxy_begin_call (priv->bus_proxy, "NameHasOwner", - init_async_got_manager_running, - init_data, NULL, - G_TYPE_STRING, NM_DBUS_SERVICE, - G_TYPE_INVALID); + init_async_got_manager_running, + init_data, NULL, + G_TYPE_STRING, NM_DBUS_SERVICE, + G_TYPE_INVALID); } } @@ -2043,7 +2014,7 @@ finalize (GObject *object) static void set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec) + const GValue *value, GParamSpec *pspec) { NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object); gboolean b; @@ -2171,12 +2142,12 @@ nm_client_class_init (NMClientClass *client_class) * * The NetworkManager version. **/ - g_object_class_install_property (object_class, PROP_VERSION, - g_param_spec_string (NM_CLIENT_VERSION, - "Version", - "NetworkManager version", - NULL, - G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_VERSION, + g_param_spec_string (NM_CLIENT_VERSION, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMClient:state: @@ -2185,11 +2156,10 @@ nm_client_class_init (NMClientClass *client_class) **/ g_object_class_install_property (object_class, PROP_STATE, - g_param_spec_uint (NM_CLIENT_STATE, - "State", - "NetworkManager state", - NM_STATE_UNKNOWN, NM_STATE_CONNECTED_GLOBAL, NM_STATE_UNKNOWN, - G_PARAM_READABLE)); + g_param_spec_uint (NM_CLIENT_STATE, "", "", + NM_STATE_UNKNOWN, NM_STATE_CONNECTED_GLOBAL, NM_STATE_UNKNOWN, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMClient:startup: @@ -2200,129 +2170,119 @@ nm_client_class_init (NMClientClass *client_class) **/ g_object_class_install_property (object_class, PROP_STARTUP, - g_param_spec_boolean (NM_CLIENT_STARTUP, - "Startup", - "Whether the daemon is still starting up", + g_param_spec_boolean (NM_CLIENT_STARTUP, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** - * NMClient::manager-running: + * NMClient:manager-running: * * Whether the daemon is running. **/ g_object_class_install_property (object_class, PROP_MANAGER_RUNNING, - g_param_spec_boolean (NM_CLIENT_MANAGER_RUNNING, - "ManagerRunning", - "Whether NetworkManager is running", - FALSE, - G_PARAM_READABLE)); + g_param_spec_boolean (NM_CLIENT_MANAGER_RUNNING, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** - * NMClient::networking-enabled: + * NMClient:networking-enabled: * * Whether networking is enabled. **/ g_object_class_install_property (object_class, PROP_NETWORKING_ENABLED, - g_param_spec_boolean (NM_CLIENT_NETWORKING_ENABLED, - "NetworkingEnabled", - "Is networking enabled", - TRUE, - G_PARAM_READWRITE)); + g_param_spec_boolean (NM_CLIENT_NETWORKING_ENABLED, "", "", + TRUE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** - * NMClient::wireless-enabled: + * NMClient:wireless-enabled: * * Whether wireless is enabled. **/ g_object_class_install_property (object_class, PROP_WIRELESS_ENABLED, - g_param_spec_boolean (NM_CLIENT_WIRELESS_ENABLED, - "WirelessEnabled", - "Is wireless enabled", - FALSE, - G_PARAM_READWRITE)); + g_param_spec_boolean (NM_CLIENT_WIRELESS_ENABLED, "", "", + FALSE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** - * NMClient::wireless-hardware-enabled: + * NMClient:wireless-hardware-enabled: * * Whether the wireless hardware is enabled. **/ g_object_class_install_property (object_class, PROP_WIRELESS_HARDWARE_ENABLED, - g_param_spec_boolean (NM_CLIENT_WIRELESS_HARDWARE_ENABLED, - "WirelessHardwareEnabled", - "Is wireless hardware enabled", - TRUE, - G_PARAM_READABLE)); + g_param_spec_boolean (NM_CLIENT_WIRELESS_HARDWARE_ENABLED, "", "", + TRUE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** - * NMClient::wwan-enabled: + * NMClient:wwan-enabled: * * Whether WWAN functionality is enabled. **/ g_object_class_install_property (object_class, PROP_WWAN_ENABLED, - g_param_spec_boolean (NM_CLIENT_WWAN_ENABLED, - "WwanEnabled", - "Is WWAN enabled", + g_param_spec_boolean (NM_CLIENT_WWAN_ENABLED, "", "", FALSE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** - * NMClient::wwan-hardware-enabled: + * NMClient:wwan-hardware-enabled: * * Whether the WWAN hardware is enabled. **/ g_object_class_install_property (object_class, PROP_WWAN_HARDWARE_ENABLED, - g_param_spec_boolean (NM_CLIENT_WWAN_HARDWARE_ENABLED, - "WwanHardwareEnabled", - "Is WWAN hardware enabled", + g_param_spec_boolean (NM_CLIENT_WWAN_HARDWARE_ENABLED, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** - * NMClient::wimax-enabled: + * NMClient:wimax-enabled: * * Whether WiMAX functionality is enabled. **/ g_object_class_install_property (object_class, PROP_WIMAX_ENABLED, - g_param_spec_boolean (NM_CLIENT_WIMAX_ENABLED, - "WimaxEnabled", - "Is WiMAX enabled", + g_param_spec_boolean (NM_CLIENT_WIMAX_ENABLED, "", "", FALSE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** - * NMClient::wimax-hardware-enabled: + * NMClient:wimax-hardware-enabled: * * Whether the WiMAX hardware is enabled. **/ g_object_class_install_property (object_class, PROP_WIMAX_HARDWARE_ENABLED, - g_param_spec_boolean (NM_CLIENT_WIMAX_HARDWARE_ENABLED, - "WimaxHardwareEnabled", - "Is WiMAX hardware enabled", + g_param_spec_boolean (NM_CLIENT_WIMAX_HARDWARE_ENABLED, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** - * NMClient::active-connections: + * NMClient:active-connections: * * The active connections. - * Type: GPtrArray<NMClient.ActiveConnection> + * Type: GLib.PtrArray **/ g_object_class_install_property (object_class, PROP_ACTIVE_CONNECTIONS, - g_param_spec_boxed (NM_CLIENT_ACTIVE_CONNECTIONS, - "Active connections", - "Active connections", - NM_TYPE_OBJECT_ARRAY, - G_PARAM_READABLE)); + g_param_spec_boxed (NM_CLIENT_ACTIVE_CONNECTIONS, "", "", + NM_TYPE_OBJECT_ARRAY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMClient:connectivity: @@ -2333,11 +2293,10 @@ nm_client_class_init (NMClientClass *client_class) */ g_object_class_install_property (object_class, PROP_CONNECTIVITY, - g_param_spec_uint (NM_CLIENT_CONNECTIVITY, - "Connectivity", - "Connectivity state", + g_param_spec_uint (NM_CLIENT_CONNECTIVITY, "", "", NM_CONNECTIVITY_UNKNOWN, NM_CONNECTIVITY_FULL, NM_CONNECTIVITY_UNKNOWN, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMClient:primary-connection: @@ -2349,11 +2308,10 @@ nm_client_class_init (NMClientClass *client_class) **/ g_object_class_install_property (object_class, PROP_PRIMARY_CONNECTION, - g_param_spec_object (NM_CLIENT_PRIMARY_CONNECTION, - "Primary connection", - "Primary connection", + g_param_spec_object (NM_CLIENT_PRIMARY_CONNECTION, "", "", NM_TYPE_ACTIVE_CONNECTION, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMClient:activating-connection: @@ -2365,11 +2323,10 @@ nm_client_class_init (NMClientClass *client_class) **/ g_object_class_install_property (object_class, PROP_ACTIVATING_CONNECTION, - g_param_spec_object (NM_CLIENT_ACTIVATING_CONNECTION, - "Activating connection", - "Activating connection", + g_param_spec_object (NM_CLIENT_ACTIVATING_CONNECTION, "", "", NM_TYPE_ACTIVE_CONNECTION, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMClient:devices: @@ -2380,34 +2337,33 @@ nm_client_class_init (NMClientClass *client_class) **/ g_object_class_install_property (object_class, PROP_DEVICES, - g_param_spec_boxed (NM_CLIENT_DEVICES, - "Devices", - "Devices", + g_param_spec_boxed (NM_CLIENT_DEVICES, "", "", NM_TYPE_OBJECT_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /* signals */ /** * NMClient::device-added: * @client: the client that received the signal - * @device: (type NMClient.Device): the new device + * @device: (type NMDevice): the new device * * Notifies that a #NMDevice is added. **/ signals[DEVICE_ADDED] = g_signal_new ("device-added", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMClientClass, device_added), - NULL, NULL, NULL, - G_TYPE_NONE, 1, - G_TYPE_OBJECT); + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMClientClass, device_added), + NULL, NULL, NULL, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); /** * NMClient::device-removed: * @client: the client that received the signal - * @device: (type NMClient.Device): the removed device + * @device: (type NMDevice): the removed device * * Notifies that a #NMDevice is removed. **/ diff --git a/libnm-glib/nm-client.h b/libnm-glib/nm-client.h index 1baabecc..ffe513cb 100644 --- a/libnm-glib/nm-client.h +++ b/libnm-glib/nm-client.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2012 Red Hat, Inc. */ #ifndef NM_CLIENT_H diff --git a/libnm-glib/nm-dbus-helpers-private.h b/libnm-glib/nm-dbus-helpers-private.h index 81c77203..8a350e78 100644 --- a/libnm-glib/nm-dbus-helpers-private.h +++ b/libnm-glib/nm-dbus-helpers-private.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2013 Red Hat, Inc. + * Copyright 2013 Red Hat, Inc. */ #ifndef NM_DBUS_HELPERS_PRIVATE_H diff --git a/libnm-glib/nm-dbus-helpers.c b/libnm-glib/nm-dbus-helpers.c index 731ad0c8..00e04ab4 100644 --- a/libnm-glib/nm-dbus-helpers.c +++ b/libnm-glib/nm-dbus-helpers.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,11 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2013 Red Hat, Inc. + * Copyright 2013 Red Hat, Inc. */ +#include "config.h" + #include <string.h> -#include <config.h> #include <gio/gio.h> #include <dbus/dbus.h> #include <dbus/dbus-glib-lowlevel.h> @@ -70,13 +69,8 @@ _nm_dbus_new_connection (GError **error) } #endif - if (connection == NULL) { -#ifdef LIBNM_GLIB_TEST - connection = dbus_g_bus_get (DBUS_BUS_SESSION, error); -#else + if (connection == NULL) connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, error); -#endif - } return connection; } @@ -104,4 +98,3 @@ _nm_dbus_new_proxy_for_connection (DBusGConnection *connection, return dbus_g_proxy_new_for_name (connection, NM_DBUS_SERVICE, path, interface); } - diff --git a/libnm-glib/nm-device-adsl.c b/libnm-glib/nm-device-adsl.c index b3f9691e..68121683 100644 --- a/libnm-glib/nm-device-adsl.c +++ b/libnm-glib/nm-device-adsl.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,8 @@ * Copyright 2009 - 2011 Red Hat, Inc. */ +#include "config.h" + #include "nm-device-adsl.h" #include "nm-device-private.h" #include "nm-object-private.h" @@ -237,9 +237,8 @@ nm_device_adsl_class_init (NMDeviceAdslClass *adsl_class) **/ g_object_class_install_property (object_class, PROP_CARRIER, - g_param_spec_boolean (NM_DEVICE_ADSL_CARRIER, - "Carrier", - "Carrier", + g_param_spec_boolean (NM_DEVICE_ADSL_CARRIER, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm-glib/nm-device-adsl.h b/libnm-glib/nm-device-adsl.h index 702d16dc..35d2731a 100644 --- a/libnm-glib/nm-device-adsl.h +++ b/libnm-glib/nm-device-adsl.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 Pantelis Koukousoulas <pktoss@gmail.com> + * Copyright 2011 Pantelis Koukousoulas <pktoss@gmail.com> */ #ifndef NM_DEVICE_ADSL_H diff --git a/libnm-glib/nm-device-bond.c b/libnm-glib/nm-device-bond.c index b2af2ec3..786d4f16 100644 --- a/libnm-glib/nm-device-bond.c +++ b/libnm-glib/nm-device-bond.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,11 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2012 Red Hat, Inc. + * Copyright 2012 Red Hat, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include <netinet/ether.h> @@ -91,9 +90,9 @@ nm_device_bond_new (DBusGConnection *connection, const char *path) g_return_val_if_fail (path != NULL, NULL); device = g_object_new (NM_TYPE_DEVICE_BOND, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); _nm_object_ensure_inited (NM_OBJECT (device)); return device; } @@ -139,7 +138,7 @@ nm_device_bond_get_carrier (NMDeviceBond *device) * * Gets the devices currently slaved to @device. * - * Returns: (element-type NMClient.Device): the #GPtrArray containing + * Returns: (element-type NMDevice): the #GPtrArray containing * #NMDevices that are slaves of @device. This is the internal * copy used by the device, and must not be modified. * @@ -291,12 +290,12 @@ get_property (GObject *object, } static void -nm_device_bond_class_init (NMDeviceBondClass *eth_class) +nm_device_bond_class_init (NMDeviceBondClass *bond_class) { - GObjectClass *object_class = G_OBJECT_CLASS (eth_class); - NMDeviceClass *device_class = NM_DEVICE_CLASS (eth_class); + GObjectClass *object_class = G_OBJECT_CLASS (bond_class); + NMDeviceClass *device_class = NM_DEVICE_CLASS (bond_class); - g_type_class_add_private (eth_class, sizeof (NMDeviceBondPrivate)); + g_type_class_add_private (bond_class, sizeof (NMDeviceBondPrivate)); /* virtual methods */ object_class->constructed = constructed; @@ -316,11 +315,10 @@ nm_device_bond_class_init (NMDeviceBondClass *eth_class) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_BOND_HW_ADDRESS, - "Active MAC Address", - "Currently set hardware MAC address", + g_param_spec_string (NM_DEVICE_BOND_HW_ADDRESS, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceBond:carrier: @@ -329,11 +327,10 @@ nm_device_bond_class_init (NMDeviceBondClass *eth_class) **/ g_object_class_install_property (object_class, PROP_CARRIER, - g_param_spec_boolean (NM_DEVICE_BOND_CARRIER, - "Carrier", - "Carrier", + g_param_spec_boolean (NM_DEVICE_BOND_CARRIER, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceBond:slaves: @@ -344,9 +341,8 @@ nm_device_bond_class_init (NMDeviceBondClass *eth_class) **/ g_object_class_install_property (object_class, PROP_SLAVES, - g_param_spec_boxed (NM_DEVICE_BOND_SLAVES, - "Slaves", - "Slaves", + g_param_spec_boxed (NM_DEVICE_BOND_SLAVES, "", "", NM_TYPE_OBJECT_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm-glib/nm-device-bond.h b/libnm-glib/nm-device-bond.h index a495689a..cd1a6027 100644 --- a/libnm-glib/nm-device-bond.h +++ b/libnm-glib/nm-device-bond.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2012 Red Hat, Inc. + * Copyright 2012 Red Hat, Inc. */ #ifndef NM_DEVICE_BOND_H diff --git a/libnm-glib/nm-device-bridge.c b/libnm-glib/nm-device-bridge.c index c8967e20..ef69fb26 100644 --- a/libnm-glib/nm-device-bridge.c +++ b/libnm-glib/nm-device-bridge.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,11 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2012 Red Hat, Inc. + * Copyright 2012 Red Hat, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include <netinet/ether.h> @@ -147,7 +146,7 @@ nm_device_bridge_get_carrier (NMDeviceBridge *device) * * Gets the devices currently slaved to @device. * - * Returns: (element-type NMClient.Device): the #GPtrArray containing + * Returns: (element-type NMDevice): the #GPtrArray containing * #NMDevices that are slaves of @device. This is the internal * copy used by the device, and must not be modified. * @@ -326,11 +325,10 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *bridge_class) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_BRIDGE_HW_ADDRESS, - "Active MAC Address", - "Currently set hardware MAC address", + g_param_spec_string (NM_DEVICE_BRIDGE_HW_ADDRESS, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceBridge:carrier: @@ -341,11 +339,10 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *bridge_class) **/ g_object_class_install_property (object_class, PROP_CARRIER, - g_param_spec_boolean (NM_DEVICE_BRIDGE_CARRIER, - "Carrier", - "Carrier", + g_param_spec_boolean (NM_DEVICE_BRIDGE_CARRIER, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceBridge:slaves: @@ -356,9 +353,8 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *bridge_class) **/ g_object_class_install_property (object_class, PROP_SLAVES, - g_param_spec_boxed (NM_DEVICE_BRIDGE_SLAVES, - "Slaves", - "Slaves", + g_param_spec_boxed (NM_DEVICE_BRIDGE_SLAVES, "", "", NM_TYPE_OBJECT_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm-glib/nm-device-bridge.h b/libnm-glib/nm-device-bridge.h index 67e08df7..2eaf475d 100644 --- a/libnm-glib/nm-device-bridge.h +++ b/libnm-glib/nm-device-bridge.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2012 Red Hat, Inc. + * Copyright 2012 Red Hat, Inc. */ #ifndef NM_DEVICE_BRIDGE_H diff --git a/libnm-glib/nm-device-bt.c b/libnm-glib/nm-device-bt.c index 4c39ad04..58d48344 100644 --- a/libnm-glib/nm-device-bt.c +++ b/libnm-glib/nm-device-bt.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,11 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2012 Red Hat, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include <netinet/ether.h> @@ -343,11 +342,10 @@ nm_device_bt_class_init (NMDeviceBtClass *bt_class) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_BT_HW_ADDRESS, - "MAC Address", - "Hardware MAC address", + g_param_spec_string (NM_DEVICE_BT_HW_ADDRESS, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceBt:name: @@ -356,11 +354,10 @@ nm_device_bt_class_init (NMDeviceBtClass *bt_class) **/ g_object_class_install_property (object_class, PROP_NAME, - g_param_spec_string (NM_DEVICE_BT_NAME, - "Name", - "Device name", + g_param_spec_string (NM_DEVICE_BT_NAME, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceBt:bt-capabilities: @@ -369,11 +366,9 @@ nm_device_bt_class_init (NMDeviceBtClass *bt_class) **/ g_object_class_install_property (object_class, PROP_BT_CAPABILITIES, - g_param_spec_uint (NM_DEVICE_BT_CAPABILITIES, - "BtCapabilities", - "Bluetooth capabilities", + g_param_spec_uint (NM_DEVICE_BT_CAPABILITIES, "", "", NM_BT_CAPABILITY_NONE, G_MAXUINT32, NM_BT_CAPABILITY_NONE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } - diff --git a/libnm-glib/nm-device-bt.h b/libnm-glib/nm-device-bt.h index 113b5eca..51dc86e3 100644 --- a/libnm-glib/nm-device-bt.h +++ b/libnm-glib/nm-device-bt.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 - 2012 Red Hat, Inc. - * Copyright (C) 2008 Novell, Inc. + * Copyright 2008 - 2012 Red Hat, Inc. + * Copyright 2008 Novell, Inc. */ #ifndef NM_DEVICE_BT_H diff --git a/libnm-glib/nm-device-ethernet.c b/libnm-glib/nm-device-ethernet.c index 8f317115..d27a980f 100644 --- a/libnm-glib/nm-device-ethernet.c +++ b/libnm-glib/nm-device-ethernet.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,11 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2012 Red Hat, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include <netinet/ether.h> @@ -93,9 +92,9 @@ nm_device_ethernet_new (DBusGConnection *connection, const char *path) g_return_val_if_fail (path != NULL, NULL); device = g_object_new (NM_TYPE_DEVICE_ETHERNET, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); _nm_object_ensure_inited (NM_OBJECT (device)); return device; } @@ -350,11 +349,10 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *eth_class) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_ETHERNET_HW_ADDRESS, - "Active MAC Address", - "Currently set hardware MAC address", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_DEVICE_ETHERNET_HW_ADDRESS, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceEthernet:perm-hw-address: @@ -363,11 +361,10 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *eth_class) **/ g_object_class_install_property (object_class, PROP_PERM_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, - "Permanent MAC Address", - "Permanent hardware MAC address", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceEthernet:speed: @@ -376,11 +373,10 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *eth_class) **/ g_object_class_install_property (object_class, PROP_SPEED, - g_param_spec_uint (NM_DEVICE_ETHERNET_SPEED, - "Speed", - "Speed", - 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + g_param_spec_uint (NM_DEVICE_ETHERNET_SPEED, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceEthernet:carrier: @@ -389,11 +385,9 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *eth_class) **/ g_object_class_install_property (object_class, PROP_CARRIER, - g_param_spec_boolean (NM_DEVICE_ETHERNET_CARRIER, - "Carrier", - "Carrier", - FALSE, - G_PARAM_READABLE)); + g_param_spec_boolean (NM_DEVICE_ETHERNET_CARRIER, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } - diff --git a/libnm-glib/nm-device-ethernet.h b/libnm-glib/nm-device-ethernet.h index a68a97ec..be289cdf 100644 --- a/libnm-glib/nm-device-ethernet.h +++ b/libnm-glib/nm-device-ethernet.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2012 Red Hat, Inc. */ #ifndef NM_DEVICE_ETHERNET_H diff --git a/libnm-glib/nm-device-generic.c b/libnm-glib/nm-device-generic.c index 2a45294f..a17a6735 100644 --- a/libnm-glib/nm-device-generic.c +++ b/libnm-glib/nm-device-generic.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -20,7 +18,7 @@ * Copyright 2013 Red Hat, Inc. */ -#include <config.h> +#include "config.h" #include <string.h> @@ -266,11 +264,10 @@ nm_device_generic_class_init (NMDeviceGenericClass *klass) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_GENERIC_HW_ADDRESS, - "Hardware Address", - "Hardware address", + g_param_spec_string (NM_DEVICE_GENERIC_HW_ADDRESS, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceGeneric:type-description: @@ -280,10 +277,8 @@ nm_device_generic_class_init (NMDeviceGenericClass *klass) **/ g_object_class_install_property (object_class, PROP_TYPE_DESCRIPTION, - g_param_spec_string (NM_DEVICE_GENERIC_TYPE_DESCRIPTION, - "Type Description", - "Type description", + g_param_spec_string (NM_DEVICE_GENERIC_TYPE_DESCRIPTION, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } - diff --git a/libnm-glib/nm-device-generic.h b/libnm-glib/nm-device-generic.h index a343d988..5bff1e3f 100644 --- a/libnm-glib/nm-device-generic.h +++ b/libnm-glib/nm-device-generic.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either diff --git a/libnm-glib/nm-device-infiniband.c b/libnm-glib/nm-device-infiniband.c index b60b2d82..663b3651 100644 --- a/libnm-glib/nm-device-infiniband.c +++ b/libnm-glib/nm-device-infiniband.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,11 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 - 2012 Red Hat, Inc. + * Copyright 2011 - 2012 Red Hat, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include <linux/if_infiniband.h> #include <netinet/ether.h> @@ -89,9 +88,9 @@ nm_device_infiniband_new (DBusGConnection *connection, const char *path) g_return_val_if_fail (path != NULL, NULL); device = g_object_new (NM_TYPE_DEVICE_INFINIBAND, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); _nm_object_ensure_inited (NM_OBJECT (device)); return device; } @@ -268,12 +267,12 @@ get_property (GObject *object, } static void -nm_device_infiniband_class_init (NMDeviceInfinibandClass *eth_class) +nm_device_infiniband_class_init (NMDeviceInfinibandClass *ib_class) { - GObjectClass *object_class = G_OBJECT_CLASS (eth_class); - NMDeviceClass *device_class = NM_DEVICE_CLASS (eth_class); + GObjectClass *object_class = G_OBJECT_CLASS (ib_class); + NMDeviceClass *device_class = NM_DEVICE_CLASS (ib_class); - g_type_class_add_private (eth_class, sizeof (NMDeviceInfinibandPrivate)); + g_type_class_add_private (ib_class, sizeof (NMDeviceInfinibandPrivate)); /* virtual methods */ object_class->constructed = constructed; @@ -293,11 +292,10 @@ nm_device_infiniband_class_init (NMDeviceInfinibandClass *eth_class) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_INFINIBAND_HW_ADDRESS, - "Active MAC Address", - "Currently set hardware MAC address", + g_param_spec_string (NM_DEVICE_INFINIBAND_HW_ADDRESS, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceInfiniband:carrier: @@ -306,11 +304,9 @@ nm_device_infiniband_class_init (NMDeviceInfinibandClass *eth_class) **/ g_object_class_install_property (object_class, PROP_CARRIER, - g_param_spec_boolean (NM_DEVICE_INFINIBAND_CARRIER, - "Carrier", - "Carrier", + g_param_spec_boolean (NM_DEVICE_INFINIBAND_CARRIER, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } - diff --git a/libnm-glib/nm-device-infiniband.h b/libnm-glib/nm-device-infiniband.h index 72d8fc6c..ba587d93 100644 --- a/libnm-glib/nm-device-infiniband.h +++ b/libnm-glib/nm-device-infiniband.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 - 2012 Red Hat, Inc. + * Copyright 2011 - 2012 Red Hat, Inc. */ #ifndef NM_DEVICE_INFINIBAND_H diff --git a/libnm-glib/nm-device-modem.c b/libnm-glib/nm-device-modem.c index b3b357cf..524d86ce 100644 --- a/libnm-glib/nm-device-modem.c +++ b/libnm-glib/nm-device-modem.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,11 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 - 2012 Red Hat, Inc. - * Copyright (C) 2008 Novell, Inc. + * Copyright 2011 - 2012 Red Hat, Inc. + * Copyright 2008 Novell, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include "nm-glib-compat.h" @@ -36,9 +35,7 @@ G_DEFINE_TYPE (NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE) -#define NM_DEVICE_MODEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ - NM_TYPE_DEVICE_MODEM, \ - NMDeviceModemPrivate)) +#define NM_DEVICE_MODEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_MODEM, NMDeviceModemPrivate)) typedef struct { DBusGProxy *proxy; @@ -273,12 +270,12 @@ nm_device_modem_class_init (NMDeviceModemClass *modem_class) * a firmware reload or other reinitialization to switch between eg * CDMA/EVDO and GSM/UMTS. **/ - g_object_class_install_property (object_class, PROP_MODEM_CAPS, - g_param_spec_uint (NM_DEVICE_MODEM_MODEM_CAPABILITIES, - "Modem capabilities", - "Modem capabilities", - 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_MODEM_CAPS, + g_param_spec_uint (NM_DEVICE_MODEM_MODEM_CAPABILITIES, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceModem:current-capabilities: @@ -286,11 +283,10 @@ nm_device_modem_class_init (NMDeviceModemClass *modem_class) * The generic family of access technologies the modem currently supports * without a firmware reload or reinitialization. **/ - g_object_class_install_property (object_class, PROP_CURRENT_CAPS, - g_param_spec_uint (NM_DEVICE_MODEM_CURRENT_CAPABILITIES, - "Current capabilities", - "Current capabilities", - 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_CURRENT_CAPS, + g_param_spec_uint (NM_DEVICE_MODEM_CURRENT_CAPABILITIES, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } - diff --git a/libnm-glib/nm-device-modem.h b/libnm-glib/nm-device-modem.h index 62719e2b..226cd046 100644 --- a/libnm-glib/nm-device-modem.h +++ b/libnm-glib/nm-device-modem.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 - 2012 Red Hat, Inc. - * Copyright (C) 2008 Novell, Inc. + * Copyright 2011 - 2012 Red Hat, Inc. + * Copyright 2008 Novell, Inc. */ #ifndef NM_DEVICE_MODEM_H diff --git a/libnm-glib/nm-device-olpc-mesh.c b/libnm-glib/nm-device-olpc-mesh.c index d1789eb9..e68fda62 100644 --- a/libnm-glib/nm-device-olpc-mesh.c +++ b/libnm-glib/nm-device-olpc-mesh.c @@ -1,8 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* vim: set ft=c ts=4 sts=4 sw=4 noexpandtab smartindent: */ /* - * libnm-glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -18,10 +15,11 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2012 Red Hat, Inc. + * Copyright 2012 Red Hat, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include "nm-glib-compat.h" @@ -90,9 +88,9 @@ nm_device_olpc_mesh_new (DBusGConnection *connection, const char *path) g_return_val_if_fail (path != NULL, NULL); device = g_object_new (NM_TYPE_DEVICE_OLPC_MESH, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); _nm_object_ensure_inited (NM_OBJECT (device)); return device; @@ -297,11 +295,10 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *olpc_mesh_class) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_OLPC_MESH_HW_ADDRESS, - "MAC Address", - "Hardware MAC address", + g_param_spec_string (NM_DEVICE_OLPC_MESH_HW_ADDRESS, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceOlpcMesh:companion: @@ -310,11 +307,10 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *olpc_mesh_class) **/ g_object_class_install_property (object_class, PROP_COMPANION, - g_param_spec_object (NM_DEVICE_OLPC_MESH_COMPANION, - "Companion device", - "Companion device", - NM_TYPE_DEVICE_WIFI, - G_PARAM_READABLE)); + g_param_spec_object (NM_DEVICE_OLPC_MESH_COMPANION, "", "", + NM_TYPE_DEVICE_WIFI, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceOlpcMesh:active-channel: @@ -323,11 +319,9 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *olpc_mesh_class) **/ g_object_class_install_property (object_class, PROP_ACTIVE_CHANNEL, - g_param_spec_uint (NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL, - "Active channel", - "Active channel", + g_param_spec_uint (NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL, "", "", 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } - diff --git a/libnm-glib/nm-device-olpc-mesh.h b/libnm-glib/nm-device-olpc-mesh.h index 93cb2cde..fcef83bc 100644 --- a/libnm-glib/nm-device-olpc-mesh.h +++ b/libnm-glib/nm-device-olpc-mesh.h @@ -1,8 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* vim: set ft=c ts=4 sts=4 sw=4 noexpandtab smartindent: */ /* - * libnm-glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -18,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2012 Red Hat, Inc. + * Copyright 2012 Red Hat, Inc. */ #ifndef NM_DEVICE_OLPC_MESH_H diff --git a/libnm-glib/nm-device-private.h b/libnm-glib/nm-device-private.h index 5c674f2f..82d676f9 100644 --- a/libnm-glib/nm-device-private.h +++ b/libnm-glib/nm-device-private.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2012 Red Hat, Inc. */ #ifndef NM_DEVICE_PRIVATE_H diff --git a/libnm-glib/nm-device-team.c b/libnm-glib/nm-device-team.c index f739e1d8..d9a5fce0 100644 --- a/libnm-glib/nm-device-team.c +++ b/libnm-glib/nm-device-team.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * Copyright (C) 2013 Jiri Pirko <jiri@resnulli.us> - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -16,9 +14,12 @@ * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. + * + * Copyright 2013 Jiri Pirko <jiri@resnulli.us> */ -#include <config.h> +#include "config.h" + #include <string.h> #include <netinet/ether.h> @@ -93,9 +94,9 @@ nm_device_team_new (DBusGConnection *connection, const char *path) g_return_val_if_fail (path != NULL, NULL); device = g_object_new (NM_TYPE_DEVICE_TEAM, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); _nm_object_ensure_inited (NM_OBJECT (device)); return device; } @@ -145,7 +146,7 @@ nm_device_team_get_carrier (NMDeviceTeam *device) * * Gets the devices currently enslaved to @device. * - * Returns: (element-type NMClient.Device): the #GPtrArray containing + * Returns: (element-type NMDevice): the #GPtrArray containing * #NMDevices that are slaves of @device. This is the internal * copy used by the device, and must not be modified. * @@ -297,12 +298,12 @@ get_property (GObject *object, } static void -nm_device_team_class_init (NMDeviceTeamClass *eth_class) +nm_device_team_class_init (NMDeviceTeamClass *team_class) { - GObjectClass *object_class = G_OBJECT_CLASS (eth_class); - NMDeviceClass *device_class = NM_DEVICE_CLASS (eth_class); + GObjectClass *object_class = G_OBJECT_CLASS (team_class); + NMDeviceClass *device_class = NM_DEVICE_CLASS (team_class); - g_type_class_add_private (eth_class, sizeof (NMDeviceTeamPrivate)); + g_type_class_add_private (team_class, sizeof (NMDeviceTeamPrivate)); /* virtual methods */ object_class->constructed = constructed; @@ -322,11 +323,10 @@ nm_device_team_class_init (NMDeviceTeamClass *eth_class) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_TEAM_HW_ADDRESS, - "Active MAC Address", - "Currently set hardware MAC address", + g_param_spec_string (NM_DEVICE_TEAM_HW_ADDRESS, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceTeam:carrier: @@ -335,11 +335,10 @@ nm_device_team_class_init (NMDeviceTeamClass *eth_class) **/ g_object_class_install_property (object_class, PROP_CARRIER, - g_param_spec_boolean (NM_DEVICE_TEAM_CARRIER, - "Carrier", - "Carrier", + g_param_spec_boolean (NM_DEVICE_TEAM_CARRIER, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceTeam:slaves: @@ -348,9 +347,8 @@ nm_device_team_class_init (NMDeviceTeamClass *eth_class) **/ g_object_class_install_property (object_class, PROP_SLAVES, - g_param_spec_boxed (NM_DEVICE_TEAM_SLAVES, - "Slaves", - "Slaves", + g_param_spec_boxed (NM_DEVICE_TEAM_SLAVES, "", "", NM_TYPE_OBJECT_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm-glib/nm-device-team.h b/libnm-glib/nm-device-team.h index 054f9ae2..46e910ba 100644 --- a/libnm-glib/nm-device-team.h +++ b/libnm-glib/nm-device-team.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * Copyright (C) 2013 Jiri Pirko <jiri@resnulli.us> - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -16,6 +14,8 @@ * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. + * + * Copyright 2013 Jiri Pirko <jiri@resnulli.us> */ #ifndef NM_DEVICE_TEAM_H diff --git a/libnm-glib/nm-device-vlan.c b/libnm-glib/nm-device-vlan.c index 2a84b946..26c234bd 100644 --- a/libnm-glib/nm-device-vlan.c +++ b/libnm-glib/nm-device-vlan.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,11 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2012 Red Hat, Inc. + * Copyright 2012 Red Hat, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include <netinet/ether.h> @@ -43,6 +42,7 @@ typedef struct { char *hw_address; gboolean carrier; + NMDevice *parent; guint vlan_id; } NMDeviceVlanPrivate; @@ -50,6 +50,7 @@ enum { PROP_0, PROP_HW_ADDRESS, PROP_CARRIER, + PROP_PARENT, PROP_VLAN_ID, LAST_PROP @@ -133,6 +134,23 @@ nm_device_vlan_get_carrier (NMDeviceVlan *device) } /** + * nm_device_vlan_get_parent: + * @device: a #NMDeviceVlan + * + * Returns: (transfer none): the device's parent device + * + * Since: 1.0 + **/ +NMDevice * +nm_device_vlan_get_parent (NMDeviceVlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), FALSE); + + _nm_object_ensure_inited (NM_OBJECT (device)); + return NM_DEVICE_VLAN_GET_PRIVATE (device)->parent; +} + +/** * nm_device_vlan_get_vlan_id: * @device: a #NMDeviceVlan * @@ -232,6 +250,7 @@ register_properties (NMDeviceVlan *device) const NMPropertiesInfo property_info[] = { { NM_DEVICE_VLAN_HW_ADDRESS, &priv->hw_address }, { NM_DEVICE_VLAN_CARRIER, &priv->carrier }, + { NM_DEVICE_VLAN_PARENT, &priv->parent, NULL, NM_TYPE_DEVICE }, { NM_DEVICE_VLAN_VLAN_ID, &priv->vlan_id }, { NULL }, }; @@ -257,6 +276,7 @@ dispose (GObject *object) { NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object); + g_clear_object (&priv->parent); g_clear_object (&priv->proxy); G_OBJECT_CLASS (nm_device_vlan_parent_class)->dispose (object); @@ -289,6 +309,9 @@ get_property (GObject *object, case PROP_CARRIER: g_value_set_boolean (value, nm_device_vlan_get_carrier (device)); break; + case PROP_PARENT: + g_value_set_object (value, nm_device_vlan_get_parent (device)); + break; case PROP_VLAN_ID: g_value_set_uint (value, nm_device_vlan_get_vlan_id (device)); break; @@ -299,12 +322,12 @@ get_property (GObject *object, } static void -nm_device_vlan_class_init (NMDeviceVlanClass *eth_class) +nm_device_vlan_class_init (NMDeviceVlanClass *vlan_class) { - GObjectClass *object_class = G_OBJECT_CLASS (eth_class); - NMDeviceClass *device_class = NM_DEVICE_CLASS (eth_class); + GObjectClass *object_class = G_OBJECT_CLASS (vlan_class); + NMDeviceClass *device_class = NM_DEVICE_CLASS (vlan_class); - g_type_class_add_private (eth_class, sizeof (NMDeviceVlanPrivate)); + g_type_class_add_private (vlan_class, sizeof (NMDeviceVlanPrivate)); /* virtual methods */ object_class->constructed = constructed; @@ -324,11 +347,10 @@ nm_device_vlan_class_init (NMDeviceVlanClass *eth_class) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_VLAN_HW_ADDRESS, - "Active MAC Address", - "Currently set hardware MAC address", + g_param_spec_string (NM_DEVICE_VLAN_HW_ADDRESS, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceVlan:carrier: @@ -337,11 +359,24 @@ nm_device_vlan_class_init (NMDeviceVlanClass *eth_class) **/ g_object_class_install_property (object_class, PROP_CARRIER, - g_param_spec_boolean (NM_DEVICE_VLAN_CARRIER, - "Carrier", - "Carrier", + g_param_spec_boolean (NM_DEVICE_VLAN_CARRIER, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVlan:parent: + * + * The devices's parent device. + * + * Since: 1.0 + **/ + g_object_class_install_property + (object_class, PROP_PARENT, + g_param_spec_object (NM_DEVICE_VLAN_PARENT, "", "", + NM_TYPE_DEVICE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceVlan:vlan-id: @@ -350,9 +385,8 @@ nm_device_vlan_class_init (NMDeviceVlanClass *eth_class) **/ g_object_class_install_property (object_class, PROP_VLAN_ID, - g_param_spec_uint (NM_DEVICE_VLAN_VLAN_ID, - "VLAN ID", - "VLAN ID", + g_param_spec_uint (NM_DEVICE_VLAN_VLAN_ID, "", "", 0, 4095, 0, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm-glib/nm-device-vlan.h b/libnm-glib/nm-device-vlan.h index 96087109..107cfea8 100644 --- a/libnm-glib/nm-device-vlan.h +++ b/libnm-glib/nm-device-vlan.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2012 Red Hat, Inc. + * Copyright 2012 - 2014 Red Hat, Inc. */ #ifndef NM_DEVICE_VLAN_H @@ -57,6 +55,7 @@ GQuark nm_device_vlan_error_quark (void); #define NM_DEVICE_VLAN_HW_ADDRESS "hw-address" #define NM_DEVICE_VLAN_CARRIER "carrier" +#define NM_DEVICE_VLAN_PARENT "parent" #define NM_DEVICE_VLAN_VLAN_ID "vlan-id" typedef struct { @@ -81,6 +80,8 @@ GObject *nm_device_vlan_new (DBusGConnection *connection, const char *path); const char * nm_device_vlan_get_hw_address (NMDeviceVlan *device); gboolean nm_device_vlan_get_carrier (NMDeviceVlan *device); +NM_AVAILABLE_IN_1_0 +NMDevice * nm_device_vlan_get_parent (NMDeviceVlan *device); guint nm_device_vlan_get_vlan_id (NMDeviceVlan *device); G_END_DECLS diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c index b9cc31d8..28609c79 100644 --- a/libnm-glib/nm-device-wifi.c +++ b/libnm-glib/nm-device-wifi.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,11 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2012 Red Hat, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include <netinet/ether.h> @@ -270,7 +269,7 @@ nm_device_wifi_get_active_access_point (NMDeviceWifi *device) * * Gets all the scanned access points of the #NMDeviceWifi. * - * Returns: (element-type NMClient.AccessPoint): a #GPtrArray containing all the + * Returns: (element-type NMAccessPoint): a #GPtrArray containing all the * scanned #NMAccessPoints. * The returned array is owned by the client and should not be modified. **/ @@ -419,7 +418,7 @@ clean_up_aps (NMDeviceWifi *self, gboolean notify) **/ void _nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, - gboolean enabled) + gboolean enabled) { g_return_if_fail (NM_IS_DEVICE_WIFI (device)); @@ -723,11 +722,10 @@ nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_WIFI_HW_ADDRESS, - "Active MAC Address", - "Currently set hardware MAC address", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_DEVICE_WIFI_HW_ADDRESS, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWifi:perm-hw-address: @@ -736,11 +734,10 @@ nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class) **/ g_object_class_install_property (object_class, PROP_PERM_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, - "Permanent MAC Address", - "Permanent hardware MAC address", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWifi:mode: @@ -749,11 +746,10 @@ nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class) **/ g_object_class_install_property (object_class, PROP_MODE, - g_param_spec_uint (NM_DEVICE_WIFI_MODE, - "Mode", - "Mode", - NM_802_11_MODE_UNKNOWN, NM_802_11_MODE_AP, NM_802_11_MODE_INFRA, - G_PARAM_READABLE)); + g_param_spec_uint (NM_DEVICE_WIFI_MODE, "", "", + NM_802_11_MODE_UNKNOWN, NM_802_11_MODE_AP, NM_802_11_MODE_INFRA, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWifi:bitrate: @@ -762,11 +758,10 @@ nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class) **/ g_object_class_install_property (object_class, PROP_BITRATE, - g_param_spec_uint (NM_DEVICE_WIFI_BITRATE, - "Bit Rate", - "Bit Rate", - 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + g_param_spec_uint (NM_DEVICE_WIFI_BITRATE, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWifi:active-access-point: @@ -775,11 +770,10 @@ nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class) **/ g_object_class_install_property (object_class, PROP_ACTIVE_ACCESS_POINT, - g_param_spec_object (NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, - "Active Access Point", - "Active Access Point", - NM_TYPE_ACCESS_POINT, - G_PARAM_READABLE)); + g_param_spec_object (NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, "", "", + NM_TYPE_ACCESS_POINT, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWifi:wireless-capabilities: @@ -788,11 +782,10 @@ nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class) **/ g_object_class_install_property (object_class, PROP_WIRELESS_CAPABILITIES, - g_param_spec_uint (NM_DEVICE_WIFI_CAPABILITIES, - "Wireless Capabilities", - "Wireless Capabilities", + g_param_spec_uint (NM_DEVICE_WIFI_CAPABILITIES, "", "", 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWifi:access-points: @@ -803,11 +796,10 @@ nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class) **/ g_object_class_install_property (object_class, PROP_ACCESS_POINTS, - g_param_spec_boxed (NM_DEVICE_WIFI_ACCESS_POINTS, - "AccessPoints", - "Access Points", + g_param_spec_boxed (NM_DEVICE_WIFI_ACCESS_POINTS, "", "", NM_TYPE_OBJECT_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /* signals */ @@ -820,13 +812,13 @@ nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class) **/ signals[ACCESS_POINT_ADDED] = g_signal_new ("access-point-added", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_added), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - G_TYPE_OBJECT); + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); /** * NMDeviceWifi::access-point-removed: @@ -837,11 +829,11 @@ nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class) **/ signals[ACCESS_POINT_REMOVED] = g_signal_new ("access-point-removed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_removed), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - G_TYPE_OBJECT); + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); } diff --git a/libnm-glib/nm-device-wifi.h b/libnm-glib/nm-device-wifi.h index f9b30d92..2bb432a7 100644 --- a/libnm-glib/nm-device-wifi.h +++ b/libnm-glib/nm-device-wifi.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2012 Red Hat, Inc. */ #ifndef NM_DEVICE_WIFI_H diff --git a/libnm-glib/nm-device-wimax.c b/libnm-glib/nm-device-wimax.c index 0b052804..f0187fdc 100644 --- a/libnm-glib/nm-device-wimax.c +++ b/libnm-glib/nm-device-wimax.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,11 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 - 2012 Red Hat, Inc. - * Copyright (C) 2009 Novell, Inc. + * Copyright 2011 - 2012 Red Hat, Inc. + * Copyright 2009 Novell, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include <netinet/ether.h> @@ -114,9 +113,9 @@ nm_device_wimax_new (DBusGConnection *connection, const char *path) g_return_val_if_fail (path != NULL, NULL); device = g_object_new (NM_TYPE_DEVICE_WIMAX, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); _nm_object_ensure_inited (NM_OBJECT (device)); return device; } @@ -180,7 +179,7 @@ nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax) * * Gets all the scanned NSPs of the #NMDeviceWimax. * - * Returns: (element-type NMClient.WimaxNsp): a #GPtrArray containing + * Returns: (element-type NMWimaxNsp): a #GPtrArray containing * all the scanned #NMWimaxNsps. * The returned array is owned by the client and should not be modified. **/ @@ -204,7 +203,7 @@ nm_device_wimax_get_nsps (NMDeviceWimax *wimax) **/ NMWimaxNsp * nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax, - const char *path) + const char *path) { const GPtrArray *nsps; int i; @@ -618,11 +617,10 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, - g_param_spec_string (NM_DEVICE_WIMAX_HW_ADDRESS, - "MAC Address", - "Hardware MAC address", + g_param_spec_string (NM_DEVICE_WIMAX_HW_ADDRESS, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWimax:active-nsp: @@ -631,11 +629,10 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) **/ g_object_class_install_property (object_class, PROP_ACTIVE_NSP, - g_param_spec_object (NM_DEVICE_WIMAX_ACTIVE_NSP, - "Active NSP", - "Active NSP", - NM_TYPE_WIMAX_NSP, - G_PARAM_READABLE)); + g_param_spec_object (NM_DEVICE_WIMAX_ACTIVE_NSP, "", "", + NM_TYPE_WIMAX_NSP, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWimax:center-frequency: @@ -646,11 +643,10 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) **/ g_object_class_install_property (object_class, PROP_CENTER_FREQ, - g_param_spec_uint (NM_DEVICE_WIMAX_CENTER_FREQUENCY, - "Center frequency", - "Center frequency", + g_param_spec_uint (NM_DEVICE_WIMAX_CENTER_FREQUENCY, "", "", 0, G_MAXUINT, 0, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWimax:rssi: @@ -662,11 +658,10 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) **/ g_object_class_install_property (object_class, PROP_RSSI, - g_param_spec_int (NM_DEVICE_WIMAX_RSSI, - "RSSI", - "RSSI", + g_param_spec_int (NM_DEVICE_WIMAX_RSSI, "", "", G_MININT, G_MAXINT, 0, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWimax:cinr: @@ -677,11 +672,10 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) **/ g_object_class_install_property (object_class, PROP_CINR, - g_param_spec_int (NM_DEVICE_WIMAX_CINR, - "CINR", - "CINR", + g_param_spec_int (NM_DEVICE_WIMAX_CINR, "", "", G_MININT, G_MAXINT, 0, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWimax:tx-power: @@ -692,11 +686,10 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) **/ g_object_class_install_property (object_class, PROP_TX_POWER, - g_param_spec_int (NM_DEVICE_WIMAX_TX_POWER, - "TX Power", - "TX Power", + g_param_spec_int (NM_DEVICE_WIMAX_TX_POWER, "", "", G_MININT, G_MAXINT, 0, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWimax:bsid: @@ -706,11 +699,10 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) **/ g_object_class_install_property (object_class, PROP_BSID, - g_param_spec_string (NM_DEVICE_WIMAX_BSID, - "BSID", - "BSID", + g_param_spec_string (NM_DEVICE_WIMAX_BSID, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDeviceWimax:nsps: @@ -721,11 +713,10 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) **/ g_object_class_install_property (object_class, PROP_NSPS, - g_param_spec_boxed (NM_DEVICE_WIMAX_NSPS, - "NSPs", - "Network Service Providers", + g_param_spec_boxed (NM_DEVICE_WIMAX_NSPS, "", "", NM_TYPE_OBJECT_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /* signals */ @@ -738,13 +729,13 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) **/ signals[NSP_ADDED] = g_signal_new ("nsp-added", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMDeviceWimaxClass, nsp_added), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - G_TYPE_OBJECT); + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceWimaxClass, nsp_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); /** * NMDeviceWimax::nsp-removed: @@ -755,11 +746,11 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) **/ signals[NSP_REMOVED] = g_signal_new ("nsp-removed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMDeviceWimaxClass, nsp_removed), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - G_TYPE_OBJECT); + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceWimaxClass, nsp_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); } diff --git a/libnm-glib/nm-device-wimax.h b/libnm-glib/nm-device-wimax.h index b2282d4f..1b889d95 100644 --- a/libnm-glib/nm-device-wimax.h +++ b/libnm-glib/nm-device-wimax.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 - 2012 Red Hat, Inc. - * Copyright (C) 2009 Novell, Inc. + * Copyright 2011 - 2012 Red Hat, Inc. + * Copyright 2009 Novell, Inc. */ #ifndef NM_DEVICE_WIMAX_H @@ -79,12 +77,12 @@ typedef struct { GType nm_device_wimax_get_type (void); GObject *nm_device_wimax_new (DBusGConnection *connection, - const char *path); + const char *path); const char *nm_device_wimax_get_hw_address (NMDeviceWimax *wimax); NMWimaxNsp *nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax); NMWimaxNsp *nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax, - const char *path); + const char *path); const GPtrArray *nm_device_wimax_get_nsps (NMDeviceWimax *wimax); diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index b328ba3b..bd5d1637 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,13 +15,15 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2012 Red Hat, Inc. */ +#include "config.h" + #include <string.h> -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> #include <gudev/gudev.h> #include "NetworkManager.h" @@ -346,9 +346,9 @@ constructed (GObject *object) register_properties (NM_DEVICE (object)); dbus_g_object_register_marshaller (g_cclosure_marshal_generic, - G_TYPE_NONE, - G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, - G_TYPE_INVALID); + G_TYPE_NONE, + G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, + G_TYPE_INVALID); dbus_g_proxy_add_signal (priv->proxy, "StateChanged", @@ -356,9 +356,9 @@ constructed (GObject *object) G_TYPE_INVALID); dbus_g_proxy_connect_signal (priv->proxy, "StateChanged", - G_CALLBACK (device_state_changed), - NM_DEVICE (object), - NULL); + G_CALLBACK (device_state_changed), + NM_DEVICE (object), + NULL); } static void @@ -552,11 +552,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_INTERFACE, - g_param_spec_string (NM_DEVICE_INTERFACE, - "Interface", - "Interface name", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_DEVICE_INTERFACE, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:ip-interface: @@ -566,11 +565,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_IP_INTERFACE, - g_param_spec_string (NM_DEVICE_IP_INTERFACE, - "IP Interface", - "IP Interface name", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_DEVICE_IP_INTERFACE, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:device-type: @@ -579,11 +577,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_DEVICE_TYPE, - g_param_spec_uint (NM_DEVICE_DEVICE_TYPE, - "Device Type", - "Numeric device type (ie Ethernet, Wi-Fi, etc)", - NM_DEVICE_TYPE_UNKNOWN, G_MAXUINT32, NM_DEVICE_TYPE_UNKNOWN, - G_PARAM_READABLE)); + g_param_spec_uint (NM_DEVICE_DEVICE_TYPE, "", "", + NM_DEVICE_TYPE_UNKNOWN, G_MAXUINT32, NM_DEVICE_TYPE_UNKNOWN, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:udi: * @@ -596,11 +593,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_UDI, - g_param_spec_string (NM_DEVICE_UDI, - "UDI", - "Unique Device Identifier", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_DEVICE_UDI, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:driver: @@ -609,11 +605,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_DRIVER, - g_param_spec_string (NM_DEVICE_DRIVER, - "Driver", - "Driver", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_DEVICE_DRIVER, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:driver-version: @@ -622,11 +617,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_DRIVER_VERSION, - g_param_spec_string (NM_DEVICE_DRIVER_VERSION, - "Driver Version", - "Driver Version", + g_param_spec_string (NM_DEVICE_DRIVER_VERSION, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:firmware-version: @@ -635,11 +629,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_FIRMWARE_VERSION, - g_param_spec_string (NM_DEVICE_FIRMWARE_VERSION, - "Firmware Version", - "Firmware Version", + g_param_spec_string (NM_DEVICE_FIRMWARE_VERSION, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:capabilities: @@ -648,11 +641,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_CAPABILITIES, - g_param_spec_uint (NM_DEVICE_CAPABILITIES, - "Capabilities", - "Capabilities", - 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + g_param_spec_uint (NM_DEVICE_CAPABILITIES, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:managed: @@ -661,11 +653,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_MANAGED, - g_param_spec_boolean (NM_DEVICE_MANAGED, - "Managed", - "Managed", - FALSE, - G_PARAM_READABLE)); + g_param_spec_boolean (NM_DEVICE_MANAGED, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:autoconnect: @@ -674,11 +665,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_AUTOCONNECT, - g_param_spec_boolean (NM_DEVICE_AUTOCONNECT, - "Autoconnect", - "Autoconnect", + g_param_spec_boolean (NM_DEVICE_AUTOCONNECT, "", "", TRUE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:firmware-missing: @@ -688,11 +678,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_FIRMWARE_MISSING, - g_param_spec_boolean (NM_DEVICE_FIRMWARE_MISSING, - "FirmwareMissing", - "Firmware missing", - FALSE, - G_PARAM_READABLE)); + g_param_spec_boolean (NM_DEVICE_FIRMWARE_MISSING, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:ip4-config: @@ -701,11 +690,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_IP4_CONFIG, - g_param_spec_object (NM_DEVICE_IP4_CONFIG, - "IP4 Config", - "IP4 Config", - NM_TYPE_IP4_CONFIG, - G_PARAM_READABLE)); + g_param_spec_object (NM_DEVICE_IP4_CONFIG, "", "", + NM_TYPE_IP4_CONFIG, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:dhcp4-config: @@ -714,11 +702,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_DHCP4_CONFIG, - g_param_spec_object (NM_DEVICE_DHCP4_CONFIG, - "DHCP4 Config", - "DHCP4 Config", - NM_TYPE_DHCP4_CONFIG, - G_PARAM_READABLE)); + g_param_spec_object (NM_DEVICE_DHCP4_CONFIG, "", "", + NM_TYPE_DHCP4_CONFIG, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:ip6-config: @@ -727,11 +714,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_IP6_CONFIG, - g_param_spec_object (NM_DEVICE_IP6_CONFIG, - "IP6 Config", - "IP6 Config", + g_param_spec_object (NM_DEVICE_IP6_CONFIG, "", "", NM_TYPE_IP6_CONFIG, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:dhcp6-config: @@ -740,11 +726,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_DHCP6_CONFIG, - g_param_spec_object (NM_DEVICE_DHCP6_CONFIG, - "DHCP6 Config", - "DHCP6 Config", - NM_TYPE_DHCP6_CONFIG, - G_PARAM_READABLE)); + g_param_spec_object (NM_DEVICE_DHCP6_CONFIG, "", "", + NM_TYPE_DHCP6_CONFIG, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:state: @@ -753,11 +738,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_STATE, - g_param_spec_uint (NM_DEVICE_STATE, - "State", - "State", - 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + g_param_spec_uint (NM_DEVICE_STATE, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:state-reason: @@ -766,11 +750,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_STATE_REASON, - g_param_spec_boxed (NM_DEVICE_STATE_REASON, - "StateReason", - "StateReason", + g_param_spec_boxed (NM_DEVICE_STATE_REASON, "", "", DBUS_G_TYPE_UINT_STRUCT, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:active-connection: @@ -779,11 +762,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_ACTIVE_CONNECTION, - g_param_spec_object (NM_DEVICE_ACTIVE_CONNECTION, - "ActiveConnection", - "Active Connection", + g_param_spec_object (NM_DEVICE_ACTIVE_CONNECTION, "", "", NM_TYPE_ACTIVE_CONNECTION, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:available-connections: @@ -794,11 +776,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_AVAILABLE_CONNECTIONS, - g_param_spec_boxed (NM_DEVICE_AVAILABLE_CONNECTIONS, - "AvailableConnections", - "Available Connections", - NM_TYPE_OBJECT_ARRAY, - G_PARAM_READABLE)); + g_param_spec_boxed (NM_DEVICE_AVAILABLE_CONNECTIONS, "", "", + NM_TYPE_OBJECT_ARRAY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:vendor: @@ -807,11 +788,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_VENDOR, - g_param_spec_string (NM_DEVICE_VENDOR, - "Vendor", - "Vendor string", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_DEVICE_VENDOR, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:product: @@ -820,11 +800,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_PRODUCT, - g_param_spec_string (NM_DEVICE_PRODUCT, - "Product", - "Product string", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_DEVICE_PRODUCT, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:physical-port-id: @@ -836,11 +815,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_PHYSICAL_PORT_ID, - g_param_spec_string (NM_DEVICE_PHYSICAL_PORT_ID, - "Physical Port ID", - "Physical port ID", + g_param_spec_string (NM_DEVICE_PHYSICAL_PORT_ID, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMDevice:mtu: @@ -851,11 +829,10 @@ nm_device_class_init (NMDeviceClass *device_class) **/ g_object_class_install_property (object_class, PROP_MTU, - g_param_spec_uint (NM_DEVICE_MTU, - "MTU", - "MTU", + g_param_spec_uint (NM_DEVICE_MTU, "", "", 0, G_MAXUINT32, 1500, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /* signals */ @@ -870,12 +847,12 @@ nm_device_class_init (NMDeviceClass *device_class) **/ signals[STATE_CHANGED] = g_signal_new ("state-changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMDeviceClass, state_changed), - NULL, NULL, NULL, - G_TYPE_NONE, 3, - G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceClass, state_changed), + NULL, NULL, NULL, + G_TYPE_NONE, 3, + G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); } /** @@ -1448,7 +1425,7 @@ nm_device_get_active_connection (NMDevice *device) * Gets the #NMRemoteConnections currently known to the daemon that could * be activated on @device. * - * Returns: (element-type NMClient.RemoteConnection): the #GPtrArray + * Returns: (element-type NMRemoteConnection): the #GPtrArray * containing #NMRemoteConnections. This is the internal copy used by * the connection, and must not be modified. * @@ -1782,8 +1759,7 @@ get_short_vendor (NMDevice *device) * nm_device_get_description: * @device: an #NMDevice * - * Gets a description of @device, incorporating the results of - * nm_device_get_short_vendor() and nm_device_get_short_product(). + * Gets a description of @device, based on its vendor and product names. * * Returns: a description of @device. If either the vendor or the * product name is unknown, this returns the interface name. @@ -2090,18 +2066,38 @@ nm_device_get_mtu (NMDevice *device) return NM_DEVICE_GET_PRIVATE (device)->mtu; } +/** + * nm_device_is_software: + * @device: a #NMDevice + * + * Whether the device is a software device. + * + * Returns: %TRUE if @device is a software device, %FALSE if it is a hardware device. + * + * Since: 1.0 + **/ +gboolean +nm_device_is_software (NMDevice *device) +{ + g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + + _nm_object_ensure_inited (NM_OBJECT (device)); + return !!(NM_DEVICE_GET_PRIVATE (device)->capabilities & NM_DEVICE_CAP_IS_SOFTWARE); +} + typedef struct { NMDevice *device; - NMDeviceDeactivateFn fn; + NMDeviceCallbackFn fn; gpointer user_data; -} DeactivateInfo; + const char *method; +} DeviceCallbackInfo; static void -deactivate_cb (DBusGProxy *proxy, - DBusGProxyCall *call, - gpointer user_data) +device_operation_cb (DBusGProxy *proxy, + DBusGProxyCall *call, + gpointer user_data) { - DeactivateInfo *info = user_data; + DeviceCallbackInfo *info = user_data; GError *error = NULL; dbus_g_proxy_end_call (proxy, call, &error, @@ -2109,16 +2105,17 @@ deactivate_cb (DBusGProxy *proxy, if (info->fn) info->fn (info->device, error, info->user_data); else if (error) { - g_warning ("%s: device %s deactivation failed: (%d) %s", + g_warning ("%s: device %s %s failed: (%d) %s", __func__, nm_object_get_path (NM_OBJECT (info->device)), + info->method, error ? error->code : -1, error && error->message ? error->message : "(unknown)"); } g_clear_error (&error); g_object_unref (info->device); - g_slice_free (DeactivateInfo, info); + g_slice_free (DeviceCallbackInfo, info); } /** @@ -2134,20 +2131,52 @@ deactivate_cb (DBusGProxy *proxy, **/ void nm_device_disconnect (NMDevice *device, - NMDeviceDeactivateFn callback, + NMDeviceCallbackFn callback, gpointer user_data) { - DeactivateInfo *info; + DeviceCallbackInfo *info; g_return_if_fail (NM_IS_DEVICE (device)); - info = g_slice_new (DeactivateInfo); + info = g_slice_new (DeviceCallbackInfo); info->fn = callback; info->user_data = user_data; + info->method = "Disconnect"; info->device = g_object_ref (device); dbus_g_proxy_begin_call (NM_DEVICE_GET_PRIVATE (device)->proxy, "Disconnect", - deactivate_cb, info, NULL, + device_operation_cb, info, NULL, + G_TYPE_INVALID); +} + +/** + * nm_device_delete: + * @device: a #NMDevice + * @callback: (scope async) (allow-none): callback to be called when delete + * operation completes + * @user_data: (closure): caller-specific data passed to @callback + * + * Deletes the software device. Hardware devices can't be deleted. + * + * Since: 1.0 + **/ +void +nm_device_delete (NMDevice *device, + NMDeviceCallbackFn callback, + gpointer user_data) +{ + DeviceCallbackInfo *info; + + g_return_if_fail (NM_IS_DEVICE (device)); + + info = g_slice_new (DeviceCallbackInfo); + info->fn = callback; + info->user_data = user_data; + info->method = "Delete"; + info->device = g_object_ref (device); + + dbus_g_proxy_begin_call (NM_DEVICE_GET_PRIVATE (device)->proxy, "Delete", + device_operation_cb, info, NULL, G_TYPE_INVALID); } @@ -2186,7 +2215,7 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro device_iface = nm_device_get_iface (device); if (config_iface && g_strcmp0 (config_iface, device_iface) != 0) { g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INTERFACE_MISMATCH, - "The interface names of the device and the connection didn't match."); + "The interface names of the device and the connection didn't match."); return FALSE; } @@ -2227,7 +2256,7 @@ nm_device_connection_compatible (NMDevice *device, NMConnection *connection, GEr /** * nm_device_filter_connections: * @device: an #NMDevice to filter connections for - * @connections: (element-type NetworkManager.Connection): a list of #NMConnection objects to filter + * @connections: (element-type NMConnection): a list of #NMConnection objects to filter * * Filters a given list of connections for a given #NMDevice object and return * connections which may be activated with the device. For example if @device @@ -2238,7 +2267,7 @@ nm_device_connection_compatible (NMDevice *device, NMConnection *connection, GEr * incompatible with the device. To get the full list of connections see * nm_remote_settings_list_connections(). * - * Returns: (transfer container) (element-type NetworkManager.Connection): a + * Returns: (transfer container) (element-type NMConnection): a * list of #NMConnection objects that could be activated with the given @device. * The elements of the list are owned by their creator and should not be freed * by the caller, but the returned list itself is owned by the caller and should diff --git a/libnm-glib/nm-device.h b/libnm-glib/nm-device.h index ed0f6876..707fddf8 100644 --- a/libnm-glib/nm-device.h +++ b/libnm-glib/nm-device.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2013 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2013 Red Hat, Inc. */ #ifndef NM_DEVICE_H @@ -144,6 +142,8 @@ NM_AVAILABLE_IN_0_9_10 const char * nm_device_get_physical_port_id (NMDevice *device); NM_AVAILABLE_IN_0_9_10 guint32 nm_device_get_mtu (NMDevice *device); +NM_AVAILABLE_IN_1_0 +gboolean nm_device_is_software (NMDevice *device); const char * nm_device_get_product (NMDevice *device); const char * nm_device_get_vendor (NMDevice *device); @@ -153,10 +153,15 @@ NM_AVAILABLE_IN_0_9_10 char ** nm_device_disambiguate_names (NMDevice **devices, int num_devices); -typedef void (*NMDeviceDeactivateFn) (NMDevice *device, GError *error, gpointer user_data); +typedef void (*NMDeviceCallbackFn) (NMDevice *device, GError *error, gpointer user_data); void nm_device_disconnect (NMDevice *device, - NMDeviceDeactivateFn callback, + NMDeviceCallbackFn callback, + gpointer user_data); + +NM_AVAILABLE_IN_1_0 +void nm_device_delete (NMDevice *device, + NMDeviceCallbackFn callback, gpointer user_data); GSList * nm_device_filter_connections (NMDevice *device, @@ -172,6 +177,10 @@ gboolean nm_device_connection_compatible (NMDevice *device, NM_AVAILABLE_IN_0_9_10 GType nm_device_get_setting_type (NMDevice *device); +/* Deprecated */ +NM_DEPRECATED_IN_1_0 +typedef void (*NMDeviceDeactivateFn) (NMDevice *device, GError *error, gpointer user_data); + G_END_DECLS #endif /* NM_DEVICE_H */ diff --git a/libnm-glib/nm-dhcp4-config.c b/libnm-glib/nm-dhcp4-config.c index a861d982..58479374 100644 --- a/libnm-glib/nm-dhcp4-config.c +++ b/libnm-glib/nm-dhcp4-config.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 - 2011 Red Hat, Inc. - * Copyright (C) 2008 Novell, Inc. + * Copyright 2008 - 2011 Red Hat, Inc. + * Copyright 2008 Novell, Inc. */ +#include "config.h" + #include <string.h> #include "nm-dhcp4-config.h" @@ -156,11 +156,10 @@ nm_dhcp4_config_class_init (NMDHCP4ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_OPTIONS, - g_param_spec_boxed (NM_DHCP4_CONFIG_OPTIONS, - "Options", - "Options", - G_TYPE_HASH_TABLE, - G_PARAM_READABLE)); + g_param_spec_boxed (NM_DHCP4_CONFIG_OPTIONS, "", "", + G_TYPE_HASH_TABLE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } /** @@ -176,9 +175,9 @@ GObject * nm_dhcp4_config_new (DBusGConnection *connection, const char *object_path) { return (GObject *) g_object_new (NM_TYPE_DHCP4_CONFIG, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, object_path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, object_path, + NULL); } /** @@ -216,4 +215,3 @@ nm_dhcp4_config_get_one_option (NMDHCP4Config *config, const char *option) return g_hash_table_lookup (nm_dhcp4_config_get_options (config), option); } - diff --git a/libnm-glib/nm-dhcp4-config.h b/libnm-glib/nm-dhcp4-config.h index 9ca1a769..c64e9a9c 100644 --- a/libnm-glib/nm-dhcp4-config.h +++ b/libnm-glib/nm-dhcp4-config.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Red Hat, Inc. - * Copyright (C) 2008 Novell, Inc. + * Copyright 2008 Red Hat, Inc. + * Copyright 2008 Novell, Inc. */ #ifndef NM_DHCP4_CONFIG_H diff --git a/libnm-glib/nm-dhcp6-config.c b/libnm-glib/nm-dhcp6-config.c index ef6006b0..e55c1416 100644 --- a/libnm-glib/nm-dhcp6-config.c +++ b/libnm-glib/nm-dhcp6-config.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 - 2011 Red Hat, Inc. - * Copyright (C) 2008 Novell, Inc. + * Copyright 2008 - 2011 Red Hat, Inc. + * Copyright 2008 Novell, Inc. */ +#include "config.h" + #include <string.h> #include "nm-dhcp6-config.h" @@ -156,11 +156,10 @@ nm_dhcp6_config_class_init (NMDHCP6ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_OPTIONS, - g_param_spec_boxed (NM_DHCP6_CONFIG_OPTIONS, - "Options", - "Options", - G_TYPE_HASH_TABLE, - G_PARAM_READABLE)); + g_param_spec_boxed (NM_DHCP6_CONFIG_OPTIONS, "", "", + G_TYPE_HASH_TABLE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } /** @@ -176,9 +175,9 @@ GObject * nm_dhcp6_config_new (DBusGConnection *connection, const char *object_path) { return (GObject *) g_object_new (NM_TYPE_DHCP6_CONFIG, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, object_path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, object_path, + NULL); } /** @@ -216,4 +215,3 @@ nm_dhcp6_config_get_one_option (NMDHCP6Config *config, const char *option) return g_hash_table_lookup (nm_dhcp6_config_get_options (config), option); } - diff --git a/libnm-glib/nm-dhcp6-config.h b/libnm-glib/nm-dhcp6-config.h index 44002940..939b3fdb 100644 --- a/libnm-glib/nm-dhcp6-config.h +++ b/libnm-glib/nm-dhcp6-config.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 - 2010 Red Hat, Inc. - * Copyright (C) 2008 Novell, Inc. + * Copyright 2008 - 2010 Red Hat, Inc. + * Copyright 2008 Novell, Inc. */ #ifndef NM_DHCP6_CONFIG_H diff --git a/libnm-glib/nm-ip4-config.c b/libnm-glib/nm-ip4-config.c index ec523a03..ffaef741 100644 --- a/libnm-glib/nm-ip4-config.c +++ b/libnm-glib/nm-ip4-config.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2011 Novell, Inc. - * Copyright (C) 2008 Red Hat, Inc. + * Copyright 2007 - 2011 Novell, Inc. + * Copyright 2008 Red Hat, Inc. */ +#include "config.h" + #include <string.h> #include <nm-setting-ip4-config.h> @@ -240,11 +240,10 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_GATEWAY, - g_param_spec_string (NM_IP4_CONFIG_GATEWAY, - "Gateway", - "Gateway", + g_param_spec_string (NM_IP4_CONFIG_GATEWAY, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMIP4Config:addresses: @@ -253,10 +252,9 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_ADDRESSES, - g_param_spec_pointer (NM_IP4_CONFIG_ADDRESSES, - "Addresses", - "Addresses", - G_PARAM_READABLE)); + g_param_spec_pointer (NM_IP4_CONFIG_ADDRESSES, "", "", + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMIP4Config:routes: @@ -265,10 +263,9 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_ROUTES, - g_param_spec_pointer (NM_IP4_CONFIG_ROUTES, - "Routes", - "Routes", - G_PARAM_READABLE)); + g_param_spec_pointer (NM_IP4_CONFIG_ROUTES, "", "", + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMIP4Config:nameservers: @@ -277,11 +274,10 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_NAMESERVERS, - g_param_spec_boxed (NM_IP4_CONFIG_NAMESERVERS, - "Nameservers", - "Nameservers", + g_param_spec_boxed (NM_IP4_CONFIG_NAMESERVERS, "", "", NM_TYPE_UINT_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMIP4Config:domains: @@ -290,11 +286,10 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_DOMAINS, - g_param_spec_boxed (NM_IP4_CONFIG_DOMAINS, - "Domains", - "Domains", + g_param_spec_boxed (NM_IP4_CONFIG_DOMAINS, "", "", NM_TYPE_STRING_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMIP4Config:searches: @@ -305,11 +300,10 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_SEARCHES, - g_param_spec_boxed (NM_IP4_CONFIG_SEARCHES, - "Searches", - "DNS searches", + g_param_spec_boxed (NM_IP4_CONFIG_SEARCHES, "", "", NM_TYPE_STRING_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMIP4Config:wins-servers: @@ -318,11 +312,10 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_WINS_SERVERS, - g_param_spec_boxed (NM_IP4_CONFIG_WINS_SERVERS, - "WINS Servers", - "WINS Servers", + g_param_spec_boxed (NM_IP4_CONFIG_WINS_SERVERS, "", "", NM_TYPE_UINT_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } /** @@ -368,7 +361,7 @@ nm_ip4_config_get_gateway (NMIP4Config *config) * * Gets the IP4 addresses (containing the address, prefix, and gateway). * - * Returns: (element-type NetworkManager.IP4Address): the #GSList containing #NMIP4Address<!-- -->es. + * Returns: (element-type NMIP4Address): the #GSList containing #NMIP4Address<!-- -->es. * This is the internal copy used by the configuration and must not be modified. **/ const GSList * @@ -405,7 +398,7 @@ nm_ip4_config_get_nameservers (NMIP4Config *config) * * Gets the domain names. * - * Returns: (element-type utf8): the #GPtrArray containing domains as strings. This is the + * Returns: (element-type utf8): the #GPtrArray containing domains as strings. This is the * internal copy used by the configuration, and must not be modified. **/ const GPtrArray * @@ -462,7 +455,7 @@ nm_ip4_config_get_wins_servers (NMIP4Config *config) * * Gets the routes. * - * Returns: (element-type NetworkManager.IP4Route): the #GSList containing + * Returns: (element-type NMIP4Route): the #GSList containing * #NMIP4Routes. This is the internal copy used by the configuration, * and must not be modified. **/ @@ -474,4 +467,3 @@ nm_ip4_config_get_routes (NMIP4Config *config) _nm_object_ensure_inited (NM_OBJECT (config)); return NM_IP4_CONFIG_GET_PRIVATE (config)->routes; } - diff --git a/libnm-glib/nm-ip4-config.h b/libnm-glib/nm-ip4-config.h index aa2e66eb..58b6b371 100644 --- a/libnm-glib/nm-ip4-config.h +++ b/libnm-glib/nm-ip4-config.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2008 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2008 Red Hat, Inc. */ #ifndef NM_IP4_CONFIG_H diff --git a/libnm-glib/nm-ip6-config.c b/libnm-glib/nm-ip6-config.c index 7c9cfca7..d44056a1 100644 --- a/libnm-glib/nm-ip6-config.c +++ b/libnm-glib/nm-ip6-config.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2008 - 2014 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2008 - 2014 Red Hat, Inc. */ +#include "config.h" + #include <string.h> #include <nm-setting-ip6-config.h> @@ -70,9 +70,9 @@ GObject * nm_ip6_config_new (DBusGConnection *connection, const char *object_path) { return (GObject *) g_object_new (NM_TYPE_IP6_CONFIG, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, object_path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, object_path, + NULL); } static gboolean @@ -179,7 +179,7 @@ nm_ip6_config_get_gateway (NMIP6Config *config) * * Gets the IP6 addresses (containing the address, prefix, and gateway). * - * Returns: (element-type NetworkManager.IP6Address): the #GSList containing + * Returns: (element-type NMIP6Address): the #GSList containing * #NMIP6Address<!-- -->es. This is the internal copy used by the configuration * and must not be modified. **/ @@ -306,7 +306,7 @@ nm_ip6_config_get_searches (NMIP6Config *config) * * Gets the routes. * - * Returns: (element-type NetworkManager.IP6Route): the #GSList containing + * Returns: (element-type NMIP6Route): the #GSList containing * #NMIP6Routes. This is the internal copy used by the configuration, * and must not be modified. **/ @@ -420,11 +420,10 @@ nm_ip6_config_class_init (NMIP6ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_GATEWAY, - g_param_spec_string (NM_IP6_CONFIG_GATEWAY, - "Gateway", - "Gateway", + g_param_spec_string (NM_IP6_CONFIG_GATEWAY, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMIP6Config:addresses: @@ -435,11 +434,10 @@ nm_ip6_config_class_init (NMIP6ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_ADDRESSES, - g_param_spec_boxed (NM_IP6_CONFIG_ADDRESSES, - "Addresses", - "Addresses", + g_param_spec_boxed (NM_IP6_CONFIG_ADDRESSES, "", "", NM_TYPE_IP6_ADDRESS_OBJECT_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMIP6Config:routes: @@ -450,11 +448,10 @@ nm_ip6_config_class_init (NMIP6ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_ROUTES, - g_param_spec_boxed (NM_IP6_CONFIG_ROUTES, - "Routes", - "Routes", + g_param_spec_boxed (NM_IP6_CONFIG_ROUTES, "", "", NM_TYPE_IP6_ROUTE_OBJECT_ARRAY, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMIP6Config:nameservers: @@ -464,11 +461,10 @@ nm_ip6_config_class_init (NMIP6ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_NAMESERVERS, - g_param_spec_boxed (NM_IP6_CONFIG_NAMESERVERS, - "Nameservers", - "Nameservers", - NM_TYPE_IP6_ADDRESS_ARRAY, - G_PARAM_READABLE)); + g_param_spec_boxed (NM_IP6_CONFIG_NAMESERVERS, "", "", + NM_TYPE_IP6_ADDRESS_ARRAY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMIP6Config:domains: @@ -477,11 +473,10 @@ nm_ip6_config_class_init (NMIP6ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_DOMAINS, - g_param_spec_boxed (NM_IP6_CONFIG_DOMAINS, - "Domains", - "Domains", - NM_TYPE_STRING_ARRAY, - G_PARAM_READABLE)); + g_param_spec_boxed (NM_IP6_CONFIG_DOMAINS, "", "", + NM_TYPE_STRING_ARRAY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMIP6Config:searches: @@ -492,11 +487,9 @@ nm_ip6_config_class_init (NMIP6ConfigClass *config_class) **/ g_object_class_install_property (object_class, PROP_SEARCHES, - g_param_spec_boxed (NM_IP6_CONFIG_SEARCHES, - "Searches", - "DNS Searches", - NM_TYPE_STRING_ARRAY, - G_PARAM_READABLE)); + g_param_spec_boxed (NM_IP6_CONFIG_SEARCHES, "", "", + NM_TYPE_STRING_ARRAY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } - diff --git a/libnm-glib/nm-ip6-config.h b/libnm-glib/nm-ip6-config.h index feef69f1..7a64805b 100644 --- a/libnm-glib/nm-ip6-config.h +++ b/libnm-glib/nm-ip6-config.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2008 - 2014 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2008 - 2014 Red Hat, Inc. */ #ifndef NM_IP6_CONFIG_H diff --git a/libnm-glib/nm-object-cache.c b/libnm-glib/nm-object-cache.c index 2748b1df..752c606a 100644 --- a/libnm-glib/nm-object-cache.c +++ b/libnm-glib/nm-object-cache.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,9 +15,11 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Red Hat, Inc. + * Copyright 2008 Red Hat, Inc. */ +#include "config.h" + #include <string.h> #include <glib.h> #include "nm-object-cache.h" @@ -65,27 +65,26 @@ _nm_object_cache_get (const char *path) } void -_nm_object_cache_clear (NMObject *except) +_nm_object_cache_clear (void) { GHashTableIter iter; - NMObject *obj; + GObject *obj; const char *path; char *foo; - _init_cache (); + if (!cache) + return; + g_hash_table_iter_init (&iter, cache); while (g_hash_table_iter_next (&iter, (gpointer) &path, (gpointer) &obj)) { - if (obj != except) { - /* Remove the callback so that if the object isn't yet released - * by a client, when it does finally get unrefed, it won't trigger - * the cache removal for a new object with the same path as the - * one being released. - */ - foo = g_object_steal_data (G_OBJECT (obj), "nm-object-cache-tag"); - g_free (foo); + /* Remove the callback so that if the object isn't yet released + * by a client, when it does finally get unrefed, it won't trigger + * the cache removal for a new object with the same path as the + * one being released. + */ + foo = g_object_steal_data (obj, "nm-object-cache-tag"); + g_free (foo); - g_hash_table_iter_remove (&iter); - } + g_hash_table_iter_remove (&iter); } } - diff --git a/libnm-glib/nm-object-cache.h b/libnm-glib/nm-object-cache.h index 84752134..7aca3b4f 100644 --- a/libnm-glib/nm-object-cache.h +++ b/libnm-glib/nm-object-cache.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Red Hat, Inc. + * Copyright 2008 Red Hat, Inc. */ #ifndef NM_OBJECT_CACHE_H @@ -32,7 +30,7 @@ G_BEGIN_DECLS /* Returns referenced object from the cache */ NMObject *_nm_object_cache_get (const char *path); void _nm_object_cache_add (NMObject *object); -void _nm_object_cache_clear (NMObject *except); +void _nm_object_cache_clear (void); G_END_DECLS diff --git a/libnm-glib/nm-object-private.h b/libnm-glib/nm-object-private.h index 3253c2ec..75e63b2e 100644 --- a/libnm-glib/nm-object-private.h +++ b/libnm-glib/nm-object-private.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 - 2011 Red Hat, Inc. + * Copyright 2008 - 2011 Red Hat, Inc. */ #ifndef NM_OBJECT_PRIVATE_H @@ -47,8 +45,8 @@ DBusGProxy *_nm_object_new_proxy (NMObject *self, gboolean _nm_object_is_connection_private (NMObject *self); void _nm_object_register_properties (NMObject *object, - DBusGProxy *proxy, - const NMPropertiesInfo *info); + DBusGProxy *proxy, + const NMPropertiesInfo *info); gboolean _nm_object_reload_properties (NMObject *object, GError **error); diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c index 61282cfb..fb25c1ac 100644 --- a/libnm-glib/nm-object.c +++ b/libnm-glib/nm-object.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2012 Red Hat, Inc. */ +#include "config.h" + #include <string.h> #include <gio/gio.h> #include <stdlib.h> @@ -41,15 +41,17 @@ static gboolean debug = FALSE; static void nm_object_initable_iface_init (GInitableIface *iface); static void nm_object_async_initable_iface_init (GAsyncInitableIface *iface); +static GHashTable *type_funcs, *type_async_funcs; + G_DEFINE_ABSTRACT_TYPE_WITH_CODE (NMObject, nm_object, G_TYPE_OBJECT, + type_funcs = g_hash_table_new (NULL, NULL); + type_async_funcs = g_hash_table_new (NULL, NULL); G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, nm_object_initable_iface_init); G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, nm_object_async_initable_iface_init); ) #define NM_OBJECT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_OBJECT, NMObjectPrivate)) -static GHashTable *type_funcs, *type_async_funcs; - typedef struct { PropertyMarshalFunc func; GType object_type; @@ -82,8 +84,8 @@ typedef struct { enum { PROP_0, - PROP_CONNECTION, - PROP_PATH, + PROP_DBUS_CONNECTION, + PROP_DBUS_PATH, LAST_PROP }; @@ -159,8 +161,6 @@ constructor (GType type, return NULL; } - _nm_object_cache_add (NM_OBJECT (object)); - return object; } @@ -336,18 +336,18 @@ finalize (GObject *object) static void set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec) + const GValue *value, GParamSpec *pspec) { NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); switch (prop_id) { - case PROP_CONNECTION: + case PROP_DBUS_CONNECTION: /* Construct only */ priv->connection = g_value_dup_boxed (value); if (!priv->connection) priv->connection = _nm_dbus_new_connection (NULL); break; - case PROP_PATH: + case PROP_DBUS_PATH: /* Construct only */ priv->path = g_value_dup_string (value); break; @@ -359,15 +359,15 @@ set_property (GObject *object, guint prop_id, static void get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) + GValue *value, GParamSpec *pspec) { NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); switch (prop_id) { - case PROP_CONNECTION: + case PROP_DBUS_CONNECTION: g_value_set_boxed (value, priv->connection); break; - case PROP_PATH: + case PROP_DBUS_PATH: g_value_set_string (value, priv->path); break; default: @@ -383,11 +383,6 @@ nm_object_class_init (NMObjectClass *nm_object_class) g_type_class_add_private (nm_object_class, sizeof (NMObjectPrivate)); - if (!type_funcs) { - type_funcs = g_hash_table_new (NULL, NULL); - type_async_funcs = g_hash_table_new (NULL, NULL); - } - /* virtual methods */ object_class->constructor = constructor; object_class->constructed = constructed; @@ -396,7 +391,7 @@ nm_object_class_init (NMObjectClass *nm_object_class) object_class->dispose = dispose; object_class->finalize = finalize; - /* porperties */ + /* Properties */ /** * NMObject:connection: @@ -404,12 +399,12 @@ nm_object_class_init (NMObjectClass *nm_object_class) * The #DBusGConnection of the object. **/ g_object_class_install_property - (object_class, PROP_CONNECTION, - g_param_spec_boxed (NM_OBJECT_DBUS_CONNECTION, - "Connection", - "Connection", - DBUS_TYPE_G_CONNECTION, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + (object_class, PROP_DBUS_CONNECTION, + g_param_spec_boxed (NM_OBJECT_DBUS_CONNECTION, "", "", + DBUS_TYPE_G_CONNECTION, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); /** * NMObject:path: @@ -417,12 +412,12 @@ nm_object_class_init (NMObjectClass *nm_object_class) * The DBus object path. **/ g_object_class_install_property - (object_class, PROP_PATH, - g_param_spec_string (NM_OBJECT_DBUS_PATH, - "Object Path", - "DBus Object Path", - NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + (object_class, PROP_DBUS_PATH, + g_param_spec_string (NM_OBJECT_DBUS_PATH, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); /* signals */ @@ -578,6 +573,8 @@ _nm_object_create (GType type, DBusGConnection *connection, const char *path) NM_OBJECT_DBUS_CONNECTION, connection, NM_OBJECT_DBUS_PATH, path, NULL); + if (NM_IS_OBJECT (object)) + _nm_object_cache_add (NM_OBJECT (object)); if (!g_initable_init (G_INITABLE (object), NULL, &error)) { dbgmsg ("Could not create object for %s: %s", path, error->message); g_error_free (error); @@ -661,6 +658,8 @@ async_got_type (GType type, gpointer user_data) NM_OBJECT_DBUS_PATH, async_data->path, NULL); g_warn_if_fail (object != NULL); + if (NM_IS_OBJECT (object)) + _nm_object_cache_add (NM_OBJECT (object)); g_async_initable_init_async (G_ASYNC_INITABLE (object), G_PRIORITY_DEFAULT, NULL, async_inited, async_data); } @@ -1189,10 +1188,10 @@ _nm_object_register_properties (NMObject *object, dbus_g_proxy_add_signal (proxy, "PropertiesChanged", DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID); dbus_g_proxy_connect_signal (proxy, - "PropertiesChanged", - G_CALLBACK (properties_changed_proxy), - object, - NULL); + "PropertiesChanged", + G_CALLBACK (properties_changed_proxy), + object, + NULL); instance = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); priv->property_tables = g_slist_prepend (priv->property_tables, instance); @@ -1446,4 +1445,3 @@ _nm_object_is_connection_private (NMObject *self) { return _nm_dbus_is_connection_private (NM_OBJECT_GET_PRIVATE (self)->connection); } - diff --git a/libnm-glib/nm-object.h b/libnm-glib/nm-object.h index ae97184f..07348f24 100644 --- a/libnm-glib/nm-object.h +++ b/libnm-glib/nm-object.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2012 Red Hat, Inc. */ #ifndef NM_OBJECT_H diff --git a/libnm-glib/nm-remote-connection-private.h b/libnm-glib/nm-remote-connection-private.h index 3df57606..e3f35428 100644 --- a/libnm-glib/nm-remote-connection-private.h +++ b/libnm-glib/nm-remote-connection-private.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2009 Red Hat, Inc. + * Copyright 2009 Red Hat, Inc. */ #ifndef __NM_REMOTE_CONNECTION_PRIVATE_H__ @@ -33,4 +31,3 @@ typedef enum { } NMRemoteConnectionInitResult; #endif /* __NM_REMOTE_CONNECTION_PRIVATE__ */ - diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c index 38911a43..3a70e81e 100644 --- a/libnm-glib/nm-remote-connection.c +++ b/libnm-glib/nm-remote-connection.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,13 +15,15 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2011 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2011 Red Hat, Inc. */ +#include "config.h" + #include <string.h> #include <gio/gio.h> -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> #include <NetworkManager.h> #include <nm-utils.h> @@ -70,13 +70,13 @@ typedef struct RemoteCall RemoteCall; typedef void (*RemoteCallFetchResultCb) (RemoteCall *call, DBusGProxyCall *proxy_call, GError *error); -typedef struct RemoteCall { +struct RemoteCall { NMRemoteConnection *self; DBusGProxyCall *call; RemoteCallFetchResultCb fetch_result_cb; GFunc callback; gpointer user_data; -} RemoteCall; +}; typedef struct { DBusGConnection *bus; @@ -125,7 +125,7 @@ _nm_remote_connection_ensure_inited (NMRemoteConnection *self) */ if (!g_error_matches (error, DBUS_GERROR, DBUS_GERROR_NO_REPLY)) { g_warning ("%s: (NMRemoteConnection) error initializing: %s\n", - __func__, error->message); + __func__, error->message); } g_error_free (error); } @@ -712,8 +712,8 @@ init_get_settings_cb (DBusGProxy *proxy, static void init_async (GAsyncInitable *initable, int io_priority, - GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data) + GCancellable *cancellable, GAsyncReadyCallback callback, + gpointer user_data) { NMRemoteConnectionInitData *init_data; NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (initable); @@ -864,29 +864,34 @@ nm_remote_connection_class_init (NMRemoteConnectionClass *remote_class) object_class->constructed = constructed; /* Properties */ + /** + * NMRemoteConnection:bus: + * + * The #DBusGConnection that the #NMRemoteConnection is connected to. + */ g_object_class_install_property (object_class, PROP_BUS, - g_param_spec_boxed (NM_REMOTE_CONNECTION_BUS, - "DBusGConnection", - "DBusGConnection", - DBUS_TYPE_G_CONNECTION, - G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_param_spec_boxed (NM_REMOTE_CONNECTION_BUS, "", "", + DBUS_TYPE_G_CONNECTION, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); /* These are needed so _nm_object_create() can create NMRemoteConnections */ g_object_class_install_property (object_class, PROP_DBUS_CONNECTION, - g_param_spec_boxed (NM_REMOTE_CONNECTION_DBUS_CONNECTION, - "DBusGConnection", - "DBusGConnection", + g_param_spec_boxed (NM_REMOTE_CONNECTION_DBUS_CONNECTION, "", "", DBUS_TYPE_G_CONNECTION, - G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_DBUS_PATH, - g_param_spec_string (NM_REMOTE_CONNECTION_DBUS_PATH, - "Object Path", - "DBus Object Path", + g_param_spec_string (NM_REMOTE_CONNECTION_DBUS_PATH, "", "", NULL, - G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); /** * NMRemoteConnection:unsaved: @@ -896,12 +901,12 @@ nm_remote_connection_class_init (NMRemoteConnectionClass *remote_class) * * Since: 0.9.10 **/ - g_object_class_install_property (object_class, PROP_UNSAVED, - g_param_spec_boolean (NM_REMOTE_CONNECTION_UNSAVED, - "Unsaved", - "Unsaved", + g_object_class_install_property + (object_class, PROP_UNSAVED, + g_param_spec_boolean (NM_REMOTE_CONNECTION_UNSAVED, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /* Signals */ /** @@ -911,7 +916,7 @@ nm_remote_connection_class_init (NMRemoteConnectionClass *remote_class) * This signal is emitted when a connection changes, and it is * still visible to the user. */ - signals[UPDATED] = + signals[UPDATED] = g_signal_new (NM_REMOTE_CONNECTION_UPDATED, G_TYPE_FROM_CLASS (remote_class), G_SIGNAL_RUN_FIRST, @@ -927,12 +932,12 @@ nm_remote_connection_class_init (NMRemoteConnectionClass *remote_class) * This signal is emitted when a connection is either deleted or becomes * invisible to the current user. */ - signals[REMOVED] = + signals[REMOVED] = g_signal_new (NM_REMOTE_CONNECTION_REMOVED, G_TYPE_FROM_CLASS (remote_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMRemoteConnectionClass, removed), - NULL, NULL, + NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); diff --git a/libnm-glib/nm-remote-connection.h b/libnm-glib/nm-remote-connection.h index 911885c4..8292c235 100644 --- a/libnm-glib/nm-remote-connection.h +++ b/libnm-glib/nm-remote-connection.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2011 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2011 Red Hat, Inc. */ #ifndef __NM_REMOTE_CONNECTION_H__ @@ -149,4 +147,3 @@ gboolean nm_remote_connection_get_unsaved (NMRemoteConnection *connection); G_END_DECLS #endif /* __NM_REMOTE_CONNECTION__ */ - diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c index 3a2a3e68..74ed083f 100644 --- a/libnm-glib/nm-remote-settings.c +++ b/libnm-glib/nm-remote-settings.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2009 - 2012 Red Hat, Inc. + * Copyright 2008 Novell, Inc. + * Copyright 2009 - 2012 Red Hat, Inc. */ +#include "config.h" + #include <string.h> #include <NetworkManager.h> #include <nm-connection.h> @@ -143,7 +143,7 @@ typedef struct { /* AddConnectionInfo objects that are waiting for the connection to become initialized */ GSList *add_list; - + DBusGProxy *props_proxy; char *hostname; gboolean can_modify; @@ -206,7 +206,7 @@ _nm_remote_settings_ensure_inited (NMRemoteSettings *self) */ if (!g_error_matches (error, DBUS_GERROR, DBUS_GERROR_NO_REPLY)) { g_warning ("%s: (NMRemoteSettings) error initializing: %s\n", - __func__, error->message); + __func__, error->message); } g_error_free (error); } @@ -559,7 +559,7 @@ fetch_connections_done (DBusGProxy *proxy, g_warn_if_fail (priv->listcon_call == call); priv->listcon_call = NULL; - if (!dbus_g_proxy_end_call (proxy, call, &error, + if (!dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, &connections, G_TYPE_INVALID)) { if ( !g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SERVICE_UNKNOWN) @@ -567,8 +567,8 @@ fetch_connections_done (DBusGProxy *proxy, && priv->service_running) { g_warning ("%s: error fetching connections: (%d) %s.", __func__, - error->code, - error->message ? error->message : "(unknown)"); + error->code, + error->message ? error->message : "(unknown)"); } g_clear_error (&error); @@ -597,7 +597,7 @@ fetch_connections_done (DBusGProxy *proxy, * nm_remote_settings_list_connections: * @settings: the %NMRemoteSettings * - * Returns: (transfer container) (element-type NMClient.RemoteConnection): a + * Returns: (transfer container) (element-type NMRemoteConnection): a * list containing all connections provided by the remote settings service. * Each element of the returned list is a %NMRemoteConnection instance, which is * owned by the %NMRemoteSettings object and should not be freed by the caller. @@ -939,7 +939,7 @@ nm_remote_settings_save_hostname (NMRemoteSettings *settings, g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), FALSE); g_return_val_if_fail (hostname != NULL, FALSE); g_return_val_if_fail (callback != NULL, FALSE); - + priv = NM_REMOTE_SETTINGS_GET_PRIVATE (settings); _nm_remote_settings_ensure_inited (settings); @@ -1354,8 +1354,8 @@ init_async_got_manager_running (DBusGProxy *proxy, DBusGProxyCall *call, static void init_async (GAsyncInitable *initable, int io_priority, - GCancellable *cancellable, GAsyncReadyCallback callback, - gpointer user_data) + GCancellable *cancellable, GAsyncReadyCallback callback, + gpointer user_data) { NMRemoteSettingsInitData *init_data; NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (initable); @@ -1365,9 +1365,10 @@ init_async (GAsyncInitable *initable, int io_priority, init_data->result = g_simple_async_result_new (G_OBJECT (initable), callback, user_data, init_async); - if (priv->private_bus) + if (priv->private_bus) { + priv->service_running = TRUE; init_get_properties (init_data); - else { + } else { /* Check if NM is running */ dbus_g_proxy_begin_call (priv->dbus_proxy, "NameHasOwner", init_async_got_manager_running, @@ -1484,54 +1485,74 @@ nm_remote_settings_class_init (NMRemoteSettingsClass *class) object_class->dispose = dispose; /* Properties */ + + /** + * NMRemoteSettings:bus: + * + * The #DBusGConnection that the #NMRemoteSettings is connected to. Defaults + * to the system bus if not specified. + */ g_object_class_install_property (object_class, PROP_BUS, - g_param_spec_boxed (NM_REMOTE_SETTINGS_BUS, - "DBusGConnection", - "DBusGConnection", + g_param_spec_boxed (NM_REMOTE_SETTINGS_BUS, "", "", DBUS_TYPE_G_CONNECTION, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + /** + * NMRemoteSettings:service-running: + * + * Whether the settings service is running. + */ g_object_class_install_property (object_class, PROP_SERVICE_RUNNING, - g_param_spec_boolean (NM_REMOTE_SETTINGS_SERVICE_RUNNING, - "Service running", - "Is service running", + g_param_spec_boolean (NM_REMOTE_SETTINGS_SERVICE_RUNNING, "", "", FALSE, - G_PARAM_READABLE)); - + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMRemoteSettings:hostname: + * + * The machine hostname stored in persistent configuration. This can be + * modified by calling nm_remote_settings_save_hostname(). + */ g_object_class_install_property (object_class, PROP_HOSTNAME, - g_param_spec_string (NM_REMOTE_SETTINGS_HOSTNAME, - "Hostname", - "Persistent hostname", + g_param_spec_string (NM_REMOTE_SETTINGS_HOSTNAME, "", "", NULL, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + /** + * NMRemoteSettings:can-modify: + * + * If %TRUE, adding and modifying connections is supported. + */ g_object_class_install_property (object_class, PROP_CAN_MODIFY, - g_param_spec_boolean (NM_REMOTE_SETTINGS_CAN_MODIFY, - "CanModify", - "Can modify anything (hostname, connections, etc)", + g_param_spec_boolean (NM_REMOTE_SETTINGS_CAN_MODIFY, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /* Signals */ - signals[NEW_CONNECTION] = - g_signal_new (NM_REMOTE_SETTINGS_NEW_CONNECTION, - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMRemoteSettingsClass, new_connection), - NULL, NULL, NULL, - G_TYPE_NONE, 1, G_TYPE_OBJECT); - - signals[CONNECTIONS_READ] = - g_signal_new (NM_REMOTE_SETTINGS_CONNECTIONS_READ, - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMRemoteSettingsClass, connections_read), - NULL, NULL, NULL, - G_TYPE_NONE, 0); + signals[NEW_CONNECTION] = + g_signal_new (NM_REMOTE_SETTINGS_NEW_CONNECTION, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMRemoteSettingsClass, new_connection), + NULL, NULL, NULL, + G_TYPE_NONE, 1, G_TYPE_OBJECT); + + signals[CONNECTIONS_READ] = + g_signal_new (NM_REMOTE_SETTINGS_CONNECTIONS_READ, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMRemoteSettingsClass, connections_read), + NULL, NULL, NULL, + G_TYPE_NONE, 0); } static void diff --git a/libnm-glib/nm-remote-settings.h b/libnm-glib/nm-remote-settings.h index 5ca646e6..92049ade 100644 --- a/libnm-glib/nm-remote-settings.h +++ b/libnm-glib/nm-remote-settings.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2009 - 2011 Red Hat, Inc. + * Copyright 2008 Novell, Inc. + * Copyright 2009 - 2011 Red Hat, Inc. */ #ifndef NM_REMOTE_SETTINGS_H diff --git a/libnm-glib/nm-secret-agent.c b/libnm-glib/nm-secret-agent.c index f58f95fe..04f8dd8b 100644 --- a/libnm-glib/nm-secret-agent.c +++ b/libnm-glib/nm-secret-agent.c @@ -15,10 +15,11 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2010 - 2011 Red Hat, Inc. + * Copyright 2010 - 2011 Red Hat, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include <dbus/dbus-glib-lowlevel.h> @@ -55,9 +56,7 @@ static void impl_secret_agent_delete_secrets (NMSecretAgent *self, G_DEFINE_ABSTRACT_TYPE (NMSecretAgent, nm_secret_agent, G_TYPE_OBJECT) -#define NM_SECRET_AGENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ - NM_TYPE_SECRET_AGENT, \ - NMSecretAgentPrivate)) +#define NM_SECRET_AGENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SECRET_AGENT, NMSecretAgentPrivate)) static gboolean auto_register_cb (gpointer user_data); @@ -124,11 +123,11 @@ get_nm_owner (NMSecretAgent *self) if (!priv->nm_owner) { if (!dbus_g_proxy_call_with_timeout (priv->dbus_proxy, - "GetNameOwner", 2000, &error, - G_TYPE_STRING, NM_DBUS_SERVICE, - G_TYPE_INVALID, - G_TYPE_STRING, &owner, - G_TYPE_INVALID)) + "GetNameOwner", 2000, &error, + G_TYPE_STRING, NM_DBUS_SERVICE, + G_TYPE_INVALID, + G_TYPE_STRING, &owner, + G_TYPE_INVALID)) return NULL; priv->nm_owner = g_strdup (owner); @@ -704,7 +703,8 @@ auto_register_cb (gpointer user_data) NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self); priv->auto_register_id = 0; - if (priv->auto_register && !priv->suppress_auto && (priv->reg_call == NULL)) + if (priv->auto_register && !priv->suppress_auto && + (priv->reg_call == NULL && !priv->registered)) nm_secret_agent_register (self); return FALSE; } @@ -1004,11 +1004,11 @@ nm_secret_agent_class_init (NMSecretAgentClass *class) **/ g_object_class_install_property (object_class, PROP_IDENTIFIER, - g_param_spec_string (NM_SECRET_AGENT_IDENTIFIER, - "Identifier", - "Identifier", - NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_param_spec_string (NM_SECRET_AGENT_IDENTIFIER, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); /** * NMSecretAgent:auto-register: @@ -1023,11 +1023,11 @@ nm_secret_agent_class_init (NMSecretAgentClass *class) **/ g_object_class_install_property (object_class, PROP_AUTO_REGISTER, - g_param_spec_boolean (NM_SECRET_AGENT_AUTO_REGISTER, - "Auto Register", - "Auto Register", - TRUE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + g_param_spec_boolean (NM_SECRET_AGENT_AUTO_REGISTER, "", "", + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); /** * NMSecretAgent:registered: @@ -1036,11 +1036,10 @@ nm_secret_agent_class_init (NMSecretAgentClass *class) **/ g_object_class_install_property (object_class, PROP_REGISTERED, - g_param_spec_boolean (NM_SECRET_AGENT_REGISTERED, - "Registered", - "Registered", + g_param_spec_boolean (NM_SECRET_AGENT_REGISTERED, "", "", FALSE, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMSecretAgent:capabilities: @@ -1049,12 +1048,12 @@ nm_secret_agent_class_init (NMSecretAgentClass *class) **/ g_object_class_install_property (object_class, PROP_CAPABILITIES, - g_param_spec_flags (NM_SECRET_AGENT_CAPABILITIES, - "Capabilities", - "Capabilities", + g_param_spec_flags (NM_SECRET_AGENT_CAPABILITIES, "", "", NM_TYPE_SECRET_AGENT_CAPABILITIES, NM_SECRET_AGENT_CAPABILITY_NONE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); /** * NMSecretAgent::registration-result: @@ -1066,10 +1065,10 @@ nm_secret_agent_class_init (NMSecretAgentClass *class) **/ signals[REGISTRATION_RESULT] = g_signal_new (NM_SECRET_AGENT_REGISTRATION_RESULT, - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - 0, NULL, NULL, NULL, - G_TYPE_NONE, 1, G_TYPE_POINTER); + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 1, G_TYPE_POINTER); dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (class), &dbus_glib_nm_secret_agent_object_info); @@ -1078,4 +1077,3 @@ nm_secret_agent_class_init (NMSecretAgentClass *class) NM_DBUS_INTERFACE_SECRET_AGENT, NM_TYPE_SECRET_AGENT_ERROR); } - diff --git a/libnm-glib/nm-secret-agent.h b/libnm-glib/nm-secret-agent.h index c70f8d07..b7df8745 100644 --- a/libnm-glib/nm-secret-agent.h +++ b/libnm-glib/nm-secret-agent.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* +/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -15,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2010 - 2011 Red Hat, Inc. + * Copyright 2010 - 2011 Red Hat, Inc. */ #ifndef NM_SECRET_AGENT_H @@ -59,7 +59,7 @@ typedef enum { * NMSecretAgentCapabilities: * @NM_SECRET_AGENT_CAPABILITY_NONE: the agent supports no special capabilities * @NM_SECRET_AGENT_CAPABILITY_VPN_HINTS: the agent supports sending hints given - * by the NMSecretAgentClass::get_secrets() class method to VPN plugin + * by the <literal>get_secrets</literal> class method to VPN plugin * authentication dialogs. * @NM_SECRET_AGENT_CAPABILITY_LAST: bounds checking value; should not be used. * diff --git a/libnm-glib/nm-types-private.h b/libnm-glib/nm-types-private.h index 178890da..c34d9a8f 100644 --- a/libnm-glib/nm-types-private.h +++ b/libnm-glib/nm-types-private.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright 2007 - 2008 Red Hat, Inc. */ #ifndef NM_TYPES_PRIVATE_H @@ -31,9 +29,9 @@ gboolean _nm_ssid_demarshal (GValue *value, GByteArray **dest); gboolean _nm_uint_array_demarshal (GValue *value, GArray **dest); gboolean _nm_string_array_demarshal (GValue *value, GPtrArray **dest); gboolean _nm_object_array_demarshal (GValue *value, - GPtrArray **dest, - DBusGConnection *connection, - NMObjectCreatorFunc func); + GPtrArray **dest, + DBusGConnection *connection, + NMObjectCreatorFunc func); gboolean _nm_ip6_address_array_demarshal (GValue *value, GSList **dest); #endif /* NM_TYPES_PRIVATE_H */ diff --git a/libnm-glib/nm-types.c b/libnm-glib/nm-types.c index f9ba6d24..5b434aa9 100644 --- a/libnm-glib/nm-types.c +++ b/libnm-glib/nm-types.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,9 +15,11 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Red Hat, Inc. + * Copyright 2008 Red Hat, Inc. */ +#include "config.h" + #include <glib.h> #include <dbus/dbus-glib.h> #include <string.h> @@ -232,9 +232,9 @@ nm_object_array_get_type (void) gboolean _nm_object_array_demarshal (GValue *value, - GPtrArray **dest, - DBusGConnection *connection, - NMObjectCreatorFunc func) + GPtrArray **dest, + DBusGConnection *connection, + NMObjectCreatorFunc func) { GPtrArray *temp = NULL; GPtrArray *array; @@ -419,4 +419,3 @@ nm_ip6_route_object_array_get_type (void) (GBoxedFreeFunc) _nm_ip6_route_object_array_free); return our_type; } - diff --git a/libnm-glib/nm-types.h b/libnm-glib/nm-types.h index adccafb7..81bd299e 100644 --- a/libnm-glib/nm-types.h +++ b/libnm-glib/nm-types.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Red Hat, Inc. + * Copyright 2008 Red Hat, Inc. */ #ifndef NM_TYPES_H diff --git a/libnm-glib/nm-vpn-connection.c b/libnm-glib/nm-vpn-connection.c index 12814cf2..16e8db5e 100644 --- a/libnm-glib/nm-vpn-connection.c +++ b/libnm-glib/nm-vpn-connection.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2012 Red Hat, Inc. */ +#include "config.h" + #include <string.h> #include "nm-vpn-connection.h" #include "NetworkManager.h" @@ -70,7 +70,7 @@ nm_vpn_connection_new (DBusGConnection *connection, const char *path) g_return_val_if_fail (connection != NULL, NULL); g_return_val_if_fail (path != NULL, NULL); - return g_object_new (NM_TYPE_VPN_CONNECTION, + return g_object_new (NM_TYPE_VPN_CONNECTION, NM_OBJECT_DBUS_CONNECTION, connection, NM_OBJECT_DBUS_PATH, path, NULL); @@ -176,10 +176,10 @@ constructed (GObject *object) G_TYPE_INVALID); dbus_g_proxy_add_signal (priv->proxy, "VpnStateChanged", G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INVALID); dbus_g_proxy_connect_signal (priv->proxy, - "VpnStateChanged", - G_CALLBACK (vpn_state_changed_proxy), - object, - NULL); + "VpnStateChanged", + G_CALLBACK (vpn_state_changed_proxy), + object, + NULL); register_properties (NM_VPN_CONNECTION (object)); } @@ -237,34 +237,34 @@ nm_vpn_connection_class_init (NMVPNConnectionClass *connection_class) * * The VPN state of the active VPN connection. **/ - g_object_class_install_property (object_class, PROP_VPN_STATE, - g_param_spec_uint (NM_VPN_CONNECTION_VPN_STATE, - "VpnState", - "Current VPN state", - NM_VPN_CONNECTION_STATE_UNKNOWN, - NM_VPN_CONNECTION_STATE_DISCONNECTED, - NM_VPN_CONNECTION_STATE_UNKNOWN, - G_PARAM_READABLE)); + 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)); /** * NMVPNConnection:banner: * * The VPN login banner of the active VPN connection. **/ - g_object_class_install_property (object_class, PROP_BANNER, - g_param_spec_string (NM_VPN_CONNECTION_BANNER, - "Banner", - "Login Banner", - NULL, - G_PARAM_READABLE)); + 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)); /* signals */ signals[VPN_STATE_CHANGED] = g_signal_new ("vpn-state-changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMVPNConnectionClass, vpn_state_changed), - NULL, NULL, NULL, - G_TYPE_NONE, 2, - G_TYPE_UINT, G_TYPE_UINT); + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVPNConnectionClass, vpn_state_changed), + NULL, NULL, NULL, + G_TYPE_NONE, 2, + G_TYPE_UINT, G_TYPE_UINT); } diff --git a/libnm-glib/nm-vpn-connection.h b/libnm-glib/nm-vpn-connection.h index 8727bb86..0495310f 100644 --- a/libnm-glib/nm-vpn-connection.h +++ b/libnm-glib/nm-vpn-connection.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2010 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2010 Red Hat, Inc. */ #ifndef NM_VPN_CONNECTION_H diff --git a/libnm-glib/nm-vpn-plugin-ui-interface.c b/libnm-glib/nm-vpn-plugin-ui-interface.c index f82c1270..b94084e2 100644 --- a/libnm-glib/nm-vpn-plugin-ui-interface.c +++ b/libnm-glib/nm-vpn-plugin-ui-interface.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 - 2010 Red Hat, Inc. - * Copyright (C) 2008 Novell, Inc. + * Copyright 2008 - 2010 Red Hat, Inc. + * Copyright 2008 Novell, Inc. */ +#include "config.h" + #include "nm-vpn-plugin-ui-interface.h" static void @@ -32,26 +32,39 @@ interface_init (gpointer g_iface) return; /* Properties */ - g_object_interface_install_property (g_iface, - g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_NAME, - "Name", - "VPN Plugin name", - NULL, - G_PARAM_READABLE)); + /** + * NMVPNPluginUiInterface:name: + * + * Short display name of the VPN plugin. + */ g_object_interface_install_property (g_iface, - g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_DESC, - "Desc", - "VPN Plugin description", - NULL, - G_PARAM_READABLE)); - + g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_NAME, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMVPNPluginUiInterface:desc: + * + * Longer description of the VPN plugin. + */ + g_object_interface_install_property (g_iface, + g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_DESC, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMVPNPluginUiInterface:service: + * + * D-Bus service name of the plugin's VPN service. + */ g_object_interface_install_property (g_iface, - g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_SERVICE, - "Service", - "VPN Plugin D-Bus service name", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_SERVICE, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); initialized = TRUE; } @@ -76,9 +89,9 @@ nm_vpn_plugin_ui_interface_get_type (void) }; vpn_plugin_ui_interface_type = g_type_register_static (G_TYPE_INTERFACE, - "NMVpnPluginUiInterface", - &vpn_plugin_ui_interface_info, - 0); + "NMVpnPluginUiInterface", + &vpn_plugin_ui_interface_info, + 0); g_type_interface_add_prerequisite (vpn_plugin_ui_interface_type, G_TYPE_OBJECT); } @@ -166,12 +179,12 @@ widget_interface_init (gpointer g_iface) /* Signals */ g_signal_new ("changed", - iface_type, - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMVpnPluginUiWidgetInterface, changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + iface_type, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVpnPluginUiWidgetInterface, changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); initialized = TRUE; } @@ -234,4 +247,3 @@ nm_vpn_plugin_ui_widget_interface_save_secrets (NMVpnPluginUiWidgetInterface *if /* Deprecated and no longer used */ return TRUE; } - diff --git a/libnm-glib/nm-vpn-plugin-ui-interface.h b/libnm-glib/nm-vpn-plugin-ui-interface.h index 2753de44..9c6e49eb 100644 --- a/libnm-glib/nm-vpn-plugin-ui-interface.h +++ b/libnm-glib/nm-vpn-plugin-ui-interface.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 - 2010 Red Hat, Inc. - * Copyright (C) 2008 Novell, Inc. + * Copyright 2008 - 2010 Red Hat, Inc. + * Copyright 2008 Novell, Inc. */ #ifndef NM_VPN_PLUGIN_UI_INTERFACE_H diff --git a/libnm-glib/nm-vpn-plugin-utils.c b/libnm-glib/nm-vpn-plugin-utils.c index b9838df9..9aafb19f 100644 --- a/libnm-glib/nm-vpn-plugin-utils.c +++ b/libnm-glib/nm-vpn-plugin-utils.c @@ -15,9 +15,11 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 Red Hat, Inc. + * Copyright 2011 Red Hat, Inc. */ +#include "config.h" + #include <errno.h> #include <stdlib.h> #include <unistd.h> diff --git a/libnm-glib/nm-vpn-plugin-utils.h b/libnm-glib/nm-vpn-plugin-utils.h index aab73c4e..d87ef16a 100644 --- a/libnm-glib/nm-vpn-plugin-utils.h +++ b/libnm-glib/nm-vpn-plugin-utils.h @@ -15,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 Red Hat, Inc. + * Copyright 2011 Red Hat, Inc. */ #ifndef NM_VPN_PLUGIN_UTILS_H diff --git a/libnm-glib/nm-vpn-plugin.c b/libnm-glib/nm-vpn-plugin.c index d5241696..7848c131 100644 --- a/libnm-glib/nm-vpn-plugin.c +++ b/libnm-glib/nm-vpn-plugin.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,12 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2008 Red Hat, Inc. */ +#include "config.h" + #include <signal.h> #include "nm-glib-compat.h" #include "nm-vpn-plugin.h" @@ -125,7 +125,7 @@ GQuark nm_vpn_plugin_error_quark (void) { static GQuark quark = 0; - + if (!quark) quark = g_quark_from_static_string ("nm_vpn_plugin_error"); @@ -729,8 +729,8 @@ nm_vpn_plugin_init (NMVPNPlugin *plugin) { active_plugins = g_slist_append (active_plugins, plugin); g_object_weak_ref (G_OBJECT (plugin), - one_plugin_destroyed, - NULL); + one_plugin_destroyed, + NULL); } static GObject * @@ -747,8 +747,8 @@ constructor (GType type, GError *err = NULL; object = G_OBJECT_CLASS (nm_vpn_plugin_parent_class)->constructor (type, - n_construct_params, - construct_params); + n_construct_params, + construct_params); if (!object) return NULL; @@ -823,7 +823,7 @@ set_property (GObject *object, guint prop_id, static void get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) + GValue *value, GParamSpec *pspec) { NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (object); @@ -953,23 +953,33 @@ nm_vpn_plugin_class_init (NMVPNPluginClass *plugin_class) plugin_class->state_changed = state_changed; /* properties */ + + /** + * NMVPNPlugin:service-name: + * + * The D-Bus service name of this plugin. + */ g_object_class_install_property (object_class, PROP_DBUS_SERVICE_NAME, - g_param_spec_string (NM_VPN_PLUGIN_DBUS_SERVICE_NAME, - "DBus service name", - "DBus service name", + g_param_spec_string (NM_VPN_PLUGIN_DBUS_SERVICE_NAME, "", "", NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + /** + * NMVPNPlugin:state: + * + * The state of the plugin. + */ g_object_class_install_property (object_class, PROP_STATE, - g_param_spec_uint (NM_VPN_PLUGIN_STATE, - "State", - "Current VPN service state", + g_param_spec_uint (NM_VPN_PLUGIN_STATE, "", "", NM_VPN_SERVICE_STATE_UNKNOWN, NM_VPN_SERVICE_STATE_STOPPED, NM_VPN_SERVICE_STATE_INIT, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /* signals */ signals[STATE_CHANGED] = diff --git a/libnm-glib/nm-vpn-plugin.h b/libnm-glib/nm-vpn-plugin.h index 4f020f31..323017f0 100644 --- a/libnm-glib/nm-vpn-plugin.h +++ b/libnm-glib/nm-vpn-plugin.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2008 Novell, Inc. - * Copyright (C) 2007 - 2013 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2013 Red Hat, Inc. */ #ifndef NM_VPN_PLUGIN_H diff --git a/libnm-glib/nm-wimax-nsp.c b/libnm-glib/nm-wimax-nsp.c index f747aff3..1735ab3e 100644 --- a/libnm-glib/nm-wimax-nsp.c +++ b/libnm-glib/nm-wimax-nsp.c @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,10 +15,11 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 Red Hat, Inc. + * Copyright 2011 Red Hat, Inc. */ -#include <config.h> +#include "config.h" + #include <string.h> #include "nm-glib-compat.h" @@ -71,9 +70,9 @@ nm_wimax_nsp_new (DBusGConnection *connection, const char *path) g_return_val_if_fail (path != NULL, NULL); return (GObject *) g_object_new (NM_TYPE_WIMAX_NSP, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, path, - NULL); + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); } /** @@ -173,14 +172,14 @@ nm_wimax_nsp_connection_valid (NMWimaxNsp *nsp, NMConnection *connection) /** * nm_wimax_nsp_filter_connections: * @nsp: an #NMWimaxNsp to filter connections for - * @connections: (element-type NetworkManager.Connection): a list of + * @connections: (element-type NMConnection): a list of * #NMConnection objects to filter * * Filters a given list of connections for a given #NMWimaxNsp object and * return connections which may be activated with the access point. Any * returned connections will match the @nsp's network name and other attributes. * - * Returns: (transfer container) (element-type NetworkManager.Connection): a + * Returns: (transfer container) (element-type NMConnection): a * list of #NMConnection objects that could be activated with the given @nsp. * The elements of the list are owned by their creator and should not be freed * by the caller, but the returned list itself is owned by the caller and should @@ -305,11 +304,10 @@ nm_wimax_nsp_class_init (NMWimaxNspClass *nsp_class) **/ g_object_class_install_property (object_class, PROP_NAME, - g_param_spec_string (NM_WIMAX_NSP_NAME, - "Name", - "Name", - NULL, - G_PARAM_READABLE)); + g_param_spec_string (NM_WIMAX_NSP_NAME, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMWimaxNsp:signal-quality: @@ -318,11 +316,10 @@ nm_wimax_nsp_class_init (NMWimaxNspClass *nsp_class) **/ g_object_class_install_property (object_class, PROP_SIGNAL_QUALITY, - g_param_spec_uint (NM_WIMAX_NSP_SIGNAL_QUALITY, - "Signal Quality", - "Signal Quality", + g_param_spec_uint (NM_WIMAX_NSP_SIGNAL_QUALITY, "", "", 0, 100, 0, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); /** * NMWimaxNsp:network-type: @@ -331,9 +328,8 @@ nm_wimax_nsp_class_init (NMWimaxNspClass *nsp_class) **/ g_object_class_install_property (object_class, PROP_NETWORK_TYPE, - g_param_spec_uint (NM_WIMAX_NSP_NETWORK_TYPE, - "Network Type", - "Network Type", + g_param_spec_uint (NM_WIMAX_NSP_NETWORK_TYPE, "", "", 0, G_MAXUINT32, 0, - G_PARAM_READABLE)); + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm-glib/nm-wimax-nsp.h b/libnm-glib/nm-wimax-nsp.h index b8e91079..74008d18 100644 --- a/libnm-glib/nm-wimax-nsp.h +++ b/libnm-glib/nm-wimax-nsp.h @@ -1,7 +1,5 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * libnm_glib -- Access network status & information from glib applications - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,8 +15,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 Red Hat, Inc. - * Copyright (C) 2009 Novell, Inc. + * Copyright 2011 Red Hat, Inc. + * Copyright 2009 Novell, Inc. */ #ifndef NM_WIMAX_NSP_H @@ -42,6 +40,15 @@ G_BEGIN_DECLS #define NM_WIMAX_NSP_SIGNAL_QUALITY "signal-quality" #define NM_WIMAX_NSP_NETWORK_TYPE "network-type" +/** + * NMWimaxNspNetworkType: + * @NM_WIMAX_NSP_NETWORK_TYPE_UNKNOWN: unknown network type + * @NM_WIMAX_NSP_NETWORK_TYPE_HOME: home network + * @NM_WIMAX_NSP_NETWORK_TYPE_PARTNER: partner network + * @NM_WIMAX_NSP_NETWORK_TYPE_ROAMING_PARTNER: roaming partner network + * + * WiMAX network type. + */ typedef enum { NM_WIMAX_NSP_NETWORK_TYPE_UNKNOWN = 0, NM_WIMAX_NSP_NETWORK_TYPE_HOME = 1, diff --git a/libnm-glib/tests/Makefile.am b/libnm-glib/tests/Makefile.am index 38f449ac..7b8f3627 100644 --- a/libnm-glib/tests/Makefile.am +++ b/libnm-glib/tests/Makefile.am @@ -2,52 +2,48 @@ if ENABLE_TESTS AM_CPPFLAGS = \ -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ -I$(top_srcdir)/libnm-util \ -I$(top_builddir)/libnm-util \ -I$(top_srcdir)/libnm-glib \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ + -DTEST_NM_SERVICE=\"$(abs_top_srcdir)/tools/test-networkmanager-service.py\" \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) -noinst_PROGRAMS = test-nm-client test-remote-settings-client +noinst_PROGRAMS = $(TESTS) + +TESTS = test-nm-client test-remote-settings-client ####### NMClient and non-settings tests ####### test_nm_client_SOURCES = \ + common.c \ + common.h \ test-nm-client.c test_nm_client_LDADD = \ $(top_builddir)/libnm-util/libnm-util.la \ - $(top_builddir)/libnm-glib/libnm-glib-test.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) ####### remote settings client test ####### test_remote_settings_client_SOURCES = \ + common.c \ + common.h \ test-remote-settings-client.c test_remote_settings_client_LDADD = \ $(top_builddir)/libnm-util/libnm-util.la \ - $(top_builddir)/libnm-glib/libnm-glib-test.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) ########################################### -TEST_NM_BIN = test-fake-nm.py -TEST_RSS_BIN = test-remote-settings-service.py - -EXTRA_DIST = $(TEST_RSS_BIN) $(TEST_NM_BIN) - -check-local: test-nm-client test-remote-settings-client - if test -z "$$DBUS_SESSION_BUS_ADDRESS" ; then \ - dbus-launch --exit-with-session $(abs_builddir)/test-nm-client $(abs_srcdir) $(TEST_NM_BIN); \ - dbus-launch --exit-with-session $(abs_builddir)/test-remote-settings-client $(abs_srcdir) $(TEST_RSS_BIN); \ - else \ - $(abs_builddir)/test-nm-client $(abs_srcdir) $(TEST_NM_BIN); \ - $(abs_builddir)/test-remote-settings-client $(abs_srcdir) $(TEST_RSS_BIN); \ - fi; +TESTS_ENVIRONMENT = $(srcdir)/libnm-glib-test-launch.sh endif + +EXTRA_DIST = libnm-glib-test-launch.sh diff --git a/libnm-glib/tests/Makefile.in b/libnm-glib/tests/Makefile.in index 28acdea0..7dd74031 100644 --- a/libnm-glib/tests/Makefile.in +++ b/libnm-glib/tests/Makefile.in @@ -78,7 +78,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@ENABLE_TESTS_TRUE@noinst_PROGRAMS = test-nm-client$(EXEEXT) \ +@ENABLE_TESTS_TRUE@noinst_PROGRAMS = $(am__EXEEXT_1) +@ENABLE_TESTS_TRUE@TESTS = test-nm-client$(EXEEXT) \ @ENABLE_TESTS_TRUE@ test-remote-settings-client$(EXEEXT) subdir = libnm-glib/tests DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ @@ -103,29 +104,32 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +@ENABLE_TESTS_TRUE@am__EXEEXT_1 = test-nm-client$(EXEEXT) \ +@ENABLE_TESTS_TRUE@ test-remote-settings-client$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) -am__test_nm_client_SOURCES_DIST = test-nm-client.c -@ENABLE_TESTS_TRUE@am_test_nm_client_OBJECTS = \ +am__test_nm_client_SOURCES_DIST = common.c common.h test-nm-client.c +@ENABLE_TESTS_TRUE@am_test_nm_client_OBJECTS = common.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test-nm-client.$(OBJEXT) test_nm_client_OBJECTS = $(am_test_nm_client_OBJECTS) am__DEPENDENCIES_1 = @ENABLE_TESTS_TRUE@test_nm_client_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-util/libnm-util.la \ -@ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-glib/libnm-glib-test.la \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-glib/libnm-glib.la \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -am__test_remote_settings_client_SOURCES_DIST = \ +am__test_remote_settings_client_SOURCES_DIST = common.c common.h \ test-remote-settings-client.c @ENABLE_TESTS_TRUE@am_test_remote_settings_client_OBJECTS = \ +@ENABLE_TESTS_TRUE@ common.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test-remote-settings-client.$(OBJEXT) test_remote_settings_client_OBJECTS = \ $(am_test_remote_settings_client_OBJECTS) @ENABLE_TESTS_TRUE@test_remote_settings_client_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-util/libnm-util.la \ -@ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-glib/libnm-glib-test.la \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-glib/libnm-glib.la \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -189,6 +193,28 @@ am__define_uniq_tagged_files = \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ @@ -199,6 +225,8 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BLUEZ5_CFLAGS = @BLUEZ5_CFLAGS@ +BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -322,6 +350,7 @@ NEWT_CFLAGS = @NEWT_CFLAGS@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ +NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -341,6 +370,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -367,7 +397,7 @@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ -UDEV_BASE_DIR = @UDEV_BASE_DIR@ +UDEV_DIR = @UDEV_DIR@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ @@ -448,41 +478,44 @@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ @ENABLE_TESTS_TRUE@AM_CPPFLAGS = \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/include \ -@ENABLE_TESTS_TRUE@ -I$(top_builddir)/include \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/libnm-util \ @ENABLE_TESTS_TRUE@ -I$(top_builddir)/libnm-util \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/libnm-glib \ @ENABLE_TESTS_TRUE@ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ +@ENABLE_TESTS_TRUE@ -DTEST_NM_SERVICE=\"$(abs_top_srcdir)/tools/test-networkmanager-service.py\" \ @ENABLE_TESTS_TRUE@ $(GLIB_CFLAGS) \ @ENABLE_TESTS_TRUE@ $(DBUS_CFLAGS) ####### NMClient and non-settings tests ####### @ENABLE_TESTS_TRUE@test_nm_client_SOURCES = \ +@ENABLE_TESTS_TRUE@ common.c \ +@ENABLE_TESTS_TRUE@ common.h \ @ENABLE_TESTS_TRUE@ test-nm-client.c @ENABLE_TESTS_TRUE@test_nm_client_LDADD = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-util/libnm-util.la \ -@ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-glib/libnm-glib-test.la \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-glib/libnm-glib.la \ @ENABLE_TESTS_TRUE@ $(GLIB_LIBS) \ @ENABLE_TESTS_TRUE@ $(DBUS_LIBS) ####### remote settings client test ####### @ENABLE_TESTS_TRUE@test_remote_settings_client_SOURCES = \ +@ENABLE_TESTS_TRUE@ common.c \ +@ENABLE_TESTS_TRUE@ common.h \ @ENABLE_TESTS_TRUE@ test-remote-settings-client.c @ENABLE_TESTS_TRUE@test_remote_settings_client_LDADD = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-util/libnm-util.la \ -@ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-glib/libnm-glib-test.la \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-glib/libnm-glib.la \ @ENABLE_TESTS_TRUE@ $(GLIB_LIBS) \ @ENABLE_TESTS_TRUE@ $(DBUS_LIBS) ########################################### -@ENABLE_TESTS_TRUE@TEST_NM_BIN = test-fake-nm.py -@ENABLE_TESTS_TRUE@TEST_RSS_BIN = test-remote-settings-service.py -@ENABLE_TESTS_TRUE@EXTRA_DIST = $(TEST_RSS_BIN) $(TEST_NM_BIN) +@ENABLE_TESTS_TRUE@TESTS_ENVIRONMENT = $(srcdir)/libnm-glib-test-launch.sh +EXTRA_DIST = libnm-glib-test-launch.sh all: all-am .SUFFIXES: @@ -541,6 +574,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nm-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-remote-settings-client.Po@am__quote@ @@ -623,6 +657,99 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + $(am__tty_colors); \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + col=$$red; res=XPASS; \ + ;; \ + *) \ + col=$$grn; res=PASS; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xfail=`expr $$xfail + 1`; \ + col=$$lgn; res=XFAIL; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + col=$$red; res=FAIL; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + col=$$blu; res=SKIP; \ + fi; \ + echo "$${col}$$res$${std}: $$tst"; \ + done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="$$All$$all $$tests passed"; \ + else \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all $$tests failed"; \ + else \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + if test "$$failed" -eq 0; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + fi; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ + test "$$failed" -eq 0; \ + else :; fi + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -653,9 +780,8 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done -@ENABLE_TESTS_FALSE@check-local: check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-local + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) installdirs: @@ -762,7 +888,7 @@ uninstall-am: .MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \ +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ @@ -777,15 +903,6 @@ uninstall-am: tags tags-am uninstall uninstall-am -@ENABLE_TESTS_TRUE@check-local: test-nm-client test-remote-settings-client -@ENABLE_TESTS_TRUE@ if test -z "$$DBUS_SESSION_BUS_ADDRESS" ; then \ -@ENABLE_TESTS_TRUE@ dbus-launch --exit-with-session $(abs_builddir)/test-nm-client $(abs_srcdir) $(TEST_NM_BIN); \ -@ENABLE_TESTS_TRUE@ dbus-launch --exit-with-session $(abs_builddir)/test-remote-settings-client $(abs_srcdir) $(TEST_RSS_BIN); \ -@ENABLE_TESTS_TRUE@ else \ -@ENABLE_TESTS_TRUE@ $(abs_builddir)/test-nm-client $(abs_srcdir) $(TEST_NM_BIN); \ -@ENABLE_TESTS_TRUE@ $(abs_builddir)/test-remote-settings-client $(abs_srcdir) $(TEST_RSS_BIN); \ -@ENABLE_TESTS_TRUE@ fi; - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/libnm-glib/tests/common.c b/libnm-glib/tests/common.c new file mode 100644 index 00000000..540d43af --- /dev/null +++ b/libnm-glib/tests/common.c @@ -0,0 +1,121 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright 2010 - 2014 Red Hat, Inc. + * + */ + +#include "config.h" + +#include <dbus/dbus.h> +#include <glib.h> +#include <string.h> + +#include "NetworkManager.h" + +#include "common.h" + +static gboolean +name_exists (GDBusConnection *c, const char *name) +{ + GVariant *reply; + gboolean exists = FALSE; + + reply = g_dbus_connection_call_sync (c, + DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS, + "GetNameOwner", + g_variant_new ("(s)", name), + NULL, + G_DBUS_CALL_FLAGS_NO_AUTO_START, + -1, + NULL, + NULL); + if (reply != NULL) { + exists = TRUE; + g_variant_unref (reply); + } + + return exists; +} + +NMTestServiceInfo * +nm_test_service_init (void) +{ + NMTestServiceInfo *info; + const char *args[2] = { TEST_NM_SERVICE, NULL }; + GError *error = NULL; + int i; + + info = g_malloc0 (sizeof (*info)); + + info->bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + g_assert_no_error (error); + + /* Spawn the test service. info->keepalive_fd will be a pipe to the service's + * stdin; if it closes, the service will exit immediately. We use this to + * make sure the service exits if the test program crashes. + */ + g_spawn_async_with_pipes (NULL, (char **) args, NULL, 0, NULL, NULL, + &info->pid, &info->keepalive_fd, NULL, NULL, &error); + g_assert_no_error (error); + + /* Wait until the service is registered on the bus */ + for (i = 100; i > 0; i--) { + if (name_exists (info->bus, "org.freedesktop.NetworkManager")) + break; + g_usleep (G_USEC_PER_SEC / 50); + } + g_assert (i > 0); + + /* Grab a proxy to our fake NM service to trigger tests */ + info->proxy = g_dbus_proxy_new_sync (info->bus, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | + G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS | + G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + NULL, + NM_DBUS_SERVICE, + NM_DBUS_PATH, + "org.freedesktop.NetworkManager.LibnmGlibTest", + NULL, &error); + g_assert_no_error (error); + + return info; +} + +void +nm_test_service_cleanup (NMTestServiceInfo *info) +{ + int i; + + g_object_unref (info->proxy); + kill (info->pid, SIGTERM); + + /* Wait until the bus notices the service is gone */ + for (i = 100; i > 0; i--) { + if (!name_exists (info->bus, "org.freedesktop.NetworkManager")) + break; + g_usleep (G_USEC_PER_SEC / 50); + } + g_assert (i > 0); + + g_object_unref (info->bus); + close (info->keepalive_fd); + + memset (info, 0, sizeof (*info)); + g_free (info); +} diff --git a/libnm-glib/tests/common.h b/libnm-glib/tests/common.h new file mode 100644 index 00000000..7c49d253 --- /dev/null +++ b/libnm-glib/tests/common.h @@ -0,0 +1,31 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2014 Red Hat, Inc. + */ + +#include <gio/gio.h> + +typedef struct { + GDBusConnection *bus; + GDBusProxy *proxy; + GPid pid; + int keepalive_fd; +} NMTestServiceInfo; + +NMTestServiceInfo *nm_test_service_init (void); +void nm_test_service_cleanup (NMTestServiceInfo *info); diff --git a/libnm-glib/tests/libnm-glib-test-launch.sh b/libnm-glib/tests/libnm-glib-test-launch.sh new file mode 100755 index 00000000..42d9fbe2 --- /dev/null +++ b/libnm-glib/tests/libnm-glib-test-launch.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# Spawn DBus if there's none +if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then + eval `dbus-launch --sh-syntax` + trap "kill $DBUS_SESSION_BUS_PID" EXIT +fi + +"$@" diff --git a/libnm-glib/tests/test-fake-nm.py b/libnm-glib/tests/test-fake-nm.py deleted file mode 100755 index 46ca3ff0..00000000 --- a/libnm-glib/tests/test-fake-nm.py +++ /dev/null @@ -1,776 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - -from __future__ import print_function - -from gi.repository import GLib, GObject -import sys -import dbus -import dbus.service -import dbus.mainloop.glib -import random - -mainloop = GObject.MainLoop() -quit_id = 0 - -# NM State -NM_STATE_UNKNOWN = 0 -NM_STATE_ASLEEP = 10 -NM_STATE_DISCONNECTED = 20 -NM_STATE_DISCONNECTING = 30 -NM_STATE_CONNECTING = 40 -NM_STATE_CONNECTED_LOCAL = 50 -NM_STATE_CONNECTED_SITE = 60 -NM_STATE_CONNECTED_GLOBAL = 70 - -# Device state -NM_DEVICE_STATE_UNKNOWN = 0 -NM_DEVICE_STATE_UNMANAGED = 10 -NM_DEVICE_STATE_UNAVAILABLE = 20 -NM_DEVICE_STATE_DISCONNECTED = 30 -NM_DEVICE_STATE_PREPARE = 40 -NM_DEVICE_STATE_CONFIG = 50 -NM_DEVICE_STATE_NEED_AUTH = 60 -NM_DEVICE_STATE_IP_CONFIG = 70 -NM_DEVICE_STATE_IP_CHECK = 80 -NM_DEVICE_STATE_SECONDARIES = 90 -NM_DEVICE_STATE_ACTIVATED = 100 -NM_DEVICE_STATE_DEACTIVATING = 110 -NM_DEVICE_STATE_FAILED = 120 - -NM_DEVICE_TYPE_UNKNOWN = 0 -NM_DEVICE_TYPE_ETHERNET = 1 -NM_DEVICE_TYPE_WIFI = 2 -NM_DEVICE_TYPE_UNUSED1 = 3 -NM_DEVICE_TYPE_UNUSED2 = 4 -NM_DEVICE_TYPE_BT = 5 -NM_DEVICE_TYPE_OLPC_MESH = 6 -NM_DEVICE_TYPE_WIMAX = 7 -NM_DEVICE_TYPE_MODEM = 8 -NM_DEVICE_TYPE_INFINIBAND = 9 -NM_DEVICE_TYPE_BOND = 10 -NM_DEVICE_TYPE_VLAN = 11 -NM_DEVICE_TYPE_ADSL = 12 -NM_DEVICE_TYPE_BRIDGE = 13 -NM_DEVICE_TYPE_GENERIC = 14 -NM_DEVICE_TYPE_TEAM = 15 - -######################################################### -IFACE_DBUS = 'org.freedesktop.DBus' - -class UnknownInterfaceException(dbus.DBusException): - _dbus_error_name = IFACE_DBUS + '.UnknownInterface' - -class UnknownPropertyException(dbus.DBusException): - _dbus_error_name = IFACE_DBUS + '.UnknownProperty' - -def to_path_array(src): - array = dbus.Array([], signature=dbus.Signature('o')) - for o in src: - array.append(o.path) - return array - -def to_path(src): - if src: - return dbus.ObjectPath(src.path) - return dbus.ObjectPath("/") - -class ExportedObj(dbus.service.Object): - def __init__(self, bus, object_path): - dbus.service.Object.__init__(self, bus, object_path) - self._bus = bus - self.path = object_path - self.__dbus_ifaces = {} - - def add_dbus_interface(self, dbus_iface, get_props_func): - self.__dbus_ifaces[dbus_iface] = get_props_func - - def _get_dbus_properties(self, iface): - return self.__dbus_ifaces[iface]() - - @dbus.service.method(dbus_interface=dbus.PROPERTIES_IFACE, in_signature='s', out_signature='a{sv}') - def GetAll(self, iface): - if iface not in self.__dbus_ifaces.keys(): - raise UnknownInterfaceException() - return self._get_dbus_properties(iface) - - @dbus.service.method(dbus_interface=dbus.PROPERTIES_IFACE, in_signature='ss', out_signature='v') - def Get(self, iface, name): - if iface not in self.__dbus_ifaces.keys(): - raise UnknownInterfaceException() - props = self._get_dbus_properties(iface) - if not name in props.keys(): - raise UnknownPropertyException() - return props[name] - -################################################################### -IFACE_DEVICE = 'org.freedesktop.NetworkManager.Device' - -PD_UDI = "Udi" -PD_IFACE = "Interface" -PD_DRIVER = "Driver" -PD_STATE = "State" -PD_ACTIVE_CONNECTION = "ActiveConnection" -PD_IP4_CONFIG = "Ip4Config" -PD_IP6_CONFIG = "Ip6Config" -PD_DHCP4_CONFIG = "Dhcp4Config" -PD_DHCP6_CONFIG = "Dhcp6Config" -PD_MANAGED = "Managed" -PD_AUTOCONNECT = "Autoconnect" -PD_DEVICE_TYPE = "DeviceType" -PD_AVAILABLE_CONNECTIONS = "AvailableConnections" - -class Device(ExportedObj): - counter = 1 - - def __init__(self, bus, iface, devtype): - object_path = "/org/freedesktop/NetworkManager/Devices/%d" % Device.counter - Device.counter = Device.counter + 1 - ExportedObj.__init__(self, bus, object_path) - self.add_dbus_interface(IFACE_DEVICE, self.__get_props) - - self.iface = iface - self.udi = "/sys/devices/virtual/%s" % iface - self.devtype = devtype - self.active_connection = None - self.state = NM_DEVICE_STATE_UNAVAILABLE - self.ip4_config = None - self.ip6_config = None - self.dhcp4_config = None - self.dhcp6_config = None - self.available_connections = [] - - # Properties interface - def __get_props(self): - props = {} - props[PD_UDI] = self.udi - props[PD_IFACE] = self.iface - props[PD_DRIVER] = "virtual" - props[PD_STATE] = dbus.UInt32(self.state) - props[PD_ACTIVE_CONNECTION] = to_path(self.active_connection) - props[PD_IP4_CONFIG] = to_path(self.ip4_config) - props[PD_IP6_CONFIG] = to_path(self.ip6_config) - props[PD_DHCP4_CONFIG] = to_path(self.dhcp4_config) - props[PD_DHCP6_CONFIG] = to_path(self.dhcp6_config) - props[PD_MANAGED] = True - props[PD_AUTOCONNECT] = True - props[PD_DEVICE_TYPE] = dbus.UInt32(self.devtype) - props[PD_AVAILABLE_CONNECTIONS] = to_path_array(self.available_connections) - return props - - # methods - @dbus.service.method(dbus_interface=IFACE_DEVICE, in_signature='', out_signature='') - def Disconnect(self): - pass - - def __notify(self, propname): - props = self._get_dbus_properties(IFACE_DEVICE) - changed = { propname: props[propname] } - Device.PropertiesChanged(self, changed) - - @dbus.service.signal(IFACE_DEVICE, signature='a{sv}') - def PropertiesChanged(self, changed): - pass - - -################################################################### - -def random_mac(): - return '%02X:%02X:%02X:%02X:%02X:%02X' % ( - random.randint(0, 255), random.randint(0, 255), random.randint(0, 255), - random.randint(0, 255), random.randint(0, 255), random.randint(0, 255) - ) - -################################################################### -IFACE_WIRED = 'org.freedesktop.NetworkManager.Device.Wired' - -PE_HW_ADDRESS = "HwAddress" -PE_PERM_HW_ADDRESS = "PermHwAddress" -PE_SPEED = "Speed" -PE_CARRIER = "Carrier" - -class WiredDevice(Device): - def __init__(self, bus, iface): - Device.__init__(self, bus, iface, NM_DEVICE_TYPE_ETHERNET) - self.add_dbus_interface(IFACE_WIRED, self.__get_props) - - self.mac = random_mac() - self.carrier = False - - # Properties interface - def __get_props(self): - props = {} - props[PE_HW_ADDRESS] = self.mac - props[PE_PERM_HW_ADDRESS] = self.mac - props[PE_SPEED] = dbus.UInt32(100) - props[PE_CARRIER] = self.carrier - return props - - def __notify(self, propname): - props = self._get_dbus_properties(IFACE_WIRED) - changed = { propname: props[propname] } - WiredDevice.PropertiesChanged(self, changed) - - @dbus.service.signal(IFACE_WIRED, signature='a{sv}') - def PropertiesChanged(self, changed): - pass - -################################################################### -IFACE_WIFI_AP = 'org.freedesktop.NetworkManager.AccessPoint' - -PP_FLAGS = "Flags" -PP_WPA_FLAGS = "WpaFlags" -PP_RSN_FLAGS = "RsnFlags" -PP_SSID = "Ssid" -PP_FREQUENCY = "Frequency" -PP_HW_ADDRESS = "HwAddress" -PP_MODE = "Mode" -PP_MAX_BITRATE = "MaxBitrate" -PP_STRENGTH = "Strength" - -class WifiAp(ExportedObj): - counter = 0 - - def __init__(self, bus, ssid, mac, flags, wpaf, rsnf, freq): - path = "/org/freedesktop/NetworkManager/AccessPoint/%d" % WifiAp.counter - WifiAp.counter = WifiAp.counter + 1 - ExportedObj.__init__(self, bus, path) - self.add_dbus_interface(IFACE_WIFI_AP, self.__get_props) - - self.ssid = ssid - if mac: - self.bssid = mac - else: - self.bssid = random_mac() - self.flags = flags - self.wpaf = wpaf - self.rsnf = rsnf - self.freq = freq - self.strength = random.randint(0, 100) - self.strength_id = GLib.timeout_add_seconds(10, self.strength_cb, None) - - def __del__(self): - if self.strength_id > 0: - GLib.source_remove(self.strength_id) - self.strength_id = 0 - - def strength_cb(self, ignored): - self.strength = random.randint(0, 100) - self.__notify(PP_STRENGTH) - return True - - # Properties interface - def __get_props(self): - props = {} - props[PP_FLAGS] = dbus.UInt32(self.flags) - props[PP_WPA_FLAGS] = dbus.UInt32(self.wpaf) - props[PP_RSN_FLAGS] = dbus.UInt32(self.rsnf) - props[PP_SSID] = dbus.ByteArray(self.ssid) - props[PP_FREQUENCY] = dbus.UInt32(self.freq) - props[PP_HW_ADDRESS] = self.bssid - props[PP_MODE] = dbus.UInt32(2) # NM_802_11_MODE_INFRA - props[PP_MAX_BITRATE] = dbus.UInt32(54000) - props[PP_STRENGTH] = dbus.Byte(self.strength) - return props - - def __notify(self, propname): - props = self._get_dbus_properties(IFACE_WIFI_AP) - changed = { propname: props[propname] } - WifiAp.PropertiesChanged(self, changed) - - @dbus.service.signal(IFACE_WIFI_AP, signature='a{sv}') - def PropertiesChanged(self, changed): - pass - -################################################################### -IFACE_WIFI = 'org.freedesktop.NetworkManager.Device.Wireless' - -class ApNotFoundException(dbus.DBusException): - _dbus_error_name = IFACE_WIFI + '.AccessPointNotFound' - -PW_HW_ADDRESS = "HwAddress" -PW_PERM_HW_ADDRESS = "PermHwAddress" -PW_MODE = "Mode" -PW_BITRATE = "Bitrate" -PW_ACCESS_POINTS = "AccessPoints" -PW_ACTIVE_ACCESS_POINT = "ActiveAccessPoint" -PW_WIRELESS_CAPABILITIES = "WirelessCapabilities" - -class WifiDevice(Device): - def __init__(self, bus, iface): - Device.__init__(self, bus, iface, NM_DEVICE_TYPE_WIFI) - self.add_dbus_interface(IFACE_WIFI, self.__get_props) - - self.mac = random_mac() - self.aps = [] - self.active_ap = None - - # methods - @dbus.service.method(dbus_interface=IFACE_WIFI, in_signature='', out_signature='ao') - def GetAccessPoints(self): - # only include non-hidden APs - array = [] - for a in self.aps: - if a.ssid(): - array.append(a) - return to_path_array(array) - - @dbus.service.method(dbus_interface=IFACE_WIFI, in_signature='', out_signature='ao') - def GetAllAccessPoints(self): - # include all APs including hidden ones - return to_path_array(self.aps) - - @dbus.service.method(dbus_interface=IFACE_WIFI, in_signature='a{sv}', out_signature='') - def RequestScan(self, props): - pass - - @dbus.service.signal(IFACE_WIFI, signature='o') - def AccessPointAdded(self, ap_path): - pass - - def add_ap(self, ap): - self.aps.append(ap) - self.__notify(PW_ACCESS_POINTS) - self.AccessPointAdded(to_path(ap)) - - @dbus.service.signal(IFACE_WIFI, signature='o') - def AccessPointRemoved(self, ap_path): - pass - - def remove_ap(self, ap): - self.aps.remove(ap) - self.__notify(PW_ACCESS_POINTS) - self.AccessPointRemoved(to_path(ap)) - - # Properties interface - def __get_props(self): - props = {} - props[PW_HW_ADDRESS] = self.mac - props[PW_PERM_HW_ADDRESS] = self.mac - props[PW_MODE] = dbus.UInt32(3) # NM_802_11_MODE_INFRA - props[PW_BITRATE] = dbus.UInt32(21000) - props[PW_WIRELESS_CAPABILITIES] = dbus.UInt32(0xFF) - props[PW_ACCESS_POINTS] = to_path_array(self.aps) - props[PW_ACTIVE_ACCESS_POINT] = to_path(self.active_ap) - return props - - def __notify(self, propname): - props = self._get_dbus_properties(IFACE_WIFI) - changed = { propname: props[propname] } - WifiDevice.PropertiesChanged(self, changed) - - @dbus.service.signal(IFACE_WIFI, signature='a{sv}') - def PropertiesChanged(self, changed): - pass - - # test functions - def add_test_ap(self, ssid, mac): - ap = WifiAp(self._bus, ssid, mac, 0x1, 0x1cc, 0x1cc, 2412) - self.add_ap(ap) - return ap.path - - def remove_ap_by_path(self, path): - for ap in self.aps: - if ap.path == path: - self.remove_ap(ap) - return - raise ApNotFoundException("AP %s not found" % path) - - -################################################################### -IFACE_WIMAX_NSP = 'org.freedesktop.NetworkManager.WiMax.Nsp' - -PN_NAME = "Name" -PN_SIGNAL_QUALITY = "SignalQuality" -PN_NETWORK_TYPE = "NetworkType" - -class WimaxNsp(ExportedObj): - counter = 0 - - def __init__(self, bus, name): - path = "/org/freedesktop/NetworkManager/Nsp/%d" % WimaxNsp.counter - WimaxNsp.counter = WimaxNsp.counter + 1 - ExportedObj.__init__(self, bus, path) - self.add_dbus_interface(IFACE_WIMAX_NSP, self.__get_props) - - self.name = name - self.strength = random.randint(0, 100) - self.strength_id = GLib.timeout_add_seconds(10, self.strength_cb, None) - - def __del__(self): - if self.strength_id > 0: - GLib.source_remove(self.strength_id) - self.strength_id = 0 - - def strength_cb(self, ignored): - self.strength = random.randint(0, 100) - self.__notify(PN_SIGNAL_QUALITY) - return True - - # Properties interface - def __get_props(self): - props = {} - props[PN_NAME] = self.name - props[PN_SIGNAL_QUALITY] = dbus.UInt32(self.strength) - props[PN_NETWORK_TYPE] = dbus.UInt32(0x1) # NM_WIMAX_NSP_NETWORK_TYPE_HOME - return props - - def __notify(self, propname): - props = self._get_dbus_properties(IFACE_WIMAX_NSP) - changed = { propname: props[propname] } - WimaxNsp.PropertiesChanged(self, changed) - - @dbus.service.signal(IFACE_WIMAX_NSP, signature='a{sv}') - def PropertiesChanged(self, changed): - pass - -################################################################### -IFACE_WIMAX = 'org.freedesktop.NetworkManager.Device.WiMax' - -class NspNotFoundException(dbus.DBusException): - _dbus_error_name = IFACE_WIMAX + '.NspNotFound' - -PX_NSPS = "Nsps" -PX_HW_ADDRESS = "HwAddress" -PX_CENTER_FREQUENCY = "CenterFrequency" -PX_RSSI = "Rssi" -PX_CINR = "Cinr" -PX_TX_POWER = "TxPower" -PX_BSID = "Bsid" -PX_ACTIVE_NSP = "ActiveNsp" - -class WimaxDevice(Device): - def __init__(self, bus, iface): - Device.__init__(self, bus, iface, NM_DEVICE_TYPE_WIMAX) - self.add_dbus_interface(IFACE_WIMAX, self.__get_props) - - self.mac = random_mac() - self.bsid = random_mac() - self.nsps = [] - self.active_nsp = None - - # methods - @dbus.service.method(dbus_interface=IFACE_WIMAX, in_signature='', out_signature='ao') - def GetNspList(self): - # include all APs including hidden ones - return to_path_array(self.nsps) - - @dbus.service.signal(IFACE_WIMAX, signature='o') - def NspAdded(self, nsp_path): - pass - - def add_nsp(self, nsp): - self.nsps.append(nsp) - self.__notify(PX_NSPS) - self.NspAdded(to_path(nsp)) - - @dbus.service.signal(IFACE_WIMAX, signature='o') - def NspRemoved(self, nsp_path): - pass - - def remove_nsp(self, nsp): - self.nsps.remove(nsp) - self.__notify(PX_NSPS) - self.NspRemoved(to_path(nsp)) - - # Properties interface - def __get_props(self): - props = {} - props[PX_HW_ADDRESS] = self.mac - props[PX_CENTER_FREQUENCY] = dbus.UInt32(2525) - props[PX_RSSI] = dbus.Int32(-48) - props[PX_CINR] = dbus.Int32(24) - props[PX_TX_POWER] = dbus.Int32(9) - props[PX_BSID] = self.bsid - props[PX_NSPS] = to_path_array(self.nsps) - props[PX_ACTIVE_NSP] = to_path(self.active_nsp) - return props - - def __notify(self, propname): - props = self._get_dbus_properties(IFACE_WIMAX) - changed = { propname: props[propname] } - WimaxDevice.PropertiesChanged(self, changed) - - @dbus.service.signal(IFACE_WIMAX, signature='a{sv}') - def PropertiesChanged(self, changed): - pass - - # test functions - def add_test_nsp(self, name): - nsp = WimaxNsp(self._bus, name) - self.add_nsp(nsp) - return nsp.path - - def remove_nsp_by_path(self, path): - for nsp in self.nsps: - if nsp.path == path: - self.remove_nsp(nsp) - return - raise NspNotFoundException("NSP %s not found" % path) - -################################################################### -IFACE_TEST = 'org.freedesktop.NetworkManager.LibnmGlibTest' -IFACE_NM = 'org.freedesktop.NetworkManager' - -class PermissionDeniedException(dbus.DBusException): - _dbus_error_name = IFACE_NM + '.PermissionDenied' - -class UnknownDeviceException(dbus.DBusException): - _dbus_error_name = IFACE_NM + '.UnknownDevice' - -PM_DEVICES = 'Devices' -PM_NETWORKING_ENABLED = 'NetworkingEnabled' -PM_WWAN_ENABLED = 'WwanEnabled' -PM_WWAN_HARDWARE_ENABLED = 'WwanHardwareEnabled' -PM_WIRELESS_ENABLED = 'WirelessEnabled' -PM_WIRELESS_HARDWARE_ENABLED = 'WirelessHardwareEnabled' -PM_WIMAX_ENABLED = 'WimaxEnabled' -PM_WIMAX_HARDWARE_ENABLED = 'WimaxHardwareEnabled' -PM_ACTIVE_CONNECTIONS = 'ActiveConnections' -PM_PRIMARY_CONNECTION = 'PrimaryConnection' -PM_ACTIVATING_CONNECTION = 'ActivatingConnection' -PM_STARTUP = 'Startup' -PM_STATE = 'State' -PM_VERSION = 'Version' -PM_CONNECTIVITY = 'Connectivity' - -class NetworkManager(ExportedObj): - def __init__(self, bus, object_path): - ExportedObj.__init__(self, bus, object_path) - self.add_dbus_interface(IFACE_NM, self.__get_props) - - self.devices = [] - self.active_connections = [] - self.primary_connection = None - self.activating_connection = None - self.state = NM_STATE_DISCONNECTED - self.connectivity = 1 - - @dbus.service.signal(IFACE_NM, signature='u') - def StateChanged(self, new_state): - pass - - def set_state(self, new_state): - self.state = new_state - self.__notify(PM_STATE) - self.StateChanged(dbus.UInt32(self.state)) - - @dbus.service.method(dbus_interface=IFACE_NM, in_signature='', out_signature='ao') - def GetDevices(self): - return self._get_dbus_properties(IFACE_NM)[PM_DEVICES] - - @dbus.service.method(dbus_interface=IFACE_NM, in_signature='s', out_signature='o') - def GetDeviceByIpIface(self, ip_iface): - for d in self.devices: - # ignore iface/ip_iface distinction for now - if d.iface == ip_iface: - return d.path - raise UnknownDeviceException("No device found for the requested iface.") - - @dbus.service.method(dbus_interface=IFACE_NM, in_signature='ooo', out_signature='o') - def ActivateConnection(self, conpath, devpath, specific_object): - device = None - for d in self.devices: - if d.path == devpath: - device = d - break - if not device: - raise UnknownDeviceException("No device found for the requested iface.") - raise PermissionDeniedException("Not yet implemented") - - @dbus.service.method(dbus_interface=IFACE_NM, in_signature='a{sa{sv}}oo', out_signature='oo') - def AddAndActivateConnection(self, connection, devpath, specific_object): - device = None - for d in self.devices: - if d.path == devpath: - device = d - break - if not device: - raise UnknownDeviceException("No device found for the requested iface.") - raise PermissionDeniedException("Not yet implemented") - - @dbus.service.method(dbus_interface=IFACE_NM, in_signature='o', out_signature='') - def DeactivateConnection(self, active_connection): - pass - - @dbus.service.method(dbus_interface=IFACE_NM, in_signature='b', out_signature='') - def Sleep(self, do_sleep): - if do_sleep: - self.state = NM_STATE_ASLEEP - else: - self.state = NM_STATE_DISCONNECTED - self.__notify(PM_STATE) - - @dbus.service.method(dbus_interface=IFACE_NM, in_signature='b', out_signature='') - def Enable(self, do_enable): - pass - - @dbus.service.method(dbus_interface=IFACE_NM, in_signature='', out_signature='a{ss}') - def GetPermissions(self): - return { "org.freedesktop.NetworkManager.enable-disable-network": "yes", - "org.freedesktop.NetworkManager.sleep-wake": "no", - "org.freedesktop.NetworkManager.enable-disable-wifi": "yes", - "org.freedesktop.NetworkManager.enable-disable-wwan": "yes", - "org.freedesktop.NetworkManager.enable-disable-wimax": "yes", - "org.freedesktop.NetworkManager.network-control": "yes", - "org.freedesktop.NetworkManager.wifi.share.protected": "yes", - "org.freedesktop.NetworkManager.wifi.share.open": "yes", - "org.freedesktop.NetworkManager.settings.modify.own": "yes", - "org.freedesktop.NetworkManager.settings.modify.system": "yes", - "org.freedesktop.NetworkManager.settings.modify.hostname": "yes" } - - @dbus.service.method(dbus_interface=IFACE_NM, in_signature='ss', out_signature='') - def SetLogging(self, level, domains): - pass - - @dbus.service.method(dbus_interface=IFACE_NM, in_signature='', out_signature='ss') - def GetLogging(self): - return ("info", "HW,RFKILL,CORE,DEVICE,WIFI,ETHER") - - @dbus.service.method(dbus_interface=IFACE_NM, in_signature='', out_signature='u') - def CheckConnectivity(self): - raise PermissionDeniedException("You fail") - - @dbus.service.signal(IFACE_NM, signature='o') - def DeviceAdded(self, devpath): - pass - - def add_device(self, device): - self.devices.append(device) - self.__notify(PM_DEVICES) - self.DeviceAdded(to_path(device)) - - @dbus.service.signal(IFACE_NM, signature='o') - def DeviceRemoved(self, devpath): - pass - - def remove_device(self, device): - self.devices.remove(device) - self.__notify(PM_DEVICES) - self.DeviceRemoved(to_path(device)) - - ################# D-Bus Properties interface - def __get_props(self): - props = {} - props[PM_DEVICES] = to_path_array(self.devices) - props[PM_NETWORKING_ENABLED] = True - props[PM_WWAN_ENABLED] = True - props[PM_WWAN_HARDWARE_ENABLED] = True - props[PM_WIRELESS_ENABLED] = True - props[PM_WIRELESS_HARDWARE_ENABLED] = True - props[PM_WIMAX_ENABLED] = True - props[PM_WIMAX_HARDWARE_ENABLED] = True - props[PM_ACTIVE_CONNECTIONS] = to_path_array(self.active_connections) - props[PM_PRIMARY_CONNECTION] = to_path(self.primary_connection) - props[PM_ACTIVATING_CONNECTION] = to_path(self.activating_connection) - props[PM_STARTUP] = False - props[PM_STATE] = dbus.UInt32(self.state) - props[PM_VERSION] = "0.9.9.0" - props[PM_CONNECTIVITY] = dbus.UInt32(self.connectivity) - return props - - def __notify(self, propname): - props = self._get_dbus_properties(IFACE_NM) - changed = { propname: props[propname] } - NetworkManager.PropertiesChanged(self, changed) - - @dbus.service.signal(IFACE_NM, signature='a{sv}') - def PropertiesChanged(self, changed): - pass - - ################# Testing methods - @dbus.service.method(IFACE_TEST, in_signature='', out_signature='') - def Quit(self): - mainloop.quit() - - @dbus.service.method(IFACE_TEST, in_signature='s', out_signature='o') - def AddWiredDevice(self, ifname): - for d in self.devices: - if d.iface == ifname: - raise PermissionDeniedError("Device already added") - dev = WiredDevice(self._bus, ifname) - self.add_device(dev) - return dbus.ObjectPath(dev.path) - - @dbus.service.method(IFACE_TEST, in_signature='s', out_signature='o') - def AddWifiDevice(self, ifname): - for d in self.devices: - if d.iface == ifname: - raise PermissionDeniedError("Device already added") - dev = WifiDevice(self._bus, ifname) - self.add_device(dev) - return dbus.ObjectPath(dev.path) - - @dbus.service.method(IFACE_TEST, in_signature='s', out_signature='o') - def AddWimaxDevice(self, ifname): - for d in self.devices: - if d.iface == ifname: - raise PermissionDeniedError("Device already added") - dev = WimaxDevice(self._bus, ifname) - self.add_device(dev) - return dbus.ObjectPath(dev.path) - - @dbus.service.method(IFACE_TEST, in_signature='o', out_signature='') - def RemoveDevice(self, path): - for d in self.devices: - if d.path == path: - self.remove_device(d) - return - raise UnknownDeviceException("Device not found") - - @dbus.service.method(IFACE_TEST, in_signature='sss', out_signature='o') - def AddWifiAp(self, ifname, ssid, mac): - for d in self.devices: - if d.iface == ifname: - return dbus.ObjectPath(d.add_test_ap(ssid, mac)) - raise UnknownDeviceException("Device not found") - - @dbus.service.method(IFACE_TEST, in_signature='so', out_signature='') - def RemoveWifiAp(self, ifname, ap_path): - for d in self.devices: - if d.iface == ifname: - d.remove_ap_by_path(ap_path) - return - raise UnknownDeviceException("Device not found") - - @dbus.service.method(IFACE_TEST, in_signature='ss', out_signature='o') - def AddWimaxNsp(self, ifname, name): - for d in self.devices: - if d.iface == ifname: - return dbus.ObjectPath(d.add_test_nsp(name)) - raise UnknownDeviceException("Device not found") - - @dbus.service.method(IFACE_TEST, in_signature='so', out_signature='') - def RemoveWimaxNsp(self, ifname, nsp_path): - for d in self.devices: - if d.iface == ifname: - d.remove_nsp_by_path(nsp_path) - return - raise UnknownDeviceException("Device not found") - -def quit_cb(user_data): - mainloop.quit() - -def main(): - dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - - random.seed() - - bus = dbus.SessionBus() - nm = NetworkManager(bus, "/org/freedesktop/NetworkManager") - if not bus.request_name("org.freedesktop.NetworkManager"): - sys.exit(1) - - # quit after inactivity to ensure we don't stick around if tests fail - quit_id = GLib.timeout_add_seconds(20, quit_cb, None) - - try: - mainloop.run() - except Exception as e: - pass - - sys.exit(0) - -if __name__ == '__main__': - main() - diff --git a/libnm-glib/tests/test-nm-client.c b/libnm-glib/tests/test-nm-client.c index b181c8fa..af3722eb 100644 --- a/libnm-glib/tests/test-nm-client.c +++ b/libnm-glib/tests/test-nm-client.c @@ -14,10 +14,12 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2010 - 2014 Red Hat, Inc. + * Copyright 2010 - 2014 Red Hat, Inc. * */ +#include "config.h" + #include <dbus/dbus.h> #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-lowlevel.h> @@ -33,153 +35,39 @@ #include "nm-device-wimax.h" #include "nm-glib-compat.h" -static const char *fake_path; -static const char *fake_bin; -static const char *fake_exec; +#include "common.h" + static GMainLoop *loop = NULL; +static NMTestServiceInfo *sinfo; /*******************************************************************/ -typedef struct { - GDBusConnection *bus; - GDBusProxy *proxy; - GPid pid; - NMClient *client; -} ServiceInfo; - -#define test_assert(condition) \ -do { \ - if (!G_LIKELY (condition)) \ - service_cleanup (); \ - g_assert (condition); \ -} while (0) - -#define test_assert_cmpint(a, b, c) \ -do { \ - if (!G_LIKELY (a b c)) \ - service_cleanup (); \ - g_assert_cmpint (a, b, c); \ -} while (0) - -#define test_assert_cmpstr(a, b, c) \ -do { \ - if (!G_LIKELY (g_str_hash (a) b g_str_hash (c))) \ - service_cleanup (); \ - g_assert_cmpstr (a, b, c); \ -} while (0) - -#define test_assert_no_error(e) \ -do { \ - if (G_UNLIKELY (e)) \ - service_cleanup (); \ - g_assert_no_error (e); \ -} while (0) - -static ServiceInfo * sinfo_static = NULL; - -static void -service_cleanup (void) -{ - ServiceInfo *info = sinfo_static; - - sinfo_static = NULL; - - if (info) { - if (info->proxy) - g_object_unref (info->proxy); - if (info->bus) - g_object_unref (info->bus); - if (info->client) - g_object_unref (info->client); - if (info->pid) - kill (info->pid, SIGTERM); - memset (info, 0, sizeof (*info)); - g_free (info); - } else - g_assert_not_reached (); -} - -static gboolean -name_exists (GDBusConnection *c, const char *name) -{ - GVariant *reply; - gboolean exists = FALSE; - - reply = g_dbus_connection_call_sync (c, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS, - "GetNameOwner", - g_variant_new ("(s)", name), - NULL, - G_DBUS_CALL_FLAGS_NO_AUTO_START, - -1, - NULL, - NULL); - if (reply != NULL) { - exists = TRUE; - g_variant_unref (reply); - } - - return exists; -} - -static ServiceInfo * -service_init (void) +static NMClient * +test_client_new (void) { - ServiceInfo *sinfo; - const char *args[2] = { fake_exec, NULL }; + NMClient *client; + DBusGConnection *bus; GError *error = NULL; - int i = 100; + gboolean success; - g_assert (!sinfo_static); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); + g_assert_no_error (error); - sinfo = g_malloc0 (sizeof (*sinfo)); + client = g_object_new (NM_TYPE_CLIENT, + NM_OBJECT_DBUS_CONNECTION, bus, + NM_OBJECT_DBUS_PATH, NM_DBUS_PATH, + NULL); + g_assert (client != NULL); - sinfo_static = sinfo; + dbus_g_connection_unref (bus); - sinfo->bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); - test_assert (sinfo->bus); + success = g_initable_init (G_INITABLE (client), NULL, &error); + g_assert_no_error (error); + g_assert (success == TRUE); - if (!g_spawn_async (fake_path, (char **) args, NULL, 0, NULL, NULL, &sinfo->pid, &error)) - test_assert_no_error (error); - - /* Wait until the service is registered on the bus */ - while (i > 0) { - g_usleep (G_USEC_PER_SEC / 50); - if (name_exists (sinfo->bus, "org.freedesktop.NetworkManager")) - break; - i--; - } - test_assert (i > 0); - - /* Grab a proxy to our fake NM service to trigger tests */ - sinfo->proxy = g_dbus_proxy_new_sync (sinfo->bus, - G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | - G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS | - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, - NULL, - NM_DBUS_SERVICE, - NM_DBUS_PATH, - "org.freedesktop.NetworkManager.LibnmGlibTest", - NULL, NULL); - test_assert (sinfo->proxy); - - sinfo->client = nm_client_new (); - test_assert (sinfo->client != NULL); - - return sinfo; -} - -static ServiceInfo * -service_get (void) -{ - g_assert (sinfo_static); - return sinfo_static; + return client; } -#define _sinfo (service_get ()) - /*******************************************************************/ static gboolean @@ -195,16 +83,16 @@ add_device (const char *method, const char *ifname, char **out_path) GError *error = NULL; GVariant *ret; - ret = g_dbus_proxy_call_sync (_sinfo->proxy, + ret = g_dbus_proxy_call_sync (sinfo->proxy, method, g_variant_new ("(s)", ifname), G_DBUS_CALL_FLAGS_NO_AUTO_START, 3000, NULL, &error); - test_assert_no_error (error); - test_assert (ret); - test_assert_cmpstr (g_variant_get_type_string (ret), ==, "(o)"); + g_assert_no_error (error); + g_assert (ret); + g_assert_cmpstr (g_variant_get_type_string (ret), ==, "(o)"); if (out_path) g_variant_get (ret, "(o)", out_path); g_variant_unref (ret); @@ -237,8 +125,8 @@ device_added_cb (NMClient *c, NMDevice *device, DeviceAddedInfo *info) { - test_assert (device); - test_assert_cmpstr (nm_device_get_iface (device), ==, "eth0"); + g_assert (device); + g_assert_cmpstr (nm_device_get_iface (device), ==, "eth0"); info->signaled = TRUE; device_add_check_quit (info); } @@ -252,12 +140,12 @@ devices_notify_cb (NMClient *c, NMDevice *device; devices = nm_client_get_devices (c); - test_assert (devices); - test_assert_cmpint (devices->len, ==, 1); + g_assert (devices); + g_assert_cmpint (devices->len, ==, 1); device = g_ptr_array_index (devices, 0); - test_assert (device); - test_assert_cmpstr (nm_device_get_iface (device), ==, "eth0"); + g_assert (device); + g_assert_cmpstr (nm_device_get_iface (device), ==, "eth0"); info->notified = TRUE; @@ -267,29 +155,27 @@ devices_notify_cb (NMClient *c, static void test_device_added (void) { + NMClient *client; const GPtrArray *devices; NMDevice *device; DeviceAddedInfo info = { loop, FALSE, FALSE, 0, 0 }; - service_init (); - - /* Give NMClient a chance to initialize */ - g_timeout_add_seconds (5, loop_quit, loop); - g_main_loop_run (loop); + sinfo = nm_test_service_init (); + client = test_client_new (); - devices = nm_client_get_devices (_sinfo->client); - test_assert (devices == NULL); + devices = nm_client_get_devices (client); + g_assert (devices == NULL); /* Tell the test service to add a new device */ add_device ("AddWiredDevice", "eth0", NULL); - g_signal_connect (_sinfo->client, + g_signal_connect (client, "device-added", (GCallback) device_added_cb, &info); info.quit_count++; - g_signal_connect (_sinfo->client, + g_signal_connect (client, "notify::devices", (GCallback) devices_notify_cb, &info); @@ -299,21 +185,22 @@ test_device_added (void) info.quit_id = g_timeout_add_seconds (5, loop_quit, loop); g_main_loop_run (loop); - test_assert (info.signaled); - test_assert (info.notified); + g_assert (info.signaled); + g_assert (info.notified); - g_signal_handlers_disconnect_by_func (_sinfo->client, device_added_cb, &info); - g_signal_handlers_disconnect_by_func (_sinfo->client, devices_notify_cb, &info); + g_signal_handlers_disconnect_by_func (client, device_added_cb, &info); + g_signal_handlers_disconnect_by_func (client, devices_notify_cb, &info); - devices = nm_client_get_devices (_sinfo->client); - test_assert (devices); - test_assert_cmpint (devices->len, ==, 1); + devices = nm_client_get_devices (client); + g_assert (devices); + g_assert_cmpint (devices->len, ==, 1); device = g_ptr_array_index (devices, 0); - test_assert (device); - test_assert_cmpstr (nm_device_get_iface (device), ==, "eth0"); + g_assert (device); + g_assert_cmpstr (nm_device_get_iface (device), ==, "eth0"); - service_cleanup (); + g_object_unref (client); + g_clear_pointer (&sinfo, nm_test_service_cleanup); } /*******************************************************************/ @@ -346,7 +233,7 @@ wifi_device_added_cb (NMClient *c, NMDevice *device, WifiApInfo *info) { - test_assert_cmpstr (nm_device_get_iface (device), ==, "wlan0"); + g_assert_cmpstr (nm_device_get_iface (device), ==, "wlan0"); info->found = TRUE; wifi_check_quit (info); } @@ -355,7 +242,7 @@ static void got_ap_path (WifiApInfo *info, const char *path) { if (info->ap_path) - test_assert_cmpstr (info->ap_path, ==, path); + g_assert_cmpstr (info->ap_path, ==, path); else info->ap_path = g_strdup (path); } @@ -365,8 +252,8 @@ wifi_ap_added_cb (NMDeviceWifi *w, NMAccessPoint *ap, WifiApInfo *info) { - test_assert (ap); - test_assert_cmpstr (nm_access_point_get_bssid (ap), ==, expected_bssid); + g_assert (ap); + g_assert_cmpstr (nm_access_point_get_bssid (ap), ==, expected_bssid); got_ap_path (info, nm_object_get_path (NM_OBJECT (ap))); info->signaled = TRUE; @@ -382,12 +269,12 @@ wifi_ap_add_notify_cb (NMDeviceWifi *w, NMAccessPoint *ap; aps = nm_device_wifi_get_access_points (w); - test_assert (aps); - test_assert_cmpint (aps->len, ==, 1); + g_assert (aps); + g_assert_cmpint (aps->len, ==, 1); ap = g_ptr_array_index (aps, 0); - test_assert (ap); - test_assert_cmpstr (nm_access_point_get_bssid (ap), ==, "66:55:44:33:22:11"); + g_assert (ap); + g_assert_cmpstr (nm_access_point_get_bssid (ap), ==, "66:55:44:33:22:11"); got_ap_path (info, nm_object_get_path (NM_OBJECT (ap))); info->notified = TRUE; @@ -399,8 +286,8 @@ wifi_ap_removed_cb (NMDeviceWifi *w, NMAccessPoint *ap, WifiApInfo *info) { - test_assert (ap); - test_assert_cmpstr (info->ap_path, ==, nm_object_get_path (NM_OBJECT (ap))); + g_assert (ap); + g_assert_cmpstr (info->ap_path, ==, nm_object_get_path (NM_OBJECT (ap))); info->signaled = TRUE; wifi_check_quit (info); @@ -414,7 +301,7 @@ wifi_ap_remove_notify_cb (NMDeviceWifi *w, const GPtrArray *aps; aps = nm_device_wifi_get_access_points (w); - test_assert (aps == NULL); + g_assert (aps == NULL); info->notified = TRUE; wifi_check_quit (info); @@ -423,23 +310,21 @@ wifi_ap_remove_notify_cb (NMDeviceWifi *w, static void test_wifi_ap_added_removed (void) { + NMClient *client; NMDeviceWifi *wifi; WifiApInfo info = { loop, FALSE, FALSE, 0, 0 }; GVariant *ret; GError *error = NULL; char *expected_path = NULL; - service_init (); - - /* Give NMClient a chance to initialize */ - g_timeout_add_seconds (5, loop_quit, loop); - g_main_loop_run (loop); + sinfo = nm_test_service_init (); + client = test_client_new (); /*************************************/ /* Add the wifi device */ add_device ("AddWifiDevice", "wlan0", NULL); - g_signal_connect (_sinfo->client, + g_signal_connect (client, "device-added", (GCallback) wifi_device_added_cb, &info); @@ -449,11 +334,11 @@ test_wifi_ap_added_removed (void) info.quit_id = g_timeout_add_seconds (5, loop_quit, loop); g_main_loop_run (loop); - test_assert (info.found); - g_signal_handlers_disconnect_by_func (_sinfo->client, wifi_device_added_cb, &info); + g_assert (info.found); + g_signal_handlers_disconnect_by_func (client, wifi_device_added_cb, &info); - wifi = (NMDeviceWifi *) nm_client_get_device_by_iface (_sinfo->client, "wlan0"); - test_assert (NM_IS_DEVICE_WIFI (wifi)); + wifi = (NMDeviceWifi *) nm_client_get_device_by_iface (client, "wlan0"); + g_assert (NM_IS_DEVICE_WIFI (wifi)); /*************************************/ /* Add the wifi device */ @@ -461,16 +346,16 @@ test_wifi_ap_added_removed (void) info.notified = FALSE; info.quit_id = 0; - ret = g_dbus_proxy_call_sync (_sinfo->proxy, + ret = g_dbus_proxy_call_sync (sinfo->proxy, "AddWifiAp", g_variant_new ("(sss)", "wlan0", "test-ap", expected_bssid), G_DBUS_CALL_FLAGS_NO_AUTO_START, 3000, NULL, &error); - test_assert_no_error (error); - test_assert (ret); - test_assert_cmpstr (g_variant_get_type_string (ret), ==, "(o)"); + g_assert_no_error (error); + g_assert (ret); + g_assert_cmpstr (g_variant_get_type_string (ret), ==, "(o)"); g_variant_get (ret, "(o)", &expected_path); g_variant_unref (ret); @@ -490,10 +375,10 @@ test_wifi_ap_added_removed (void) info.quit_id = g_timeout_add_seconds (5, loop_quit, loop); g_main_loop_run (loop); - test_assert (info.signaled); - test_assert (info.notified); - test_assert (info.ap_path); - test_assert_cmpstr (info.ap_path, ==, expected_path); + g_assert (info.signaled); + g_assert (info.notified); + g_assert (info.ap_path); + g_assert_cmpstr (info.ap_path, ==, expected_path); g_signal_handlers_disconnect_by_func (wifi, wifi_ap_added_cb, &info); g_signal_handlers_disconnect_by_func (wifi, wifi_ap_add_notify_cb, &info); @@ -503,14 +388,14 @@ test_wifi_ap_added_removed (void) info.notified = FALSE; info.quit_id = 0; - ret = g_dbus_proxy_call_sync (_sinfo->proxy, + ret = g_dbus_proxy_call_sync (sinfo->proxy, "RemoveWifiAp", g_variant_new ("(so)", "wlan0", expected_path), G_DBUS_CALL_FLAGS_NO_AUTO_START, 3000, NULL, &error); - test_assert_no_error (error); + g_assert_no_error (error); g_clear_pointer (&ret, g_variant_unref); g_signal_connect (wifi, @@ -529,14 +414,16 @@ test_wifi_ap_added_removed (void) info.quit_id = g_timeout_add_seconds (5, loop_quit, loop); g_main_loop_run (loop); - test_assert (info.signaled); - test_assert (info.notified); + g_assert (info.signaled); + g_assert (info.notified); g_signal_handlers_disconnect_by_func (wifi, wifi_ap_removed_cb, &info); g_signal_handlers_disconnect_by_func (wifi, wifi_ap_remove_notify_cb, &info); g_free (info.ap_path); g_free (expected_path); - service_cleanup (); + + g_object_unref (client); + g_clear_pointer (&sinfo, nm_test_service_cleanup); } /*******************************************************************/ @@ -569,7 +456,7 @@ wimax_device_added_cb (NMClient *c, NMDevice *device, WimaxNspInfo *info) { - test_assert_cmpstr (nm_device_get_iface (device), ==, "wmx0"); + g_assert_cmpstr (nm_device_get_iface (device), ==, "wmx0"); info->found = TRUE; wimax_check_quit (info); } @@ -578,7 +465,7 @@ static void got_nsp_path (WimaxNspInfo *info, const char *path) { if (info->nsp_path) - test_assert_cmpstr (info->nsp_path, ==, path); + g_assert_cmpstr (info->nsp_path, ==, path); else info->nsp_path = g_strdup (path); } @@ -588,8 +475,8 @@ wimax_nsp_added_cb (NMDeviceWimax *w, NMWimaxNsp *nsp, WimaxNspInfo *info) { - test_assert (nsp); - test_assert_cmpstr (nm_wimax_nsp_get_name (nsp), ==, expected_nsp_name); + g_assert (nsp); + g_assert_cmpstr (nm_wimax_nsp_get_name (nsp), ==, expected_nsp_name); got_nsp_path (info, nm_object_get_path (NM_OBJECT (nsp))); info->signaled = TRUE; @@ -605,12 +492,12 @@ wimax_nsp_add_notify_cb (NMDeviceWimax *w, NMWimaxNsp *nsp; nsps = nm_device_wimax_get_nsps (w); - test_assert (nsps); - test_assert_cmpint (nsps->len, ==, 1); + g_assert (nsps); + g_assert_cmpint (nsps->len, ==, 1); nsp = g_ptr_array_index (nsps, 0); - test_assert (nsp); - test_assert_cmpstr (nm_wimax_nsp_get_name (nsp), ==, expected_nsp_name); + g_assert (nsp); + g_assert_cmpstr (nm_wimax_nsp_get_name (nsp), ==, expected_nsp_name); got_nsp_path (info, nm_object_get_path (NM_OBJECT (nsp))); info->notified = TRUE; @@ -622,8 +509,8 @@ wimax_nsp_removed_cb (NMDeviceWimax *w, NMWimaxNsp *nsp, WimaxNspInfo *info) { - test_assert (nsp); - test_assert_cmpstr (info->nsp_path, ==, nm_object_get_path (NM_OBJECT (nsp))); + g_assert (nsp); + g_assert_cmpstr (info->nsp_path, ==, nm_object_get_path (NM_OBJECT (nsp))); info->signaled = TRUE; wimax_check_quit (info); @@ -637,7 +524,7 @@ wimax_nsp_remove_notify_cb (NMDeviceWimax *w, const GPtrArray *nsps; nsps = nm_device_wimax_get_nsps (w); - test_assert (nsps == NULL); + g_assert (nsps == NULL); info->notified = TRUE; wimax_check_quit (info); @@ -646,23 +533,21 @@ wimax_nsp_remove_notify_cb (NMDeviceWimax *w, static void test_wimax_nsp_added_removed (void) { + NMClient *client; NMDeviceWimax *wimax; WimaxNspInfo info = { loop, FALSE, FALSE, 0, 0 }; GVariant *ret; GError *error = NULL; char *expected_path = NULL; - service_init (); - - /* Give NMClient a chance to initialize */ - g_timeout_add_seconds (5, loop_quit, loop); - g_main_loop_run (loop); + sinfo = nm_test_service_init (); + client = test_client_new (); /*************************************/ /* Add the wimax device */ add_device ("AddWimaxDevice", "wmx0", NULL); - g_signal_connect (_sinfo->client, + g_signal_connect (client, "device-added", (GCallback) wimax_device_added_cb, &info); @@ -672,11 +557,11 @@ test_wimax_nsp_added_removed (void) info.quit_id = g_timeout_add_seconds (5, loop_quit, loop); g_main_loop_run (loop); - test_assert (info.found); - g_signal_handlers_disconnect_by_func (_sinfo->client, wimax_device_added_cb, &info); + g_assert (info.found); + g_signal_handlers_disconnect_by_func (client, wimax_device_added_cb, &info); - wimax = (NMDeviceWimax *) nm_client_get_device_by_iface (_sinfo->client, "wmx0"); - test_assert (NM_IS_DEVICE_WIMAX (wimax)); + wimax = (NMDeviceWimax *) nm_client_get_device_by_iface (client, "wmx0"); + g_assert (NM_IS_DEVICE_WIMAX (wimax)); /*************************************/ /* Add the wimax NSP */ @@ -684,16 +569,16 @@ test_wimax_nsp_added_removed (void) info.notified = FALSE; info.quit_id = 0; - ret = g_dbus_proxy_call_sync (_sinfo->proxy, + ret = g_dbus_proxy_call_sync (sinfo->proxy, "AddWimaxNsp", g_variant_new ("(ss)", "wmx0", expected_nsp_name), G_DBUS_CALL_FLAGS_NO_AUTO_START, 3000, NULL, &error); - test_assert_no_error (error); - test_assert (ret); - test_assert_cmpstr (g_variant_get_type_string (ret), ==, "(o)"); + g_assert_no_error (error); + g_assert (ret); + g_assert_cmpstr (g_variant_get_type_string (ret), ==, "(o)"); g_variant_get (ret, "(o)", &expected_path); g_variant_unref (ret); @@ -713,10 +598,10 @@ test_wimax_nsp_added_removed (void) info.quit_id = g_timeout_add_seconds (5, loop_quit, loop); g_main_loop_run (loop); - test_assert (info.signaled); - test_assert (info.notified); - test_assert (info.nsp_path); - test_assert_cmpstr (info.nsp_path, ==, expected_path); + g_assert (info.signaled); + g_assert (info.notified); + g_assert (info.nsp_path); + g_assert_cmpstr (info.nsp_path, ==, expected_path); g_signal_handlers_disconnect_by_func (wimax, wimax_nsp_added_cb, &info); g_signal_handlers_disconnect_by_func (wimax, wimax_nsp_add_notify_cb, &info); @@ -726,14 +611,14 @@ test_wimax_nsp_added_removed (void) info.notified = FALSE; info.quit_id = 0; - ret = g_dbus_proxy_call_sync (_sinfo->proxy, + ret = g_dbus_proxy_call_sync (sinfo->proxy, "RemoveWimaxNsp", g_variant_new ("(so)", "wmx0", expected_path), G_DBUS_CALL_FLAGS_NO_AUTO_START, 3000, NULL, &error); - test_assert_no_error (error); + g_assert_no_error (error); g_clear_pointer (&ret, g_variant_unref); g_signal_connect (wimax, @@ -752,14 +637,16 @@ test_wimax_nsp_added_removed (void) info.quit_id = g_timeout_add_seconds (5, loop_quit, loop); g_main_loop_run (loop); - test_assert (info.signaled); - test_assert (info.notified); + g_assert (info.signaled); + g_assert (info.notified); g_signal_handlers_disconnect_by_func (wimax, wimax_nsp_removed_cb, &info); g_signal_handlers_disconnect_by_func (wimax, wimax_nsp_remove_notify_cb, &info); g_free (info.nsp_path); g_free (expected_path); - service_cleanup (); + + g_object_unref (client); + g_clear_pointer (&sinfo, nm_test_service_cleanup); } /*******************************************************************/ @@ -796,7 +683,7 @@ da_device_removed_cb (NMClient *c, NMDevice *device, DaInfo *info) { - test_assert_cmpstr (nm_device_get_iface (device), ==, "eth0"); + g_assert_cmpstr (nm_device_get_iface (device), ==, "eth0"); info->signaled = TRUE; da_check_quit (info); } @@ -812,14 +699,14 @@ da_devices_notify_cb (NMClient *c, const char *iface; devices = nm_client_get_devices (c); - test_assert (devices); - test_assert_cmpint (devices->len, ==, 2); + g_assert (devices); + g_assert_cmpint (devices->len, ==, 2); for (i = 0; i < devices->len; i++) { device = g_ptr_array_index (devices, i); iface = nm_device_get_iface (device); - test_assert (!strcmp (iface, "wlan0") || !strcmp (iface, "eth1")); + g_assert (!strcmp (iface, "wlan0") || !strcmp (iface, "eth1")); } info->notified = TRUE; @@ -829,6 +716,7 @@ da_devices_notify_cb (NMClient *c, static void test_devices_array (void) { + NMClient *client; DaInfo info = { loop }; char *paths[3] = { NULL, NULL, NULL }; NMDevice *device; @@ -836,11 +724,8 @@ test_devices_array (void) GError *error = NULL; GVariant *ret; - service_init (); - - /* Give NMClient a chance to initialize */ - g_timeout_add_seconds (5, loop_quit, loop); - g_main_loop_run (loop); + sinfo = nm_test_service_init (); + client = test_client_new (); /*************************************/ /* Add some devices */ @@ -849,7 +734,7 @@ test_devices_array (void) add_device ("AddWiredDevice", "eth1", &paths[2]); info.quit_count = 3; - g_signal_connect (_sinfo->client, + g_signal_connect (client, "device-added", (GCallback) da_device_added_cb, &info); @@ -858,42 +743,42 @@ test_devices_array (void) info.quit_id = g_timeout_add_seconds (5, loop_quit, loop); g_main_loop_run (loop); - test_assert_cmpint (info.quit_count, ==, 0); - g_signal_handlers_disconnect_by_func (_sinfo->client, da_device_added_cb, &info); + g_assert_cmpint (info.quit_count, ==, 0); + g_signal_handlers_disconnect_by_func (client, da_device_added_cb, &info); /* Ensure the devices now exist */ - devices = nm_client_get_devices (_sinfo->client); - test_assert (devices); - test_assert_cmpint (devices->len, ==, 3); + devices = nm_client_get_devices (client); + g_assert (devices); + g_assert_cmpint (devices->len, ==, 3); - device = nm_client_get_device_by_iface (_sinfo->client, "wlan0"); - test_assert (NM_IS_DEVICE_WIFI (device)); + device = nm_client_get_device_by_iface (client, "wlan0"); + g_assert (NM_IS_DEVICE_WIFI (device)); - device = nm_client_get_device_by_iface (_sinfo->client, "eth0"); - test_assert (NM_IS_DEVICE_ETHERNET (device)); + device = nm_client_get_device_by_iface (client, "eth0"); + g_assert (NM_IS_DEVICE_ETHERNET (device)); - device = nm_client_get_device_by_iface (_sinfo->client, "eth1"); - test_assert (NM_IS_DEVICE_ETHERNET (device)); + device = nm_client_get_device_by_iface (client, "eth1"); + g_assert (NM_IS_DEVICE_ETHERNET (device)); /********************************/ /* Now remove the device in the middle */ - ret = g_dbus_proxy_call_sync (_sinfo->proxy, + ret = g_dbus_proxy_call_sync (sinfo->proxy, "RemoveDevice", g_variant_new ("(o)", paths[1]), G_DBUS_CALL_FLAGS_NO_AUTO_START, 3000, NULL, &error); - test_assert_no_error (error); - test_assert (ret); + g_assert_no_error (error); + g_assert (ret); g_variant_unref (ret); - g_signal_connect (_sinfo->client, + g_signal_connect (client, "device-removed", (GCallback) da_device_removed_cb, &info); - g_signal_connect (_sinfo->client, + g_signal_connect (client, "notify::devices", (GCallback) da_devices_notify_cb, &info); @@ -903,25 +788,94 @@ test_devices_array (void) info.quit_id = g_timeout_add_seconds (5, loop_quit, loop); g_main_loop_run (loop); - test_assert_cmpint (info.quit_count, ==, 0); - g_signal_handlers_disconnect_by_func (_sinfo->client, da_device_removed_cb, &info); - g_signal_handlers_disconnect_by_func (_sinfo->client, da_devices_notify_cb, &info); + g_assert_cmpint (info.quit_count, ==, 0); + g_signal_handlers_disconnect_by_func (client, da_device_removed_cb, &info); + g_signal_handlers_disconnect_by_func (client, da_devices_notify_cb, &info); /* Ensure only two are left */ - devices = nm_client_get_devices (_sinfo->client); - test_assert (devices); - test_assert_cmpint (devices->len, ==, 2); + devices = nm_client_get_devices (client); + g_assert (devices); + g_assert_cmpint (devices->len, ==, 2); - device = nm_client_get_device_by_iface (_sinfo->client, "wlan0"); - test_assert (NM_IS_DEVICE_WIFI (device)); + device = nm_client_get_device_by_iface (client, "wlan0"); + g_assert (NM_IS_DEVICE_WIFI (device)); - device = nm_client_get_device_by_iface (_sinfo->client, "eth1"); - test_assert (NM_IS_DEVICE_ETHERNET (device)); + device = nm_client_get_device_by_iface (client, "eth1"); + g_assert (NM_IS_DEVICE_ETHERNET (device)); g_free (paths[0]); g_free (paths[1]); g_free (paths[2]); - service_cleanup (); + + g_object_unref (client); + g_clear_pointer (&sinfo, nm_test_service_cleanup); +} + +static void +manager_running_changed (GObject *client, + GParamSpec *pspec, + gpointer user_data) +{ + int *running_changed = user_data; + + (*running_changed)++; + g_main_loop_quit (loop); +} + +static void +test_client_manager_running (void) +{ + NMClient *client1, *client2; + guint quit_id; + int running_changed = 0; + GError *error = NULL; + + client1 = test_client_new (); + + g_assert (!nm_client_get_manager_running (client1)); + g_assert_cmpstr (nm_client_get_version (client1), ==, NULL); + + g_assert (!nm_client_networking_get_enabled (client1)); + /* This will have no effect, but it shouldn't cause any warnings either. */ + nm_client_networking_set_enabled (client1, TRUE); + g_assert (!nm_client_networking_get_enabled (client1)); + + /* OTOH, this should result in an error */ + nm_client_set_logging (client1, "DEFAULT", "INFO", &error); + g_assert_error (error, NM_CLIENT_ERROR, NM_CLIENT_ERROR_MANAGER_NOT_RUNNING); + g_clear_error (&error); + + /* Now start the test service. */ + sinfo = nm_test_service_init (); + client2 = test_client_new (); + + /* client2 should know that NM is running, but the previously-created + * client1 hasn't gotten the news yet. + */ + g_assert (!nm_client_get_manager_running (client1)); + g_assert (nm_client_get_manager_running (client2)); + + g_signal_connect (client1, "notify::" NM_CLIENT_MANAGER_RUNNING, + G_CALLBACK (manager_running_changed), &running_changed); + quit_id = g_timeout_add_seconds (5, loop_quit, loop); + g_main_loop_run (loop); + g_assert_cmpint (running_changed, ==, 1); + g_assert (nm_client_get_manager_running (client1)); + g_source_remove (quit_id); + + /* And kill it */ + g_clear_pointer (&sinfo, nm_test_service_cleanup); + + g_assert (nm_client_get_manager_running (client1)); + + quit_id = g_timeout_add_seconds (5, loop_quit, loop); + g_main_loop_run (loop); + g_assert_cmpint (running_changed, ==, 2); + g_assert (!nm_client_get_manager_running (client1)); + g_source_remove (quit_id); + + g_object_unref (client1); + g_object_unref (client2); } /*******************************************************************/ @@ -929,24 +883,19 @@ test_devices_array (void) int main (int argc, char **argv) { - g_assert (argc == 3); - #if !GLIB_CHECK_VERSION (2, 35, 0) g_type_init (); #endif g_test_init (&argc, &argv, NULL); - fake_path = argv[1]; - fake_bin = argv[2]; - fake_exec = g_strdup_printf ("%s/%s", argv[1], argv[2]); - loop = g_main_loop_new (NULL, FALSE); g_test_add_func ("/libnm-glib/device-added", test_device_added); g_test_add_func ("/libnm-glib/wifi-ap-added-removed", test_wifi_ap_added_removed); g_test_add_func ("/libnm-glib/wimax-nsp-added-removed", test_wimax_nsp_added_removed); g_test_add_func ("/libnm-glib/devices-array", test_devices_array); + g_test_add_func ("/libnm-glib/client-manager-running", test_client_manager_running); return g_test_run (); } diff --git a/libnm-glib/tests/test-remote-settings-client.c b/libnm-glib/tests/test-remote-settings-client.c index e3ef7f22..237e287f 100644 --- a/libnm-glib/tests/test-remote-settings-client.c +++ b/libnm-glib/tests/test-remote-settings-client.c @@ -14,10 +14,12 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2010 - 2011 Red Hat, Inc. + * Copyright 2010 - 2011 Red Hat, Inc. * */ +#include "config.h" + #include <dbus/dbus.h> #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-lowlevel.h> @@ -33,8 +35,9 @@ #include <nm-utils.h> #include "nm-remote-settings.h" +#include "common.h" -static GPid spid = 0; +static NMTestServiceInfo *sinfo; static NMRemoteSettings *settings = NULL; DBusGConnection *bus = NULL; NMRemoteConnection *remote = NULL; @@ -42,23 +45,6 @@ NMRemoteConnection *remote = NULL; /*******************************************************************/ static void -cleanup (void) -{ - if (settings) - g_object_unref (settings); - kill (spid, SIGTERM); -} - -#define test_assert(condition) \ -do { \ - if (!G_LIKELY (condition)) \ - cleanup (); \ - g_assert (condition); \ -} while (0) - -/*******************************************************************/ - -static void add_cb (NMRemoteSettings *s, NMRemoteConnection *connection, GError *error, @@ -69,6 +55,7 @@ add_cb (NMRemoteSettings *s, *((gboolean *) user_data) = TRUE; remote = connection; + g_object_add_weak_pointer (G_OBJECT (connection), (void **) &remote); } #define TEST_CON_ID "blahblahblah" @@ -103,20 +90,20 @@ test_add_connection (void) connection, add_cb, &done); - test_assert (success == TRUE); + g_assert (success == TRUE); start = time (NULL); do { now = time (NULL); g_main_context_iteration (NULL, FALSE); } while ((done == FALSE) && (now - start < 5)); - test_assert (done == TRUE); - test_assert (remote != NULL); + g_assert (done == TRUE); + g_assert (remote != NULL); /* Make sure the connection is the same as what we added */ - test_assert (nm_connection_compare (connection, - NM_CONNECTION (remote), - NM_SETTING_COMPARE_FLAG_EXACT) == TRUE); + g_assert (nm_connection_compare (connection, + NM_CONNECTION (remote), + NM_SETTING_COMPARE_FLAG_EXACT) == TRUE); } /*******************************************************************/ @@ -130,10 +117,8 @@ set_visible_cb (DBusGProxy *proxy, gboolean success; success = dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); - if (!success) - g_warning ("Failed to change connection visibility: %s", error->message); - test_assert (success == TRUE); - test_assert (error == NULL); + g_assert_no_error (error); + g_assert (success == TRUE); } static void @@ -161,7 +146,7 @@ test_make_invisible (void) gboolean done = FALSE, has_settings = FALSE; char *path; - test_assert (remote != NULL); + g_assert (remote != NULL); /* Listen for the remove event when the connection becomes invisible */ g_signal_connect (remote, "removed", G_CALLBACK (invis_removed_cb), &done); @@ -171,7 +156,7 @@ test_make_invisible (void) NM_DBUS_SERVICE, path, NM_DBUS_IFACE_SETTINGS_CONNECTION); - test_assert (proxy != NULL); + g_assert (proxy != NULL); /* Bypass the NMRemoteSettings object so we can test it independently */ dbus_g_proxy_begin_call (proxy, "SetVisible", set_visible_cb, NULL, NULL, @@ -183,22 +168,26 @@ test_make_invisible (void) now = time (NULL); g_main_context_iteration (NULL, FALSE); } while ((done == FALSE) && (now - start < 5)); - test_assert (done == TRUE); + g_assert (done == TRUE); + + g_assert (remote); + g_signal_handlers_disconnect_by_func (remote, G_CALLBACK (invis_removed_cb), &done); /* Ensure NMRemoteSettings no longer has the connection */ list = nm_remote_settings_list_connections (settings); for (iter = list; iter; iter = g_slist_next (iter)) { NMConnection *candidate = NM_CONNECTION (iter->data); - test_assert ((gpointer) remote != (gpointer) candidate); - test_assert (strcmp (path, nm_connection_get_path (candidate)) != 0); + g_assert ((gpointer) remote != (gpointer) candidate); + g_assert (strcmp (path, nm_connection_get_path (candidate)) != 0); } /* And ensure the invisible connection no longer has any settings */ + g_assert (remote); nm_connection_for_each_setting_value (NM_CONNECTION (remote), invis_has_settings_cb, &has_settings); - test_assert (has_settings == FALSE); + g_assert (has_settings == FALSE); g_free (path); g_object_unref (proxy); @@ -224,7 +213,7 @@ test_make_visible (void) char *path; NMRemoteConnection *new = NULL; - test_assert (remote != NULL); + g_assert (remote != NULL); /* Wait for the new-connection signal when the connection is visible again */ g_signal_connect (settings, NM_REMOTE_SETTINGS_NEW_CONNECTION, @@ -235,7 +224,7 @@ test_make_visible (void) NM_DBUS_SERVICE, path, NM_DBUS_IFACE_SETTINGS_CONNECTION); - test_assert (proxy != NULL); + g_assert (proxy != NULL); /* Bypass the NMRemoteSettings object so we can test it independently */ dbus_g_proxy_begin_call (proxy, "SetVisible", set_visible_cb, NULL, NULL, @@ -250,7 +239,10 @@ test_make_visible (void) } while ((new == NULL) && (now - start < 5)); /* Ensure the new connection is the same as the one we made visible again */ - test_assert (new == remote); + g_assert (new); + g_assert (new == remote); + + g_signal_handlers_disconnect_by_func (settings, G_CALLBACK (vis_new_connection_cb), &new); /* Ensure NMRemoteSettings has the connection */ list = nm_remote_settings_list_connections (settings); @@ -258,13 +250,13 @@ test_make_visible (void) NMConnection *candidate = NM_CONNECTION (iter->data); if ((gpointer) remote == (gpointer) candidate) { - test_assert (strcmp (path, nm_connection_get_path (candidate)) == 0); - test_assert (strcmp (TEST_CON_ID, nm_connection_get_id (candidate)) == 0); + g_assert_cmpstr (path, ==, nm_connection_get_path (candidate)); + g_assert_cmpstr (TEST_CON_ID, ==, nm_connection_get_id (candidate)); found = TRUE; break; } } - test_assert (found == TRUE); + g_assert (found == TRUE); g_free (path); g_object_unref (proxy); @@ -281,10 +273,8 @@ deleted_cb (DBusGProxy *proxy, gboolean success; success = dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); - if (!success) - g_warning ("Failed to delete connection: %s", error->message); - test_assert (success == TRUE); - test_assert (error == NULL); + g_assert_no_error (error); + g_assert (success == TRUE); } static void @@ -305,9 +295,11 @@ test_remove_connection (void) /* Find a connection to delete */ list = nm_remote_settings_list_connections (settings); - test_assert (g_slist_length (list) > 0); + g_assert_cmpint (g_slist_length (list), >, 0); connection = NM_REMOTE_CONNECTION (list->data); + g_assert (connection); + g_assert (remote == connection); path = g_strdup (nm_connection_get_path (NM_CONNECTION (connection))); g_signal_connect (connection, "removed", G_CALLBACK (removed_cb), &done); @@ -315,7 +307,7 @@ test_remove_connection (void) NM_DBUS_SERVICE, path, NM_DBUS_IFACE_SETTINGS_CONNECTION); - test_assert (proxy != NULL); + g_assert (proxy != NULL); /* Bypass the NMRemoteSettings object so we can test it independently */ dbus_g_proxy_begin_call (proxy, "Delete", deleted_cb, NULL, NULL, G_TYPE_INVALID); @@ -325,15 +317,17 @@ test_remove_connection (void) now = time (NULL); g_main_context_iteration (NULL, FALSE); } while ((done == FALSE) && (now - start < 5)); - test_assert (done == TRUE); + g_assert (done == TRUE); + + g_assert (!remote); /* Ensure NMRemoteSettings no longer has the connection */ list = nm_remote_settings_list_connections (settings); for (iter = list; iter; iter = g_slist_next (iter)) { NMConnection *candidate = NM_CONNECTION (iter->data); - test_assert ((gpointer) connection != (gpointer) candidate); - test_assert (strcmp (path, nm_connection_get_path (candidate)) != 0); + g_assert ((gpointer) connection != (gpointer) candidate); + g_assert_cmpstr (path, ==, nm_connection_get_path (candidate)); } g_free (path); @@ -342,15 +336,93 @@ test_remove_connection (void) /*******************************************************************/ +static GMainLoop *loop; + +static gboolean +loop_quit (gpointer user_data) +{ + g_main_loop_quit (loop); + return G_SOURCE_REMOVE; +} + +static void +settings_service_running_changed (GObject *client, + GParamSpec *pspec, + gpointer user_data) +{ + int *running_changed = user_data; + + (*running_changed)++; + g_main_loop_quit (loop); +} + +static void +test_service_running (void) +{ + NMRemoteSettings *settings2; + guint quit_id; + int running_changed = 0; + gboolean running; + + loop = g_main_loop_new (NULL, FALSE); + + g_object_get (G_OBJECT (settings), + NM_REMOTE_SETTINGS_SERVICE_RUNNING, &running, + NULL); + g_assert (running == TRUE); + + /* Now kill the test service. */ + nm_test_service_cleanup (sinfo); + + settings2 = nm_remote_settings_new (bus); + + /* settings2 should know that NM is running, but the previously-created + * settings hasn't gotten the news yet. + */ + g_object_get (G_OBJECT (settings2), + NM_REMOTE_SETTINGS_SERVICE_RUNNING, &running, + NULL); + g_assert (running == FALSE); + g_object_get (G_OBJECT (settings), + NM_REMOTE_SETTINGS_SERVICE_RUNNING, &running, + NULL); + g_assert (running == TRUE); + + g_signal_connect (settings, "notify::" NM_REMOTE_SETTINGS_SERVICE_RUNNING, + G_CALLBACK (settings_service_running_changed), &running_changed); + quit_id = g_timeout_add_seconds (5, loop_quit, loop); + g_main_loop_run (loop); + g_assert_cmpint (running_changed, ==, 1); + g_source_remove (quit_id); + + g_object_get (G_OBJECT (settings2), + NM_REMOTE_SETTINGS_SERVICE_RUNNING, &running, + NULL); + g_assert (running == FALSE); + + /* Now restart it */ + sinfo = nm_test_service_init (); + + quit_id = g_timeout_add_seconds (5, loop_quit, loop); + g_main_loop_run (loop); + g_assert_cmpint (running_changed, ==, 2); + g_source_remove (quit_id); + + g_object_get (G_OBJECT (settings2), + NM_REMOTE_SETTINGS_SERVICE_RUNNING, &running, + NULL); + g_assert (running == TRUE); + + g_object_unref (settings2); +} + +/*******************************************************************/ + int main (int argc, char **argv) { - char *service_argv[3] = { NULL, NULL, NULL }; int ret; GError *error = NULL; - int i = 100; - - g_assert (argc == 3); #if !GLIB_CHECK_VERSION (2, 35, 0) g_type_init (); @@ -359,39 +431,27 @@ main (int argc, char **argv) g_test_init (&argc, &argv, NULL); bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - if (!bus) { - g_warning ("Error connecting to D-Bus: %s", error->message); - g_assert (error == NULL); - } - - service_argv[0] = g_strdup_printf ("%s/%s", argv[1], argv[2]); - if (!g_spawn_async (argv[1], service_argv, NULL, 0, NULL, NULL, &spid, &error)) { - g_warning ("Error spawning %s: %s", argv[2], error->message); - g_assert (error == NULL); - } + g_assert_no_error (error); - /* Wait until the service is registered on the bus */ - while (i > 0) { - g_usleep (G_USEC_PER_SEC / 50); - if (dbus_bus_name_has_owner (dbus_g_connection_get_connection (bus), - "org.freedesktop.NetworkManager", - NULL)) - break; - i--; - } - test_assert (i > 0); + sinfo = nm_test_service_init (); settings = nm_remote_settings_new (bus); - test_assert (settings != NULL); + g_assert (settings != NULL); + /* FIXME: these tests assume that they get run in order, but g_test_run() + * does not actually guarantee that! + */ g_test_add_func ("/remote_settings/add_connection", test_add_connection); g_test_add_func ("/remote_settings/make_invisible", test_make_invisible); g_test_add_func ("/remote_settings/make_visible", test_make_visible); g_test_add_func ("/remote_settings/remove_connection", test_remove_connection); + g_test_add_func ("/remote_settings/service_running", test_service_running); ret = g_test_run (); - cleanup (); + nm_test_service_cleanup (sinfo); + g_object_unref (settings); + dbus_g_connection_unref (bus); return ret; } diff --git a/libnm-glib/tests/test-remote-settings-service.py b/libnm-glib/tests/test-remote-settings-service.py deleted file mode 100755 index 439073ad..00000000 --- a/libnm-glib/tests/test-remote-settings-service.py +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - -from __future__ import print_function - -from gi.repository import GLib, GObject -import sys -import dbus -import dbus.service -import dbus.mainloop.glib - -IFACE_SETTINGS = 'org.freedesktop.NetworkManager.Settings' -IFACE_CONNECTION = 'org.freedesktop.NetworkManager.Settings.Connection' -IFACE_DBUS = 'org.freedesktop.DBus' - -class UnknownInterfaceException(dbus.DBusException): - _dbus_error_name = IFACE_DBUS + '.UnknownInterface' - -class UnknownPropertyException(dbus.DBusException): - _dbus_error_name = IFACE_DBUS + '.UnknownProperty' - -class PermissionDeniedException(dbus.DBusException): - _dbus_error_name = IFACE_SETTINGS + '.PermissionDenied' - -mainloop = GObject.MainLoop() - -class Connection(dbus.service.Object): - def __init__(self, bus, object_path, settings, remove_func): - dbus.service.Object.__init__(self, bus, object_path) - self.path = object_path - self.settings = settings - self.remove_func = remove_func - self.visible = True - self.props = {} - self.props['Unsaved'] = False - - # Properties interface - @dbus.service.method(dbus_interface=dbus.PROPERTIES_IFACE, in_signature='s', out_signature='a{sv}') - def GetAll(self, iface): - if iface != IFACE_CONNECTION: - raise UnknownInterfaceException() - return self.props - - @dbus.service.method(dbus_interface=dbus.PROPERTIES_IFACE, in_signature='ss', out_signature='v') - def Get(self, iface, name): - if iface != IFACE_CONNECTION: - raise UnknownInterfaceException() - if not name in self.props.keys(): - raise UnknownPropertyException() - return self.props[name] - - # Connection methods - @dbus.service.method(dbus_interface=IFACE_CONNECTION, in_signature='', out_signature='a{sa{sv}}') - def GetSettings(self): - if not self.visible: - raise PermissionDeniedException() - return self.settings - - @dbus.service.method(dbus_interface=IFACE_CONNECTION, in_signature='b', out_signature='') - def SetVisible(self, vis): - self.visible = vis - self.Updated() - - @dbus.service.method(dbus_interface=IFACE_CONNECTION, in_signature='', out_signature='') - def Delete(self): - self.remove_func(self) - self.Removed() - - @dbus.service.signal(IFACE_CONNECTION, signature='') - def Removed(self): - pass - - @dbus.service.signal(IFACE_CONNECTION, signature='') - def Updated(self): - pass - -class Settings(dbus.service.Object): - def __init__(self, bus, object_path): - dbus.service.Object.__init__(self, bus, object_path) - self.connections = {} - self.bus = bus - self.counter = 1 - self.props = {} - self.props['Hostname'] = "foobar.baz" - self.props['CanModify'] = True - - @dbus.service.method(dbus_interface=IFACE_SETTINGS, in_signature='', out_signature='ao') - def ListConnections(self): - connections = [] - return self.connections.keys() - - @dbus.service.method(dbus_interface=IFACE_SETTINGS, in_signature='a{sa{sv}}', out_signature='o') - def AddConnection(self, settings): - path = "/org/freedesktop/NetworkManager/Settings/Connection/{0}".format(self.counter) - self.counter = self.counter + 1 - self.connections[path] = Connection(self.bus, path, settings, self.delete_connection) - print("Added connection {0}".format(path)) - return path - - def delete_connection(self, connection): - del self.connections[connection.path] - - @dbus.service.method(dbus_interface=dbus.PROPERTIES_IFACE, in_signature='s', out_signature='a{sv}') - def GetAll(self, iface): - if iface != IFACE_SETTINGS: - raise UnknownInterfaceException() - return self.props - - @dbus.service.method(dbus_interface=dbus.PROPERTIES_IFACE, in_signature='ss', out_signature='v') - def Get(self, iface, name): - if iface != IFACE_SETTINGS: - raise UnknownInterfaceException() - if not name in self.props.keys(): - raise UnknownPropertyException() - return self.props[name] - - @dbus.service.signal(IFACE_SETTINGS, signature='o') - def NewConnection(self, path): - pass - - @dbus.service.method(IFACE_SETTINGS, in_signature='', out_signature='') - def Quit(self): - mainloop.quit() - -def quit_cb(user_data): - mainloop.quit() - -def main(): - dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - - bus = dbus.SessionBus() - obj = Settings(bus, "/org/freedesktop/NetworkManager/Settings") - if not bus.request_name("org.freedesktop.NetworkManager"): - sys.exit(1) - - print("Service started") - - GLib.timeout_add_seconds(20, quit_cb, None) - - try: - mainloop.run() - except Exception as e: - pass - - print("Service stopped") - sys.exit(0) - -if __name__ == '__main__': - main() - |