Help with NM DBus API

2011-04-18 Thread David Rothlisberger
Hi,

I'm looking for some insight into how to use the NM DBus API. (I've
poked around a bit in the libnm-util and network-manager-applet
sources but my small brain is none the wiser.)

I have a single *system* connection (no user connections) and I want
to change the settings of this system connection.

Just looking at the interfaces, it seems I need to call
NetworkManagerSettings.ListConnections() on the
NetworkManagerSystemSettings service (this is NM 0.7/0.8) to get the
path of the connection object; and then call
NetworkManagerSettings.Connection.Update( ... ) on this object, with
the new settings. If this method call returns successfully (i.e. no
error, as it has no out arguments), what does it mean -- that the
connection is now active, or merely that the settings have been
applied (potentially disconnecting the connection)? Which signals
should I register for, to know when the new settings have successfully
taken effect?

My experiments sending some messages with D-Feet indicate that calling
Update() on the System Connection isn't allowed (Read-only
connections may not be modified) -- or is this merely a configuration
issue around DBus permissions?

Finally, any tips on tools for sending DBus messages? dbus-send
doesn't support nested containers (which are required by
Connection.Update()) and I haven't had much luck sending nested
container parameters with D-Feet either. Perhaps bindings to a
language like Python will be the way to go for quick exploration.

Many thanks,

David Röthlisberger
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


RE: Help with NM DBus API

2011-04-18 Thread Jos Collin-ERS,HCLTech
 Just looking at the interfaces, it seems I need to call
 NetworkManagerSettings.ListConnections() on the
 NetworkManagerSystemSettings service (this is NM 0.7/0.8) to get the
 path of the connection object; and then call
 NetworkManagerSettings.Connection.Update( ... ) on this object, with
 the new settings. If this method call returns successfully (i.e. no
 error, as it has no out arguments), what does it mean -- that the
 connection is now active, or merely that the settings have been
 applied (potentially disconnecting the connection)?
This will just update your new settings for that connection. It won't make the 
connection active.

 Which signals
 should I register for, to know when the new settings have successfully
 taken effect?
org.freedesktop.NetworkManagerSettings.Connection.Updated

 My experiments sending some messages with D-Feet indicate that calling
 Update() on the System Connection isn't allowed (Read-only
 connections may not be modified) -- or is this merely a configuration
 issue around DBus permissions?
You should have root permissions to modify the Network Manager System Settings.

 Perhaps bindings to a
 language like Python will be the way to go for quick exploration.
Yes, this would be a better option. See the samples.
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python

::DISCLAIMER::
---

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and
attachments please check them for viruses and defect.

---
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list