summaryrefslogtreecommitdiff
path: root/libnm
Commit message (Collapse)AuthorAgeFilesLines
* libnm: minor refactoring by using g_clear_object() and nm_str_not_empty()Thomas Haller2016-10-232-18/+4
|
* libnm: avoid possibly NULL address for NMDeviceVlan calling ↵Thomas Haller2016-10-231-2/+5
| | | | nm_utils_hwaddr_matches()
* libnm: fix memleak in NMDeviceVxlanThomas Haller2016-10-231-0/+2
|
* build: merge "libnm/tests/Makefile.am" into toplevel MakefileThomas Haller2016-10-192-62/+0
|
* build: merge "libnm/Makefile.am" into toplevel MakefileThomas Haller2016-10-192-258/+5
|
* tests: combine "run-test-valgrind.sh" and "run-test-dbus-session.sh" in ↵Thomas Haller2016-10-191-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.
* build/trivial: rename VALGRIND_RULES in Makefile.am to NM_LOG_COMPILERThomas Haller2016-10-191-1/+1
|
* libnm-core: introduce connection.autoconnect-retries propertyBeniamino Galvani2016-10-161-0/+1
| | | | | | | | | | | | | | | | While technically it's already possible to implement a fail-over mechanism using multiple connections (for example, defining a higher priority DHCP connection with short DHCP timeout and a lower priority one with static address), in practice this doesn't work well as we try to autoactivate each connection 4 times before switching to the next one. Introduce a connection.autoconnect-retries property that can be used to change the number of retries. The special value 0 means infinite and can be used to try the connection forever. A -1 value means the global configured default, which is equal to 4 unless overridden. https://bugzilla.gnome.org/show_bug.cgi?id=763524
* libnm: disconnect devices' signals when disposing managerBeniamino Galvani2016-10-141-7/+15
| | | | | | | | | | | We connect signal handlers to devices when they appear, but don't disconnect the handlers when the manager instance is destroyed. This can cause crashes as device_ac_changed() is called on an invalid manager instance. Disconnect the handlers from dispose(). https://bugzilla.redhat.com/show_bug.cgi?id=1383758
* build: add extra dependencies for linker-version-script for NetworkManager ↵Thomas Haller2016-10-141-0/+3
| | | | and libnm.so
* libnm: move backported symbols from libnm-core to libnmThomas Haller2016-10-131-0/+47
| | | | | | | | | | Backported symbols only make sense for libnm itself, not for libnm-core which is statically linked with NetworkManager and nm-ifcace-helper. Declaring the symbols in libnm-core, means that NetworkManager binary also contains them, although there are not used. Move them to libnm.
* proxy: remove unnecessary APIsAtul Anand2016-10-041-12/+1
| | | | | | Unnecessary APIs have been removed from nm-setting-proxy, client like nm-connection-editor are expected to create a PAC script snippet the load the location of file in NM.
* libnm: API for Proxy FeatureAtul Anand2016-10-042-0/+20
| | | | | | | libnm-core has been expanded to include proxy settings which clients like nmcli, nm-connection-editor use to configure proxy in PacRunner. It offers three modes i.e 'auto', 'manual'and 'none' and accordingly take data to configure PacRunner. The modes matches on the PacRunner side too.
* all: modify line separator comments to be 80 chars wideThomas Haller2016-10-0331-84/+84
| | | | sed 's#^/\*\{5\}\*\+/$#/*****************************************************************************/#' $(git grep -l '\*\{5\}' | grep '\.[hc]$') -i
* cli: reject team.config from files with '\0'Thomas Haller2016-09-271-0/+1
| | | | | | | | | The team-config must be valid utf-8. First of all, JSON is also defined for other unicode encodings, but libjansson can only handle utf-8. So, just require that. A file with a '\0' truncates part of the file and is thus invalid.
* libnm: expose nm_utils_is_json_object() utility functionThomas Haller2016-09-271-0/+1
| | | | | | | | | Since we possibly already link against libjansson, we can also expose some helper utils which allows nmcli to do basic validation of JSON without requiring to duplicate the effort of using libjansson. Also, tighten up the cecks to ensure that we have a JSON object at hand. We are really interested in that and not of arrays or literals.
* libnm: fix symbol versioningThomas Haller2016-09-231-1/+4
| | | | | Already released versions must not be extended or modified. The new symbol is part of upcomming 1.6.0 release.
* manager: Add "Capabilities" propertyMarius Vollmer2016-09-231-0/+1
|
* build: fix build with address sanitizerBeniamino Galvani2016-09-201-8/+4
| | | | | | | | Every program run during the build which loads a NM library must preload libasan.so if the address sanitizer is enabled. Add a macro to set the needed environment variables and use it when performing the shared object link tests.
* libnm: make waiting objects fail when an object initialization failsBeniamino Galvani2016-09-091-5/+18
| | | | | | Previously, when the load of an object failed and there were other objects waiting for it, those objects would remain waiting forever. Make them fail as well.
* all: cleanup includes in header filesThomas Haller2016-08-173-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)
* auth: check when setting statistics refresh rateAlfonso Sanchez-Beato2016-08-172-1/+6
|
* permissions: properly add checkpoint-rollback permissionThomas Haller2016-08-172-1/+5
| | | | Fixes: a52d4654ec4d3afbbb0ef70ada55f4a5ddac92db
* build: rename $(LIBDL) to $(DL_LIBS) and modify detectionThomas Haller2016-08-151-1/+1
|
* libnm: fix introspection annotations for nm_client_load_connections()Beniamino Galvani2016-08-041-4/+4
| | | | | | | | | Add the "(array zero-terminated=1)" GLib introspection annotation when the parameter is a NULL-terminated string array. https://mail.gnome.org/archives/networkmanager-list/2016-August/msg00017.html Reported-by: Petr Horacek <phoracek@redhat.com>
* libnm: link with libdlLubomir Rintel2016-08-011-0/+1
| | | | | | | | Not default when linking with GOLD linker, but used for loading the VPN plugins. We still get it when using NSS by dumb luck, but GnuTLS doesn't drag it in. https://bugzilla.gnome.org/show_bug.cgi?id=769328
* device: enable MAC address check on virtual devicesfg/mac_fixesFrancesco Giudici2016-07-221-0/+5
| | | | | | | Virtual devices don't have a valid permanent hw address: when activating a connection against a specific interface, a check is performed on the device MAC address too: if it is an empty string, give a try to the currently assigned MAC address.
* cli: improve devices vs connection compatibility checkFrancesco Giudici2016-07-221-2/+2
| | | | report error message on device compatibility failures
* libnm/client: emit signals when active connection disappearsLubomir Rintel2016-07-072-0/+54
| | | | It allows us to reliably track failures to activate a connection.
* all: make MAC address randomization algorithm configurableThomas Haller2016-06-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the per-connection settings "ethernet.cloned-mac-address" and "wifi.cloned-mac-address", and for the per-device setting "wifi.scan-rand-mac-address", we may generate MAC addresses using either the "random" or "stable" algorithm. Add new properties "generate-mac-address-mask" that allow to configure which bits of the MAC address will be scrambled. By default, the "random" and "stable" algorithms scamble all bits of the MAC address, including the OUI part and generate a locally- administered, unicast address. By specifying a MAC address mask, we can now configure to perserve parts of the current MAC address of the device. For example, setting "FF:FF:FF:00:00:00" will preserve the first 3 octects of the current MAC address. One can also explicitly specify a MAC address to use instead of the current MAC address. For example, "FF:FF:FF:00:00:00 68:F7:28:00:00:00" sets the OUI part of the MAC address to "68:F7:28" while scrambling the last 3 octects. Similarly, "02:00:00:00:00:00 00:00:00:00:00:00" will scamble all bits of the MAC address, except clearing the second-least significant bit. Thus, creating a burned-in address, globally administered. One can also supply a list of MAC addresses like "FF:FF:FF:00:00:00 68:F7:28:00:00:00 00:0C:29:00:00:00 ..." in which case a MAC address is choosen randomly. To fully scamble the MAC address one can configure "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00". which also randomly creates either a locally or globally administered address. With this, the following macchanger options can be implemented: `macchanger --random` This is the default if no mask is configured. -> "" while is the same as: -> "00:00:00:00:00:00" -> "02:00:00:00:00:00 02:00:00:00:00:00" `macchanger --random --bia` -> "02:00:00:00:00:00 00:00:00:00:00:00" `macchanger --ending` This option cannot be fully implemented, because macchanger uses the current MAC address but also implies --bia. -> "FF:FF:FF:00:00:00" This would yields the same result only if the current MAC address is already a burned-in address too. Otherwise, it has not the same effect as --ending. -> "FF:FF:FF:00:00:00 <MAC_ADDR>" Alternatively, instead of using the current MAC address, spell the OUI part out. But again, that is not really the same as macchanger does because you explictly have to name the OUI part to use. `machanger --another` `machanger --another_any` -> "FF:FF:FF:00:00:00 <MAC_ADDR> <MAC_ADDR> ..." "$(printf "FF:FF:FF:00:00:00 %s\n" "$(sed -n 's/^\([0-9a-fA-F][0-9a-fA-F]\) \([0-9a-fA-F][0-9a-fA-F]\) \([0-9a-fA-F][0-9a-fA-F]\) .*/\1:\2:\3:00:00:00/p' /usr/share/macchanger/wireless.list | xargs)")"
* libnm: add NMSettingConnection:stable-id propertyThomas Haller2016-06-301-0/+1
| | | | | | | | | | | | | | This new property be used as token to generate stable-ids instead of the connection's UUID. Later, this will be used by ipv6.addr-gen-mode=stable-privacy, ethernet.cloned-mac-address=stable, and wifi.cloned-mac-address=stable setting. Those generate stable addresses based on the connection's UUID, but allow to use the stable-id instead. This allows multiple connections to generate the same addresses -- on the same machine, because in the above cases a machine dependant key is also hashed.
* libnm/libnm-glib: use Bluetooth device name as description (bgo #592819)Dan Williams2016-06-211-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
* shared/tests: build "nm-utils/nm-vpn-plugin-utils.c"th/shared-bgo767697Thomas Haller2016-06-161-0/+24
| | | | For testing, add a build target to build those files too.
* shared: move shared files to subdirectory "shared/nm-utils/"Thomas Haller2016-06-161-1/+1
| | | | | | | | | | | | | The "shared" directory contains files that are possibly used by all components of NetworkManager repository. Some of these files are even copied as-is to other projects (VPN plugins, nm-applet) and used there without modification. Move those files to a separate directory. By moving them to a common directory, it is clearer that they belong together. Also, you can easier compare the copied versions to their original via $ diff -r ./shared/nm-utils/ /path/to/nm-vpn-plugin/shared/nm-utils/
* libnm/vpn: add nm_vpn_editor_plugin_load_vt()Thomas Haller2016-06-152-0/+9
| | | | | | | | | | Let VPN plugins return a virtual function table to extend the API while bypassing libnm. This allows to add and use new functionality to VPN plugins without updating libnm. The actual definitions are in a header-only file "nm-vpn-editor-plugin-call.h", which can be copied to the caller/plugin.
* libnm/vpn: pass NMVpnPluginInfo to the NMVpnEditorPlugin instanceThomas Haller2016-06-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | The NMVpnPluginInfo is essentially the .name file, that is, a configuration file about the plugin itself. Via NMVpnPluginInfo instance, the NMVpnEditorPlugin can be created. Usually, one would create a NMVpnPluginInfo (that is, reading the .name file) and then create a NMVpnEditorPlugin instance from there. In this case, usually the editor-plugin is owned by the plugin-info instance (although the API allows for creating the editor-plugin independently). Now, pass the NMVpnPluginInfo to the editor-plugin too. This is useful, because then the editor-plugin can look at the .name file. The .name file is not user configuration. Instead it is configuration about the plugin itself. Although the .name file is part of the plugin build artefacts, it is useful to allow the plugin to access the .name file. The reason is, that this can allow the user to easily change a configuration knob of the plugin without requiring to patch or the plugin.
* libnm/vpn: add nm_vpn_plugin_info_list_find_service_name() functionThomas Haller2016-06-151-0/+2
|
* libnm/vpn: add nm_vpn_plugin_info_get_aliasesThomas Haller2016-06-151-0/+1
|
* libnm: backport symbols nm_setting_ip_config_get_dns_priority to libnm_1_2_4Thomas Haller2016-06-101-0/+4
| | | | | | | | | Commit bdd0e7fec0a2af12331b815bfaf3de182ed6eebb which added symbol nm_setting_ip_config_get_dns_priority to libnm_1_4_0 was backported to nm-1-2 in commit ad1cdcf6571da23e3197b09f1b4b14d23b8899d1. Add the backported symbol to master to allow seemless upgrading from 1.2.4 to 1.4.0.
* build: add options to compile with address/undefined sanitizersBeniamino Galvani2016-06-031-3/+16
| | | | | | | 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.
* all: move NM_AUTH_PERMISSION_* defines to "nm-common-macros.h" headerThomas Haller2016-06-011-14/+1
|
* manager: add Reload() D-Bus commandThomas Haller2016-06-012-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new Reload D-Bus command to reload NetworkManager configuration. For now, this is like sending SIGHUP to the process. There are several advantages here: - it is guarded via PolicyKit authentication while signals can only be sent by root. - the user can wait for the reload to be complete instead of sending an asynchronous signal. For now, we operation completes after nm_config_reload() returns, but later we could delay the response further until specific parts are fully reloaded. - SIGHUP reloads everything including re-reading configuration from disk while SIGUSR1 reloads just certain parts such as writing out DNS configuration anew. Now, the Reload command has a flags argument which is more granular in selecting parts which are to be reloaded. For example, via signals the user can: 1) send SIGUSR1: this writes out the DNS configuration to resolv.conf and possibly reloads other parts without re-reading configuration and without restarting the DNS plugin. 2) send SIGHUP: this reloads configuration from disk, writes out resolv.conf and restarts the DNS plugin. There is no way, to only restart the DNS plugin without also reloading everything else.
* libnm: implement missing NM_AUTH_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNSThomas Haller2016-06-012-1/+7
|
* libnm: export nm_setting_ip6_config_get_token() symbolBeniamino Galvani2016-05-301-0/+1
| | | | Fixes: 954d937b2f6bfe5a513497c6ea13d0651a0c0b16
* team: expose current device configuration through D-Bus and nmcliBeniamino Galvani2016-05-263-0/+44
| | | | | | | | Add a new "Config" property to the D-Bus interface for team devices and show its value through "nmcli device show". The property contains the full JSON configuration from teamd for the device. https://bugzilla.redhat.com/show_bug.cgi?id=1310435
* libnm-core: add dns-priority to NMSettingIPConfigBeniamino Galvani2016-05-121-0/+1
|
* docs: libnm: add doc comment to typesBeniamino Galvani2016-05-0536-1/+108
| | | | | | This is required to add objects in the "Types and Values" section and in the API index. Later, we may want to add useful content in those empty comments.
* libnm/vpn: add nm_vpn_plugin_info_new_search_file()Thomas Haller2016-04-221-0/+1
|
* libnm/vpn: add nm_vpn_plugin_info_supports_hints()Thomas Haller2016-04-221-0/+1
|
* libnm/vpn: add nm_vpn_plugin_info_get_auth_dialog()Thomas Haller2016-04-221-0/+1
|