Convert WiFi access point flags to connection profile security settings

Adrien Cossa a.cossa at viewpointsystem.com
Wed May 8 13:12:06 UTC 2024


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...

[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    [http://sig.viewpointsystem.com/icons.png]
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<mailto:a.cossa at viewpointsystem.com> | www.viewpointsystem.com<https://www.viewpointsystem.com>
Datenschutzerklaerung <https://viewpointsystem.com/de/datenschutz/>
[http://sig.viewpointsystem.com/xing22_vps.png] <https://www.xing.com/companies/viewpointsystemgmbh>    [http://sig.viewpointsystem.com/linkedin22_vps.png]  <https://www.linkedin.com/company/viewpointsystem-gmbh?trk=prof-following-company-logo>    [http://sig.viewpointsystem.com/twitter22_vps.png]  <https://twitter.com/VPS_Eyetracking>       [http://sig.viewpointsystem.com/fb22_vps.png]  <https://www.facebook.com/Viewpointsystem-GmbH-382331958771804/>         [http://sig.viewpointsystem.com/youtube22_vps.png]  <https://www.youtube.com/user/viewpointsystem>
https://viewpointsystem.wetransfer.com [http://sig.viewpointsystem.com/news_eng.jpg] <https://seu2.cleverreach.com/f/342259-351488/>
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/networkmanager/attachments/20240508/cc3d0826/attachment.htm>


More information about the Networkmanager mailing list