summaryrefslogtreecommitdiff
path: root/src/supplicant/nm-supplicant-interface.h
AgeCommit message (Collapse)AuthorFilesLines
2021-02-04all: move "src/" directory to "src/core/"Thomas Haller1-195/+0
Currently "src/" mostly contains the source code of the daemon. I say mostly, because that is not true, there are also the device, settings, wwan, ppp plugins, the initrd generator, the pppd and dhcp helper, and probably more. Also we have source code under libnm-core/, libnm/, clients/, and shared/ directories. That is all confusing. We should have one "src" directory, that contains subdirectories. Those subdirectories should contain individual parts (libraries or applications), that possibly have dependencies on other subdirectories. There should be a flat hierarchy of directories under src/, which contains individual modules. As the name "src/" is already taken, that prevents any sensible restructuring of the code. As a first step, move "src/" to "src/core/". This gives space to reorganize the code better by moving individual components into "src/". For inspiration, look at systemd's "src/" directory. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/743
2021-01-05all: update deprecated SPDX license identifiersThomas Haller1-1/+1
These SPDX license identifiers are deprecated ([1]). Update them. [1] https://spdx.org/licenses/ sed \ -e '1 s%^/\* SPDX-License-Identifier: \(GPL-2.0\|LGPL-2.1\)+ \*/$%/* SPDX-License-Identifier: \1-or-later */%' \ -e '1,2 s%^\(--\|#\|//\) SPDX-License-Identifier: \(GPL-2.0\|LGPL-2.1\)+$%\1 SPDX-License-Identifier: \2-or-later%' \ -i \ $(git grep -l SPDX-License-Identifier -- \ ':(exclude)shared/c-*/' \ ':(exclude)shared/n-*/' \ ':(exclude)shared/systemd/src' \ ':(exclude)src/systemd/src')
2020-10-13wifi: set the BridgeIfname supplicant property when neededBeniamino Galvani1-0/+2
When a wifi device is in a bridge, the supplicant must be aware of it, as a socket must be opened on the bridge to receive packets. Set the BridgeIfname property of the supplicant Interface object before starting the association. Note that the property was read-only in the past and recently [1] became read-write. When using a supplicant version without the patch, writing the property will return an InvalidArgs error and NetworkManager will print a warning. [1] https://w1.fi/cgit/hostap/commit/?id=1c58317f56e312576b6872440f125f794e45f991 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/83
2020-09-29all: unify comment style for SPDX-License-Identifier tagThomas Haller1-1/+1
Our coding style recommends C style comments (/* */) instead of C++ (//). Also, systemd (which we partly fork) uses C style comments for the SPDX-License-Identifier. Unify the style. $ sed -i '1 s#// SPDX-License-Identifier: \([^ ]\+\)$#/* SPDX-License-Identifier: \1 */#' -- $(git ls-files -- '*.[hc]' '*.[hc]pp')
2020-09-28all: reformat all with new clang-format styleAntonio Cardace1-122/+123
Run: ./contrib/scripts/nm-code-format.sh -i ./contrib/scripts/nm-code-format.sh -i Yes, it needs to run twice because the first run doesn't yet produce the final result. Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-04-24wifi: add callback to nm_supplicant_interface_request_scan()Thomas Haller1-1/+8
While we request a scan, we are not yet actually scanning. That means, the supplicant's "scanning" property will only change to TRUE a while after we initiate the scan. It may even never happen. We thus need to handle that the request is currently pending and react when the request completes. (cherry picked from commit 16c1869476106859b684151eb1b101c24cff3451)
2020-04-03wifi: cleanup periodic_update() in "nm-device-wifi.c"Thomas Haller1-0/+7
2020-04-03wifi/trivial: rename function nm_supplicant_interface_state_is_operational() ↵Thomas Haller1-1/+1
from upper case name
2020-04-03wifi: fix and improve handling of Wi-Fi scanning stateThomas Haller1-1/+0
In NMSupplicantInterface, we determine whether we currently are scanning both on the "scanning" supplicant state and the "Scanning" property. Extend that. If we currently are scanning and are about to clear the scanning state, then pretend to still scan as long as we are still initializing BSS instances. What otherwise happens is that we declare that we finished scanning, but the NMWifiAP instances are not yet ready. The result is, that `nmcli device wifi` will already start printing the scan list, when we didn't yet fully process all access points. Now, _notify_maybe_scanning() will delay switching the scanning state to disabled, as long as we have BSS initializing (bss_initializing_lst_head). Also, ignore the "ScanDone" signal. It's redundant to the "Scanning" property anyway. Also, only set priv->last_scan_msec when we switch the scanning state off. That is the right (and only) place where the last-scan timestamp needs updating.
2020-03-12supplicant: large rework of wpa_supplicant handlingThomas Haller1-21/+28
Avoid GDBusProxy, instead use GDBusConnection directly. I very much prefer this because that way we have explicit control over what happens on D-Bus. With GDBusProxy this is hidden under another layer of complex code. The hardest part when using a D-Bus interface is to manage the state via an asynchronous medium. GDBusProxy contains state about the D-Bus interface and duplicate the state that we track. This makes it hard to reason about things. Rework creation of NMSupplicantInterface. Previously, a NMSupplicantInterface had multiple initialization states. In particular, the first state would not yet tie the interface to a certain D-Bus object path. Instead, NMSupplicantInterface would try and retry to create the D-Bus object. Now, NMSupplicantManager has an asynchronous method to create interface instances. The manager only creates an interface instance after the D-Bus path is known. That means, a NMSupplicantInterface instance is now strongly tied to a name-owner and D-Bus path. It follows that the state of NMSupplicantInterface can only go from STARTING, via the supplicant states, to DOWN. Never back. That was already previously the case that the state from DOWN was final and once the 3 initial states were passed, the interface's state would never go back to the initial state. Now this is more strict and more formalized. The 3 initialization states are combined. I think the tighter state handling simplifies users of NMSupplicantInterface. See for example "nm-device-ethernet.c". It's still complicated, because handling state is fundamentally difficult. NMSupplicantManager will take care to D-Bus activate wpa_supplicant only when necessary (poke). Previously, creating the manager instance would always start suppliant service. Now, it's started on demand.
2020-02-10supplicant: drop unused NM_SUPPLICANT_INTERFACE_CREDENTIALS_REQUEST signalThomas Haller1-1/+0
2020-02-10supplicant: remove unused nm_supplicant_interface_credentials_reply()Thomas Haller1-7/+0
Also, it is a synchronous D-Bus call. Get rid of the unused function.
2020-02-10supplicant: define wpas_state_string_to_enum() via ↵Thomas Haller1-0/+2
NM_UTILS_STRING_TABLE_LOOKUP_DEFINE() We frequently have code that converts a string to number/enum. Use a preferred implementation via the NM_UTILS_STRING_TABLE_LOOKUP_DEFINE() macro. Also, this does binary search, so in most cases it's (slightly) faster.
2020-02-10supplicant: track supplicant interface instances in manager via embedded CListThomas Haller1-0/+10
2020-02-10supplicant: rework handling of capabilities (features) to use capabilities ↵Thomas Haller1-76/+30
enumeration We keep adding capabilities. Tracking them individually via boolean (or ternary) properties is cumbersome. Instead, use an enum NMSupplCapType and a corresponding bitmask NMSupplCapMask. The latter can track whether a capability is detected, detected to be absent or not detected (unknown).
2020-02-10supplicant: remove unused NM_SUPPLICANT_INTERFACE_GROUP_FORMATION_FAILURE signalThomas Haller1-1/+0
2019-10-15supplicant: export authentication stateBeniamino Galvani1-0/+11
Add a property to the supplicant to indicate the current state of the authentication process.
2019-10-01all: manually drop code comments with file descriptionThomas Haller1-2/+1
2019-09-10all: SPDX header conversionLubomir Rintel1-14/+1
$ find * -type f |xargs perl contrib/scripts/spdx.pl $ git rm contrib/scripts/spdx.pl
2019-07-29supplicant-interface: detect mesh supportLubomir Rintel1-0/+6
This ensures that we know whether wpa_supplicant was built with CONFIG_MESH enabled. [andreas.kling@peiker-cee.de: add add PROP_MESH_SUPPORT to set_property()]
2019-07-29supplicant-interface: add async disconnectAndy Kling1-0/+10
allow to call dbus method "Disconnect" and handle a callback given by the caller. This allows graceful disconnects that require to wait for the operation to complete.
2019-07-25supplicant: detect SHA384 supportLubomir Rintel1-1/+7
2019-07-25supplicant: detect 802.11r fast BSS transition (FT)Lubomir Rintel1-1/+7
2019-06-11all: drop emacs file variables from source filesThomas Haller1-1/+0
We no longer add these. If you use Emacs, configure it yourself. Also, due to our "smart-tab" usage the editor anyway does a subpar job handling our tabs. However, on the upside every user can choose whatever tab-width he/she prefers. If "smart-tabs" are used properly (like we do), every tab-width will work. No manual changes, just ran commands: F=($(git grep -l -e '-\*-')) sed '1 { /\/\* *-\*- *[mM]ode.*\*\/$/d }' -i "${F[@]}" sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}" Check remaining lines with: git grep -e '-\*-' The ultimate purpose of this is to cleanup our files and eventually use SPDX license identifiers. For that, first get rid of the boilerplate lines.
2018-12-13supplicant: Add methods to start/stop a P2P Find operationBenjamin Berg1-0/+4
The timeout is limited to be in the range of 1-600s. This is arbitrary, but the point is that a timeout of 0 is not permitted to prevent a client from making us run a find continuously simply by forgetting to call the stop method.
2018-12-13supplicant: Add API to join/cancel/disconnect a P2P GroupBenjamin Berg1-0/+7
2018-12-13supplicant: Export group path of active groupBenjamin Berg1-0/+3
This can be used to check whether a peer is joined to our group.
2018-12-13supplicant: Track P2P Group information, creation and destructionBenjamin Berg1-0/+9
Add basic tracking of P2P group information and the creation and destruction of them.
2018-12-13supplicant: Allow creating an interface from object pathBenjamin Berg1-0/+2
wpa_supplicant will create a new interface for P2P devices. In this case we need to fetch the supplicant interface using the object path and then fetch the interface name via dbus to setup the IP interface of the P2P device later.
2018-12-13supplicant: Monitor existance of P2P Peers foundBenjamin Berg1-0/+2
2018-12-13supplicant: Connect to P2PDevice supplicant interfaceBenjamin Berg1-0/+1
The wpa_supplicant interface has a P2PDevice when P2P is supported. Create a proxy for this and wait for it to be ready before marking the interface as ready.
2018-12-13supplicant: Detect P2P and WFD supportBenjamin Berg1-1/+13
Add detection for P2P and WFD support in wpa_supplicant and pass the information to the NMSupplicantInterface.
2018-08-22wifi: use GBytes for ssids scan listThomas Haller1-1/+3
Use GBytes instead of GBytesArray. GBytes is immutable and can be shared. It is also the type that we natively get from nm_setting_wireless_get_ssid(). This way we avoid some conversions.
2018-06-15wifi: expose LastScan as milliseconds not secondsLubomir Rintel1-1/+1
This doesn't wrap around in 68 years of uptime and is consistent with o.fd.NM.Checkpoint.Created.
2018-01-16supplicant: enable FILS only when wpa_supplicant supports itMasashi Honma1-1/+7
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2017-05-15supplicant-interface: add support for WPS enrollmentLubomir Rintel1-1/+10
2017-04-28supplicant: configure PMF for each connectionBeniamino Galvani1-0/+1
Now that we have a PMF connection property, get rid of the previous code to globally enable/disable PMF and use the 'ieee80211w' configuration option for each configured network when the supplicant supports it.
2017-04-15supplicant: enable PMF only when wpa_supplicant supports itBeniamino Galvani1-1/+5
2017-02-17supplicant: merge NEW_BSS signal with BSS_UPDATEDThomas Haller1-1/+0
Before, the NEW_BSS signal was not careful to emit the signal only when the BSS is seen for the first time. Consequently, supplicant_iface_new_bss_cb() checked whether it already knows about the new BSS. Merge NEW_BSS and BSS_UPDATED. Now we emit BSS_UPDATED when either the BSS is new or changed. Also, in supplicant_iface_new_bss_cb() (now supplicant_iface_bss_updated_cb()) no longer constructs an @ap instance if we have a @found_ap. In some situations there can be a value of having a separate ADD signal. But only when there the consumers care, and if the consumers can trust that ADD is not just an UPDATE. The only consumer doesn't care and it not not be trusted, so merge the signals.
2017-02-17supplicant: remove unused return value from ↵Thomas Haller1-1/+1
nm_supplicant_interface_request_scan() It cannot fail, remove code that anticipates a failure of request-scan.
2017-02-17supplicant: rework nm_supplicant_interface_set_config() to invoke result ↵Thomas Haller1-4/+9
callback Instead of having a NM_SUPPLICANT_INTERFACE_CONNECTION_ERROR signal to notify about failures during AddNetwork/SelectNetwork, accept a callback to report success/failure. Thereby, rename nm_supplicant_interface_set_config() to nm_supplicant_interface_assoc(). The async callback is guaranteed to: - be invoked exactly once, signalling success or failure - always being invoked asyncronously. The pending request can be (synchronously) cancelled via nm_supplicant_interface_disconnect() or by disposing the interface instance. In those cases the callback will be invoked too, with error code cancelled/disposing.
2017-02-14wifi: introduce enum type NMSupplicantInterfaceState instead of plain intThomas Haller1-5/+5
Also change the signature of the NM_SUPPLICANT_INTERFACE_STATE signal, to have three "int" type arguments. Thereby also fix the subscribers to this signal that wrongly had type guint32, instead of guint (which happens to be the same underlying type, so no real problem). https://mail.gnome.org/archives/networkmanager-list/2017-February/msg00021.html
2017-01-18supplicant: update whether EAP-FAST is supported for existing ↵Thomas Haller1-5/+8
supplicant-interface As the fast-supported flag changes, update the existing supplicant interfaces with the new information. Also, by default assume it is supported. (cherry picked from commit 872b9ec5ea20c702ccb08eab75ca012a7aa1895f)
2017-01-16supplicant: add an enum to specify the driverBeniamino Galvani1-2/+2
With macsec we now have 3 drivers and a boolean is no longer enough.
2016-11-21build: rename "src/supplicant-manager" to "src/supplicant"Thomas Haller1-0/+122
The supplicant directory does not only contain the manager instance, but various files related to wpa-supplicant. Rename.