Convert WiFi access point flags to connection profile security settings

Thomas Haller thaller at redhat.com
Wed May 8 15:00:29 UTC 2024


On Wed, 2024-05-08 at 15:12 +0200, Adrien Cossa wrote:
> 
> Hi Beniamino,
> thanks, that's very helpful.
> On 06.05.24 09:36, Beniamino Galvani wrote:
> > There is a better way: you can use the AddAndActivate2() D-Bus API
> > [1]
> > and pass as `specific_object` the path of an AP object. NM will
> > autocomplete the security settings automatically [2]. You only need
> > to
> > supply a PSK if you are connecting to a WPA-PSK/SAE network. For
> > reference, you can look at how nmcli does it in [3].
> > 
> > [1]
> > https://networkmanager.dev/docs/api/latest/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.AddAndActivateConnection2
> > [2]
> > https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/1.49.0-dev/src/core/devices/wifi/nm-wifi-utils.c#L533
> > [3]
> > https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/1.49.0-dev/src/nmcli/devices.c#L3643
> Is there a way to get the same auto-completion feature when adding a
> new connection profile, but without activating it?
> I was thinking of AddConnection2() [4], but it does not allow to pass
> an AP's path...

Hi,

That does not exist (yet).

AddAndActivate does three things:

  1) make a partial profile complete (e.g. with information from the
AP/specific-object).
  2) add that profile.
  3) activate that profile.

There is API for doing steps 2) and 3). But there is no API for step 1)
alone.

That would be a useful feature.


Thomas

> [4]
> https://networkmanager.dev/docs/api/latest/gdbus-org.freedesktop.NetworkManager.Settings.html#gdbus-method-org-freedesktop-NetworkManager-Settings.AddConnection2
> Adrien Cossa
>  Senior Software Developer
> Viewpointsystem GmbH	
> Technology Center Seestadt, Bt. 2 Christine-Touaillon-Str. 11 / Top
> 14, 1220 Vienna, Austria
> UID ATU 65189299 | FN 333211t | HG Wien
> M | T +43 1 208 90 90
> a.cossa at viewpointsystem.com |www.viewpointsystem.com
> Datenschutzerklaerung
> 
> https://viewpointsystem.wetransfer.com
>  This message and any attached files are confidential and intended
> solely for the addressee(s). Any publication, transmission or other
> use of the information by a person or entity other than the intended
> addressee is prohibited. If you receive this in error, please contact
> the sender and delete the material. The sender does not accept
> liability for any errors or omissions as a result of the
> transmission. The contents of this email and any attachments are
> confidential to the intended recipient. They may not be disclosed to
> or used by or copied in any way by anyone other than the intended
> recipient. If this email is received in error, please contact
> viewpointsystem gmbh nor the name of the sender and the email address
> to which it has been sent and then delete it. Please note that
> neither viewpointsystem gmbh or the sender accepts any responsibility
> for viruses - it is your responsibility to scan or otherwise check
> this email and any attachments.



More information about the Networkmanager mailing list