summaryrefslogtreecommitdiff
path: root/libnm-glib
AgeCommit message (Collapse)AuthorFilesLines
2018-04-12build: meson: add prefix to test namesBeniamino Galvani1-1/+1
There are multiple tests with the same in different directories; add a unique prefix to test names so that it is clear from the output which one is running.
2018-04-12build: meson: enable all tests againBeniamino Galvani1-3/+2
Some tests were disabled because they failed when run in parallel. Now that we use the wrapper script they succeed and can be enabled again.
2018-04-12build: meson: use run-nm-test.sh to run testsBeniamino Galvani1-1/+5
Like autotools, use the wrapper script 'run-nm-test.sh' that starts a separate D-Bus session when needed.
2018-03-26libnm-glib: do not use deprecated Gtk-Doc Type: and Virtual: tagsJiří Klimeš4-17/+6
Signed-off-by: Jiří Klimeš <jklimes@redhat.com> https://bugzilla.gnome.org/show_bug.cgi?id=744250
2018-03-08Add calls to g_simple_async_result_set_check_cancellableBenjamin Berg4-0/+14
If an operation is cancelled through the GCancellable, then the idiom is that the operation is always cancelled, even if it has finished successfully. To ensure this is the case, add calls to g_simple_async_result_set_check_cancellable everywhere. Without this, e.g. gnome-control-center will crash when switching away from the power panel quickly, as the NMClient creation finishes asynchronously and g-c-c assume that G_IO_ERROR_CANCELLED is returned to ensure it doesn't access the now invalid user_data parameter. https://bugzilla.gnome.org/show_bug.cgi?id=794088
2018-02-08all: fix -Wcast-function-type warningsLubomir Rintel1-7/+7
GCC 8.0's -Wcast-function-type objects casting function pointers to ones with incompatible prototypes. Sometimes we do that on purpose though. Notably, the g_source_set_callback()'s func argument can point to functions of various prototypes. Also, libnm-glib/nm-remote-connection is perhaps just not worth reworking, that would just be a waste of time. A cast to void(*)(void) avoids the GCC warning, let's use it.
2018-02-08libnm/vpn-plugin: avoid bad function pointer type castsLubomir Rintel1-1/+9
This makes GCC 8.0 unhappy and it is probably right about that -- it's more difficult to get things wrong when the function prototypes actually match.
2018-02-07all: drop trailing spacesThomas Haller1-1/+1
2018-02-07all: replace non-leading tabs with spacesThomas Haller5-63/+63
We commonly only allow tabs at the beginning of a line, not afterwards. The reason for this style is so that the code looks formated right with tabstop=4 and tabstop=8.
2018-01-18all: require glib 2.40Lubomir Rintel2-4/+0
RHEL 7.1 and Ubuntu 14.04 LTS both have this. https://bugzilla.gnome.org/show_bug.cgi?id=792323
2018-01-16build: don't install NetworkManager.pc when libnm-glib is disabledLubomir Rintel1-0/+15
2018-01-12meson: Fix missing symbols in libnm-glibIñigo Martínez1-1/+1
The following symbols are missing from the libnm-glib library: * libnm_glib_get_network_state * libnm_glib_init * libnm_glib_register_callback * libnm_glib_shutdown * libnm_glib_unregister_callback This has been changed by linking `libdeprecated_nm_glib` as a whole. https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00056.html
2018-01-11build/meson: use variables for ldflags and linker-scriptThomas Haller1-15/+11
2018-01-10build/meson: unconditionally use linker version scriptsThomas Haller1-8/+6
We also unconditionally use them with autotools. Also, the detection for have_version_script does not seem correct to me. At least, it didn't work with clang.
2018-01-10build/meson: disable unit tests that are known to failThomas Haller1-2/+3
I think it's because meson doesn't run the tests in their own D-Bus session, hence the use the system service. automake solves this running all tests via ./tools/run-nm-test.sh, which knows how to prepare a suitable environment for the tests.
2018-01-10meson: Use string variables extensivelyIñigo Martínez1-11/+11
The strings holding the names used for libraries have also been moved to different variables. This way they would be less error as these variables can be reused easily and any typing error would be quickly detected.
2018-01-10meson: Improve dependency systemIñigo Martínez2-33/+17
Some targets are missing dependencies on some generated sources in the meson port. These makes the build to fail due to missing source files on a highly parallelized build. These dependencies have been resolved by taking advantage of meson's internal dependencies which can be used to pass source files, include directories, libraries and compiler flags. One of such internal dependencies called `core_dep` was already in use. However, in order to avoid any confusion with another new internal dependency called `nm_core_dep`, which is used to include directories and source files from the `libnm-core` directory, the `core_dep` dependency has been renamed to `nm_dep`. These changes have allowed minimizing the build details which are inherited by using those dependencies. The parallelized build has also been improved.
2018-01-08build: refine the NETWORKMANAGER_COMPILATION defineThomas Haller2-19/+20
Note that: - we compile some source files multiple times. Most notably those under "shared/". - we include a default header "shared/nm-default.h" in every source file. This header is supposed to setup a common environment by defining and including parts that are commonly used. As we always include the same header, the header must behave differently depending one whether the compilation is for libnm-core, NetworkManager or libnm-glib. E.g. it must include <glib/gi18n.h> or <glib/gi18n-lib.h> depending on whether we compile a library or an application. For that, the source files need the NETWORKMANAGER_COMPILATION #define to behave accordingly. Extend the define to be composed of flags. These flags are all named NM_NETWORKMANAGER_COMPILATION_WITH_*, they indicate which part of the build are available. E.g. when building libnm-core.la itself, then WITH_LIBNM_CORE, WITH_LIBNM_CORE_INTERNAL, and WITH_LIBNM_CORE_PRIVATE are available. When building NetworkManager, WITH_LIBNM_CORE_PRIVATE is not available but the internal parts are still accessible. When building nmcli, only WITH_LIBNM_CORE (the public part) is available. This granularily controls the build.
2018-01-02build: Remove default install directoriesIñigo Martínez1-14/+5
The install directories of those targets that match the default install directories have been removed because they are redundant. This also allows a simple meson build files and it is unnecessary to create some paths. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00078.html
2017-12-18build: use template files for enum types' sources generationIñigo Martínez6-41/+156
Source files for enum types are generated by passing segments of the source code of the files to the `glib-mkenums` command. This patch removes those parameters where source code is used from meson build files by moving those segmeents to template files. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00057.html
2017-12-14build: rename unit tests with the `test-` patternIñigo Martínez1-4/+2
There are some tests located in different directories which are using the same name. To avoid any confussion a prefix was used to name the test and the target. This patch uses the prefix just for the target, to avoid any collision that may happen, and uses the `test-` pattern as the name. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00051.html
2017-12-13build: add initial support for meson build systemIñigo Martínez2-0/+362
meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools. [thaller@redhat.com: rebased patch and adjusted for iwd support] https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00022.html
2017-12-06all: use cast macros instead of C castThomas Haller1-9/+10
When building with assertions, they nm_assert() for the type. Otherwise, they are identical to a C cast. Also, where possible, don't cast at all, but adjust the type instead. Also, there were a few missing casts.
2017-12-06tree-wide: cast after g_object_ref() for proposed GLib patchColin Walters1-3/+3
This fixes the build with related bug https://bugzilla.gnome.org/show_bug.cgi?id=790697 https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00005.html
2017-11-16all: don't use g_direct_equal() for hash table equality functionThomas Haller1-1/+1
GHashTable optimizes a NULL equality function to use direct pointer comparison. That saves the overhead of calling g_direct_equal(). This is also documented behavior for g_hash_table_new(). While at it, also don't pass g_direct_hash() but use the default of %NULL. The behavior is the same, but consistently don't use g_direct_hash().
2017-05-28all: fix typos in documentation, translated strings and commentsYuri Chornoivan1-1/+1
https://bugzilla.gnome.org/show_bug.cgi?id=783173
2017-04-13libnm-glib/secret-agent: don't error out on missing out_connectionLubomir Rintel1-1/+1
It's perfectly valid to call the function with out_connection == NULL when connection_hash == NULL too, as cancel_get_secrets() does. Fixes: fbb1662269e3c47fa51abfe37d1f3c8f0a213bd0 (cherry picked from commit c4a0002f05fd0f57091b95646f1c9064e208ea66)
2017-03-24libnm: handle errors gracefully in nm_access_point_connection_valid()Thomas Haller1-17/+22
Suppress warnings and avoid assertions in nm_access_point_connection_valid(). https://bugzilla.gnome.org/show_bug.cgi?id=773675
2017-03-22udev: add and use nm_udev_utils_property_decode() functionThomas Haller1-28/+1
DRY.
2017-03-22udev: drop libgudev in favor of libudevThomas Haller1-40/+29
libgudev is just a wrapper around libudev. We can use libudev directly and drop the dependency for libgudev.
2017-03-20libnm: fix memleak of GUdevDevice in get_bus_name()Thomas Haller1-0/+1
Fixes: f7b1b2820245aff26da0c2c946b55752e91112e5
2017-03-09include: use double-quotes to include our own headersThomas Haller13-21/+21
In practice, this should only matter when there are multiple header files with the same name. That is something we try to avoid already, by giving headers a distinct name. When building NetworkManager itself, we clearly want to use double-quotes for including our own headers. But we also want to do that in our public headers. For example: ./a.c #include <stdio.h> #include <nm-1.h> void main() { printf ("INCLUDED %s/nm-2.h\n", SYMB); } ./1/nm-1.h #include <nm-2.h> ./1/nm-2.h #define SYMB "1" ./2/nm-2.h #define SYMB "2" $ cc -I./2 -I./1 ./a.c $ ./a.out INCLUDED 2/nm-2.h Exceptions to this are - headers in "shared/nm-utils" that include <NetworkManager.h>. These headers are copied into projects and hence used like headers owned by those projects. - examples/C
2017-03-08all/trivial: unify construct-only property commentsThomas Haller5-6/+6
Unify marking GObject properties that are G_PARAM_CONSTRUCT_ONLY with a comment /* construct-only */
2017-02-15libnm-glib/nm-object: defer assignment of default D-Bus connectionPhilip Withnall1-3/+16
If no D-Bus connection is provided to the constructor of an NMObject, a default one will be assigned in set_property(). However, construction of that default D-Bus connection might fail (if our connection to the system bus is refused, for example), so priv->connection might still be NULL. This will cause the constructor to fail construction of the NMObject, which is correct, but hard to debug. Instead, move the default D-Bus connection handling into the constructor, so all the (priv->connection == NULL) handling is in the same place. Print out any error message. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=778610
2017-02-15libnm-glib: add some missing precondition assertionsPhilip Withnall4-0/+12
To validate the connection and path for NmObject subclass instances. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=778610
2016-11-21libnm-glib: silence some build warningsLubomir Rintel1-4/+10
libnm-glib/nm-object-private.h:28: Warning: NMClient: symbol='PropertyMarshalFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:28: Warning: NMClient: symbol='PropertyMarshalFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:28: Warning: NMClient: symbol='PropertyMarshalFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:28: Warning: NMClient: symbol='PropertyMarshalFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:82: Warning: NMClient: symbol='NMObjectTypeFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:82: Warning: NMClient: symbol='NMObjectTypeFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:83: Warning: NMClient: symbol='NMObjectTypeCallbackFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:83: Warning: NMClient: symbol='NMObjectTypeCallbackFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:84: Warning: NMClient: symbol='NMObjectTypeAsyncFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:84: Warning: NMClient: symbol='NMObjectTypeAsyncFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:84: Warning: NMClient: symbol='NMObjectTypeAsyncFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:84: Warning: NMClient: symbol='NMObjectTypeAsyncFunc': missing parameter name; undocumentable
2016-11-21libnm-glib: drop some unneeded codeLubomir Rintel3-52/+0
...so that we don't have to fix the following: libnm-glib/nm-object-private.h:30: Warning: NMClient: symbol='NMObjectCreatorFunc': missing parameter name; undocumentable libnm-glib/nm-object-private.h:30: Warning: NMClient: symbol='NMObjectCreatorFunc': missing parameter name; undocumentable Fixes: ad5daa098c308ae58a6d54c453c73451044598fc
2016-10-21build: merge "libnm-glib/tests/Makefile.am" into toplevel MakefileThomas Haller2-48/+0
2016-10-21build: merge "libnm-glib/Makefile.am" into toplevel MakefileThomas Haller1-226/+1
2016-10-19build: merge "libnm/tests/Makefile.am" into toplevel MakefileThomas Haller1-1/+1
2016-10-19tests: combine "run-test-valgrind.sh" and "run-test-dbus-session.sh" in ↵Thomas Haller1-4/+0
"run-nm-test.sh" No need to have two test-runners. Combine them, and call tests always via "tools/run-nm-test.sh". Yes, this brings an overhead, that we now always invoke the test with a test wrapper script, also --without-vagrind. Previously, that was only necessary for libnm tests that require their own D-Bus session. Later we will do non-recursive Makefiles, thus all tests should have the same LOG_COMPILER.
2016-10-19build/trivial: rename VALGRIND_RULES in Makefile.am to NM_LOG_COMPILERThomas Haller1-1/+1
2016-10-13build: don't guard check-local with "if ENABLE_TESTS"Thomas Haller1-5/+0
We should enable tests by default, probably we even should drop the configure flags to enable tests and just always build them. Anyway, at this point there is no use in guarding check-local with a check for ENABLE_TESTS. A user who does't want to run the tests, should just not call `make check`.
2016-10-03all: modify line separator comments to be 80 chars wideThomas Haller24-61/+61
sed 's#^/\*\{5\}\*\+/$#/*****************************************************************************/#' $(git grep -l '\*\{5\}' | grep '\.[hc]$') -i
2016-08-17all: cleanup includes in header filesThomas Haller3-4/+0
- don't include "nm-default.h" in header files. Every source file must include as first header "nm-default.h", thus our headers get the default include already implicitly. - we don't support compiling NetworkManager itself with a C++ compiler. Remove G_BEGIN_DECLS/G_END_DECLS from internal headers. We do however support users of libnm to use C++, thus they stay in public headers. (cherry picked from commit f19aff89095ca192b8b2e37534b7a899aecd82f9)
2016-08-17auth: check when setting statistics refresh rateAlfonso Sanchez-Beato2-1/+6
2016-08-17permissions: properly add checkpoint-rollback permissionThomas Haller2-1/+5
Fixes: a52d4654ec4d3afbbb0ef70ada55f4a5ddac92db
2016-06-21libnm/libnm-glib: use Bluetooth device name as description (bgo #592819)Dan Williams1-0/+10
Abuse the 'name' property for this, for now, so we don't have to grab a free slot from NMDeviceClass. https://bugzilla.gnome.org/show_bug.cgi?id=592819
2016-06-03build: add options to compile with address/undefined sanitizersBeniamino Galvani1-0/+4
This adds two new options to the configure scripts to compile NM, clients and libraries with the address and undefined-behavior sanitizers available in recent GCC versions. Clang is not supported at moment.
2016-06-01all: move NM_AUTH_PERMISSION_* defines to "nm-common-macros.h" headerThomas Haller1-14/+1