Add WIFI_SAP_IFACE_NO_IR state to keep same as hostapd_iface_state,
which is updated as the hostap upmerge.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
For CMD 'wifi ap status', removing HAPD related definition to make it
more commonly used for non-supplicant case.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Most users won't be interested in the per-channel rules but only in the
country code, so, add a verbose option to hiden per-channel rules which
are too verbose.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
In order to prepare for extending the options, convert to getopt long
for easier parsing of options.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
If a shell command does not have a sub command, then the 3rd parameter
to SHELL_SUBCMD_ADD() macro should be set to NULL so that the help
will only print information specific to that command and not all
wifi commands.
Fixes#82633
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When calling wifi_ap_disable() API specific WiFi driver implementation was
checked whether 'ap_enable' was provided, instead of 'ap_disable'. Fix
that copy-paste error.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Add "bandwidth" parameter to "wifi ap enable" command.
Add "ht_capab" and "vht_capab" parameters to "wifi ap config" command.
Signed-off-by: Gang Li <gang.li_1@nxp.com>
k_fifo_put is a macro that expands the call to net_pkt_ref(pending)
multiple times when CONFIG_TRACING is enabled thus causing extra
reference for the pending packet and a memory leak.
Fix by moving the referencing call to a separate line.
Signed-off-by: Rait Rääk <raitraak@gmail.com>
For WiFi interface, uniformly use net_if_get_wifi_sta() and
net_if_get_wifi_sap() APIs to replace net_if_get_first_wifi().
Signed-off-by: Gang Li <gang.li_1@nxp.com>
Removed implying of NVS by the NET_L2_OPENTHREAD, and from now a
platform can choose between ZMS and NVS as a settings backend.
NET_L2_OPENTHREAD still requires NVS or ZMS backend so the config
depends on one of those.
Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
With recent changes the regulatory domain is handled via the hostap
rather than by passing and going through the driver and hostap doesn't
have any option for forcing the regulatory domain, so, add a note to
reflect that this is implementation dependent to cover both hostap as
well other offloaded implementations.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
We need to drop the cloned packet that was fed to the bridge instead of
returning directly from the function. Without this change we have a
buffer leak.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If the packet cloning failed, bail out in order to avoid
null pointer access.
Fixes#81992
Coverity-CID: 434493
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Several arguments were added but have not yet been aligned with others
in the same function. Hence, use `getopt_state` to access `optarg`,
offering a better alternative to direct global access.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add EAP-TLS, EAP-PEAP-MSCHAPv2, EAP-PEAP-GTC, EAP-TTLS-MSCHAPv2,
EAP-PEAP-TLS, EAP-TLS-SHA256 enterprise wpa2 and wpa3 suiteb
support for sap.
Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
802.11 doesn't have specific constraints, it just says that listen
interval should be >=0 and it a 2 byte field.
3 as a typical DTIM value from nRF chipsets, so, remove the hardware
specific line and just set a failure.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This implements support for RFC 7217 which describes a method
to have stable IPv6 Interface Identifiers to be used with IPv6
Stateless Address Autoconfiguration (SLAAC). The stable IIDs are used
to provide enhanced privacy so that an IPv6 address configured using
this method is stable within each subnet, but the corresponding
Interface Identifier changes when the host moves from one network
to another. This method is meant to be an alternative to generating
Interface Identifiers based on hardware (MAC) addresses,
such that the benefits of stable addresses can be achieved without
sacrificing the security and privacy of users.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
* Add CONFIG_OPENTHREAD_PLATFORM_MESSAGE_MANAGEMENT to allow enabling
message management by the platform.
* Add implementation of `otPlatMessagePoolInit`, `otPlatMessagePoolNew`
and `otPlatMessagePoolFree`.
Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
If a gateway is not set for a interface,
also log the destination address.
Also print the interface index instead of the
interface pointer.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add condition check so that the 11k flag will be updated for set
operation only.
Fix print log error when getting 11k status.
Signed-off-by: Hui Bai <hui.bai@nxp.com>
Using strncpy gives this warning
warning: 'strncpy' output may be truncated copying 32 bytes from
a string of length 32 [-Wstringop-truncation]
strncpy(roaming_params.neighbor_rep.neighbor_ap[idx].bssid_info,
bssid_info,
sizeof(roaming_params.neighbor_rep.neighbor_ap->bssid_info));
There is '\0' at the end of the allocated buffer so we can safely
use memcpy() here to avoid any warnings.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure we are not able to overwrite string variables in sscanf
call. Allocate also one extra byte for null terminator character.
Fixes#80644
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Added new ops and events in glue layer to support roaming.
Added new flag WIFI_NM_WPA_SUPPLICANT_ROAMING to control roaming
feature.
Signed-off-by: Hui Bai <hui.bai@nxp.com>
Generated PEM headers need to be created before we build the WiFi shell
when WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE is enabled, so add an
explicit dependency on the app target to be certain these headers are
created
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The "wifi ap config" command uses the station interface via
net_if_get_first_wifi(), and should use the ap interface.
Signed-off-by: Gang Li <gang.li_1@nxp.com>
This patch adds a feature to directly connect to stored Wi-Fi
credentials without having to compose the NET_MGMT commands yourself.
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
Add EAP-TLS, EAP-PEAP-MSCHAPv2, EAP-PEAP-GTC, EAP-TTLS-MSCHAPv2,
EAP-PEAP-TLS, EAP-TLS-SHA256 enterprise wpa2 and wpa3 suiteb
support for station.
Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
If AP indicates the presence of buffered traffic, then it is up to the
STA to decide whether to stay in PS or come out of PS, add configuration
options that can be used at runtime to choose this.
This is tagged as "noup" because it's a backport and "fromlist" cannot
be used as it won't apply cleanly.
Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
MbedTLS specifically checks for null-terminator, else it skips PEM
format processing and tries to parse it as DER causing parsing failures.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
The 11v_btm_query shell command was calling parse_number() using
a pointer to uint8_t. This will cause memory overwrite and possible
crash. Convert to use long temporary value to avoid this.
Fix also the output prints in case of an error.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Rework the wifi-shell code so that external subcommands can be
bolted into it easily. This means that the commands should be
created using SHELL_SUBCMD_ADD().
Place the various subcommands in alphabetical order to find them
more easily.
Split long lines in order to pass CI checks.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
In case WPA supplicant disabled DPP, we need to compile out the
corresponding DPP code in Wi-Fi shell too.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
The `cmd_wifi_dpp_ap_auth_init` function was added but is not yet
aligned with others.
This update enhances consistency with the following changes:
- Unified the order of declaration for `opt`, `opt_index`,
`state`, and `long_options`.
- Wrapped lines in the `long_options` declaration to prevent them
from extending too far to the right.
- Applied `struct option` as `static const`
- Unified the wrapping of `getopt_long` calls, regardless of
the length of the `options` string.
- Using `getopt_state` to access `optarg` and also `optopt` offers
a better alternative to direct global access.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>