Commit Graph

5294 Commits

Author SHA1 Message Date
James Prestwood 11ff9adba1 test: add StationDiagnostic interface to monitor-iwd 2021-01-20 14:14:05 -06:00
James Prestwood 0ba811df3c test: add AccessPointDiagnostics to monitor-iwd 2021-01-20 14:14:01 -06:00
James Prestwood 4233e0ca3a client: add AccessPointDiagnostic interface definition 2021-01-20 14:12:17 -06:00
James Prestwood 8e03d56688 netdev: add netdev_get_all_stations
This is a nl80211 dump version of netdev_get_station aimed at
AP mode. This will dump all stations, parse into
netdev_station_info structs, and call the callback for each
individual station found. Once the dump is completed the destroy
callback is called.
2021-01-20 14:01:15 -06:00
James Prestwood 8620698b66 dbus: add AccessPointDiagnostic interface 2021-01-20 14:01:10 -06:00
James Prestwood 0b3b644c55 doc: document AccessPointDiagnostic interface 2021-01-20 13:59:38 -06:00
Alvin Šipraga 9edd941bc2 station: remove unused roam_no_orig_ap state variable
Since commit 836beb1276 removed beacon
loss handling, the roam_no_orig_ap variable has no use and is always set
to false. This commit removes it.
2021-01-20 11:14:06 -06:00
James Prestwood 1f8f209c04 client: add station diagnostic information to 'show'
The information requested with GetDiagnostics will now appear in
the "station <iface> show" command. If IWD is not connected, or
there is no diagnostic interface (older IWD version) 'show' will
behave as it always has, only showing scanning/connected.
2021-01-19 13:10:12 -06:00
James Prestwood c15cdbe753 client: add diagnostic interface definition 2021-01-19 13:10:12 -06:00
James Prestwood a17e5e0f7f station: create StationDiagnostic interface
This interface sits aside the regular station interface but
provides low level connection details for diagnostic and
testing purposes.
2021-01-14 15:02:13 -06:00
James Prestwood a0aa6fecb4 test: update get-diagnostics with Rx/TxMode 2021-01-14 15:01:27 -06:00
James Prestwood 18e48a7997 doc: add Diagnostic RxMode/TxMode attributes 2021-01-14 14:59:13 -06:00
James Prestwood 93b5a5a4ae netdev: parse expected throughput in netdev_get_station 2021-01-14 14:58:33 -06:00
James Prestwood 0ba73ec139 netdev: parse rates in netdev_get_station 2021-01-14 14:57:19 -06:00
James Prestwood 67cb8de2ef test: add a script for GetDiagnostics 2021-01-12 13:42:39 -06:00
James Prestwood 2fe20808c2 doc: update diagnostics with [optional] tags
Some elements, though unlikely, are not required to be included
with the GET_STATION call that GetDiagnostics relies on. mac80211
based drivers include most of these, but other drivers may not.
To be on the safe side all properties except ConnectedBss are now
optional and may not be included.
2021-01-12 13:39:30 -06:00
James Prestwood 08de8186c6 netdev: update RSSI polling to use station info parser 2021-01-12 13:39:14 -06:00
James Prestwood cf17d42972 netdev: add netdev_get_station/current_station
This adds a generalized API for GET_STATION. This API handles
calling and parsing the results into a new structure,
netdev_station_info. This results structure will hold any
data needed by consumers of netdev_get_station. A helper API
(netdev_get_current_station) was added as a convenience which
automatically passes handshake->aa as the MAC.

For now only the RSSI is parsed as this is already being
done for RSSI polling/events. Looking further more info will
be added such as rx/tx rates and estimated throughput.
2021-01-12 13:39:07 -06:00
James Prestwood 09b124f073 dbus: add helper for appending a dictionary
Arrays of dictionaries are quite common, and for basic
types this API makes things much more convenient by
putting all the enter/append/leave calls in one place.
2021-01-12 13:19:38 -06:00
James Prestwood 668b61ff3a dbus: add diagnostic interface definition 2021-01-11 14:51:48 -06:00
James Prestwood c3d5caec98 doc: diagnostic DBus interface definition 2021-01-11 14:22:36 -06:00
Andrew Zaborowski 9ef3d51f87 crypto: Update l_pkcs5_pbkdf2 call after rename 2021-01-07 14:05:40 -06:00
Denis Kenzior d5c364a4e4 build: Update to ell's pkcs5 restructure 2021-01-07 14:05:40 -06:00
Marcel Holtmann 355c2df97e Release 1.11 2021-01-07 00:40:45 +01:00
Marcel Holtmann bbf79bc511 build: Require at least version 0.35 when building with external ELL 2021-01-07 00:34:37 +01:00
Andrew Zaborowski 047b0e71a1 eap-tls: Dump server certificate when IWD_TLS_DEBUG set 2021-01-04 12:17:00 -06:00
Carlo Abelli d3606cd255 doc: move EnableIPv6 under Network
The EnableIPv6 option is incorrectly documented under General but should
be documented under Network instead.
2020-12-22 09:35:48 -06:00
Fabrice Fontaine 62d31539d6 configure.ac: fix static build with readline
Retrieve the dependencies of readline through pkg-config (and fallback
to -lreadline) to avoid the following build failure:

/nvme/rc-buildroot-test/scripts/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/8.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: /nvme/rc-buildroot-test/scripts/instance-0/output-1/host/bin/../x86_64-buildroot-linux-uclibc/sysroot/usr/lib/libreadline.a(display.o): in function `cr':
display.c:(.text+0x1ab): undefined reference to `tputs'

Fixes:
 - http://autobuild.buildroot.org/results/8fb1341f2f5094c346456b43b4fc04996c2e1485
2020-12-17 20:30:13 -06:00
Andrew Zaborowski f5a30a1cfc station: Don't expire BSSes between freq subset scans
Add a parameter to station_set_scan_results to allow skipping the
removal of old BSSes.  In the DBus-triggered scan only expire BSSes
after having gone through the full supported frequency set.

It should be safe to pass partial scan results to
station_set_scan_results() when not expiring BSSes so using this new
parameter I guess we could also call it for roam scan results.
2020-12-17 20:22:47 -06:00
Andrew Zaborowski e3bece76f9 station: Split DBus scans into 3 frequency subsets
A scan normally takes about 2 seconds on my dual-band wifi adapter when
connected.  The drivers will normally probe on each supported channel in
some unspecified order and will have new partial results after each step
but the kernel sends NL80211_CMD_NEW_SCAN_RESULTS only when the full
scan request finishes, and for segmented scans we will wait for all
segments to finish before calling back from scan_active() or
scan_passive().

To improve user experience define our own channel order favouring the
2.4 channels 1, 6 and 11 and probe those as an individual scan request
so we can update most our DBus org.connman.iwd.Network objects more
quickly, before continuing with 5GHz band channels, updating DBus
objects again and finally the other 2.4GHz band channels.

The overall DBus-triggered scan on my wifi adapter takes about the same
time but my measurements were not very strict, and were not very
consistent with and without this change.  With the change most Network
objects are updated after about 200ms though, meaning that I get most
of the network updates in the nm-applet UI 200ms from opening the
network list.  The 5GHz band channels take another 1 to 1.5s to scan and
remaining 2.4GHz band channels another ~300ms.

Hopefully this is similar when using other drivers although I can easily
imagine a driver that parallelizes 2.4GHz and 5GHz channel probing using
two radios, or uses 2, 4 or another number of dual-band radios to probe
2, 4, ... channels simultanously.  We'd then lose some of the
performance benefit.  The faster scan results may be worth the longer
overall scan time anyway.
I'm also assuming that the wiphy's supported frequency list is exactly
what was scanned when we passed no frequency list to
NL80211_CMD_TRIGGER_SCAN and we won't get errors for passing some
frequency that shouldn't have been scanned.
2020-12-17 20:15:37 -06:00
James Prestwood 01c108938e test-runner: Use DBus for hwsim radios
Use the hwsim DBus API rather than command line. This both is
faster and more dynamic than doing so with the command line.
This also avoids tracking the radio ID since we can just hang
on to the radio Dbus object directly.
2020-12-17 20:13:56 -06:00
James Prestwood 55e7caa8e0 auto-t: add iftype/cipher disable to hwsim.py 2020-12-17 20:13:41 -06:00
James Prestwood 5567caf64a hwsim: add iftype/cipher disabling through DBus
Update the Dbus API to allow disabling iftypes and ciphers
just as you can with the command line.
2020-12-17 20:11:25 -06:00
James Prestwood fe0879f7d1 test-runner: start hwsim always (optionally --no-register)
Always start hwsim but if tests do not need radio rules start
with the --no-register option.
2020-12-17 20:11:13 -06:00
James Prestwood e8031bab2a test-runner: add wait_for_dbus_service
Common API to wait for a DBus service to appear on the bus
2020-12-17 20:10:57 -06:00
James Prestwood 5525f32cdd auto-t: update hwsim radio create to use dictionary 2020-12-17 20:10:45 -06:00
James Prestwood 6a1853b01a hwsim: change radio Create() to take a dictionary
The Create() API was limited to only taking a Name and boolean
(for p2p enabling). The actual hwsim nl80211 API can take more
attributes than this (which are actually utilized when creating
from the command line). To get the DBus API up to the same
functionality the two arguments in Create were replaced with
a single dictionary. This allows for extending later if more
arguments are needed.
2020-12-17 20:10:33 -06:00
James Prestwood eaf176220c auto-t: fix hwsim.py to use Destroy rather than Remove
There is no Remove() method, but since this code never was used it
remained incorrect for quite some time.
2020-12-17 20:10:30 -06:00
James Prestwood 799ab03f59 hwsim: check pending_create_msg before replying
In the NEW_RADIO callback hwsim was assuming that DBus had no
yet replied to the Create() method. In some cases the NEW_RADIO
event fires before the actual callback which will respond to
DBus. This causes a crash in the create callback.
2020-12-17 20:08:54 -06:00
James Prestwood 554a78fbf0 hwsim: add --no-register option
Starts hwsim but does not register to mac80211_hwsim. This is to
allow autotests to disable hwsim, while still having the ability
to create/destroy radios over DBus.
2020-12-17 20:08:49 -06:00
Ronan Pigott 0193940e50 client: ignore control sequence length in prompt
Readline uses the characters \001 and \002 to mark the start and end
of zero-length character sequnces in the prompt before prompt
expansion. Without these characters the input point can become offset
from the visual end of the prompt when performing some actions.
2020-12-09 09:40:40 -06:00
James Prestwood fde1012f5d auto-t: add static netconfig test
Tests netconfig with a static configuration, as well as tests ACD
functionality.

The test has two IWD radios which will eventually use the same IP.
One is configured statically, one will receive the IP via DHCP.
The static client sets its IP first and begins using it. Then the
DHCP client is started. Since ACD in a DHCP client is configured
to use its address indefinitely, the static client *should* give
up its address.
2020-12-08 16:29:09 -06:00
James Prestwood f39d1b4ac2 netconfig: add ACD client for static configuration
When the IP is configured to be static we can now use ACD in
order to check that the IP is available and not already in
use. If a conflict is found netconfig will be reset and no IP
will be set on the interface. The ACD client is left with
the default 'defend once' policy, and probes are not turned
off. This will increase connection time, but for static IP's
it is the best approach.
2020-12-08 16:29:09 -06:00
James Prestwood 4e4ba6769d test-runner: add iwd-acd to verbose options
This will turn on IWD_ACD_DEBUG
2020-12-08 15:16:28 -06:00
James Prestwood ada46fb2db test-runner: set processor count for VM
For better reliability the processor count is now set to qemu.
In cases of low CPU count (< 2) hosts the processor count is
limited to 1. Otherwise half of the host cores will be used for
the VM.
2020-12-08 15:15:51 -06:00
James Prestwood d40cac403f auto-t: support IP match with no IP set
This allows an interface with no IP set to be checked for
by passing None in as the address. This will generate an
exception by ioctl which we catch.
2020-12-08 15:15:42 -06:00
James Prestwood d2cc033d09 auto-t: pass namespace on to other IWD classes
Certain classes were still using the default namespace. This
didn't matter yet since testAP was the only test using namespaces,
and the AP interface was the only one being used.

For an IWD station on a separate namespace all objects need to
be accessable, so the namespace is passed along to those as needed.
2020-12-08 15:15:39 -06:00
James Prestwood b18f843532 auto-t: add storage dir to IWD() constructor
Add support for setting a custom storage directory.
2020-12-08 15:15:36 -06:00
James Prestwood 41b8a32dfc test-runner: have start_iwd take a storage dir
Allow the storage directory (default /tmp/iwd) to be configured
just like the state directory. This is in order to support multiple
IWD instances which require separate storage directories for network
provisioning files.
2020-12-08 15:15:33 -06:00
James Prestwood 3f686da550 build: add ell/acd.{c,h} to makefile 2020-12-08 15:15:31 -06:00