summaryrefslogtreecommitdiff
path: root/src/supplicant/nm-supplicant-interface.h
AgeCommit message (Collapse)AuthorFilesLines
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.