summaryrefslogtreecommitdiff
path: root/introspection
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-07-09 15:22:01 +0200
committerThomas Haller <thaller@redhat.com>2019-07-25 15:26:49 +0200
commit22c8721f35ec111335be0acc36bb0cc7b89bf97d (patch)
tree87f4576ae17008edd4d09594444f37ef0e41dc07 /introspection
parent0aa323fb2887fc4b5decfb5360d7384bf774e6db (diff)
downloadNetworkManager-22c8721f35ec111335be0acc36bb0cc7b89bf97d.tar.gz
core,libnm: add AddConnection2() D-Bus API to block autoconnect from the start
It should be possible to add a profile with autoconnect blocked form the start. Update2() has a %NM_SETTINGS_UPDATE2_FLAG_BLOCK_AUTOCONNECT flag to block autoconnect, and so we need something similar when adding a connection. As the existing AddConnection() and AddConnectionUnsaved() API is not extensible, add AddConnection2() that has flags and room for additional arguments. Then add and implement the new flag %NM_SETTINGS_ADD_CONNECTION2_FLAG_BLOCK_AUTOCONNECT for AddConnection2(). Note that libnm's nm_client_add_connection2() API can completely replace the existing nm_client_add_connection_async() call. In particular, it will automatically prefer to call the D-Bus methods AddConnection() and AddConnectionUnsaved(), in order to work with server versions older than 1.20. The purpose of this is that when upgrading the package, the running NetworkManager might still be older than the installed libnm. Anyway, so since nm_client_add_connection2_finish() also has a result output, the caller needs to decide whether he cares about that result. Hence it has an argument ignore_out_result, which allows to fallback to the old API. One might argue that a caller who doesn't care about the output results while still wanting to be backward compatible, should itself choose to call nm_client_add_connection_async() or nm_client_add_connection2(). But instead, it's more convenient if the new function can fully replace the old one, so that the caller does not need to switch which start/finish method to call. https://bugzilla.redhat.com/show_bug.cgi?id=1677068
Diffstat (limited to 'introspection')
-rw-r--r--introspection/org.freedesktop.NetworkManager.Settings.xml35
1 files changed, 35 insertions, 0 deletions
diff --git a/introspection/org.freedesktop.NetworkManager.Settings.xml b/introspection/org.freedesktop.NetworkManager.Settings.xml
index 73da345ceb..f7be2717b8 100644
--- a/introspection/org.freedesktop.NetworkManager.Settings.xml
+++ b/introspection/org.freedesktop.NetworkManager.Settings.xml
@@ -64,6 +64,41 @@
</method>
<!--
+ AddConnection2:
+ @settings: New connection settings, properties, and (optionally) secrets.
+ @flags: optional flags argument. Currently the following flags are supported:
+ "0x1" (to-disk),
+ "0x2" (in-memory),
+ "0x20" (block-autoconnect).
+ Unknown flags cause the call to fail.
+ @args: optional arguments dictionary, for extensibility. Currently no
+ arguments are accepted. Specifying unknown keys causes the call
+ to fail.
+ @path: Object path of the new connection that was just added.
+ @result: output argument, currently no additional results are returned.
+
+ Add a new connection profile.
+
+ Either the flags 0x1 (to-disk) or 0x2 (in-memory) must be specified.
+ The effect is whether to behave like AddConnection or AddConnectionUnsaved.
+ If 0x20 (block-autoconnect) is specified, autoconnect for the new profile
+ is blocked from the beginnin. Otherwise, the profile might automatically
+ connect if a suitable device is around.
+
+ AddConnection2 is a extensible alternative to AddConnection, and AddConnectionUnsaved.
+ The new variant can do everything that the older variants could, and more.
+
+ Since: 1.20
+ -->
+ <method name="AddConnection2">
+ <arg name="settings" type="a{sa{sv}}" direction="in"/>
+ <arg name="flags" type="u" direction="in"/>
+ <arg name="args" type="a{sv}" direction="in"/>
+ <arg name="path" type="o" direction="out"/>
+ <arg name="result" type="a{sv}" direction="out"/>
+ </method>
+
+ <!--
LoadConnections:
@filenames: Array of paths to on-disk connection profiles in directories monitored by NetworkManager.
@status: Success or failure of the operation as a whole. True if NetworkManager at least tried to load the indicated connections, even if it did not succeed. False if an error occurred before trying to load the connections (eg, permission denied).