Activate the same profile on two devices. Arguably, real NetworkManager
(currently) does not allow that. But the D-Bus API is fine with
having multiple ActiveConnections for one SettingsConnection.
So, also the client should do something sensible.
Also, later we will add wildcard support to NetworkManager, which means
that a profile can be active multiple times (simultaneously).
This is purely for (manual) printf debugging. Hence, it is unused in the commited code.
The point is, to add printf statements to nmcli or libnm, like
if (getenv ("MY_HACK1")) { ...
and trigger it from test-client.py via
self.call_nmcli(..., extra_env = { 'MY_HACK1': '1' } )
- don't use GSList as intermediate data type to construct
the environment, especially when all we want is to get
a strv array at the end. This reverts the order of elements
compared to previously.
- add and use helper methods _items_add_*() which assert against sensible
input.
- merge IPv4 and IPv6 implementations for creating the environment.
https://github.com/NetworkManager/NetworkManager/pull/112
libnm-util/crypto_gnutls.c: In function crypto_encrypt:
libnm-util/crypto_gnutls.c:245:8: error: variable salt_len set but not used [-Werror=unused-but-set-variable]
gsize salt_len;
^~~~~~~~
See-also: 312c72f761
glib 2.56's g_steal_pointer() won't tolerate a function pointer in place
of a gpointer.
CC src/src_libNetworkManager_la-nm-active-connection.lo
src/nm-active-connection.c:1017:17: error: pointer type mismatch
('NMActiveConnectionAuthResultFunc' (aka 'void (*)(struct _NMActiveConnection *,
int, const char *, void *)') and 'gpointer' (aka 'void *'))
[-Werror,-Wpointer-type-mismatch]
result_func = g_steal_pointer (&priv->auth.result_func);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmem.h:200:6: note: expanded from macro 'g_steal_pointer'
(0 ? (*(pp)) : (g_steal_pointer) (pp))
^ ~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
There's just a single spot we use it that way, so it's perhaps better to
work around the warning instead of disabling it.
Avoids an annoying warning in Fedora:
|DEPRECATION WARNING: python2 invoked with /usr/bin/python.
Use /usr/bin/python3 or /usr/bin/python2
/usr/bin/python will be removed or switched to Python 3 in the future.
Also allows the user to override the Python version that's actually
used.
Previously, the callbacks would return gl.mainloop.quit(), which is None
and thus the source got removed already. The later GLib.source_remove()
would thus use an invalid source-id.
Fix that, by no removing the source id from the callback.
Fixes: b1ff82eba5
Instead of exporting exported-objects during construction, export
them right before we register them (for example, in case of device
instances, before we add the device to the manager's device list).
Likewise, when removing the object from the list, always explicitly
unexport them.
Without explicitly unexporting the objects, they can also not be
removed, because object-manage and D-Bus library keep references
to them.
Instead of registering a __get_props() function which constructs the
entire hash anew each time, register a props dictionary. This dictionary
is used as cache for the properies.
In most cases, we don't need to additionally cache the properties
outside the props dictionary. Also, add _dbus_property_set() which
sets the property and emits the notification.
Also, cleanup the property names by giving them a PRP_ prefix.
The reasons are:
- I want to locate all implmenetations of the get_fcn() handler. By
consistently using this macro, you can just grep for the macro and
find them all.
- all implementations should follow the same style. This macro
enforces the same names for arguments and avoids copy&paste.
- if we are going to add or change an argument, it becomes easier.
That's because we can easily identify all implementation and can
change arguments in one place.
These helper function will be needed in the next commit to be earlier.
Helper functions like these, that operate solely on trival types (in
this case, converting an enum to a string), make generally sense to have
at the beginning of the source file. Because they themself have few/no
dependencies and are rather trivial and self contained.
Functions like nmc_find_connection() and nmc_find_active_connection()
can easily find multiple matching results. For example, the
"connection.id" in NetworkManager is not enforced to be unique,
so if the user adds multiple connections with the same name,
they should be all selected.
The previous API had a @pos argument, that allowed to iterate over
the results. Change that, to return all matches in a GPtrArray.
Also, extend connection-show and other places, to anticipate that
a connection might be active multiple times in any moment.
At various places we sort our D-Bus paths. For example,
server sorts them before exporting them on D-Bus.
Server knows well, that a lot of these paths are build
by attaching an incrementing number as last component.
It looks nicer to sort by this number, instead of strictly
lexical with strcmp().
Note that this handles the cases correctly where paths have
different prefixes, or where they don't end with a number.
- no more global variables, except those in the new variable "gl".
- don't pass that bus instance around. Use the singleton gl.bus.
- separate creation of ExportedObj from exporting on D-Bus.
- use enum values loaded from NM via GObject introspection.
- the visible change is that the generated D-Bus paths now start
counting at one. That is also how NetworkManager behaves, and
it looks nicer to have no zero ID for an object.
This makes package updates more robust, avoiding in-place replaces of
the plugins.
Previously, if an upgrade transaction was terminated, NetworkManager
library could end up being of a different version than the plugins.
If the user was unfortunate enough to connect using a connection that
required a plugin (say, Wi-Fi), he would be left without a network
connection making it somewhat inconvenient to recover from the botched
upgrade.
This makes the whole situation a little bit less sad.
The VPN plugins are kept where they always have been -- the path is not
qualified with a version number.
When built with iwd support, add an option to use iwd in place of
wpa_supplicant.
The "boolean dependencies" are only supported since RPM 4.13, with older
versions just keep things the way they were before.