diff options
| author | Michael Biebl <biebl@debian.org> | 2014-07-06 03:04:17 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2014-07-06 03:04:17 +0200 |
| commit | 3ce667b6ee6b86291bbe60ef93cba7f11a5c5400 (patch) | |
| tree | af3daa7221e898b72f3de26eb2cf0c1b1c8661b0 /src/supplicant-manager | |
| parent | f02d31d95af29678092d1ff01f714621bc9dcc0f (diff) | |
| parent | 33491bc4279481db8ae47213e34a6d695a0e8830 (diff) | |
Merge tag 'upstream/0.9.10.0'
Upstream version 0.9.10.0
Diffstat (limited to 'src/supplicant-manager')
| -rw-r--r-- | src/supplicant-manager/Makefile.am | 34 | ||||
| -rw-r--r-- | src/supplicant-manager/Makefile.in | 889 | ||||
| -rw-r--r-- | src/supplicant-manager/nm-call-store.c | 111 | ||||
| -rw-r--r-- | src/supplicant-manager/nm-call-store.h | 41 | ||||
| -rw-r--r-- | src/supplicant-manager/nm-supplicant-config.c | 127 | ||||
| -rw-r--r-- | src/supplicant-manager/nm-supplicant-config.h | 4 | ||||
| -rw-r--r-- | src/supplicant-manager/nm-supplicant-interface.c | 507 | ||||
| -rw-r--r-- | src/supplicant-manager/nm-supplicant-interface.h | 2 | ||||
| -rw-r--r-- | src/supplicant-manager/nm-supplicant-manager.c | 3 | ||||
| -rw-r--r-- | src/supplicant-manager/nm-supplicant-settings-verify.c | 3 | ||||
| -rw-r--r-- | src/supplicant-manager/tests/Makefile.am | 19 | ||||
| -rw-r--r-- | src/supplicant-manager/tests/Makefile.in | 209 | ||||
| -rw-r--r-- | src/supplicant-manager/tests/test-supplicant-config.c | 117 |
13 files changed, 585 insertions, 1481 deletions
diff --git a/src/supplicant-manager/Makefile.am b/src/supplicant-manager/Makefile.am deleted file mode 100644 index a4d2f250..00000000 --- a/src/supplicant-manager/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -SUBDIRS = . tests - -noinst_LTLIBRARIES = libsupplicant-manager.la - -libsupplicant_manager_la_CPPFLAGS = \ - -I${top_srcdir}/src \ - -I${top_builddir}/src/generated \ - -I${top_srcdir}/src/generated \ - -I${top_srcdir}/src/logging \ - -I${top_builddir}/include \ - -I${top_srcdir}/include \ - -I${top_builddir}/libnm-util \ - -I${top_srcdir}/libnm-util \ - $(DBUS_CFLAGS) \ - $(GLIB_CFLAGS) \ - -DNM_PKGDATADIR=\"$(pkgdatadir)\" \ - -DNM_LOCALSTATEDIR=\"$(localstatedir)\" - -libsupplicant_manager_la_SOURCES = \ - nm-supplicant-types.h \ - nm-supplicant-manager.h \ - nm-supplicant-manager.c \ - nm-supplicant-config.h \ - nm-supplicant-config.c \ - nm-supplicant-interface.c \ - nm-supplicant-interface.h \ - nm-supplicant-settings-verify.h \ - nm-supplicant-settings-verify.c - -libsupplicant_manager_la_LIBADD = \ - $(top_builddir)/src/logging/libnm-logging.la \ - $(DBUS_LIBS) \ - $(GLIB_LIBS) - diff --git a/src/supplicant-manager/Makefile.in b/src/supplicant-manager/Makefile.in deleted file mode 100644 index 6a46202a..00000000 --- a/src/supplicant-manager/Makefile.in +++ /dev/null @@ -1,889 +0,0 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/supplicant-manager -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/build-aux/depcomp -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ - $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/gnome-code-coverage.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intltool.m4 \ - $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -am__DEPENDENCIES_1 = -libsupplicant_manager_la_DEPENDENCIES = \ - $(top_builddir)/src/logging/libnm-logging.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -am_libsupplicant_manager_la_OBJECTS = \ - libsupplicant_manager_la-nm-supplicant-manager.lo \ - libsupplicant_manager_la-nm-supplicant-config.lo \ - libsupplicant_manager_la-nm-supplicant-interface.lo \ - libsupplicant_manager_la-nm-supplicant-settings-verify.lo -libsupplicant_manager_la_OBJECTS = \ - $(am_libsupplicant_manager_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libsupplicant_manager_la_SOURCES) -DIST_SOURCES = $(libsupplicant_manager_la_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DATADIRNAME = @DATADIRNAME@ -DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_LIBS = @DBUS_LIBS@ -DBUS_SYS_DIR = @DBUS_SYS_DIR@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DHCLIENT_PATH = @DHCLIENT_PATH@ -DHCPCD_PATH = @DHCPCD_PATH@ -DLLTOOL = @DLLTOOL@ -DNSMASQ_PATH = @DNSMASQ_PATH@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GENHTML = @GENHTML@ -GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ -GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_MAKEFILE = @GLIB_MAKEFILE@ -GLIB_MKENUMS = @GLIB_MKENUMS@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GUDEV_CFLAGS = @GUDEV_CFLAGS@ -GUDEV_LIBS = @GUDEV_LIBS@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ -INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ -INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ -INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ -INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ -INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ -INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ -INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ -INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ -IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ -KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBM = @LIBM@ -LIBNL_CFLAGS = @LIBNL_CFLAGS@ -LIBNL_LIBS = @LIBNL_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ -LIBSOUP_LIBS = @LIBSOUP_LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MM_GLIB_CFLAGS = @MM_GLIB_CFLAGS@ -MM_GLIB_LIBS = @MM_GLIB_LIBS@ -MOC = @MOC@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ -NM_MICRO_VERSION = @NM_MICRO_VERSION@ -NM_MINOR_VERSION = @NM_MINOR_VERSION@ -NM_MODIFY_SYSTEM_POLICY = @NM_MODIFY_SYSTEM_POLICY@ -NM_VERSION = @NM_VERSION@ -NSS_CFLAGS = @NSS_CFLAGS@ -NSS_LIBS = @NSS_LIBS@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -POLKIT_CFLAGS = @POLKIT_CFLAGS@ -POLKIT_LIBS = @POLKIT_LIBS@ -POSUB = @POSUB@ -PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -QT_CFLAGS = @QT_CFLAGS@ -QT_LIBS = @QT_LIBS@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ -SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ -SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ -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@ -USE_NLS = @USE_NLS@ -UUID_CFLAGS = @UUID_CFLAGS@ -UUID_LIBS = @UUID_LIBS@ -VAPIGEN = @VAPIGEN@ -VAPIGEN_MAKEFILE = @VAPIGEN_MAKEFILE@ -VAPIGEN_VAPIDIR = @VAPIGEN_VAPIDIR@ -VERSION = @VERSION@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -nmbinary = @nmbinary@ -nmconfdir = @nmconfdir@ -nmdatadir = @nmdatadir@ -nmrundir = @nmrundir@ -nmstatedir = @nmstatedir@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -with_dhclient = @with_dhclient@ -with_dhcpcd = @with_dhcpcd@ -with_netconfig = @with_netconfig@ -with_resolvconf = @with_resolvconf@ -SUBDIRS = . tests -noinst_LTLIBRARIES = libsupplicant-manager.la -libsupplicant_manager_la_CPPFLAGS = \ - -I${top_srcdir}/src \ - -I${top_builddir}/src/generated \ - -I${top_srcdir}/src/generated \ - -I${top_srcdir}/src/logging \ - -I${top_builddir}/include \ - -I${top_srcdir}/include \ - -I${top_builddir}/libnm-util \ - -I${top_srcdir}/libnm-util \ - $(DBUS_CFLAGS) \ - $(GLIB_CFLAGS) \ - -DNM_PKGDATADIR=\"$(pkgdatadir)\" \ - -DNM_LOCALSTATEDIR=\"$(localstatedir)\" - -libsupplicant_manager_la_SOURCES = \ - nm-supplicant-types.h \ - nm-supplicant-manager.h \ - nm-supplicant-manager.c \ - nm-supplicant-config.h \ - nm-supplicant-config.c \ - nm-supplicant-interface.c \ - nm-supplicant-interface.h \ - nm-supplicant-settings-verify.h \ - nm-supplicant-settings-verify.c - -libsupplicant_manager_la_LIBADD = \ - $(top_builddir)/src/logging/libnm-logging.la \ - $(DBUS_LIBS) \ - $(GLIB_LIBS) - -all: all-recursive - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/supplicant-manager/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/supplicant-manager/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libsupplicant-manager.la: $(libsupplicant_manager_la_OBJECTS) $(libsupplicant_manager_la_DEPENDENCIES) $(EXTRA_libsupplicant_manager_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libsupplicant_manager_la_OBJECTS) $(libsupplicant_manager_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsupplicant_manager_la-nm-supplicant-config.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsupplicant_manager_la-nm-supplicant-interface.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsupplicant_manager_la-nm-supplicant-manager.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsupplicant_manager_la-nm-supplicant-settings-verify.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -libsupplicant_manager_la-nm-supplicant-manager.lo: nm-supplicant-manager.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsupplicant_manager_la-nm-supplicant-manager.lo -MD -MP -MF $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-manager.Tpo -c -o libsupplicant_manager_la-nm-supplicant-manager.lo `test -f 'nm-supplicant-manager.c' || echo '$(srcdir)/'`nm-supplicant-manager.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-manager.Tpo $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-manager.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-supplicant-manager.c' object='libsupplicant_manager_la-nm-supplicant-manager.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) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsupplicant_manager_la-nm-supplicant-manager.lo `test -f 'nm-supplicant-manager.c' || echo '$(srcdir)/'`nm-supplicant-manager.c - -libsupplicant_manager_la-nm-supplicant-config.lo: nm-supplicant-config.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsupplicant_manager_la-nm-supplicant-config.lo -MD -MP -MF $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-config.Tpo -c -o libsupplicant_manager_la-nm-supplicant-config.lo `test -f 'nm-supplicant-config.c' || echo '$(srcdir)/'`nm-supplicant-config.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-config.Tpo $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-config.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-supplicant-config.c' object='libsupplicant_manager_la-nm-supplicant-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) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsupplicant_manager_la-nm-supplicant-config.lo `test -f 'nm-supplicant-config.c' || echo '$(srcdir)/'`nm-supplicant-config.c - -libsupplicant_manager_la-nm-supplicant-interface.lo: nm-supplicant-interface.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsupplicant_manager_la-nm-supplicant-interface.lo -MD -MP -MF $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-interface.Tpo -c -o libsupplicant_manager_la-nm-supplicant-interface.lo `test -f 'nm-supplicant-interface.c' || echo '$(srcdir)/'`nm-supplicant-interface.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-interface.Tpo $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-interface.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-supplicant-interface.c' object='libsupplicant_manager_la-nm-supplicant-interface.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) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsupplicant_manager_la-nm-supplicant-interface.lo `test -f 'nm-supplicant-interface.c' || echo '$(srcdir)/'`nm-supplicant-interface.c - -libsupplicant_manager_la-nm-supplicant-settings-verify.lo: nm-supplicant-settings-verify.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsupplicant_manager_la-nm-supplicant-settings-verify.lo -MD -MP -MF $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-settings-verify.Tpo -c -o libsupplicant_manager_la-nm-supplicant-settings-verify.lo `test -f 'nm-supplicant-settings-verify.c' || echo '$(srcdir)/'`nm-supplicant-settings-verify.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-settings-verify.Tpo $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-settings-verify.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nm-supplicant-settings-verify.c' object='libsupplicant_manager_la-nm-supplicant-settings-verify.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) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsupplicant_manager_la-nm-supplicant-settings-verify.lo `test -f 'nm-supplicant-settings-verify.c' || echo '$(srcdir)/'`nm-supplicant-settings-verify.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile $(LTLIBRARIES) -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool \ - clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am - - -# 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/src/supplicant-manager/nm-call-store.c b/src/supplicant-manager/nm-call-store.c new file mode 100644 index 00000000..4b427549 --- /dev/null +++ b/src/supplicant-manager/nm-call-store.c @@ -0,0 +1,111 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * 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 of the License, 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 (C) 2007 Novell, Inc. + * Copyright (C) 2010 Red Hat, Inc. + */ + +#include "nm-call-store.h" +#include "nm-logging.h" + +NMCallStore * +nm_call_store_new (void) +{ + /* Maps { DBusGProxy :: GHashTable { DBusGProxyCall :: NULL } } */ + return g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_hash_table_destroy); +} + +static void +proxy_destroyed_cb (gpointer data, GObject *proxy) +{ + g_hash_table_remove ((NMCallStore *) data, proxy); +} + +void +nm_call_store_add (NMCallStore *store, + DBusGProxy *proxy, + DBusGProxyCall *call) +{ + GHashTable *calls; + + g_return_if_fail (store != NULL); + g_return_if_fail (proxy != NULL); + g_return_if_fail (call != NULL); + + calls = g_hash_table_lookup (store, proxy); + if (!calls) { + calls = g_hash_table_new (NULL, NULL); + g_hash_table_insert (store, proxy, calls); + g_object_weak_ref (G_OBJECT (proxy), proxy_destroyed_cb, store); + } + + g_hash_table_add (calls, call); +} + +void +nm_call_store_remove (NMCallStore *store, + DBusGProxy *proxy, + DBusGProxyCall *call) +{ + GHashTable *calls; + + g_return_if_fail (store != NULL); + g_return_if_fail (proxy != NULL); + g_return_if_fail (call != NULL); + + calls = g_hash_table_lookup (store, proxy); + if (!calls) + return; + + g_hash_table_remove (calls, call); + if (g_hash_table_size (calls) == 0) { + g_hash_table_remove (store, proxy); + g_object_weak_unref (G_OBJECT (proxy), proxy_destroyed_cb, store); + } +} + +void +nm_call_store_clear (NMCallStore *store) +{ + DBusGProxy *proxy; + GHashTable *calls; + GHashTableIter proxies_iter; + + g_return_if_fail (store != NULL); + + g_hash_table_iter_init (&proxies_iter, store); + while (g_hash_table_iter_next (&proxies_iter, (gpointer) &proxy, (gpointer) &calls)) { + GHashTableIter calls_iter; + DBusGProxyCall *call; + + g_hash_table_iter_init (&calls_iter, calls); + while (g_hash_table_iter_next (&calls_iter, (gpointer) &call, NULL)) { + dbus_g_proxy_cancel_call (proxy, call); + g_hash_table_iter_remove (&calls_iter); + } + g_object_weak_unref (G_OBJECT (proxy), proxy_destroyed_cb, store); + g_hash_table_iter_remove (&proxies_iter); + } + g_assert_cmpint (g_hash_table_size (store), ==, 0); +} + +void +nm_call_store_destroy (NMCallStore *store) +{ + g_return_if_fail (store); + g_hash_table_destroy (store); +} diff --git a/src/supplicant-manager/nm-call-store.h b/src/supplicant-manager/nm-call-store.h new file mode 100644 index 00000000..b24c97a4 --- /dev/null +++ b/src/supplicant-manager/nm-call-store.h @@ -0,0 +1,41 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * 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 of the License, 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. + * + * (C) Copyright 2007 Novell, Inc. + */ + +#ifndef NM_CALLBACK_STORE_H +#define NM_CALLBACK_STORE_H + +#include <glib-object.h> +#include <dbus/dbus-glib.h> + +typedef GHashTable NMCallStore; + +NMCallStore *nm_call_store_new (void); +void nm_call_store_add (NMCallStore *store, + DBusGProxy *proxy, + DBusGProxyCall *call); + +void nm_call_store_remove (NMCallStore *store, + DBusGProxy *proxy, + DBusGProxyCall *call); + +void nm_call_store_clear (NMCallStore *store); +void nm_call_store_destroy (NMCallStore *store); + +#endif /* NM_CALLBACK_STORE_H */ diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c index f5fc1542..438b436e 100644 --- a/src/supplicant-manager/nm-supplicant-config.c +++ b/src/supplicant-manager/nm-supplicant-config.c @@ -34,8 +34,7 @@ #include "nm-logging.h" #include "nm-setting.h" #include "NetworkManagerUtils.h" - -static char *hexstr2bin (const char *hex, size_t len); +#include "nm-utils.h" #define NM_SUPPLICANT_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ NM_TYPE_SUPPLICANT_CONFIG, \ @@ -136,17 +135,7 @@ nm_supplicant_config_add_option_with_type (NMSupplicantConfig *self, } opt = g_slice_new0 (ConfigOption); - if (opt == NULL) { - nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option."); - return FALSE; - } - opt->value = g_malloc0 ((sizeof (char) * len) + 1); - if (opt->value == NULL) { - nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option value."); - g_slice_free (ConfigOption, opt); - return FALSE; - } memcpy (opt->value, value, len); opt->len = len; @@ -207,27 +196,10 @@ nm_supplicant_config_add_blob (NMSupplicantConfig *self, } blob = g_byte_array_sized_new (value->len); - if (!blob) { - nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config blob."); - return FALSE; - } g_byte_array_append (blob, value->data, value->len); opt = g_slice_new0 (ConfigOption); - if (opt == NULL) { - nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option."); - g_byte_array_free (blob, TRUE); - return FALSE; - } - opt->value = g_strdup_printf ("blob://%s", blobid); - if (opt->value == NULL) { - nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option value."); - g_byte_array_free (blob, TRUE); - g_slice_free (ConfigOption, opt); - return FALSE; - } - opt->len = strlen (opt->value); opt->type = type; @@ -274,7 +246,7 @@ nm_supplicant_config_set_ap_scan (NMSupplicantConfig * self, guint32 ap_scan) { g_return_if_fail (NM_IS_SUPPLICANT_CONFIG (self)); - g_return_if_fail (ap_scan >= 0 && ap_scan <= 2); + g_return_if_fail (ap_scan <= 2); NM_SUPPLICANT_CONFIG_GET_PRIVATE (self)->ap_scan = ap_scan; } @@ -359,16 +331,21 @@ nm_supplicant_config_get_blobs (NMSupplicantConfig * self) #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" #define MAC_ARG(x) ((guint8*)(x))[0],((guint8*)(x))[1],((guint8*)(x))[2],((guint8*)(x))[3],((guint8*)(x))[4],((guint8*)(x))[5] +#define TWO_GHZ_FREQS "2412,2417,2422,2427,2432,2437,2442,2447,2452,2457,2462,2467,2472,2484" +#define FIVE_GHZ_FREQS "4915,4920,4925,4935,4940,4945,4960,4980,5035,5040,5045,5055,5060,5080," \ + "5170,5180,5190,5200,5210,5220,5230,5240,5260,5280,5300,5320,5500," \ + "5520,5540,5560,5580,5600,5620,5640,5660,5680,5700,5745,5765,5785," \ + "5805,5825" + + gboolean nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self, NMSettingWireless * setting, - gboolean is_broadcast, - guint32 fixed_freq, - gboolean has_scan_capa_ssid) + guint32 fixed_freq) { NMSupplicantConfigPrivate *priv; gboolean is_adhoc, is_ap; - const char *mode; + const char *mode, *band; const GByteArray *id; g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), FALSE); @@ -381,12 +358,8 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self, is_ap = (mode && !strcmp (mode, "ap")) ? TRUE : FALSE; if (is_adhoc || is_ap) priv->ap_scan = 2; - else if (is_broadcast == FALSE) { - /* drivers that support scanning specific SSIDs should use - * ap_scan=1, while those that do not should use ap_scan=2. - */ - priv->ap_scan = has_scan_capa_ssid ? 1 : 2; - } + else + priv->ap_scan = 1; id = nm_setting_wireless_get_ssid (setting); if (!nm_supplicant_config_add_option (self, "ssid", (char *) id->data, id->len, FALSE)) { @@ -443,7 +416,22 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self, g_free (str_bssid); } - // FIXME: band & channel config items + band = nm_setting_wireless_get_band (setting); + if (band) { + const char *freqs = NULL; + + if (!strcmp (band, "a")) + freqs = FIVE_GHZ_FREQS; + else if (!strcmp (band, "bg")) + freqs = TWO_GHZ_FREQS; + + if (freqs && !nm_supplicant_config_add_option (self, "freq_list", freqs, strlen (freqs), FALSE)) { + nm_log_warn (LOGD_SUPPLICANT, "Error adding frequency list/band to supplicant config."); + return FALSE; + } + } + + // FIXME: channel config item return TRUE; } @@ -565,7 +553,7 @@ add_wep_key (NMSupplicantConfig *self, if ( (wep_type == NM_WEP_KEY_TYPE_UNKNOWN) || (wep_type == NM_WEP_KEY_TYPE_KEY)) { if ((key_len == 10) || (key_len == 26)) { - value = hexstr2bin (key, strlen (key)); + value = nm_utils_hexstr2bin (key, strlen (key)); success = nm_supplicant_config_add_option (self, name, value, key_len / 2, TRUE); g_free (value); if (!success) { @@ -626,7 +614,7 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self, if (psk_len == 64) { /* Hex PSK */ - value = hexstr2bin (psk, psk_len); + value = nm_utils_hexstr2bin (psk, psk_len); success = nm_supplicant_config_add_option (self, "psk", value, psk_len / 2, TRUE); g_free (value); if (!success) { @@ -1073,56 +1061,3 @@ nm_supplicant_config_add_no_security (NMSupplicantConfig *self) return nm_supplicant_config_add_option (self, "key_mgmt", "NONE", -1, FALSE); } -/* From hostap, Copyright (c) 2002-2005, Jouni Malinen <jkmaline@cc.hut.fi> */ - -static int hex2num (char c) -{ - if (c >= '0' && c <= '9') - return c - '0'; - if (c >= 'a' && c <= 'f') - return c - 'a' + 10; - if (c >= 'A' && c <= 'F') - return c - 'A' + 10; - return -1; -} - -static int hex2byte (const char *hex) -{ - int a, b; - a = hex2num(*hex++); - if (a < 0) - return -1; - b = hex2num(*hex++); - if (b < 0) - return -1; - return (a << 4) | b; -} - -static char * -hexstr2bin (const char *hex, size_t len) -{ - size_t i; - int a; - const char * ipos = hex; - char * buf = NULL; - char * opos; - - /* Length must be a multiple of 2 */ - if ((len % 2) != 0) - return NULL; - - opos = buf = g_malloc0 ((len / 2) + 1); - for (i = 0; i < len; i += 2) { - a = hex2byte (ipos); - if (a < 0) { - g_free (buf); - return NULL; - } - *opos++ = a; - ipos += 2; - } - return buf; -} - -/* End from hostap */ - diff --git a/src/supplicant-manager/nm-supplicant-config.h b/src/supplicant-manager/nm-supplicant-config.h index a8d30470..75d6b779 100644 --- a/src/supplicant-manager/nm-supplicant-config.h +++ b/src/supplicant-manager/nm-supplicant-config.h @@ -65,9 +65,7 @@ GHashTable *nm_supplicant_config_get_blobs (NMSupplicantConfig *self); gboolean nm_supplicant_config_add_setting_wireless (NMSupplicantConfig *self, NMSettingWireless *setting, - gboolean is_broadcast, - guint32 adhoc_freq, - gboolean has_scan_capa_ssid); + guint32 fixed_freq); gboolean nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self, NMSettingWirelessSecurity *setting, diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 75450a0a..15138dc8 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -24,10 +24,10 @@ #include <string.h> #include <glib.h> +#include "NetworkManagerUtils.h" #include "nm-supplicant-interface.h" #include "nm-supplicant-manager.h" #include "nm-logging.h" -#include "nm-marshal.h" #include "nm-supplicant-config.h" #include "nm-dbus-manager.h" #include "nm-call-store.h" @@ -100,120 +100,20 @@ typedef struct { gboolean scanning; DBusGProxy * wpas_proxy; + DBusGProxy * introspect_proxy; DBusGProxy * iface_proxy; DBusGProxy * props_proxy; char * net_path; guint32 blobs_left; GHashTable * bss_proxies; - time_t last_scan; + gint32 last_scan; /* timestamp as returned by nm_utils_get_monotonic_timestamp_s() */ NMSupplicantConfig * cfg; gboolean disposed; } NMSupplicantInterfacePrivate; -/* FIXME: remove this and just store the standard D-Bus properties - * proxy object in bss_proxies when we drop support for wpa_supplicant - * 0.7.x. - */ -typedef struct { - /* Proxy for standard D-Bus Properties interface */ - DBusGProxy *props; - /* Proxy for old wpa_supplicant-specific PropertiesChanged signal */ - DBusGProxy *old_props; -} BssProxies; - -static void -bss_proxies_free (gpointer data) -{ - BssProxies *proxies = data; - - g_object_unref (proxies->props); - g_object_unref (proxies->old_props); - memset (proxies, 0, sizeof (*proxies)); - g_free (proxies); -} - -static gboolean -cancel_all_cb (GObject *object, gpointer call_id, gpointer user_data) -{ - dbus_g_proxy_cancel_call (DBUS_G_PROXY (object), (DBusGProxyCall *) call_id); - - return TRUE; -} - -static void -cancel_all_callbacks (NMCallStore *store) -{ - nm_call_store_foreach (store, NULL, cancel_all_cb, NULL); - nm_call_store_clear (store); -} - -typedef struct { - NMSupplicantInterface *interface; - DBusGProxy *proxy; - NMCallStore *store; - DBusGProxyCall *call; - gboolean disposing; -} NMSupplicantInfo; - -static NMSupplicantInfo * -nm_supplicant_info_new (NMSupplicantInterface *interface, - DBusGProxy *proxy, - NMCallStore *store) -{ - NMSupplicantInfo *info; - - info = g_slice_new0 (NMSupplicantInfo); - info->interface = g_object_ref (interface); - info->proxy = g_object_ref (proxy); - info->store = store; - - return info; -} - -static void -nm_supplicant_info_set_call (NMSupplicantInfo *info, DBusGProxyCall *call) -{ - g_return_if_fail (info != NULL); - g_return_if_fail (call != NULL); - - nm_call_store_add (info->store, G_OBJECT (info->proxy), (gpointer) call); - info->call = call; -} - -static void -nm_supplicant_info_destroy (gpointer user_data) -{ - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - - /* Guard against double-disposal; since DBusGProxy doesn't guard against - * double-disposal, we could infinite loop here if we're in the middle of - * some wpa_supplicant D-Bus calls. When the supplicant dies we'll dispose - * of the proxy, which kills all its pending calls, which brings us here. - * Then when we unref the proxy here, its dispose() function will get called - * again, and we get right back here until we segfault because our callstack - * is too long. - */ - if (!info->disposing) { - info->disposing = TRUE; - - if (info->call) { - nm_call_store_remove (info->store, G_OBJECT (info->proxy), info->call); - info->call = NULL; - } - - g_object_unref (info->proxy); - info->proxy = NULL; - g_object_unref (info->interface); - info->interface = NULL; - - memset (info, 0, sizeof (NMSupplicantInfo)); - g_slice_free (NMSupplicantInfo, info); - } -} - static void emit_error_helper (NMSupplicantInterface *self, GError *err) @@ -237,14 +137,16 @@ signal_new_bss (NMSupplicantInterface *self, static void bssid_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); GError *error = NULL; GHashTable *props = NULL; + nm_call_store_remove (priv->other_pcalls, proxy, call_id); if (dbus_g_proxy_end_call (proxy, call_id, &error, DBUS_TYPE_G_MAP_OF_VARIANT, &props, G_TYPE_INVALID)) { - signal_new_bss (info->interface, dbus_g_proxy_get_path (proxy), props); + signal_new_bss (self, dbus_g_proxy_get_path (proxy), props); g_hash_table_destroy (props); } else { if (!strstr (error->message, "The BSSID requested was invalid")) { @@ -266,91 +168,56 @@ bss_properties_changed (DBusGProxy *proxy, NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); if (priv->scanning) - priv->last_scan = time (NULL); + priv->last_scan = nm_utils_get_monotonic_timestamp_s (); if (g_strcmp0 (interface, WPAS_DBUS_IFACE_BSS) == 0) g_signal_emit (self, signals[BSS_UPDATED], 0, dbus_g_proxy_get_path (proxy), props); } static void -old_bss_properties_changed (DBusGProxy *proxy, - GHashTable *props, - gpointer user_data) -{ - NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - - if (priv->scanning) - priv->last_scan = time (NULL); - - g_signal_emit (self, signals[BSS_UPDATED], 0, dbus_g_proxy_get_path (proxy), props); -} - -static void handle_new_bss (NMSupplicantInterface *self, const char *object_path, GHashTable *props) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - NMSupplicantInfo *info; + DBusGProxy *bss_proxy; DBusGProxyCall *call; - BssProxies *proxies; g_return_if_fail (object_path != NULL); if (g_hash_table_lookup (priv->bss_proxies, object_path)) return; - proxies = g_malloc0 (sizeof (*proxies)); - proxies->props = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), - WPAS_DBUS_SERVICE, - object_path, - DBUS_INTERFACE_PROPERTIES); - proxies->old_props = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), - WPAS_DBUS_SERVICE, - object_path, - WPAS_DBUS_IFACE_BSS); + bss_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), + WPAS_DBUS_SERVICE, + object_path, + DBUS_INTERFACE_PROPERTIES); g_hash_table_insert (priv->bss_proxies, - (gpointer) dbus_g_proxy_get_path (proxies->props), - proxies); + (gpointer) dbus_g_proxy_get_path (bss_proxy), + bss_proxy); /* Standard D-Bus PropertiesChanged signal */ - dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_BOXED_BOXED, + dbus_g_object_register_marshaller (g_cclosure_marshal_generic, G_TYPE_NONE, G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_STRV, G_TYPE_INVALID); - dbus_g_proxy_add_signal (proxies->props, "PropertiesChanged", + dbus_g_proxy_add_signal (bss_proxy, "PropertiesChanged", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_STRV, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (proxies->props, "PropertiesChanged", + dbus_g_proxy_connect_signal (bss_proxy, "PropertiesChanged", G_CALLBACK (bss_properties_changed), self, NULL); - /* Old wpa_supplicant-specific PropertiesChanged signal; since it's using - * a different interface, we have to use a different DBusGProxy - */ - dbus_g_object_register_marshaller (g_cclosure_marshal_VOID__BOXED, - G_TYPE_NONE, - DBUS_TYPE_G_MAP_OF_VARIANT, - G_TYPE_INVALID); - dbus_g_proxy_add_signal (proxies->old_props, "PropertiesChanged", - DBUS_TYPE_G_MAP_OF_VARIANT, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal (proxies->old_props, "PropertiesChanged", - G_CALLBACK (old_bss_properties_changed), - self, NULL); - if (props) { signal_new_bss (self, object_path, props); } else { - info = nm_supplicant_info_new (self, proxies->props, priv->other_pcalls); - call = dbus_g_proxy_begin_call (proxies->props, "GetAll", + call = dbus_g_proxy_begin_call (bss_proxy, "GetAll", bssid_properties_cb, - info, - nm_supplicant_info_destroy, + self, + NULL, G_TYPE_STRING, WPAS_DBUS_IFACE_BSS, G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); + nm_call_store_add (priv->other_pcalls, bss_proxy, call); } } @@ -364,7 +231,7 @@ wpas_iface_bss_added (DBusGProxy *proxy, NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); if (priv->scanning) - priv->last_scan = time (NULL); + priv->last_scan = nm_utils_get_monotonic_timestamp_s (); handle_new_bss (self, object_path, props); } @@ -435,8 +302,8 @@ set_state (NMSupplicantInterface *self, guint32 new_state) wpas_iface_get_props (self); } else if (new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) { /* Cancel all pending calls when going down */ - cancel_all_callbacks (priv->other_pcalls); - cancel_all_callbacks (priv->assoc_pcalls); + nm_call_store_clear (priv->other_pcalls); + nm_call_store_clear (priv->assoc_pcalls); /* Disconnect supplicant manager state listeners since we're done */ if (priv->smgr_avail_id) { @@ -468,7 +335,7 @@ set_state (NMSupplicantInterface *self, guint32 new_state) if ( priv->state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING || old_state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING) - priv->last_scan = time (NULL); + priv->last_scan = nm_utils_get_monotonic_timestamp_s (); /* Disconnect reason is no longer relevant when not in the DISCONNECTED state */ if (priv->state != NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED) @@ -501,7 +368,7 @@ set_scanning (NMSupplicantInterface *self, gboolean new_scanning) /* Cache time of last scan completion */ if (priv->scanning == FALSE) - priv->last_scan = time (NULL); + priv->last_scan = nm_utils_get_monotonic_timestamp_s (); g_object_notify (G_OBJECT (self), "scanning"); } @@ -522,7 +389,7 @@ nm_supplicant_interface_get_scanning (NMSupplicantInterface *self) return FALSE; } -time_t +gint32 nm_supplicant_interface_get_last_scan_time (NMSupplicantInterface *self) { return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->last_scan; @@ -537,7 +404,7 @@ wpas_iface_scan_done (DBusGProxy *proxy, NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); /* Cache last scan completed time */ - priv->last_scan = time (NULL); + priv->last_scan = nm_utils_get_monotonic_timestamp_s (); g_signal_emit (self, signals[SCAN_DONE], 0, success); } @@ -648,38 +515,38 @@ iface_check_ready (NMSupplicantInterface *self) static void iface_get_props_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); GHashTable *props = NULL; GError *error = NULL; + nm_call_store_remove (priv->other_pcalls, proxy, call_id); if (dbus_g_proxy_end_call (proxy, call_id, &error, DBUS_TYPE_G_MAP_OF_VARIANT, &props, G_TYPE_INVALID)) { - wpas_iface_properties_changed (NULL, props, info->interface); + wpas_iface_properties_changed (NULL, props, self); g_hash_table_destroy (props); } else { nm_log_warn (LOGD_SUPPLICANT, "could not get interface properties: %s.", error && error->message ? error->message : "(unknown)"); g_clear_error (&error); } - iface_check_ready (info->interface); + iface_check_ready (self); } static void wpas_iface_get_props (NMSupplicantInterface *self) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - NMSupplicantInfo *info; DBusGProxyCall *call; - info = nm_supplicant_info_new (self, priv->props_proxy, priv->other_pcalls); call = dbus_g_proxy_begin_call (priv->props_proxy, "GetAll", iface_get_props_cb, - info, - nm_supplicant_info_destroy, + self, + NULL, G_TYPE_STRING, WPAS_DBUS_IFACE_INTERFACE, G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); + nm_call_store_add (priv->other_pcalls, priv->props_proxy, call); } gboolean @@ -690,7 +557,6 @@ nm_supplicant_interface_credentials_reply (NMSupplicantInterface *self, { NMSupplicantInterfacePrivate *priv; - g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE); g_return_val_if_fail (field != NULL, FALSE); g_return_val_if_fail (value != NULL, FALSE); @@ -729,10 +595,11 @@ wpas_iface_network_request (DBusGProxy *proxy, static void iface_check_netreply_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); GError *error = NULL; + nm_call_store_remove (priv->other_pcalls, proxy, call_id); if ( dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID) || dbus_g_error_has_name (error, "fi.w1.wpa_supplicant1.InvalidArgs")) { /* We know NetworkReply is supported if the NetworkReply method returned @@ -748,27 +615,25 @@ iface_check_netreply_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer us } g_clear_error (&error); - iface_check_ready (info->interface); + iface_check_ready (self); } static void wpas_iface_check_network_reply (NMSupplicantInterface *self) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - NMSupplicantInfo *info; DBusGProxyCall *call; priv->ready_count++; - info = nm_supplicant_info_new (self, priv->props_proxy, priv->other_pcalls); call = dbus_g_proxy_begin_call (priv->iface_proxy, "NetworkReply", iface_check_netreply_cb, - info, - nm_supplicant_info_destroy, + self, + NULL, DBUS_TYPE_G_OBJECT_PATH, "/foobaraasdfasdf", G_TYPE_STRING, "foobar", G_TYPE_STRING, "foobar", G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); + nm_call_store_add (priv->other_pcalls, priv->iface_proxy, call); } ApSupport @@ -793,11 +658,12 @@ nm_supplicant_interface_set_ap_support (NMSupplicantInterface *self, static void iface_check_ap_mode_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); char *data; /* The ProbeRequest method only exists if AP mode has been enabled */ + nm_call_store_remove (priv->other_pcalls, proxy, call_id); if (dbus_g_proxy_end_call (proxy, call_id, NULL, G_TYPE_STRING, &data, @@ -807,38 +673,28 @@ iface_check_ap_mode_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer use g_free (data); } - iface_check_ready (info->interface); + iface_check_ready (self); } static void wpas_iface_check_ap_mode (NMSupplicantInterface *self) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - NMSupplicantInfo *info; DBusGProxyCall *call; - DBusGProxy *proxy; priv->ready_count++; - proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), - WPAS_DBUS_SERVICE, - priv->object_path, - DBUS_INTERFACE_INTROSPECTABLE); - - info = nm_supplicant_info_new (self, proxy, priv->other_pcalls); - g_object_unref (proxy); - /* If the global supplicant capabilities property is not present, we can * fall back to checking whether the ProbeRequest method is supported. If * neither of these works we have no way of determining if AP mode is * supported or not. hostap 1.0 and earlier don't support either of these. */ - call = dbus_g_proxy_begin_call (proxy, "Introspect", + call = dbus_g_proxy_begin_call (priv->introspect_proxy, "Introspect", iface_check_ap_mode_cb, - info, - nm_supplicant_info_destroy, + self, + NULL, G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); + nm_call_store_add (priv->other_pcalls, priv->introspect_proxy, call); } static void @@ -872,7 +728,7 @@ interface_add_done (NMSupplicantInterface *self, char *path) self, NULL); - dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_BOXED, + dbus_g_object_register_marshaller (g_cclosure_marshal_generic, G_TYPE_NONE, DBUS_TYPE_G_OBJECT_PATH, DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID); @@ -896,7 +752,7 @@ interface_add_done (NMSupplicantInterface *self, char *path) self, NULL); - dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_STRING_STRING, + dbus_g_object_register_marshaller (g_cclosure_marshal_generic, G_TYPE_NONE, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); @@ -908,6 +764,11 @@ interface_add_done (NMSupplicantInterface *self, char *path) self, NULL); + priv->introspect_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), + WPAS_DBUS_SERVICE, + priv->object_path, + DBUS_INTERFACE_INTROSPECTABLE); + priv->props_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), WPAS_DBUS_SERVICE, path, @@ -923,24 +784,23 @@ interface_add_done (NMSupplicantInterface *self, char *path) } static void -interface_get_cb (DBusGProxy *proxy, - DBusGProxyCall *call_id, - gpointer user_data) +interface_get_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); GError *error = NULL; char *path = NULL; + nm_call_store_remove (priv->other_pcalls, proxy, call_id); if (dbus_g_proxy_end_call (proxy, call_id, &error, DBUS_TYPE_G_OBJECT_PATH, &path, G_TYPE_INVALID)) { - interface_add_done (info->interface, path); + interface_add_done (self, path); } else { nm_log_err (LOGD_SUPPLICANT, "(%s): error getting interface: %s", priv->dev, error->message); g_clear_error (&error); - set_state (info->interface, NM_SUPPLICANT_INTERFACE_STATE_DOWN); + set_state (self, NM_SUPPLICANT_INTERFACE_STATE_DOWN); } } @@ -948,54 +808,53 @@ static void interface_get (NMSupplicantInterface *self) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - NMSupplicantInfo *info; DBusGProxyCall *call; - info = nm_supplicant_info_new (self, priv->wpas_proxy, priv->other_pcalls); call = dbus_g_proxy_begin_call (priv->wpas_proxy, "GetInterface", interface_get_cb, - info, - nm_supplicant_info_destroy, + self, + NULL, G_TYPE_STRING, priv->dev, G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); + nm_call_store_add (priv->other_pcalls, priv->wpas_proxy, call); } static void -interface_add_cb (DBusGProxy *proxy, - DBusGProxyCall *call_id, - gpointer user_data) +interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); GError *error = NULL; char *path = NULL; + nm_call_store_remove (priv->other_pcalls, proxy, call_id); if (dbus_g_proxy_end_call (proxy, call_id, &error, DBUS_TYPE_G_OBJECT_PATH, &path, G_TYPE_INVALID)) { - interface_add_done (info->interface, path); + interface_add_done (self, path); } else { if (dbus_g_error_has_name (error, WPAS_ERROR_EXISTS_ERROR)) { /* Interface already added, just get its object path */ - interface_get (info->interface); + interface_get (self); } else if ( g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SERVICE_UNKNOWN) || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SPAWN_EXEC_FAILED) || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SPAWN_FORK_FAILED) || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SPAWN_FAILED) || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_TIMEOUT) + || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_NO_REPLY) + || g_error_matches (error, DBUS_GERROR, DBUS_GERROR_TIMED_OUT) || dbus_g_error_has_name (error, DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND)) { - /* Supplicant wasn't running and could be launched via service + /* Supplicant wasn't running and could not be launched via service * activation. Wait for it to start by moving back to the INIT * state. */ nm_log_dbg (LOGD_SUPPLICANT, "(%s): failed to activate supplicant: %s", priv->dev, error->message); - set_state (info->interface, NM_SUPPLICANT_INTERFACE_STATE_INIT); + set_state (self, NM_SUPPLICANT_INTERFACE_STATE_INIT); } else { nm_log_err (LOGD_SUPPLICANT, "(%s): error adding interface: %s", priv->dev, error->message); - set_state (info->interface, NM_SUPPLICANT_INTERFACE_STATE_DOWN); + set_state (self, NM_SUPPLICANT_INTERFACE_STATE_DOWN); } g_clear_error (&error); } @@ -1012,9 +871,9 @@ interface_add (NMSupplicantInterface *self, gboolean is_wireless) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); DBusGProxyCall *call; - NMSupplicantInfo *info; GHashTable *hash; - GValue *driver, *ifname; + GValue driver = G_VALUE_INIT; + GValue ifname = G_VALUE_INIT; /* Can only start the interface from INIT state */ g_return_if_fail (priv->state == NM_SUPPLICANT_INTERFACE_STATE_INIT); @@ -1029,34 +888,27 @@ interface_add (NMSupplicantInterface *self, gboolean is_wireless) * when the supplicant has started. */ - info = nm_supplicant_info_new (self, priv->wpas_proxy, priv->other_pcalls); - hash = g_hash_table_new (g_str_hash, g_str_equal); - driver = g_new0 (GValue, 1); - g_value_init (driver, G_TYPE_STRING); - g_value_set_string (driver, is_wireless ? DEFAULT_WIFI_DRIVER : "wired"); - g_hash_table_insert (hash, "Driver", driver); + g_value_init (&driver, G_TYPE_STRING); + g_value_set_string (&driver, is_wireless ? DEFAULT_WIFI_DRIVER : "wired"); + g_hash_table_insert (hash, "Driver", &driver); - ifname = g_new0 (GValue, 1); - g_value_init (ifname, G_TYPE_STRING); - g_value_set_string (ifname, priv->dev); - g_hash_table_insert (hash, "Ifname", ifname); + g_value_init (&ifname, G_TYPE_STRING); + g_value_set_string (&ifname, priv->dev); + g_hash_table_insert (hash, "Ifname", &ifname); call = dbus_g_proxy_begin_call (priv->wpas_proxy, "CreateInterface", interface_add_cb, - info, - nm_supplicant_info_destroy, + self, + NULL, DBUS_TYPE_G_MAP_OF_VARIANT, hash, G_TYPE_INVALID); + nm_call_store_add (priv->other_pcalls, priv->wpas_proxy, call); g_hash_table_destroy (hash); - g_value_unset (driver); - g_free (driver); - g_value_unset (ifname); - g_free (ifname); - - nm_supplicant_info_set_call (info, call); + g_value_unset (&driver); + g_value_unset (&ifname); } static void @@ -1115,7 +967,7 @@ nm_supplicant_interface_disconnect (NMSupplicantInterface * self) /* Clear and cancel all pending calls related to a prior * connection attempt. */ - cancel_all_callbacks (priv->assoc_pcalls); + nm_call_store_clear (priv->assoc_pcalls); /* Don't do anything if there is no connection to the supplicant yet. */ if (!priv->iface_proxy) @@ -1145,12 +997,14 @@ nm_supplicant_interface_disconnect (NMSupplicantInterface * self) static void select_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); GError *err = NULL; + nm_call_store_remove (priv->assoc_pcalls, proxy, call_id); if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_INVALID)) { nm_log_warn (LOGD_SUPPLICANT, "Couldn't select network config: %s.", err->message); - emit_error_helper (info->interface, err); + emit_error_helper (self, err); g_error_free (err); } } @@ -1160,61 +1014,59 @@ call_select_network (NMSupplicantInterface *self) { NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); DBusGProxyCall *call; - NMSupplicantInfo *info; /* We only select the network after all blobs (if any) have been set */ - if (priv->blobs_left > 0) - return; - - info = nm_supplicant_info_new (self, priv->iface_proxy, priv->assoc_pcalls); - call = dbus_g_proxy_begin_call (priv->iface_proxy, "SelectNetwork", - select_network_cb, - info, - nm_supplicant_info_destroy, - DBUS_TYPE_G_OBJECT_PATH, priv->net_path, - G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); + if (priv->blobs_left == 0) { + call = dbus_g_proxy_begin_call (priv->iface_proxy, "SelectNetwork", + select_network_cb, + self, + NULL, + DBUS_TYPE_G_OBJECT_PATH, priv->net_path, + G_TYPE_INVALID); + nm_call_store_add (priv->assoc_pcalls, priv->iface_proxy, call); + } } static void add_blob_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); GError *err = NULL; guint tmp; priv->blobs_left--; + nm_call_store_remove (priv->assoc_pcalls, proxy, call_id); if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { nm_log_warn (LOGD_SUPPLICANT, "Couldn't set network certificates: %s.", err->message); - emit_error_helper (info->interface, err); + emit_error_helper (self, err); g_error_free (err); } else - call_select_network (info->interface); + call_select_network (self); } static void add_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); GError *err = NULL; GHashTable *blobs; GHashTableIter iter; gpointer name, data; DBusGProxyCall *call; - NMSupplicantInfo *blob_info; g_free (priv->net_path); priv->net_path = NULL; + nm_call_store_remove (priv->assoc_pcalls, proxy, call_id); if (!dbus_g_proxy_end_call (proxy, call_id, &err, DBUS_TYPE_G_OBJECT_PATH, &priv->net_path, G_TYPE_INVALID)) { nm_log_warn (LOGD_SUPPLICANT, "Couldn't add a network to the supplicant interface: %s.", err->message); - emit_error_helper (info->interface, err); + emit_error_helper (self, err); g_error_free (err); return; } @@ -1224,33 +1076,33 @@ add_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) priv->blobs_left = g_hash_table_size (blobs); g_hash_table_iter_init (&iter, blobs); while (g_hash_table_iter_next (&iter, &name, &data)) { - blob_info = nm_supplicant_info_new (info->interface, priv->iface_proxy, priv->assoc_pcalls); call = dbus_g_proxy_begin_call (priv->iface_proxy, "AddBlob", add_blob_cb, - blob_info, - nm_supplicant_info_destroy, + self, + NULL, DBUS_TYPE_STRING, name, - DBUS_TYPE_G_UCHAR_ARRAY, blobs, + DBUS_TYPE_G_UCHAR_ARRAY, data, G_TYPE_INVALID); - nm_supplicant_info_set_call (blob_info, call); + nm_call_store_add (priv->assoc_pcalls, priv->iface_proxy, call); } - call_select_network (info->interface); + call_select_network (self); } static void set_ap_scan_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); GError *err = NULL; DBusGProxyCall *call; GHashTable *config_hash; + nm_call_store_remove (priv->assoc_pcalls, proxy, call_id); if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_INVALID)) { nm_log_warn (LOGD_SUPPLICANT, "Couldn't send AP scan mode to the supplicant interface: %s.", err->message); - emit_error_helper (info->interface, err); + emit_error_helper (self, err); g_error_free (err); return; } @@ -1258,26 +1110,24 @@ set_ap_scan_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) nm_log_info (LOGD_SUPPLICANT, "Config: set interface ap_scan to %d", nm_supplicant_config_get_ap_scan (priv->cfg)); - info = nm_supplicant_info_new (info->interface, priv->iface_proxy, info->store); config_hash = nm_supplicant_config_get_hash (priv->cfg); call = dbus_g_proxy_begin_call (priv->iface_proxy, "AddNetwork", add_network_cb, - info, - nm_supplicant_info_destroy, + self, + NULL, DBUS_TYPE_G_MAP_OF_VARIANT, config_hash, G_TYPE_INVALID); g_hash_table_destroy (config_hash); - nm_supplicant_info_set_call (info, call); + nm_call_store_add (priv->assoc_pcalls, priv->iface_proxy, call); } gboolean -nm_supplicant_interface_set_config (NMSupplicantInterface * self, - NMSupplicantConfig * cfg) +nm_supplicant_interface_set_config (NMSupplicantInterface *self, + NMSupplicantConfig *cfg) { NMSupplicantInterfacePrivate *priv; - NMSupplicantInfo *info; DBusGProxyCall *call; - GValue value = { 0, }; + GValue value = G_VALUE_INIT; g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE); @@ -1305,16 +1155,15 @@ nm_supplicant_interface_set_config (NMSupplicantInterface * self, g_value_init (&value, G_TYPE_UINT); g_value_set_uint (&value, nm_supplicant_config_get_ap_scan (priv->cfg)); - info = nm_supplicant_info_new (self, priv->props_proxy, priv->other_pcalls); call = dbus_g_proxy_begin_call (priv->props_proxy, "Set", set_ap_scan_cb, - info, - nm_supplicant_info_destroy, + self, + NULL, G_TYPE_STRING, WPAS_DBUS_IFACE_INTERFACE, G_TYPE_STRING, "ApScan", G_TYPE_VALUE, &value, G_TYPE_INVALID); - nm_supplicant_info_set_call (info, call); + nm_call_store_add (priv->assoc_pcalls, priv->props_proxy, call); g_value_unset (&value); return call != NULL; @@ -1323,13 +1172,15 @@ nm_supplicant_interface_set_config (NMSupplicantInterface * self, static void scan_request_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { - NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); GError *err = NULL; - if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_INVALID)) { + nm_call_store_remove (priv->other_pcalls, proxy, call_id); + if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_INVALID)) nm_log_warn (LOGD_SUPPLICANT, "Could not get scan request result: %s", err->message); - } - g_signal_emit (info->interface, signals[SCAN_DONE], 0, err ? FALSE : TRUE); + + g_signal_emit (self, signals[SCAN_DONE], 0, err ? FALSE : TRUE); g_clear_error (&err); } @@ -1366,7 +1217,6 @@ gboolean nm_supplicant_interface_request_scan (NMSupplicantInterface *self, const GPtrArray *ssids) { NMSupplicantInterfacePrivate *priv; - NMSupplicantInfo *info; DBusGProxyCall *call; GHashTable *hash; @@ -1380,15 +1230,14 @@ nm_supplicant_interface_request_scan (NMSupplicantInterface *self, const GPtrArr if (ssids) g_hash_table_insert (hash, "SSIDs", byte_array_array_to_gvalue (ssids)); - info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls); call = dbus_g_proxy_begin_call (priv->iface_proxy, "Scan", scan_request_cb, - info, - nm_supplicant_info_destroy, + self, + NULL, DBUS_TYPE_G_MAP_OF_VARIANT, hash, G_TYPE_INVALID); g_hash_table_destroy (hash); - nm_supplicant_info_set_call (info, call); + nm_call_store_add (priv->other_pcalls, priv->iface_proxy, call); return call != NULL; } @@ -1442,7 +1291,6 @@ nm_supplicant_interface_state_to_string (guint32 state) const char * nm_supplicant_interface_get_device (NMSupplicantInterface * self) { - g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL); return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev; @@ -1451,7 +1299,6 @@ nm_supplicant_interface_get_device (NMSupplicantInterface * self) const char * nm_supplicant_interface_get_object_path (NMSupplicantInterface *self) { - g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL); return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->object_path; @@ -1460,7 +1307,6 @@ nm_supplicant_interface_get_object_path (NMSupplicantInterface *self) const char * nm_supplicant_interface_get_ifname (NMSupplicantInterface *self) { - g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL); return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev; @@ -1469,7 +1315,6 @@ nm_supplicant_interface_get_ifname (NMSupplicantInterface *self) guint nm_supplicant_interface_get_max_scan_ssids (NMSupplicantInterface *self) { - g_return_val_if_fail (self != NULL, 0); g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), 0); return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->max_scan_ssids; @@ -1493,24 +1338,22 @@ nm_supplicant_interface_new (NMSupplicantManager *smgr, g_return_val_if_fail (ifname != NULL, NULL); self = g_object_new (NM_TYPE_SUPPLICANT_INTERFACE, NULL); - if (self) { - priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - - priv->smgr = g_object_ref (smgr); - id = g_signal_connect (priv->smgr, - "notify::" NM_SUPPLICANT_MANAGER_AVAILABLE, - G_CALLBACK (smgr_avail_cb), - self); - priv->smgr_avail_id = id; - - priv->dev = g_strdup (ifname); - priv->is_wireless = is_wireless; - priv->fast_supported = fast_supported; - priv->ap_support = ap_support; + priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); - if (start_now) - interface_add (self, priv->is_wireless); - } + priv->smgr = g_object_ref (smgr); + id = g_signal_connect (priv->smgr, + "notify::" NM_SUPPLICANT_MANAGER_AVAILABLE, + G_CALLBACK (smgr_avail_cb), + self); + priv->smgr_avail_id = id; + + priv->dev = g_strdup (ifname); + priv->is_wireless = is_wireless; + priv->fast_supported = fast_supported; + priv->ap_support = ap_support; + + if (start_now) + interface_add (self, priv->is_wireless); return self; } @@ -1532,7 +1375,7 @@ nm_supplicant_interface_init (NMSupplicantInterface * self) WPAS_DBUS_PATH, WPAS_DBUS_INTERFACE); - priv->bss_proxies = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, bss_proxies_free); + priv->bss_proxies = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref); } static void @@ -1576,10 +1419,10 @@ dispose (GObject *object) priv->disposed = TRUE; /* Cancel pending calls before unrefing the dbus manager */ - cancel_all_callbacks (priv->other_pcalls); + nm_call_store_clear (priv->other_pcalls); nm_call_store_destroy (priv->other_pcalls); - cancel_all_callbacks (priv->assoc_pcalls); + nm_call_store_clear (priv->assoc_pcalls); nm_call_store_destroy (priv->assoc_pcalls); if (priv->props_proxy) @@ -1590,6 +1433,9 @@ dispose (GObject *object) g_free (priv->net_path); + if (priv->introspect_proxy) + g_object_unref (priv->introspect_proxy); + if (priv->wpas_proxy) g_object_unref (priv->wpas_proxy); @@ -1603,8 +1449,7 @@ dispose (GObject *object) g_free (priv->dev); - if (priv->dbus_mgr) - g_object_unref (priv->dbus_mgr); + priv->dbus_mgr = NULL; if (priv->cfg) g_object_unref (priv->cfg); @@ -1640,8 +1485,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMSupplicantInterfaceClass, state), - NULL, NULL, - _nm_marshal_VOID__UINT_UINT_INT, + NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INT); signals[REMOVED] = @@ -1649,8 +1493,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMSupplicantInterfaceClass, removed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, + NULL, NULL, NULL, G_TYPE_NONE, 0); signals[NEW_BSS] = @@ -1658,8 +1501,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMSupplicantInterfaceClass, new_bss), - NULL, NULL, - _nm_marshal_VOID__STRING_POINTER, + NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_POINTER); signals[BSS_UPDATED] = @@ -1667,8 +1509,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMSupplicantInterfaceClass, bss_updated), - NULL, NULL, - _nm_marshal_VOID__STRING_POINTER, + NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_POINTER); signals[BSS_REMOVED] = @@ -1676,8 +1517,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMSupplicantInterfaceClass, bss_removed), - NULL, NULL, - g_cclosure_marshal_VOID__STRING, + NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_STRING); signals[SCAN_DONE] = @@ -1685,8 +1525,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_done), - NULL, NULL, - g_cclosure_marshal_VOID__BOOLEAN, + NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); signals[CONNECTION_ERROR] = @@ -1694,8 +1533,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_error), - NULL, NULL, - _nm_marshal_VOID__STRING_STRING, + NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); signals[CREDENTIALS_REQUEST] = @@ -1703,8 +1541,7 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NMSupplicantInterfaceClass, credentials_request), - NULL, NULL, - _nm_marshal_VOID__STRING_STRING, + NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); } diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h index 2f0233cf..633c16cc 100644 --- a/src/supplicant-manager/nm-supplicant-interface.h +++ b/src/supplicant-manager/nm-supplicant-interface.h @@ -144,7 +144,7 @@ const char *nm_supplicant_interface_state_to_string (guint32 state); gboolean nm_supplicant_interface_get_scanning (NMSupplicantInterface *self); -time_t nm_supplicant_interface_get_last_scan_time (NMSupplicantInterface *self); +gint32 nm_supplicant_interface_get_last_scan_time (NMSupplicantInterface *self); const char *nm_supplicant_interface_get_ifname (NMSupplicantInterface *self); diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index adc46008..f146b239 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -210,7 +210,6 @@ check_capabilities (NMSupplicantManager *self) gboolean nm_supplicant_manager_available (NMSupplicantManager *self) { - g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), FALSE); if (die_count_exceeded (NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->die_count)) @@ -379,7 +378,7 @@ dispose (GObject *object) if (priv->dbus_mgr) { if (priv->name_owner_id) g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id); - g_object_unref (G_OBJECT (priv->dbus_mgr)); + priv->dbus_mgr = NULL; } g_hash_table_destroy (priv->ifaces); diff --git a/src/supplicant-manager/nm-supplicant-settings-verify.c b/src/supplicant-manager/nm-supplicant-settings-verify.c index 143e51a3..f7d4ca58 100644 --- a/src/supplicant-manager/nm-supplicant-settings-verify.c +++ b/src/supplicant-manager/nm-supplicant-settings-verify.c @@ -74,7 +74,7 @@ const char * key_mgmt_allowed[] = { "WPA-PSK", "WPA-EAP", "IEEE8021X", "WPA-NONE "NONE", NULL }; const char * auth_alg_allowed[] = { "OPEN", "SHARED", "LEAP", NULL }; const char * eap_allowed[] = { "LEAP", "MD5", "TLS", "PEAP", "TTLS", "SIM", - "PSK", "FAST", NULL }; + "PSK", "FAST", "PWD", NULL }; const char * phase1_allowed[] = {"peapver=0", "peapver=1", "peaplabel=1", "peap_outer_success=0", "include_tls_length=1", @@ -137,6 +137,7 @@ static const struct Opt opt_table[] = { { "proactive_key_caching", TYPE_INT, 0, 1, FALSE, NULL }, { "bgscan", TYPE_BYTES, 0, 0, FALSE, NULL }, { "pac_file", TYPE_BYTES, 0, 1024, FALSE, NULL }, + { "freq_list", TYPE_BYTES, 0, 0, FALSE, NULL }, }; diff --git a/src/supplicant-manager/tests/Makefile.am b/src/supplicant-manager/tests/Makefile.am index 58132a60..9defe66b 100644 --- a/src/supplicant-manager/tests/Makefile.am +++ b/src/supplicant-manager/tests/Makefile.am @@ -1,26 +1,21 @@ -if ENABLE_TESTS - -noinst_PROGRAMS = test-supplicant-config - -test_supplicant_config_CPPFLAGS = \ +AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/libnm-util \ -I$(top_builddir)/libnm-util \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/supplicant-manager \ + -DG_LOG_DOMAIN=\""NetworkManager"\" \ + -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) +noinst_PROGRAMS = test-supplicant-config + test_supplicant_config_SOURCES = \ test-supplicant-config.c test_supplicant_config_LDADD = \ - $(top_builddir)/libnm-util/libnm-util.la \ - $(top_builddir)/src/supplicant-manager/libsupplicant-manager.la \ - $(DBUS_LIBS) - -check-local: test-supplicant-config - $(abs_builddir)/test-supplicant-config + $(top_builddir)/src/libNetworkManager.la -endif +TESTS = test-supplicant-config diff --git a/src/supplicant-manager/tests/Makefile.in b/src/supplicant-manager/tests/Makefile.in index 11dc6d5c..42a7f6ff 100644 --- a/src/supplicant-manager/tests/Makefile.in +++ b/src/supplicant-manager/tests/Makefile.in @@ -78,12 +78,14 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@ENABLE_TESTS_TRUE@noinst_PROGRAMS = test-supplicant-config$(EXEEXT) +noinst_PROGRAMS = test-supplicant-config$(EXEEXT) +TESTS = test-supplicant-config$(EXEEXT) subdir = src/supplicant-manager/tests DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \ + $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gnome-code-coverage.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ @@ -102,14 +104,10 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) -am__test_supplicant_config_SOURCES_DIST = test-supplicant-config.c -@ENABLE_TESTS_TRUE@am_test_supplicant_config_OBJECTS = test_supplicant_config-test-supplicant-config.$(OBJEXT) +am_test_supplicant_config_OBJECTS = test-supplicant-config.$(OBJEXT) test_supplicant_config_OBJECTS = $(am_test_supplicant_config_OBJECTS) -am__DEPENDENCIES_1 = -@ENABLE_TESTS_TRUE@test_supplicant_config_DEPENDENCIES = \ -@ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-util/libnm-util.la \ -@ENABLE_TESTS_TRUE@ $(top_builddir)/src/supplicant-manager/libsupplicant-manager.la \ -@ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) +test_supplicant_config_DEPENDENCIES = \ + $(top_builddir)/src/libNetworkManager.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -149,7 +147,7 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(test_supplicant_config_SOURCES) -DIST_SOURCES = $(am__test_supplicant_config_SOURCES_DIST) +DIST_SOURCES = $(test_supplicant_config_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -174,6 +172,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@ @@ -200,12 +220,15 @@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ +DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DHCLIENT_PATH = @DHCLIENT_PATH@ DHCPCD_PATH = @DHCPCD_PATH@ +DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ DSYMUTIL = @DSYMUTIL@ @@ -230,7 +253,6 @@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ @@ -275,12 +297,16 @@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ +LIBNDP_CFLAGS = @LIBNDP_CFLAGS@ +LIBNDP_LIBS = @LIBNDP_LIBS@ LIBNL_CFLAGS = @LIBNL_CFLAGS@ LIBNL_LIBS = @LIBNL_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ LIBSOUP_LIBS = @LIBSOUP_LIBS@ +LIBTEAMDCTL_CFLAGS = @LIBTEAMDCTL_CFLAGS@ +LIBTEAMDCTL_LIBS = @LIBTEAMDCTL_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -297,6 +323,8 @@ MOC = @MOC@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +NEWT_CFLAGS = @NEWT_CFLAGS@ +NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ @@ -324,11 +352,16 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POLKIT_CFLAGS = @POLKIT_CFLAGS@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ +PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ +READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ @@ -343,6 +376,7 @@ UDEV_BASE_DIR = @UDEV_BASE_DIR@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ +VALGRIND_RULES = @VALGRIND_RULES@ VAPIGEN = @VAPIGEN@ VAPIGEN_MAKEFILE = @VAPIGEN_MAKEFILE@ VAPIGEN_VAPIDIR = @VAPIGEN_VAPIDIR@ @@ -405,6 +439,7 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ +subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ @@ -415,23 +450,24 @@ with_dhclient = @with_dhclient@ with_dhcpcd = @with_dhcpcd@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ -@ENABLE_TESTS_TRUE@test_supplicant_config_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)/src \ -@ENABLE_TESTS_TRUE@ -I$(top_srcdir)/src/supplicant-manager \ -@ENABLE_TESTS_TRUE@ $(GLIB_CFLAGS) \ -@ENABLE_TESTS_TRUE@ $(DBUS_CFLAGS) - -@ENABLE_TESTS_TRUE@test_supplicant_config_SOURCES = \ -@ENABLE_TESTS_TRUE@ test-supplicant-config.c - -@ENABLE_TESTS_TRUE@test_supplicant_config_LDADD = \ -@ENABLE_TESTS_TRUE@ $(top_builddir)/libnm-util/libnm-util.la \ -@ENABLE_TESTS_TRUE@ $(top_builddir)/src/supplicant-manager/libsupplicant-manager.la \ -@ENABLE_TESTS_TRUE@ $(DBUS_LIBS) +with_valgrind = @with_valgrind@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_builddir)/libnm-util \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/supplicant-manager \ + -DG_LOG_DOMAIN=\""NetworkManager"\" \ + -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +test_supplicant_config_SOURCES = \ + test-supplicant-config.c + +test_supplicant_config_LDADD = \ + $(top_builddir)/src/libNetworkManager.la all: all-am @@ -487,7 +523,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_supplicant_config-test-supplicant-config.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-supplicant-config.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -510,20 +546,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -test_supplicant_config-test-supplicant-config.o: test-supplicant-config.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_supplicant_config_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_supplicant_config-test-supplicant-config.o -MD -MP -MF $(DEPDIR)/test_supplicant_config-test-supplicant-config.Tpo -c -o test_supplicant_config-test-supplicant-config.o `test -f 'test-supplicant-config.c' || echo '$(srcdir)/'`test-supplicant-config.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_supplicant_config-test-supplicant-config.Tpo $(DEPDIR)/test_supplicant_config-test-supplicant-config.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-supplicant-config.c' object='test_supplicant_config-test-supplicant-config.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_supplicant_config_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_supplicant_config-test-supplicant-config.o `test -f 'test-supplicant-config.c' || echo '$(srcdir)/'`test-supplicant-config.c - -test_supplicant_config-test-supplicant-config.obj: test-supplicant-config.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_supplicant_config_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_supplicant_config-test-supplicant-config.obj -MD -MP -MF $(DEPDIR)/test_supplicant_config-test-supplicant-config.Tpo -c -o test_supplicant_config-test-supplicant-config.obj `if test -f 'test-supplicant-config.c'; then $(CYGPATH_W) 'test-supplicant-config.c'; else $(CYGPATH_W) '$(srcdir)/test-supplicant-config.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_supplicant_config-test-supplicant-config.Tpo $(DEPDIR)/test_supplicant_config-test-supplicant-config.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-supplicant-config.c' object='test_supplicant_config-test-supplicant-config.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_supplicant_config_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_supplicant_config-test-supplicant-config.obj `if test -f 'test-supplicant-config.c'; then $(CYGPATH_W) 'test-supplicant-config.c'; else $(CYGPATH_W) '$(srcdir)/test-supplicant-config.c'; fi` - mostlyclean-libtool: -rm -f *.lo @@ -582,6 +604,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'`; \ @@ -612,9 +727,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: @@ -721,7 +835,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 \ @@ -736,9 +850,6 @@ uninstall-am: tags tags-am uninstall uninstall-am -@ENABLE_TESTS_TRUE@check-local: test-supplicant-config -@ENABLE_TESTS_TRUE@ $(abs_builddir)/test-supplicant-config - # 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/src/supplicant-manager/tests/test-supplicant-config.c b/src/supplicant-manager/tests/test-supplicant-config.c index d92fb0d1..ce884a8d 100644 --- a/src/supplicant-manager/tests/test-supplicant-config.c +++ b/src/supplicant-manager/tests/test-supplicant-config.c @@ -39,11 +39,11 @@ #include <nm-setting-ip4-config.h> #include <nm-setting-8021x.h> -#include "nm-test-helpers.h" - #include "nm-supplicant-config.h" #include "nm-supplicant-settings-verify.h" +#include "nm-test-utils.h" + static gboolean validate_opt (const char *detail, GHashTable *hash, @@ -128,14 +128,9 @@ test_wifi_open (void) const char *bssid_str = "11:22:33:44:55:66"; connection = nm_connection_new (); - ASSERT (connection != NULL, - "wifi-open", "failed to allocate new connection"); /* Connection setting */ s_con = (NMSettingConnection *) nm_setting_connection_new (); - ASSERT (s_con != NULL, - "wifi-open", "failed to allocate new %s setting", - NM_SETTING_CONNECTION_SETTING_NAME); nm_connection_add_setting (connection, NM_SETTING (s_con)); uuid = nm_utils_uuid_generate (); @@ -149,9 +144,6 @@ test_wifi_open (void) /* Wifi setting */ s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); - ASSERT (s_wifi != NULL, - "wifi-open", "failed to allocate new %s setting", - NM_SETTING_WIRELESS_SETTING_NAME); nm_connection_add_setting (connection, NM_SETTING (s_wifi)); ssid = g_byte_array_sized_new (sizeof (ssid_data)); @@ -171,9 +163,6 @@ test_wifi_open (void) /* IP4 setting */ s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); - ASSERT (s_ip4 != NULL, - "wifi-open", "failed to allocate new %s setting", - NM_SETTING_IP4_CONFIG_SETTING_NAME); nm_connection_add_setting (connection, NM_SETTING (s_ip4)); g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); @@ -183,16 +172,26 @@ test_wifi_open (void) (error && error->message) ? error->message : "(unknown)"); config = nm_supplicant_config_new (); - ASSERT (config != NULL, - "wifi-open", "failed to create new supplicant config"); - success = nm_supplicant_config_add_setting_wireless (config, s_wifi, TRUE, 0, TRUE); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'ssid' value 'Test SSID'*"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'scan_ssid' value '1'*"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'bssid' value '11:22:33:44:55:66'*"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'freq_list' value *"); + success = nm_supplicant_config_add_setting_wireless (config, s_wifi, 0); ASSERT (success == TRUE, "wifi-open", "failed to add wireless setting to supplicant config."); + g_test_assert_expected_messages (); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'key_mgmt' value 'NONE'"); success = nm_supplicant_config_add_no_security (config); ASSERT (success == TRUE, "wifi-open", "failed to add wireless security to supplicant config."); + g_test_assert_expected_messages (); hash = nm_supplicant_config_get_hash (config); ASSERT (hash != NULL, @@ -230,14 +229,9 @@ test_wifi_wep_key (const char *detail, const char *bssid_str = "11:22:33:44:55:66"; connection = nm_connection_new (); - ASSERT (connection != NULL, - detail, "failed to allocate new connection"); /* Connection setting */ s_con = (NMSettingConnection *) nm_setting_connection_new (); - ASSERT (s_con != NULL, - detail, "failed to allocate new %s setting", - NM_SETTING_CONNECTION_SETTING_NAME); nm_connection_add_setting (connection, NM_SETTING (s_con)); uuid = nm_utils_uuid_generate (); @@ -251,9 +245,6 @@ test_wifi_wep_key (const char *detail, /* Wifi setting */ s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); - ASSERT (s_wifi != NULL, - detail, "failed to allocate new %s setting", - NM_SETTING_WIRELESS_SETTING_NAME); nm_connection_add_setting (connection, NM_SETTING (s_wifi)); ssid = g_byte_array_sized_new (sizeof (ssid_data)); @@ -266,7 +257,6 @@ test_wifi_wep_key (const char *detail, NM_SETTING_WIRELESS_BSSID, bssid, NM_SETTING_WIRELESS_MODE, "infrastructure", NM_SETTING_WIRELESS_BAND, "bg", - NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL); g_byte_array_free (ssid, TRUE); @@ -274,9 +264,6 @@ test_wifi_wep_key (const char *detail, /* Wifi Security setting */ s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); - ASSERT (s_wsec != NULL, - detail, "failed to allocate new %s setting", - NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); nm_connection_add_setting (connection, NM_SETTING (s_wsec)); g_object_set (s_wsec, @@ -287,9 +274,6 @@ test_wifi_wep_key (const char *detail, /* IP4 setting */ s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); - ASSERT (s_ip4 != NULL, - detail, "failed to allocate new %s setting", - NM_SETTING_IP4_CONFIG_SETTING_NAME); nm_connection_add_setting (connection, NM_SETTING (s_ip4)); g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); @@ -299,19 +283,33 @@ test_wifi_wep_key (const char *detail, (error && error->message) ? error->message : "(unknown)"); config = nm_supplicant_config_new (); - ASSERT (config != NULL, - detail, "failed to create new supplicant config"); - success = nm_supplicant_config_add_setting_wireless (config, s_wifi, TRUE, 0, TRUE); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'ssid' value 'Test SSID'*"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'scan_ssid' value '1'*"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'bssid' value '11:22:33:44:55:66'*"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'freq_list' value *"); + success = nm_supplicant_config_add_setting_wireless (config, s_wifi, 0); ASSERT (success == TRUE, detail, "failed to add wireless setting to supplicant config."); - + g_test_assert_expected_messages (); + + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'key_mgmt' value 'NONE'"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'wep_key0' value *"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'wep_tx_keyidx' value '0'"); success = nm_supplicant_config_add_setting_wireless_security (config, s_wsec, NULL, "376aced7-b28c-46be-9a62-fcdf072571da"); ASSERT (success == TRUE, detail, "failed to add wireless security to supplicant config."); + g_test_assert_expected_messages (); hash = nm_supplicant_config_get_hash (config); ASSERT (hash != NULL, @@ -374,14 +372,9 @@ test_wifi_wpa_psk (const char *detail, const char *bssid_str = "11:22:33:44:55:66"; connection = nm_connection_new (); - ASSERT (connection != NULL, - detail, "failed to allocate new connection"); /* Connection setting */ s_con = (NMSettingConnection *) nm_setting_connection_new (); - ASSERT (s_con != NULL, - detail, "failed to allocate new %s setting", - NM_SETTING_CONNECTION_SETTING_NAME); nm_connection_add_setting (connection, NM_SETTING (s_con)); uuid = nm_utils_uuid_generate (); @@ -395,9 +388,6 @@ test_wifi_wpa_psk (const char *detail, /* Wifi setting */ s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); - ASSERT (s_wifi != NULL, - detail, "failed to allocate new %s setting", - NM_SETTING_WIRELESS_SETTING_NAME); nm_connection_add_setting (connection, NM_SETTING (s_wifi)); ssid = g_byte_array_sized_new (sizeof (ssid_data)); @@ -410,7 +400,6 @@ test_wifi_wpa_psk (const char *detail, NM_SETTING_WIRELESS_BSSID, bssid, NM_SETTING_WIRELESS_MODE, "infrastructure", NM_SETTING_WIRELESS_BAND, "bg", - NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL); g_byte_array_free (ssid, TRUE); @@ -418,9 +407,6 @@ test_wifi_wpa_psk (const char *detail, /* Wifi Security setting */ s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); - ASSERT (s_wsec != NULL, - detail, "failed to allocate new %s setting", - NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); nm_connection_add_setting (connection, NM_SETTING (s_wsec)); g_object_set (s_wsec, @@ -437,9 +423,6 @@ test_wifi_wpa_psk (const char *detail, /* IP4 setting */ s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); - ASSERT (s_ip4 != NULL, - detail, "failed to allocate new %s setting", - NM_SETTING_IP4_CONFIG_SETTING_NAME); nm_connection_add_setting (connection, NM_SETTING (s_ip4)); g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); @@ -449,19 +432,37 @@ test_wifi_wpa_psk (const char *detail, (error && error->message) ? error->message : "(unknown)"); config = nm_supplicant_config_new (); - ASSERT (config != NULL, - detail, "failed to create new supplicant config"); - success = nm_supplicant_config_add_setting_wireless (config, s_wifi, TRUE, 0, TRUE); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'ssid' value 'Test SSID'*"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'scan_ssid' value '1'*"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'bssid' value '11:22:33:44:55:66'*"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'freq_list' value *"); + success = nm_supplicant_config_add_setting_wireless (config, s_wifi, 0); ASSERT (success == TRUE, detail, "failed to add wireless setting to supplicant config."); - + g_test_assert_expected_messages (); + + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'key_mgmt' value 'WPA-PSK'"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'psk' value *"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'proto' value 'WPA RSN'"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'pairwise' value 'TKIP CCMP'"); + g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, + "*added 'group' value 'TKIP CCMP'"); success = nm_supplicant_config_add_setting_wireless_security (config, s_wsec, NULL, "376aced7-b28c-46be-9a62-fcdf072571da"); ASSERT (success == TRUE, detail, "failed to add wireless security to supplicant config."); + g_test_assert_expected_messages (); hash = nm_supplicant_config_get_hash (config); ASSERT (hash != NULL, @@ -493,15 +494,13 @@ test_wifi_wpa_psk_types (void) test_wifi_wpa_psk ("wifi-wep-psk-passphrase", TYPE_STRING, key2, (gconstpointer) key2, strlen (key2)); } +NMTST_DEFINE (); + int main (int argc, char **argv) { - GError *error = NULL; char *base; - g_type_init (); - - if (!nm_utils_init (&error)) - FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message); + nmtst_init (&argc, &argv, TRUE); /* The tests */ test_wifi_open (); |