Commit graph

16023 commits

Author SHA1 Message Date
Thomas Haller a63867a40b build: use NetworkManager logging domain for device and settings plugins
First of all, G_LOG_DOMAIN only matters when using g_log() directly.
Inside core, we always want to log via nm-logging. Every call to a
g_log() is a bug in the first place (like a failed assertion that logs
a g_critical() during g_return_if_fail()).

So, for all practic purposes, the logging domain is not used.

For nm-logging, the G_LOG_DOMAIN has no effect. Unless we find a proper
use of this domain, G_LOG_DOMAIN should not differ from what the rest of
core.
2016-10-06 20:41:20 +02:00
Thomas Haller fbaba4c1c3 wifi: merge branch 'th/wifi-rename' 2016-10-06 20:40:18 +02:00
Thomas Haller ac1c353196 wifi: move code in nm-wifi-ap.c around and minor cleanup 2016-10-06 20:37:04 +02:00
Thomas Haller 44b2044faa wifi: rename NMAccessPoint to NMWifiAP
NMAccessPoint was in file "nm-wifi-ap.h" with
method nm_ap_*(). Make the naming consistent.

Also rename "nm-wifi-ap-utils.*" as it contains general
purpose wifi utilities. No need to have special "ap" utilities.

Same for "test-wifi-ap-utils.c". It just contains general wifi
tests.
2016-10-06 20:35:05 +02:00
Thomas Haller 1791978007 iface-helper: merge branch 'th/iface-helper-logging-bgo772456'
https://bugzilla.gnome.org/show_bug.cgi?id=772456
2016-10-06 13:34:23 +02:00
Thomas Haller 2b728c7dda iface-helper: use different syslog-identfier for nm-iface-helper 2016-10-06 13:31:34 +02:00
Thomas Haller fd12aa1b20 logging: allow setting the syslog-identifier not to use G_LOG_DOMAIN
For nm-iface-helper we want to use a different syslog-identifier then
"NetworkManager".

Since we build "nm-logging.c" as part of libNetworkManagerBase.la,
it would be cumbersome to compile the logging part multiple times
with different -DG_LOG_DOMAIN settings.

Instead, allow configuring at runtime.
2016-10-06 13:31:34 +02:00
Thomas Haller 921f6a9c34 iface-helper: pass on the logging level to nm-iface-helper 2016-10-06 13:31:34 +02:00
Thomas Haller 1098abe8c8 iface-helper: set logging prefix 2016-10-06 13:31:34 +02:00
Thomas Haller 06b3b06a95 logging: support system-wide prefix
Will be used by nm-iface-helper.
2016-10-05 15:34:45 +02:00
Thomas Haller bedb19840f iface-helper: use logging macros 2016-10-05 15:34:45 +02:00
Thomas Haller 918f33cde8 iface-helper: free main_loop instance at end of main() 2016-10-05 15:10:34 +02:00
Thomas Haller d8724ab4f5 iface-helper: return from main() instead of calling exit() 2016-10-05 15:07:48 +02:00
Thomas Haller 852a52a4fc iface-helper: namespace global variables 2016-10-05 15:05:50 +02:00
Thomas Haller 67405bd5bc proxy: merge branch 'th/proxy-cleanup' 2016-10-05 15:03:09 +02:00
Thomas Haller 8bc8d343ca ifcfg-rh/proxy: fix memleak in make_proxy_setting() 2016-10-05 14:58:03 +02:00
Thomas Haller 8b51e345af libnm/proxy: add proxy setting for non-slave connection during normalization
And reject slave settings with proxies.
2016-10-05 14:53:21 +02:00
Thomas Haller e2c71c82e7 libnm: cleanup error paths in _nm_connection_verify() 2016-10-05 14:46:18 +02:00
Thomas Haller 29b576bd70 proxy: cleanup handling of proxy-method
The numeric value of NM_SETTING_PROXY_METHOD_NONE should be zero,
as that is the more natural default.

Also, cast all uses of the enum values in g_object_set() to
(int).
2016-10-05 14:46:18 +02:00
Thomas Haller a93fee0844 keyfile/tests: refactor loading plain keyfile via glib API 2016-10-05 14:46:18 +02:00
Thomas Haller cadeaf9c20 keyfile/tests: refactor uuid creation in test 2016-10-05 14:46:18 +02:00
Thomas Haller 00ef37cd98 keyfile/tests: refactor writing of test keyfile 2016-10-05 14:46:18 +02:00
Thomas Haller 9f9e4b0c35 keyfile/tests: use cleanup attribute for keyfile 2016-10-05 14:46:18 +02:00
Thomas Haller f25cd2b844 keyfile/tests: refactor checking re-reading keyfile in tests 2016-10-05 14:46:18 +02:00
Thomas Haller 3e13ebd1c9 keyfile/tests: refactor tests to use cleanup attributes 2016-10-05 14:46:18 +02:00
Thomas Haller 84346d172a shared: add NMTST_UUID_INIT() macro 2016-10-05 14:46:18 +02:00
Beniamino Galvani a070a410db core: merge branch 'bg/config-show-default-bgo772144'
https://bugzilla.gnome.org/show_bug.cgi?id=772144
2016-10-04 14:54:14 +02:00
Beniamino Galvani a8e02899bc config: add default values to 'NM --print-config' output
There isn't an easy way to determine the effective value of some
configuration options as their default value can be set at build time;
the user has to search in logs or look at the manual page when
available.

This adds those default values that can be changed at build time to
the output of 'NetworkManager --print-config':

 [main]
 # plugins=ifcfg-rh,ifupdown,ifnet,ibft
 # rc-manager=symlink
 # auth-polkit=true
 dns=dnsmasq
 ...

 [logging]
 # backend=journal
 ...
2016-10-04 14:51:14 +02:00
Beniamino Galvani 63ceab3a48 config: pass default auth-polkit value as string instead of boolean
It is less efficient, but allows us to easily print the default value.
2016-10-04 14:51:14 +02:00
Beniamino Galvani fb2ca0ce3d config: don't set default plugins in nm-config keyfile
Like all other keys that can have a default value, substitute the
default only when needed. In this way, we can tell later if the
value comes from configuration file or if it's the default value.

Also, rename CONFIG_PLUGINS_DEFAULT to NM_CONFIG_PLUGINS_DEFAULT.
2016-10-04 14:50:01 +02:00
Beniamino Galvani 984d4f0684 cli: properly set multiple addresses in questionnaire mode
Pass the '+' modifier to set_property() for IPv4 and IPv6 addresses to
append the new address to existing ones instead of overwriting them.

Fixes: 2f45665559

https://bugzilla.redhat.com/show_bug.cgi?id=1380165
2016-10-04 14:18:27 +02:00
Thomas Haller 6e9abe3d88 proxy: merge branch 'th/proxy'
https://mail.gnome.org/archives/networkmanager-list/2016-August/msg00072.html

https://bugzilla.gnome.org/show_bug.cgi?id=772042
2016-10-04 12:22:18 +02:00
Thomas Haller 1f2a0dc70b proxy: rename NMPacRunnerManager to NMPacrunnerManager
The names NMPacRunnerManager, nm_pac_runner_manager were inconsistent
with NM_PACRUNNER_MANAGER and nm-pacrunner-manager.[hc]. They should
be consistent.

It seems pacrunner project calls itself "PACrunner" or just "pacrunner",
so prefer the spelling with lower-case 'r'.
2016-10-04 12:14:15 +02:00
Thomas Haller 107089327c proxy: reorder parts in nm-proxy-config.c and nm-pacrunner-manager.c 2016-10-04 11:58:32 +02:00
Thomas Haller 132234bb79 cli: support qualifying proxy.pac-script with "file://" or "js://" 2016-10-04 11:44:44 +02:00
Thomas Haller 2de000e1d2 proxy: reject huge pac_script values in verify() 2016-10-04 11:44:44 +02:00
Atul Anand 20098591d9 proxy: change semantics of pac-script
libnm-core: pac-script property in NMSettingProxy now represents the
script itself not the location. It ensures that the connection is
self contained.

nmcli: Supports loading of PAC Script via file path or written explicitly.
2016-10-04 11:44:44 +02:00
Atul Anand 812b8774f6 proxy: remove unnecessary APIs
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.
2016-10-04 11:44:44 +02:00
Thomas Haller 0a9d1e001b po: translate libnm-core/nm-setting-proxy.c 2016-10-04 11:44:44 +02:00
Thomas Haller ac8bf57f1b proxy: refactor NMProxyConfig to keep internal variables as strv
The API of NMProxyConfig exposes @proxies and @excludes as strv values.
There is no need to track those values internally as a GPtrArray and
then clone them in the getters (especially, since the entire NMProxyConfig
API is internal to core.

Thereby, fix a few memory leaks in add_proxy_config() and some
style fixes for { }.
2016-10-04 11:44:44 +02:00
Thomas Haller 931871995c proxy: fix logging level for proxy related messages in nm-device.c
Give them a common prefix ("proxy") and more importantly: don't log
non-important messages with <info> priority.
2016-10-04 11:44:44 +02:00
Thomas Haller 404f57a2a9 proxy/trivial: rename nm_pac_runner_manager*() functions
As the type is called NMPacRunnerManager, the proper name for the
functions is nm_pac_runner_manager*(). Alternatively, it the type
should be NMPacrunnerManager.
2016-10-04 11:44:44 +02:00
Thomas Haller a9820a63d4 proxy: embed private date in NMPacRunnerManager and NMProxyConfig
These are final/sealed types (that is without subclasses). We can
hide the type structures and neatly embed the private data there.
2016-10-04 11:44:44 +02:00
Thomas Haller 27811b792c proxy: don't let nm_pacrunner_manager_send() fail
nm_pacrunner_manager_send() would only fail if passed in a NULL proxy_config.
And then it would log a <info> message without details about what failed.

Just don't do that.
2016-10-04 11:44:44 +02:00
Atul Anand 3ef7d316f6 TODO: Remove Proxies from the list of TODO
Remove Proxies from the list once proxy patches are successfully merged.
2016-10-04 11:44:44 +02:00
Atul Anand 2cb75e08d6 nmcli: Add Proxy support to nmcli
nmcli fixed to allow users edit proxy properties.
2016-10-04 11:44:44 +02:00
Atul Anand 197baf6dee callouts: Fixes in Dispatcher to release Proxy env variables
Dispatcher Fixed to release env variables for proxy stuff. For VPNs
proxy variables have prefix "VPN_" as usual.
2016-10-04 11:44:44 +02:00
Atul Anand 86d4573baa src: Fixes to add Proxy Feature
src: Fixes in nm-device.c and nm-vpn-connection.c to update PacRunner
at the right place and moment. When a device goes up PacRunner is
configured with the Device IPxConfigs and Proxy Config. When it goes
down the same configuration is removed from PacRunner.

ifcfg-rh: Fixed to read and write proxy settings to the ifcfg network
scripts.
2016-10-04 11:44:44 +02:00
Atul Anand fd0b9ab583 src:(pacrunner-manager): Object for interaction with PacRunner
A new object NMPacRunnerManager has been added to manage and interact
PacRunner. It invokes both DBus methods on PacRunner DBus interface.
It stores the returned object path from CreateProxyConfiguration()
to feed as parameter to DestroyProxyCofiguration() when network goes down.
2016-10-04 11:44:13 +02:00
Atul Anand ecfcdbda46 src:(proxy): A new Object NMProxyConfig with Proxy Parameters
A new config object NMProxyConfig has been implemented inside core
which contains proxy parameters.
2016-10-04 11:44:13 +02:00