Initial commit
This commit is contained in:
89
package/network/services/hostapd/Config.in
Normal file
89
package/network/services/hostapd/Config.in
Normal file
@@ -0,0 +1,89 @@
|
||||
# wpa_supplicant config
|
||||
config WPA_RFKILL_SUPPORT
|
||||
bool "Add rfkill support"
|
||||
depends on PACKAGE_wpa-supplicant || \
|
||||
PACKAGE_wpa-supplicant-openssl || \
|
||||
PACKAGE_wpa-supplicant-wolfssl || \
|
||||
PACKAGE_wpa-supplicant-mesh-openssl || \
|
||||
PACKAGE_wpa-supplicant-mesh-wolfssl || \
|
||||
PACKAGE_wpa-supplicant-basic || \
|
||||
PACKAGE_wpa-supplicant-mini || \
|
||||
PACKAGE_wpa-supplicant-p2p || \
|
||||
PACKAGE_wpad || \
|
||||
PACKAGE_wpad-openssl || \
|
||||
PACKAGE_wpad-wolfssl || \
|
||||
PACKAGE_wpad-basic || \
|
||||
PACKAGE_wpad-basic-openssl || \
|
||||
PACKAGE_wpad-basic-wolfssl || \
|
||||
PACKAGE_wpad-mini || \
|
||||
PACKAGE_wpad-mesh-openssl || \
|
||||
PACKAGE_wpad-mesh-wolfssl
|
||||
default n
|
||||
|
||||
config WPA_MSG_MIN_PRIORITY
|
||||
int "Minimum debug message priority"
|
||||
depends on PACKAGE_wpa-supplicant || \
|
||||
PACKAGE_wpa-supplicant-openssl || \
|
||||
PACKAGE_wpa-supplicant-wolfssl || \
|
||||
PACKAGE_wpa-supplicant-mesh-openssl || \
|
||||
PACKAGE_wpa-supplicant-mesh-wolfssl || \
|
||||
PACKAGE_wpa-supplicant-basic || \
|
||||
PACKAGE_wpa-supplicant-mini || \
|
||||
PACKAGE_wpa-supplicant-p2p || \
|
||||
PACKAGE_wpad || \
|
||||
PACKAGE_wpad-openssl || \
|
||||
PACKAGE_wpad-wolfssl || \
|
||||
PACKAGE_wpad-basic || \
|
||||
PACKAGE_wpad-basic-openssl || \
|
||||
PACKAGE_wpad-basic-wolfssl || \
|
||||
PACKAGE_wpad-mini || \
|
||||
PACKAGE_wpad-mesh-openssl || \
|
||||
PACKAGE_wpad-mesh-wolfssl
|
||||
default 3
|
||||
help
|
||||
Useful values are:
|
||||
0 = all messages
|
||||
1 = raw message dumps
|
||||
2 = most debugging messages
|
||||
3 = info messages
|
||||
4 = warnings
|
||||
5 = errors
|
||||
|
||||
config WPA_WOLFSSL
|
||||
bool
|
||||
default PACKAGE_wpa-supplicant-wolfssl ||\
|
||||
PACKAGE_wpad-wolfssl ||\
|
||||
PACKAGE_wpad-basic-wolfssl || \
|
||||
PACKAGE_wpad-mesh-wolfssl ||\
|
||||
PACKAGE_eapol-test-wolfssl
|
||||
select WOLFSSL_HAS_AES_CCM
|
||||
select WOLFSSL_HAS_ARC4
|
||||
select WOLFSSL_HAS_DH
|
||||
select WOLFSSL_HAS_OCSP
|
||||
select WOLFSSL_HAS_SESSION_TICKET
|
||||
select WOLFSSL_HAS_WPAS
|
||||
|
||||
config DRIVER_WEXT_SUPPORT
|
||||
bool
|
||||
default n
|
||||
|
||||
config DRIVER_11N_SUPPORT
|
||||
bool
|
||||
default n
|
||||
|
||||
config DRIVER_11AC_SUPPORT
|
||||
bool
|
||||
default n
|
||||
|
||||
config DRIVER_11AX_SUPPORT
|
||||
bool
|
||||
default n
|
||||
|
||||
config WPA_ENABLE_WEP
|
||||
bool "Enable support for unsecure and obsolete WEP"
|
||||
help
|
||||
Wired equivalent privacy (WEP) is an obsolete cryptographic data
|
||||
confidentiality algorithm that is not considered secure. It should not be used
|
||||
for anything anymore. The functionality needed to use WEP is available in the
|
||||
current hostapd release under this optional build parameter and completely
|
||||
removed in a future release.
|
||||
709
package/network/services/hostapd/Makefile
Normal file
709
package/network/services/hostapd/Makefile
Normal file
@@ -0,0 +1,709 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2006-2021 OpenWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostapd
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2021-05-22
|
||||
PKG_SOURCE_VERSION:=b102f19bcc53c7f7db3951424d4d46709b4f1986
|
||||
PKG_MIRROR_HASH:=cb3cb968883042fc582752be1607586696c18e6ecf9808c9a8ac50e204584367
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_CPE_ID:=cpe:/a:w1.fi:hostapd
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_ASLR_PIE_REGULAR:=1
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_kmod-ath9k \
|
||||
CONFIG_PACKAGE_kmod-cfg80211 \
|
||||
CONFIG_PACKAGE_hostapd \
|
||||
CONFIG_PACKAGE_hostapd-basic \
|
||||
CONFIG_PACKAGE_hostapd-mini \
|
||||
CONFIG_WPA_RFKILL_SUPPORT \
|
||||
CONFIG_DRIVER_WEXT_SUPPORT \
|
||||
CONFIG_DRIVER_11N_SUPPORT \
|
||||
CONFIG_DRIVER_11AC_SUPPORT \
|
||||
CONFIG_DRIVER_11AX_SUPPORT \
|
||||
CONFIG_WPA_ENABLE_WEP
|
||||
|
||||
EAPOL_TEST_PROVIDERS:=eapol-test eapol-test-openssl eapol-test-wolfssl
|
||||
|
||||
SUPPLICANT_PROVIDERS:=
|
||||
HOSTAPD_PROVIDERS:=
|
||||
|
||||
LOCAL_TYPE=$(strip \
|
||||
$(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \
|
||||
$(if $(findstring supplicant,$(BUILD_VARIANT)),supplicant, \
|
||||
hostapd \
|
||||
)))
|
||||
|
||||
LOCAL_AND_LIB_VARIANT=$(patsubst hostapd-%,%,\
|
||||
$(patsubst wpad-%,%,\
|
||||
$(patsubst supplicant-%,%,\
|
||||
$(BUILD_VARIANT)\
|
||||
)))
|
||||
|
||||
LOCAL_VARIANT=$(patsubst %-internal,%,\
|
||||
$(patsubst %-openssl,%,\
|
||||
$(patsubst %-wolfssl,%,\
|
||||
$(LOCAL_AND_LIB_VARIANT)\
|
||||
)))
|
||||
|
||||
SSL_VARIANT=$(strip \
|
||||
$(if $(findstring openssl,$(LOCAL_AND_LIB_VARIANT)),openssl,\
|
||||
$(if $(findstring wolfssl,$(LOCAL_AND_LIB_VARIANT)),wolfssl,\
|
||||
internal\
|
||||
)))
|
||||
|
||||
CONFIG_VARIANT:=$(LOCAL_VARIANT)
|
||||
ifeq ($(LOCAL_VARIANT),mesh)
|
||||
CONFIG_VARIANT:=full
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)
|
||||
|
||||
|
||||
ifneq ($(CONFIG_DRIVER_11N_SUPPORT),)
|
||||
HOSTAPD_IEEE80211N:=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DRIVER_11AC_SUPPORT),)
|
||||
HOSTAPD_IEEE80211AC:=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DRIVER_11AX_SUPPORT),)
|
||||
HOSTAPD_IEEE80211AX:=y
|
||||
endif
|
||||
|
||||
DRIVER_MAKEOPTS= \
|
||||
CONFIG_ACS=$(CONFIG_PACKAGE_kmod-cfg80211) \
|
||||
CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-cfg80211) \
|
||||
CONFIG_IEEE80211N=$(HOSTAPD_IEEE80211N) \
|
||||
CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \
|
||||
CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \
|
||||
CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \
|
||||
|
||||
ifeq ($(SSL_VARIANT),openssl)
|
||||
DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y
|
||||
TARGET_LDFLAGS += -lcrypto -lssl
|
||||
|
||||
ifeq ($(LOCAL_VARIANT),basic)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),mesh)
|
||||
DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),full)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SSL_VARIANT),wolfssl)
|
||||
DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_SAE=y
|
||||
TARGET_LDFLAGS += -lwolfssl
|
||||
|
||||
ifeq ($(LOCAL_VARIANT),basic)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),mesh)
|
||||
DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),full)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(LOCAL_TYPE),hostapd)
|
||||
ifdef CONFIG_WPA_RFKILL_SUPPORT
|
||||
DRIVER_MAKEOPTS += NEED_RFKILL=y
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_USE_GLIBC
|
||||
TARGET_LDFLAGS += -lrt
|
||||
TARGET_LDFLAGS_C += -lrt
|
||||
endif
|
||||
|
||||
DRV_DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny
|
||||
|
||||
|
||||
define Package/hostapd/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=IEEE 802.1x Authenticator
|
||||
URL:=http://hostap.epitest.fi/
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus
|
||||
USERID:=network=101:network=101
|
||||
PROVIDES:=hostapd
|
||||
CONFLICTS:=$(HOSTAPD_PROVIDERS)
|
||||
HOSTAPD_PROVIDERS+=$(1)
|
||||
endef
|
||||
|
||||
define Package/hostapd
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=full-internal
|
||||
endef
|
||||
|
||||
define Package/hostapd/description
|
||||
This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
|
||||
Authenticator.
|
||||
endef
|
||||
|
||||
define Package/hostapd-openssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=full-openssl
|
||||
DEPENDS+=+libopenssl
|
||||
endef
|
||||
|
||||
Package/hostapd-openssl/description = $(Package/hostapd/description)
|
||||
|
||||
define Package/hostapd-wolfssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=full-wolfssl
|
||||
DEPENDS+=+libwolfssl
|
||||
endef
|
||||
|
||||
Package/hostapd-wolfssl/description = $(Package/hostapd/description)
|
||||
|
||||
define Package/hostapd-basic
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r, 11w)
|
||||
VARIANT:=basic
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-openssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r and 11w)
|
||||
VARIANT:=basic-openssl
|
||||
DEPENDS+=+libopenssl
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-openssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-wolfssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r and 11w)
|
||||
VARIANT:=basic-wolfssl
|
||||
DEPENDS+=+libwolfssl
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-wolfssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-mini
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK only)
|
||||
VARIANT:=mini
|
||||
endef
|
||||
|
||||
define Package/hostapd-mini/description
|
||||
This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only).
|
||||
endef
|
||||
|
||||
|
||||
define Package/wpad/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=IEEE 802.1x Auth/Supplicant
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus
|
||||
USERID:=network=101:network=101
|
||||
URL:=http://hostap.epitest.fi/
|
||||
PROVIDES:=hostapd wpa-supplicant
|
||||
CONFLICTS:=$(HOSTAPD_PROVIDERS) $(SUPPLICANT_PROVIDERS)
|
||||
HOSTAPD_PROVIDERS+=$(1)
|
||||
SUPPLICANT_PROVIDERS+=$(1)
|
||||
endef
|
||||
|
||||
define Package/wpad
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=wpad-full-internal
|
||||
endef
|
||||
|
||||
define Package/wpad/description
|
||||
This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
|
||||
Authenticator and Supplicant
|
||||
endef
|
||||
|
||||
define Package/wpad-openssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=wpad-full-openssl
|
||||
DEPENDS+=+libopenssl
|
||||
endef
|
||||
|
||||
Package/wpad-openssl/description = $(Package/wpad/description)
|
||||
|
||||
define Package/wpad-wolfssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=wpad-full-wolfssl
|
||||
DEPENDS+=+libwolfssl
|
||||
endef
|
||||
|
||||
Package/wpad-wolfssl/description = $(Package/wpad/description)
|
||||
|
||||
define Package/wpad-basic
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r, 11w)
|
||||
VARIANT:=wpad-basic
|
||||
endef
|
||||
|
||||
define Package/wpad-basic/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-openssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (OpenSSL, 11r, 11w)
|
||||
VARIANT:=wpad-basic-openssl
|
||||
DEPENDS+=+libopenssl
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-openssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-wolfssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (wolfSSL, 11r, 11w)
|
||||
VARIANT:=wpad-basic-wolfssl
|
||||
DEPENDS+=+libwolfssl
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-wolfssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/wpad-mini
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (WPA-PSK only)
|
||||
VARIANT:=wpad-mini
|
||||
endef
|
||||
|
||||
define Package/wpad-mini/description
|
||||
This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (WPA-PSK only).
|
||||
endef
|
||||
|
||||
define Package/wpad-mesh
|
||||
$(call Package/wpad/Default,$(1))
|
||||
DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
|
||||
PROVIDES+=wpa-supplicant-mesh wpad-mesh
|
||||
endef
|
||||
|
||||
define Package/wpad-mesh/description
|
||||
This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (with 802.11s mesh and SAE support).
|
||||
endef
|
||||
|
||||
define Package/wpad-mesh-openssl
|
||||
$(call Package/wpad-mesh,$(1))
|
||||
TITLE+= (OpenSSL, 11s, SAE)
|
||||
DEPENDS+=+libopenssl
|
||||
VARIANT:=wpad-mesh-openssl
|
||||
endef
|
||||
|
||||
Package/wpad-mesh-openssl/description = $(Package/wpad-mesh/description)
|
||||
|
||||
define Package/wpad-mesh-wolfssl
|
||||
$(call Package/wpad-mesh,$(1))
|
||||
TITLE+= (wolfSSL, 11s, SAE)
|
||||
DEPENDS+=+libwolfssl
|
||||
VARIANT:=wpad-mesh-wolfssl
|
||||
endef
|
||||
|
||||
Package/wpad-mesh-wolfssl/description = $(Package/wpad-mesh/description)
|
||||
|
||||
|
||||
define Package/wpa-supplicant/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=WPA Supplicant
|
||||
URL:=http://hostap.epitest.fi/wpa_supplicant/
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus
|
||||
USERID:=network=101:network=101
|
||||
PROVIDES:=wpa-supplicant
|
||||
CONFLICTS:=$(SUPPLICANT_PROVIDERS)
|
||||
SUPPLICANT_PROVIDERS+=$(1)
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=supplicant-full-internal
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-openssl
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=supplicant-full-openssl
|
||||
DEPENDS+=+libopenssl
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-wolfssl
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=supplicant-full-wolfssl
|
||||
DEPENDS+=+libwolfssl
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-p2p
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (Wi-Fi P2P support)
|
||||
DEPENDS+=@PACKAGE_kmod-cfg80211
|
||||
VARIANT:=supplicant-p2p-internal
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh/Default
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
|
||||
PROVIDES+=wpa-supplicant-mesh
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh-openssl
|
||||
$(call Package/wpa-supplicant-mesh/Default,$(1))
|
||||
TITLE+= (OpenSSL, 11s, SAE)
|
||||
VARIANT:=supplicant-mesh-openssl
|
||||
DEPENDS+=+libopenssl
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh-wolfssl
|
||||
$(call Package/wpa-supplicant-mesh/Default,$(1))
|
||||
TITLE+= (wolfSSL, 11s, SAE)
|
||||
VARIANT:=supplicant-mesh-wolfssl
|
||||
DEPENDS+=+libwolfssl
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-basic
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (11r, 11w)
|
||||
VARIANT:=supplicant-basic
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mini
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (minimal)
|
||||
VARIANT:=supplicant-mini
|
||||
endef
|
||||
|
||||
|
||||
define Package/hostapd-common
|
||||
TITLE:=hostapd/wpa_supplicant common support files
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
endef
|
||||
|
||||
define Package/hostapd-utils
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=IEEE 802.1x Authenticator (utils)
|
||||
URL:=http://hostap.epitest.fi/
|
||||
DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(HOSTAPD_PROVIDERS),PACKAGE_$(pkg)))
|
||||
endef
|
||||
|
||||
define Package/hostapd-utils/description
|
||||
This package contains a command line utility to control the
|
||||
IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
|
||||
endef
|
||||
|
||||
define Package/wpa-cli
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(SUPPLICANT_PROVIDERS),PACKAGE_$(pkg)))
|
||||
TITLE:=WPA Supplicant command line control utility
|
||||
endef
|
||||
|
||||
define Package/eapol-test/Default
|
||||
TITLE:=802.1x auth test utility
|
||||
SECTION:=net
|
||||
SUBMENU:=WirelessAPD
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=$(DRV_DEPENDS) +libubus
|
||||
endef
|
||||
|
||||
define Package/eapol-test
|
||||
$(call Package/eapol-test/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=supplicant-full-internal
|
||||
endef
|
||||
|
||||
define Package/eapol-test-openssl
|
||||
$(call Package/eapol-test/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=supplicant-full-openssl
|
||||
CONFLICTS:=$(filter-out eapol-test-openssl ,$(EAPOL_TEST_PROVIDERS))
|
||||
DEPENDS+=+libopenssl
|
||||
PROVIDES:=eapol-test
|
||||
endef
|
||||
|
||||
define Package/eapol-test-wolfssl
|
||||
$(call Package/eapol-test/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=supplicant-full-wolfssl
|
||||
CONFLICTS:=$(filter-out eapol-test-openssl ,$(filter-out eapol-test-wolfssl ,$(EAPOL_TEST_PROVIDERS)))
|
||||
DEPENDS+=+libwolfssl
|
||||
PROVIDES:=eapol-test
|
||||
endef
|
||||
|
||||
|
||||
ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
|
||||
define Build/Configure/rebuild
|
||||
$(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.a | $(XARGS) rm -f
|
||||
rm -f $(PKG_BUILD_DIR)/hostapd/hostapd
|
||||
rm -f $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant
|
||||
rm -f $(PKG_BUILD_DIR)/.config_*
|
||||
touch $(subst .configured_,.config_,$(STAMP_CONFIGURED))
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/Configure
|
||||
$(Build/Configure/rebuild)
|
||||
$(if $(wildcard ./files/hostapd-$(CONFIG_VARIANT).config), \
|
||||
$(CP) ./files/hostapd-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config \
|
||||
)
|
||||
$(if $(wildcard ./files/wpa_supplicant-$(CONFIG_VARIANT).config), \
|
||||
$(CP) ./files/wpa_supplicant-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config
|
||||
)
|
||||
endef
|
||||
|
||||
TARGET_CPPFLAGS := \
|
||||
-I$(STAGING_DIR)/usr/include/libnl-tiny \
|
||||
-I$(PKG_BUILD_DIR)/src/crypto \
|
||||
$(TARGET_CPPFLAGS) \
|
||||
-DCONFIG_LIBNL20 \
|
||||
-D_GNU_SOURCE \
|
||||
$(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY))
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver -fuse-linker-plugin -lubox -lubus
|
||||
|
||||
ifdef CONFIG_PACKAGE_kmod-cfg80211
|
||||
TARGET_LDFLAGS += -lm -lnl-tiny
|
||||
endif
|
||||
|
||||
ifdef CONFIG_WPA_ENABLE_WEP
|
||||
DRIVER_MAKEOPTS += CONFIG_WEP=y
|
||||
endif
|
||||
|
||||
define Build/RunMake
|
||||
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
|
||||
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(1) \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
$(DRIVER_MAKEOPTS) \
|
||||
LIBS="$(TARGET_LDFLAGS)" \
|
||||
LIBS_c="$(TARGET_LDFLAGS_C)" \
|
||||
AR="$(TARGET_CROSS)gcc-ar" \
|
||||
BCHECK= \
|
||||
$(if $(findstring s,$(OPENWRT_VERBOSE)),V=1) \
|
||||
$(2)
|
||||
endef
|
||||
|
||||
define Build/Compile/wpad
|
||||
echo ` \
|
||||
$(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
|
||||
$(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
|
||||
sed -e 's,-n ,,g' -e 's^$(TARGET_CFLAGS)^^' \
|
||||
` > $(PKG_BUILD_DIR)/.cflags
|
||||
sed -i 's/"/\\"/g' $(PKG_BUILD_DIR)/.cflags
|
||||
+$(call Build/RunMake,hostapd, \
|
||||
CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
|
||||
MULTICALL=1 \
|
||||
hostapd_cli hostapd_multi.a \
|
||||
)
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
|
||||
MULTICALL=1 \
|
||||
wpa_cli wpa_supplicant_multi.a \
|
||||
)
|
||||
+export MAKEFLAGS="$(MAKE_JOBSERVER)"; $(TARGET_CC) -o $(PKG_BUILD_DIR)/wpad \
|
||||
$(TARGET_CFLAGS) \
|
||||
./files/multicall.c \
|
||||
$(PKG_BUILD_DIR)/hostapd/hostapd_multi.a \
|
||||
$(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant_multi.a \
|
||||
$(TARGET_LDFLAGS)
|
||||
endef
|
||||
|
||||
define Build/Compile/hostapd
|
||||
+$(call Build/RunMake,hostapd, \
|
||||
hostapd hostapd_cli \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
wpa_cli wpa_supplicant \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant-full-internal
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
eapol_test \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant-full-openssl
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
eapol_test \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant-full-wolfssl
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
eapol_test \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(Build/Compile/$(LOCAL_TYPE))
|
||||
$(Build/Compile/$(BUILD_VARIANT))
|
||||
endef
|
||||
|
||||
define Install/hostapd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
define Install/supplicant
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
define Package/hostapd-common/install
|
||||
$(INSTALL_DIR) $(1)/etc/capabilities $(1)/etc/rc.button $(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d $(1)/lib/netifd $(1)/usr/share/acl.d
|
||||
$(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/netifd/hostapd.sh
|
||||
$(INSTALL_BIN) ./files/wpad.init $(1)/etc/init.d/wpad
|
||||
$(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps
|
||||
$(INSTALL_DATA) ./files/wpad_acl.json $(1)/usr/share/acl.d
|
||||
$(INSTALL_DATA) ./files/wpad.json $(1)/etc/capabilities
|
||||
endef
|
||||
|
||||
define Package/hostapd/install
|
||||
$(call Install/hostapd,$(1))
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/
|
||||
endef
|
||||
Package/hostapd-basic/install = $(Package/hostapd/install)
|
||||
Package/hostapd-basic-openssl/install = $(Package/hostapd/install)
|
||||
Package/hostapd-basic-wolfssl/install = $(Package/hostapd/install)
|
||||
Package/hostapd-mini/install = $(Package/hostapd/install)
|
||||
Package/hostapd-openssl/install = $(Package/hostapd/install)
|
||||
Package/hostapd-wolfssl/install = $(Package/hostapd/install)
|
||||
|
||||
ifneq ($(LOCAL_TYPE),supplicant)
|
||||
define Package/hostapd-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/wpad/install
|
||||
$(call Install/hostapd,$(1))
|
||||
$(call Install/supplicant,$(1))
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wpad $(1)/usr/sbin/
|
||||
$(LN) wpad $(1)/usr/sbin/hostapd
|
||||
$(LN) wpad $(1)/usr/sbin/wpa_supplicant
|
||||
endef
|
||||
Package/wpad-basic/install = $(Package/wpad/install)
|
||||
Package/wpad-basic-openssl/install = $(Package/wpad/install)
|
||||
Package/wpad-basic-wolfssl/install = $(Package/wpad/install)
|
||||
Package/wpad-mini/install = $(Package/wpad/install)
|
||||
Package/wpad-openssl/install = $(Package/wpad/install)
|
||||
Package/wpad-wolfssl/install = $(Package/wpad/install)
|
||||
Package/wpad-mesh-openssl/install = $(Package/wpad/install)
|
||||
Package/wpad-mesh-wolfssl/install = $(Package/wpad/install)
|
||||
|
||||
define Package/wpa-supplicant/install
|
||||
$(call Install/supplicant,$(1))
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant $(1)/usr/sbin/
|
||||
endef
|
||||
Package/wpa-supplicant-basic/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mini/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-p2p/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-openssl/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-wolfssl/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mesh-openssl/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mesh-wolfssl/install = $(Package/wpa-supplicant/install)
|
||||
|
||||
ifneq ($(LOCAL_TYPE),hostapd)
|
||||
define Package/wpa-cli/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_cli $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),supplicant-full-internal)
|
||||
define Package/eapol-test/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),supplicant-full-openssl)
|
||||
define Package/eapol-test-openssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),supplicant-full-wolfssl)
|
||||
define Package/eapol-test-wolfssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,hostapd))
|
||||
$(eval $(call BuildPackage,hostapd-basic))
|
||||
$(eval $(call BuildPackage,hostapd-basic-openssl))
|
||||
$(eval $(call BuildPackage,hostapd-basic-wolfssl))
|
||||
$(eval $(call BuildPackage,hostapd-mini))
|
||||
$(eval $(call BuildPackage,hostapd-openssl))
|
||||
$(eval $(call BuildPackage,hostapd-wolfssl))
|
||||
$(eval $(call BuildPackage,wpad))
|
||||
$(eval $(call BuildPackage,wpad-mesh-openssl))
|
||||
$(eval $(call BuildPackage,wpad-mesh-wolfssl))
|
||||
$(eval $(call BuildPackage,wpad-basic))
|
||||
$(eval $(call BuildPackage,wpad-basic-openssl))
|
||||
$(eval $(call BuildPackage,wpad-basic-wolfssl))
|
||||
$(eval $(call BuildPackage,wpad-mini))
|
||||
$(eval $(call BuildPackage,wpad-openssl))
|
||||
$(eval $(call BuildPackage,wpad-wolfssl))
|
||||
$(eval $(call BuildPackage,wpa-supplicant))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-mesh-openssl))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-mesh-wolfssl))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-basic))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-mini))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-p2p))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-openssl))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-wolfssl))
|
||||
$(eval $(call BuildPackage,wpa-cli))
|
||||
$(eval $(call BuildPackage,hostapd-utils))
|
||||
$(eval $(call BuildPackage,hostapd-common))
|
||||
$(eval $(call BuildPackage,eapol-test))
|
||||
$(eval $(call BuildPackage,eapol-test-openssl))
|
||||
$(eval $(call BuildPackage,eapol-test-wolfssl))
|
||||
404
package/network/services/hostapd/files/hostapd-basic.config
Normal file
404
package/network/services/hostapd/files/hostapd-basic.config
Normal file
@@ -0,0 +1,404 @@
|
||||
# Example hostapd build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# hostapd binary. All lines starting with # are ignored. Configuration option
|
||||
# lines must be commented out complete, if they are not to be included, i.e.,
|
||||
# just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cass, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
# Driver interface for Host AP driver
|
||||
#CONFIG_DRIVER_HOSTAP=y
|
||||
|
||||
# Driver interface for wired authenticator
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for no driver (e.g., RADIUS server only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# IEEE 802.11F/IAPP
|
||||
#CONFIG_IAPP=y
|
||||
|
||||
# WPA2/IEEE 802.11i RSN pre-authentication
|
||||
CONFIG_RSN_PREAUTH=y
|
||||
|
||||
# IEEE 802.11w (management frame protection)
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
#CONFIG_OCV=y
|
||||
|
||||
# Integrated EAP server
|
||||
#CONFIG_EAP=y
|
||||
|
||||
# EAP Re-authentication Protocol (ERP) in integrated EAP server
|
||||
#CONFIG_ERP=y
|
||||
|
||||
# EAP-MD5 for the integrated EAP server
|
||||
#CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-TLS for the integrated EAP server
|
||||
#CONFIG_EAP_TLS=y
|
||||
|
||||
# EAP-MSCHAPv2 for the integrated EAP server
|
||||
#CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-PEAP for the integrated EAP server
|
||||
#CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-GTC for the integrated EAP server
|
||||
#CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-TTLS for the integrated EAP server
|
||||
#CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-SIM for the integrated EAP server
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# EAP-AKA for the integrated EAP server
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' for the integrated EAP server
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# EAP-PAX for the integrated EAP server
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd for the integrated EAP server (secure authentication with a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-SAKE for the integrated EAP server
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK for the integrated EAP server
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-FAST for the integrated EAP server
|
||||
#CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP for the integrated EAP server
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
#CONFIG_WPS=y
|
||||
# Enable UPnP support for external WPS Registrars
|
||||
#CONFIG_WPS_UPNP=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# Trusted Network Connect (EAP-TNC)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# EAP-EKE for the integrated EAP server
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
#CONFIG_PKCS12=y
|
||||
|
||||
# RADIUS authentication server. This provides access to the integrated EAP
|
||||
# server from external hosts using RADIUS.
|
||||
#CONFIG_RADIUS_SERVER=y
|
||||
|
||||
# Build IPv6 support for RADIUS operations
|
||||
#CONFIG_IPV6=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition)
|
||||
CONFIG_IEEE80211R=y
|
||||
|
||||
# Use the hostapd's IEEE 802.11 authentication (ACL), but without
|
||||
# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211)
|
||||
#CONFIG_DRIVER_RADIUS_ACL=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support
|
||||
CONFIG_IEEE80211N=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
#CONFIG_WNM=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support
|
||||
CONFIG_IEEE80211AC=y
|
||||
|
||||
# IEEE 802.11ax HE support
|
||||
# Note: This is experimental and work in progress. The definitions are still
|
||||
# subject to change and this should not be expected to interoperate with the
|
||||
# final IEEE 802.11ax version.
|
||||
#CONFIG_IEEE80211AX=y
|
||||
|
||||
# Remove debugging code that is printing out debug messages to stdout.
|
||||
# This can be used to reduce the size of the hostapd considerably if debugging
|
||||
# code is not needed.
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Add support for writing debug log to a file: -f /tmp/hostapd.log
|
||||
# Disabled by default.
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Remove support for RADIUS accounting
|
||||
CONFIG_NO_ACCOUNTING=y
|
||||
|
||||
# Remove support for RADIUS
|
||||
CONFIG_NO_RADIUS=y
|
||||
|
||||
# Remove support for VLANs
|
||||
#CONFIG_NO_VLAN=y
|
||||
|
||||
# Enable support for fully dynamic VLANs. This enables hostapd to
|
||||
# automatically create bridge and VLAN interfaces if necessary.
|
||||
#CONFIG_FULL_DYNAMIC_VLAN=y
|
||||
|
||||
# Use netlink-based kernel API for VLAN operations instead of ioctl()
|
||||
# Note: This requires libnl 3.1 or newer.
|
||||
#CONFIG_VLAN_NETLINK=y
|
||||
|
||||
# Remove support for dumping internal state through control interface commands
|
||||
# This can be used to reduce binary size at the cost of disabling a debugging
|
||||
# option.
|
||||
CONFIG_NO_DUMP_STATE=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# hostapd depends on strong random number generation being available from the
|
||||
# operating system. os_get_random() function is used to fetch random data when
|
||||
# needed, e.g., for key generation. On Linux and BSD systems, this works by
|
||||
# reading /dev/urandom. It should be noted that the OS entropy pool needs to be
|
||||
# properly initialized before hostapd is started. This is important especially
|
||||
# on embedded devices that do not have a hardware random number generator and
|
||||
# may by default start up with minimal entropy available for random number
|
||||
# generation.
|
||||
#
|
||||
# As a safety net, hostapd is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data
|
||||
# fetched from the OS. This by itself is not considered to be very strong, but
|
||||
# it may help in cases where the system pool is not initialized properly.
|
||||
# However, it is very strongly recommended that the system pool is initialized
|
||||
# with enough entropy either by using hardware assisted random number
|
||||
# generator or by storing state over device reboots.
|
||||
#
|
||||
# hostapd can be configured to maintain its own entropy store over restarts to
|
||||
# enhance random number generation. This is not perfect, but it is much more
|
||||
# secure than using the same sequence of random numbers after every reboot.
|
||||
# This can be enabled with -e<entropy file> command line option. The specified
|
||||
# file needs to be readable and writable by hostapd.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal hostapd random pool can be disabled.
|
||||
# This will save some in binary size and CPU use. However, this should only be
|
||||
# considered for builds that are known to be used on devices that meet the
|
||||
# requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used.
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms.
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
#CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks.
|
||||
#CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
#CONFIG_HS20=y
|
||||
|
||||
# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file
|
||||
#CONFIG_SQLITE=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# Testing options
|
||||
# This can be used to enable some testing options (see also the example
|
||||
# configuration file) that are really useful only for testing clients that
|
||||
# connect to this hostapd. These options allow, for example, to drop a
|
||||
# certain percentage of probe requests or auth/(re)assoc frames.
|
||||
#
|
||||
#CONFIG_TESTING_OPTIONS=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow hostapd to pick the channel automatically when channel is set
|
||||
# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# You can customize the ACS survey algorithm with the hostapd.conf variable
|
||||
# acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Multiband Operation support
|
||||
# These extentions facilitate efficient use of multiple frequency bands
|
||||
# available to the AP and the devices that may associate with it.
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Client Taxonomy
|
||||
# Has the AP retain the Probe Request and (Re)Association Request frames from
|
||||
# a client, from which a signature can be produced which can identify the model
|
||||
# of client device like "Nexus 6P" or "iPhone 5s".
|
||||
#CONFIG_TAXONOMY=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Include internal line edit mode in hostapd_cli. This can be used to provide
|
||||
# limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Airtime policy support
|
||||
CONFIG_AIRTIME_POLICY=y
|
||||
|
||||
# Proxy ARP support
|
||||
#CONFIG_PROXYARP=y
|
||||
|
||||
# Override default value for the wpa_disable_eapol_key_retries configuration
|
||||
# parameter. See that parameter in hostapd.conf for more details.
|
||||
#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
#CONFIG_CTRL_IFACE_MIB=y
|
||||
404
package/network/services/hostapd/files/hostapd-full.config
Normal file
404
package/network/services/hostapd/files/hostapd-full.config
Normal file
@@ -0,0 +1,404 @@
|
||||
# Example hostapd build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# hostapd binary. All lines starting with # are ignored. Configuration option
|
||||
# lines must be commented out complete, if they are not to be included, i.e.,
|
||||
# just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cass, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
# Driver interface for Host AP driver
|
||||
#CONFIG_DRIVER_HOSTAP=y
|
||||
|
||||
# Driver interface for wired authenticator
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for no driver (e.g., RADIUS server only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# IEEE 802.11F/IAPP
|
||||
CONFIG_IAPP=y
|
||||
|
||||
# WPA2/IEEE 802.11i RSN pre-authentication
|
||||
CONFIG_RSN_PREAUTH=y
|
||||
|
||||
# IEEE 802.11w (management frame protection)
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
#CONFIG_OCV=y
|
||||
|
||||
# Integrated EAP server
|
||||
CONFIG_EAP=y
|
||||
|
||||
# EAP Re-authentication Protocol (ERP) in integrated EAP server
|
||||
#CONFIG_ERP=y
|
||||
|
||||
# EAP-MD5 for the integrated EAP server
|
||||
CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-TLS for the integrated EAP server
|
||||
CONFIG_EAP_TLS=y
|
||||
|
||||
# EAP-MSCHAPv2 for the integrated EAP server
|
||||
CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-PEAP for the integrated EAP server
|
||||
CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-GTC for the integrated EAP server
|
||||
CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-TTLS for the integrated EAP server
|
||||
CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-SIM for the integrated EAP server
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# EAP-AKA for the integrated EAP server
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' for the integrated EAP server
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# EAP-PAX for the integrated EAP server
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd for the integrated EAP server (secure authentication with a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-SAKE for the integrated EAP server
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK for the integrated EAP server
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-FAST for the integrated EAP server
|
||||
CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP for the integrated EAP server
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
CONFIG_WPS=y
|
||||
# Enable UPnP support for external WPS Registrars
|
||||
#CONFIG_WPS_UPNP=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# Trusted Network Connect (EAP-TNC)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# EAP-EKE for the integrated EAP server
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
CONFIG_PKCS12=y
|
||||
|
||||
# RADIUS authentication server. This provides access to the integrated EAP
|
||||
# server from external hosts using RADIUS.
|
||||
#CONFIG_RADIUS_SERVER=y
|
||||
|
||||
# Build IPv6 support for RADIUS operations
|
||||
CONFIG_IPV6=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition)
|
||||
CONFIG_IEEE80211R=y
|
||||
|
||||
# Use the hostapd's IEEE 802.11 authentication (ACL), but without
|
||||
# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211)
|
||||
#CONFIG_DRIVER_RADIUS_ACL=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support
|
||||
CONFIG_IEEE80211N=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
CONFIG_WNM=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support
|
||||
CONFIG_IEEE80211AC=y
|
||||
|
||||
# IEEE 802.11ax HE support
|
||||
# Note: This is experimental and work in progress. The definitions are still
|
||||
# subject to change and this should not be expected to interoperate with the
|
||||
# final IEEE 802.11ax version.
|
||||
#CONFIG_IEEE80211AX=y
|
||||
|
||||
# Remove debugging code that is printing out debug messages to stdout.
|
||||
# This can be used to reduce the size of the hostapd considerably if debugging
|
||||
# code is not needed.
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Add support for writing debug log to a file: -f /tmp/hostapd.log
|
||||
# Disabled by default.
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Remove support for RADIUS accounting
|
||||
#CONFIG_NO_ACCOUNTING=y
|
||||
|
||||
# Remove support for RADIUS
|
||||
#CONFIG_NO_RADIUS=y
|
||||
|
||||
# Remove support for VLANs
|
||||
#CONFIG_NO_VLAN=y
|
||||
|
||||
# Enable support for fully dynamic VLANs. This enables hostapd to
|
||||
# automatically create bridge and VLAN interfaces if necessary.
|
||||
CONFIG_FULL_DYNAMIC_VLAN=y
|
||||
|
||||
# Use netlink-based kernel API for VLAN operations instead of ioctl()
|
||||
# Note: This requires libnl 3.1 or newer.
|
||||
#CONFIG_VLAN_NETLINK=y
|
||||
|
||||
# Remove support for dumping internal state through control interface commands
|
||||
# This can be used to reduce binary size at the cost of disabling a debugging
|
||||
# option.
|
||||
CONFIG_NO_DUMP_STATE=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# hostapd depends on strong random number generation being available from the
|
||||
# operating system. os_get_random() function is used to fetch random data when
|
||||
# needed, e.g., for key generation. On Linux and BSD systems, this works by
|
||||
# reading /dev/urandom. It should be noted that the OS entropy pool needs to be
|
||||
# properly initialized before hostapd is started. This is important especially
|
||||
# on embedded devices that do not have a hardware random number generator and
|
||||
# may by default start up with minimal entropy available for random number
|
||||
# generation.
|
||||
#
|
||||
# As a safety net, hostapd is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data
|
||||
# fetched from the OS. This by itself is not considered to be very strong, but
|
||||
# it may help in cases where the system pool is not initialized properly.
|
||||
# However, it is very strongly recommended that the system pool is initialized
|
||||
# with enough entropy either by using hardware assisted random number
|
||||
# generator or by storing state over device reboots.
|
||||
#
|
||||
# hostapd can be configured to maintain its own entropy store over restarts to
|
||||
# enhance random number generation. This is not perfect, but it is much more
|
||||
# secure than using the same sequence of random numbers after every reboot.
|
||||
# This can be enabled with -e<entropy file> command line option. The specified
|
||||
# file needs to be readable and writable by hostapd.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal hostapd random pool can be disabled.
|
||||
# This will save some in binary size and CPU use. However, this should only be
|
||||
# considered for builds that are known to be used on devices that meet the
|
||||
# requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used.
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms.
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks.
|
||||
CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
#CONFIG_HS20=y
|
||||
|
||||
# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file
|
||||
#CONFIG_SQLITE=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# Testing options
|
||||
# This can be used to enable some testing options (see also the example
|
||||
# configuration file) that are really useful only for testing clients that
|
||||
# connect to this hostapd. These options allow, for example, to drop a
|
||||
# certain percentage of probe requests or auth/(re)assoc frames.
|
||||
#
|
||||
#CONFIG_TESTING_OPTIONS=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow hostapd to pick the channel automatically when channel is set
|
||||
# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# You can customize the ACS survey algorithm with the hostapd.conf variable
|
||||
# acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Multiband Operation support
|
||||
# These extentions facilitate efficient use of multiple frequency bands
|
||||
# available to the AP and the devices that may associate with it.
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Client Taxonomy
|
||||
# Has the AP retain the Probe Request and (Re)Association Request frames from
|
||||
# a client, from which a signature can be produced which can identify the model
|
||||
# of client device like "Nexus 6P" or "iPhone 5s".
|
||||
CONFIG_TAXONOMY=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Include internal line edit mode in hostapd_cli. This can be used to provide
|
||||
# limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Airtime policy support
|
||||
CONFIG_AIRTIME_POLICY=y
|
||||
|
||||
# Proxy ARP support
|
||||
CONFIG_PROXYARP=y
|
||||
|
||||
# Override default value for the wpa_disable_eapol_key_retries configuration
|
||||
# parameter. See that parameter in hostapd.conf for more details.
|
||||
#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
CONFIG_CTRL_IFACE_MIB=y
|
||||
404
package/network/services/hostapd/files/hostapd-mini.config
Normal file
404
package/network/services/hostapd/files/hostapd-mini.config
Normal file
@@ -0,0 +1,404 @@
|
||||
# Example hostapd build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# hostapd binary. All lines starting with # are ignored. Configuration option
|
||||
# lines must be commented out complete, if they are not to be included, i.e.,
|
||||
# just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cass, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
# Driver interface for Host AP driver
|
||||
#CONFIG_DRIVER_HOSTAP=y
|
||||
|
||||
# Driver interface for wired authenticator
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for no driver (e.g., RADIUS server only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# IEEE 802.11F/IAPP
|
||||
#CONFIG_IAPP=y
|
||||
|
||||
# WPA2/IEEE 802.11i RSN pre-authentication
|
||||
CONFIG_RSN_PREAUTH=y
|
||||
|
||||
# IEEE 802.11w (management frame protection)
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
#CONFIG_OCV=y
|
||||
|
||||
# Integrated EAP server
|
||||
#CONFIG_EAP=y
|
||||
|
||||
# EAP Re-authentication Protocol (ERP) in integrated EAP server
|
||||
#CONFIG_ERP=y
|
||||
|
||||
# EAP-MD5 for the integrated EAP server
|
||||
#CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-TLS for the integrated EAP server
|
||||
#CONFIG_EAP_TLS=y
|
||||
|
||||
# EAP-MSCHAPv2 for the integrated EAP server
|
||||
#CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-PEAP for the integrated EAP server
|
||||
#CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-GTC for the integrated EAP server
|
||||
#CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-TTLS for the integrated EAP server
|
||||
#CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-SIM for the integrated EAP server
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# EAP-AKA for the integrated EAP server
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' for the integrated EAP server
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# EAP-PAX for the integrated EAP server
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd for the integrated EAP server (secure authentication with a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-SAKE for the integrated EAP server
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK for the integrated EAP server
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-FAST for the integrated EAP server
|
||||
#CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP for the integrated EAP server
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
#CONFIG_WPS=y
|
||||
# Enable UPnP support for external WPS Registrars
|
||||
#CONFIG_WPS_UPNP=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# Trusted Network Connect (EAP-TNC)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# EAP-EKE for the integrated EAP server
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
#CONFIG_PKCS12=y
|
||||
|
||||
# RADIUS authentication server. This provides access to the integrated EAP
|
||||
# server from external hosts using RADIUS.
|
||||
#CONFIG_RADIUS_SERVER=y
|
||||
|
||||
# Build IPv6 support for RADIUS operations
|
||||
#CONFIG_IPV6=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition)
|
||||
#CONFIG_IEEE80211R=y
|
||||
|
||||
# Use the hostapd's IEEE 802.11 authentication (ACL), but without
|
||||
# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211)
|
||||
#CONFIG_DRIVER_RADIUS_ACL=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support
|
||||
CONFIG_IEEE80211N=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
#CONFIG_WNM=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support
|
||||
CONFIG_IEEE80211AC=y
|
||||
|
||||
# IEEE 802.11ax HE support
|
||||
# Note: This is experimental and work in progress. The definitions are still
|
||||
# subject to change and this should not be expected to interoperate with the
|
||||
# final IEEE 802.11ax version.
|
||||
#CONFIG_IEEE80211AX=y
|
||||
|
||||
# Remove debugging code that is printing out debug messages to stdout.
|
||||
# This can be used to reduce the size of the hostapd considerably if debugging
|
||||
# code is not needed.
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Add support for writing debug log to a file: -f /tmp/hostapd.log
|
||||
# Disabled by default.
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Remove support for RADIUS accounting
|
||||
CONFIG_NO_ACCOUNTING=y
|
||||
|
||||
# Remove support for RADIUS
|
||||
CONFIG_NO_RADIUS=y
|
||||
|
||||
# Remove support for VLANs
|
||||
#CONFIG_NO_VLAN=y
|
||||
|
||||
# Enable support for fully dynamic VLANs. This enables hostapd to
|
||||
# automatically create bridge and VLAN interfaces if necessary.
|
||||
#CONFIG_FULL_DYNAMIC_VLAN=y
|
||||
|
||||
# Use netlink-based kernel API for VLAN operations instead of ioctl()
|
||||
# Note: This requires libnl 3.1 or newer.
|
||||
#CONFIG_VLAN_NETLINK=y
|
||||
|
||||
# Remove support for dumping internal state through control interface commands
|
||||
# This can be used to reduce binary size at the cost of disabling a debugging
|
||||
# option.
|
||||
CONFIG_NO_DUMP_STATE=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# hostapd depends on strong random number generation being available from the
|
||||
# operating system. os_get_random() function is used to fetch random data when
|
||||
# needed, e.g., for key generation. On Linux and BSD systems, this works by
|
||||
# reading /dev/urandom. It should be noted that the OS entropy pool needs to be
|
||||
# properly initialized before hostapd is started. This is important especially
|
||||
# on embedded devices that do not have a hardware random number generator and
|
||||
# may by default start up with minimal entropy available for random number
|
||||
# generation.
|
||||
#
|
||||
# As a safety net, hostapd is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data
|
||||
# fetched from the OS. This by itself is not considered to be very strong, but
|
||||
# it may help in cases where the system pool is not initialized properly.
|
||||
# However, it is very strongly recommended that the system pool is initialized
|
||||
# with enough entropy either by using hardware assisted random number
|
||||
# generator or by storing state over device reboots.
|
||||
#
|
||||
# hostapd can be configured to maintain its own entropy store over restarts to
|
||||
# enhance random number generation. This is not perfect, but it is much more
|
||||
# secure than using the same sequence of random numbers after every reboot.
|
||||
# This can be enabled with -e<entropy file> command line option. The specified
|
||||
# file needs to be readable and writable by hostapd.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal hostapd random pool can be disabled.
|
||||
# This will save some in binary size and CPU use. However, this should only be
|
||||
# considered for builds that are known to be used on devices that meet the
|
||||
# requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used.
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms.
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
#CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks.
|
||||
#CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
#CONFIG_HS20=y
|
||||
|
||||
# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file
|
||||
#CONFIG_SQLITE=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# Testing options
|
||||
# This can be used to enable some testing options (see also the example
|
||||
# configuration file) that are really useful only for testing clients that
|
||||
# connect to this hostapd. These options allow, for example, to drop a
|
||||
# certain percentage of probe requests or auth/(re)assoc frames.
|
||||
#
|
||||
#CONFIG_TESTING_OPTIONS=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow hostapd to pick the channel automatically when channel is set
|
||||
# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# You can customize the ACS survey algorithm with the hostapd.conf variable
|
||||
# acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Multiband Operation support
|
||||
# These extentions facilitate efficient use of multiple frequency bands
|
||||
# available to the AP and the devices that may associate with it.
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Client Taxonomy
|
||||
# Has the AP retain the Probe Request and (Re)Association Request frames from
|
||||
# a client, from which a signature can be produced which can identify the model
|
||||
# of client device like "Nexus 6P" or "iPhone 5s".
|
||||
#CONFIG_TAXONOMY=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Include internal line edit mode in hostapd_cli. This can be used to provide
|
||||
# limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Airtime policy support
|
||||
#CONFIG_AIRTIME_POLICY=y
|
||||
|
||||
# Proxy ARP support
|
||||
#CONFIG_PROXYARP=y
|
||||
|
||||
# Override default value for the wpa_disable_eapol_key_retries configuration
|
||||
# parameter. See that parameter in hostapd.conf for more details.
|
||||
#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
#CONFIG_CTRL_IFACE_MIB=y
|
||||
1517
package/network/services/hostapd/files/hostapd.sh
Normal file
1517
package/network/services/hostapd/files/hostapd.sh
Normal file
File diff suppressed because it is too large
Load Diff
28
package/network/services/hostapd/files/multicall.c
Normal file
28
package/network/services/hostapd/files/multicall.c
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
extern int hostapd_main(int argc, char **argv);
|
||||
extern int wpa_supplicant_main(int argc, char **argv);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
bool restart = false;
|
||||
const char *prog = argv[0];
|
||||
|
||||
restart:
|
||||
if (strstr(argv[0], "hostapd"))
|
||||
return hostapd_main(argc, argv);
|
||||
else if (strstr(argv[0], "wpa_supplicant"))
|
||||
return wpa_supplicant_main(argc, argv);
|
||||
|
||||
if (!restart && argc > 1) {
|
||||
argv++;
|
||||
argc--;
|
||||
restart = true;
|
||||
goto restart;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Invalid command.\nUsage: %s wpa_supplicant|hostapd [<arguments>]\n", prog);
|
||||
return 255;
|
||||
}
|
||||
@@ -0,0 +1,625 @@
|
||||
# Example wpa_supplicant build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# wpa_supplicant binary. All lines starting with # are ignored. Configuration
|
||||
# option lines must be commented out complete, if they are not to be included,
|
||||
# i.e., just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cases, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
|
||||
# Uncomment following two lines and fix the paths if you have installed OpenSSL
|
||||
# or GnuTLS in non-default location
|
||||
#CFLAGS += -I/usr/local/openssl/include
|
||||
#LIBS += -L/usr/local/openssl/lib
|
||||
|
||||
# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
|
||||
# the kerberos files are not in the default include path. Following line can be
|
||||
# used to fix build issues on such systems (krb5.h not found).
|
||||
#CFLAGS += -I/usr/include/kerberos
|
||||
|
||||
# Driver interface for generic Linux wireless extensions
|
||||
# Note: WEXT is deprecated in the current Linux kernel version and no new
|
||||
# functionality is added to it. nl80211-based interface is the new
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for Windows NDIS
|
||||
#CONFIG_DRIVER_NDIS=y
|
||||
#CFLAGS += -I/usr/include/w32api/ddk
|
||||
#LIBS += -L/usr/local/lib
|
||||
# For native build using mingw
|
||||
#CONFIG_NATIVE_WINDOWS=y
|
||||
# Additional directories for cross-compilation on Linux host for mingw target
|
||||
#CFLAGS += -I/opt/mingw/mingw32/include/ddk
|
||||
#LIBS += -L/opt/mingw/mingw32/lib
|
||||
#CC=mingw32-gcc
|
||||
# By default, driver_ndis uses WinPcap for low-level operations. This can be
|
||||
# replaced with the following option which replaces WinPcap calls with NDISUIO.
|
||||
# However, this requires that WZC is disabled (net stop wzcsvc) before starting
|
||||
# wpa_supplicant.
|
||||
# CONFIG_USE_NDISUIO=y
|
||||
|
||||
# Driver interface for wired Ethernet drivers
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for MACsec capable Qualcomm Atheros drivers
|
||||
#CONFIG_DRIVER_MACSEC_QCA=y
|
||||
|
||||
# Driver interface for Linux MACsec drivers
|
||||
#CONFIG_DRIVER_MACSEC_LINUX=y
|
||||
|
||||
# Driver interface for the Broadcom RoboSwitch family
|
||||
#CONFIG_DRIVER_ROBOSWITCH=y
|
||||
|
||||
# Driver interface for no driver (e.g., WPS ER only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# Solaris libraries
|
||||
#LIBS += -lsocket -ldlpi -lnsl
|
||||
#LIBS_c += -lsocket
|
||||
|
||||
# Enable IEEE 802.1X Supplicant (automatically included if any EAP method or
|
||||
# MACsec is included)
|
||||
#CONFIG_IEEE8021X_EAPOL=y
|
||||
|
||||
# EAP-MD5
|
||||
#CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-MSCHAPv2
|
||||
#CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-TLS
|
||||
#CONFIG_EAP_TLS=y
|
||||
|
||||
# EAL-PEAP
|
||||
#CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-TTLS
|
||||
#CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-FAST
|
||||
#CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# EAP-GTC
|
||||
#CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-OTP
|
||||
#CONFIG_EAP_OTP=y
|
||||
|
||||
# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# Enable SIM simulator (Milenage) for EAP-SIM
|
||||
#CONFIG_SIM_SIMULATOR=y
|
||||
|
||||
# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd (secure authentication using only a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-PAX
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# LEAP
|
||||
#CONFIG_EAP_LEAP=y
|
||||
|
||||
# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# Enable USIM simulator (Milenage) for EAP-AKA
|
||||
#CONFIG_USIM_SIMULATOR=y
|
||||
|
||||
# EAP-SAKE
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-TNC and related Trusted Network Connect support (experimental)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
#CONFIG_WPS=y
|
||||
# Enable WPS external registrar functionality
|
||||
#CONFIG_WPS_ER=y
|
||||
# Disable credentials for an open network by default when acting as a WPS
|
||||
# registrar.
|
||||
#CONFIG_WPS_REG_DISABLE_OPEN=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# EAP-EKE
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# MACsec
|
||||
#CONFIG_MACSEC=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
#CONFIG_PKCS12=y
|
||||
|
||||
# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
|
||||
# engine.
|
||||
#CONFIG_SMARTCARD=y
|
||||
|
||||
# PC/SC interface for smartcards (USIM, GSM SIM)
|
||||
# Enable this if EAP-SIM or EAP-AKA is included
|
||||
#CONFIG_PCSC=y
|
||||
|
||||
# Support HT overrides (disable HT/HT40, mask MCS rates, etc.)
|
||||
CONFIG_HT_OVERRIDES=y
|
||||
|
||||
# Support VHT overrides (disable VHT, mask MCS rates, etc.)
|
||||
CONFIG_VHT_OVERRIDES=y
|
||||
|
||||
# Development testing
|
||||
#CONFIG_EAPOL_TEST=y
|
||||
|
||||
# Select control interface backend for external programs, e.g, wpa_cli:
|
||||
# unix = UNIX domain sockets (default for Linux/*BSD)
|
||||
# udp = UDP sockets using localhost (127.0.0.1)
|
||||
# udp6 = UDP IPv6 sockets using localhost (::1)
|
||||
# named_pipe = Windows Named Pipe (default for Windows)
|
||||
# udp-remote = UDP sockets with remote access (only for tests systems/purpose)
|
||||
# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose)
|
||||
# y = use default (backwards compatibility)
|
||||
# If this option is commented out, control interface is not included in the
|
||||
# build.
|
||||
CONFIG_CTRL_IFACE=y
|
||||
|
||||
# Include support for GNU Readline and History Libraries in wpa_cli.
|
||||
# When building a wpa_cli binary for distribution, please note that these
|
||||
# libraries are licensed under GPL and as such, BSD license may not apply for
|
||||
# the resulting binary.
|
||||
#CONFIG_READLINE=y
|
||||
|
||||
# Include internal line edit mode in wpa_cli. This can be used as a replacement
|
||||
# for GNU Readline to provide limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Remove debugging code that is printing out debug message to stdout.
|
||||
# This can be used to reduce the size of the wpa_supplicant considerably
|
||||
# if debugging code is not needed. The size reduction can be around 35%
|
||||
# (e.g., 90 kB).
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
|
||||
# 35-50 kB in code size.
|
||||
#CONFIG_NO_WPA=y
|
||||
|
||||
# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
|
||||
# This option can be used to reduce code size by removing support for
|
||||
# converting ASCII passphrases into PSK. If this functionality is removed, the
|
||||
# PSK can only be configured as the 64-octet hexstring (e.g., from
|
||||
# wpa_passphrase). This saves about 0.5 kB in code size.
|
||||
#CONFIG_NO_WPA_PASSPHRASE=y
|
||||
|
||||
# Simultaneous Authentication of Equals (SAE), WPA3-Personal
|
||||
#CONFIG_SAE=y
|
||||
|
||||
# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
|
||||
# This can be used if ap_scan=1 mode is never enabled.
|
||||
#CONFIG_NO_SCAN_PROCESSING=y
|
||||
|
||||
# Select configuration backend:
|
||||
# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
|
||||
# path is given on command line, not here; this option is just used to
|
||||
# select the backend that allows configuration files to be used)
|
||||
# winreg = Windows registry (see win_example.reg for an example)
|
||||
CONFIG_BACKEND=file
|
||||
|
||||
# Remove configuration write functionality (i.e., to allow the configuration
|
||||
# file to be updated based on runtime configuration changes). The runtime
|
||||
# configuration can still be changed, the changes are just not going to be
|
||||
# persistent over restarts. This option can be used to reduce code size by
|
||||
# about 3.5 kB.
|
||||
CONFIG_NO_CONFIG_WRITE=y
|
||||
|
||||
# Remove support for configuration blobs to reduce code size by about 1.5 kB.
|
||||
#CONFIG_NO_CONFIG_BLOBS=y
|
||||
|
||||
# Select program entry point implementation:
|
||||
# main = UNIX/POSIX like main() function (default)
|
||||
# main_winsvc = Windows service (read parameters from registry)
|
||||
# main_none = Very basic example (development use only)
|
||||
#CONFIG_MAIN=main
|
||||
|
||||
# Select wrapper for operating system and C library specific functions
|
||||
# unix = UNIX/POSIX like systems (default)
|
||||
# win32 = Windows systems
|
||||
# none = Empty template
|
||||
#CONFIG_OS=unix
|
||||
|
||||
# Select event loop implementation
|
||||
# eloop = select() loop (default)
|
||||
# eloop_win = Windows events and WaitForMultipleObject() loop
|
||||
#CONFIG_ELOOP=eloop
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select layer 2 packet implementation
|
||||
# linux = Linux packet socket (default)
|
||||
# pcap = libpcap/libdnet/WinPcap
|
||||
# freebsd = FreeBSD libpcap
|
||||
# winpcap = WinPcap with receive thread
|
||||
# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
|
||||
# none = Empty template
|
||||
#CONFIG_L2_PACKET=linux
|
||||
|
||||
# Disable Linux packet socket workaround applicable for station interface
|
||||
# in a bridge for EAPOL frames. This should be uncommented only if the kernel
|
||||
# is known to not have the regression issue in packet socket behavior with
|
||||
# bridge interfaces (commit 'bridge: respect RFC2863 operational state')').
|
||||
CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y
|
||||
|
||||
# IEEE 802.11w (management frame protection), also known as PMF
|
||||
# Driver support is also needed for IEEE 802.11w.
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
#CONFIG_OCV=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used. It should be noted that some existing TLS v1.0 -based
|
||||
# implementation may not be compatible with TLS v1.1 message (ClientHello is
|
||||
# sent prior to negotiating which version will be used)
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms. It should be
|
||||
# noted that some existing TLS v1.0 -based implementation may not be compatible
|
||||
# with TLS v1.2 message (ClientHello is sent prior to negotiating which version
|
||||
# will be used)
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
#CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
|
||||
# This is only for Windows builds and requires WMI-related header files and
|
||||
# WbemUuid.Lib from Platform SDK even when building with MinGW.
|
||||
#CONFIG_NDIS_EVENTS_INTEGRATED=y
|
||||
#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
|
||||
|
||||
# Add support for new DBus control interface
|
||||
# (fi.w1.hostap.wpa_supplicant1)
|
||||
#CONFIG_CTRL_IFACE_DBUS_NEW=y
|
||||
|
||||
# Add introspection support for new DBus control interface
|
||||
#CONFIG_CTRL_IFACE_DBUS_INTRO=y
|
||||
|
||||
# Add support for loading EAP methods dynamically as shared libraries.
|
||||
# When this option is enabled, each EAP method can be either included
|
||||
# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
|
||||
# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
|
||||
# be loaded in the beginning of the wpa_supplicant configuration file
|
||||
# (see load_dynamic_eap parameter in the example file) before being used in
|
||||
# the network blocks.
|
||||
#
|
||||
# Note that some shared parts of EAP methods are included in the main program
|
||||
# and in order to be able to use dynamic EAP methods using these parts, the
|
||||
# main program must have been build with the EAP method enabled (=y or =dyn).
|
||||
# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
|
||||
# unless at least one of them was included in the main build to force inclusion
|
||||
# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
|
||||
# in the main build to be able to load these methods dynamically.
|
||||
#
|
||||
# Please also note that using dynamic libraries will increase the total binary
|
||||
# size. Thus, it may not be the best option for targets that have limited
|
||||
# amount of memory/flash.
|
||||
#CONFIG_DYNAMIC_EAP_METHODS=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode
|
||||
CONFIG_IEEE80211R=y
|
||||
|
||||
# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
# Set syslog facility for debug messages
|
||||
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Add support for writing debug log to Android logcat instead of standard
|
||||
# output
|
||||
#CONFIG_ANDROID_LOG=y
|
||||
|
||||
# Enable privilege separation (see README 'Privilege separation' for details)
|
||||
#CONFIG_PRIVSEP=y
|
||||
|
||||
# Enable mitigation against certain attacks against TKIP by delaying Michael
|
||||
# MIC error reports by a random amount of time between 0 and 60 seconds
|
||||
#CONFIG_DELAYED_MIC_ERROR_REPORT=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# wpa_supplicant depends on strong random number generation being available
|
||||
# from the operating system. os_get_random() function is used to fetch random
|
||||
# data when needed, e.g., for key generation. On Linux and BSD systems, this
|
||||
# works by reading /dev/urandom. It should be noted that the OS entropy pool
|
||||
# needs to be properly initialized before wpa_supplicant is started. This is
|
||||
# important especially on embedded devices that do not have a hardware random
|
||||
# number generator and may by default start up with minimal entropy available
|
||||
# for random number generation.
|
||||
#
|
||||
# As a safety net, wpa_supplicant is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data fetched
|
||||
# from the OS. This by itself is not considered to be very strong, but it may
|
||||
# help in cases where the system pool is not initialized properly. However, it
|
||||
# is very strongly recommended that the system pool is initialized with enough
|
||||
# entropy either by using hardware assisted random number generator or by
|
||||
# storing state over device reboots.
|
||||
#
|
||||
# wpa_supplicant can be configured to maintain its own entropy store over
|
||||
# restarts to enhance random number generation. This is not perfect, but it is
|
||||
# much more secure than using the same sequence of random numbers after every
|
||||
# reboot. This can be enabled with -e<entropy file> command line option. The
|
||||
# specified file needs to be readable and writable by wpa_supplicant.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal wpa_supplicant random pool can be
|
||||
# disabled. This will save some in binary size and CPU use. However, this
|
||||
# should only be considered for builds that are known to be used on devices
|
||||
# that meet the requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support (mainly for AP mode)
|
||||
#CONFIG_IEEE80211N=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode)
|
||||
# (depends on CONFIG_IEEE80211N)
|
||||
#CONFIG_IEEE80211AC=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
#CONFIG_WNM=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks (GAS/ANQP to learn more about the networks and network
|
||||
# selection based on available credentials).
|
||||
#CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
#CONFIG_HS20=y
|
||||
|
||||
# Enable interface matching in wpa_supplicant
|
||||
#CONFIG_MATCH_IFACE=y
|
||||
|
||||
# Disable roaming in wpa_supplicant
|
||||
#CONFIG_NO_ROAMING=y
|
||||
|
||||
# AP mode operations with wpa_supplicant
|
||||
# This can be used for controlling AP mode operations with wpa_supplicant. It
|
||||
# should be noted that this is mainly aimed at simple cases like
|
||||
# WPA2-Personal while more complex configurations like WPA2-Enterprise with an
|
||||
# external RADIUS server can be supported with hostapd.
|
||||
#CONFIG_AP=y
|
||||
|
||||
# P2P (Wi-Fi Direct)
|
||||
# This can be used to enable P2P support in wpa_supplicant. See README-P2P for
|
||||
# more information on P2P operations.
|
||||
#CONFIG_P2P=y
|
||||
|
||||
# Enable TDLS support
|
||||
#CONFIG_TDLS=y
|
||||
|
||||
# Wi-Fi Display
|
||||
# This can be used to enable Wi-Fi Display extensions for P2P using an external
|
||||
# program to control the additional information exchanges in the messages.
|
||||
#CONFIG_WIFI_DISPLAY=y
|
||||
|
||||
# Autoscan
|
||||
# This can be used to enable automatic scan support in wpa_supplicant.
|
||||
# See wpa_supplicant.conf for more information on autoscan usage.
|
||||
#
|
||||
# Enabling directly a module will enable autoscan support.
|
||||
# For exponential module:
|
||||
#CONFIG_AUTOSCAN_EXPONENTIAL=y
|
||||
# For periodic module:
|
||||
#CONFIG_AUTOSCAN_PERIODIC=y
|
||||
|
||||
# Password (and passphrase, etc.) backend for external storage
|
||||
# These optional mechanisms can be used to add support for storing passwords
|
||||
# and other secrets in external (to wpa_supplicant) location. This allows, for
|
||||
# example, operating system specific key storage to be used
|
||||
#
|
||||
# External password backend for testing purposes (developer use)
|
||||
#CONFIG_EXT_PASSWORD_TEST=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# OS X builds. This is only for building eapol_test.
|
||||
#CONFIG_OSX=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow wpa_supplicant to pick the channel automatically when channel
|
||||
# is set to "0".
|
||||
#
|
||||
# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative
|
||||
# to "channel=0". This would enable us to eventually add other ACS algorithms in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with
|
||||
# a newly to create wpa_supplicant.conf variable acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Support Multi Band Operation
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Support RSN on IBSS networks
|
||||
# This is needed to be able to use mode=1 network profile with proto=RSN and
|
||||
# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None).
|
||||
#CONFIG_IBSS_RSN=y
|
||||
|
||||
# External PMKSA cache control
|
||||
# This can be used to enable control interface commands that allow the current
|
||||
# PMKSA cache entries to be fetched and new entries to be added.
|
||||
#CONFIG_PMKSA_CACHE_EXTERNAL=y
|
||||
|
||||
# Mesh Networking (IEEE 802.11s)
|
||||
#CONFIG_MESH=y
|
||||
|
||||
# Background scanning modules
|
||||
# These can be used to request wpa_supplicant to perform background scanning
|
||||
# operations for roaming within an ESS (same SSID). See the bgscan parameter in
|
||||
# the wpa_supplicant.conf file for more details.
|
||||
# Periodic background scans based on signal strength
|
||||
#CONFIG_BGSCAN_SIMPLE=y
|
||||
# Learn channels used by the network and try to avoid bgscans on other
|
||||
# channels (experimental)
|
||||
#CONFIG_BGSCAN_LEARN=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Device Provisioning Protocol (DPP)
|
||||
# This requires CONFIG_IEEE80211W=y to be enabled, too. (see
|
||||
# wpa_supplicant/README-DPP for details)
|
||||
#CONFIG_DPP=y
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
#CONFIG_CTRL_IFACE_MIB=y
|
||||
@@ -0,0 +1,625 @@
|
||||
# Example wpa_supplicant build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# wpa_supplicant binary. All lines starting with # are ignored. Configuration
|
||||
# option lines must be commented out complete, if they are not to be included,
|
||||
# i.e., just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cases, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
|
||||
# Uncomment following two lines and fix the paths if you have installed OpenSSL
|
||||
# or GnuTLS in non-default location
|
||||
#CFLAGS += -I/usr/local/openssl/include
|
||||
#LIBS += -L/usr/local/openssl/lib
|
||||
|
||||
# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
|
||||
# the kerberos files are not in the default include path. Following line can be
|
||||
# used to fix build issues on such systems (krb5.h not found).
|
||||
#CFLAGS += -I/usr/include/kerberos
|
||||
|
||||
# Driver interface for generic Linux wireless extensions
|
||||
# Note: WEXT is deprecated in the current Linux kernel version and no new
|
||||
# functionality is added to it. nl80211-based interface is the new
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for Windows NDIS
|
||||
#CONFIG_DRIVER_NDIS=y
|
||||
#CFLAGS += -I/usr/include/w32api/ddk
|
||||
#LIBS += -L/usr/local/lib
|
||||
# For native build using mingw
|
||||
#CONFIG_NATIVE_WINDOWS=y
|
||||
# Additional directories for cross-compilation on Linux host for mingw target
|
||||
#CFLAGS += -I/opt/mingw/mingw32/include/ddk
|
||||
#LIBS += -L/opt/mingw/mingw32/lib
|
||||
#CC=mingw32-gcc
|
||||
# By default, driver_ndis uses WinPcap for low-level operations. This can be
|
||||
# replaced with the following option which replaces WinPcap calls with NDISUIO.
|
||||
# However, this requires that WZC is disabled (net stop wzcsvc) before starting
|
||||
# wpa_supplicant.
|
||||
# CONFIG_USE_NDISUIO=y
|
||||
|
||||
# Driver interface for wired Ethernet drivers
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for MACsec capable Qualcomm Atheros drivers
|
||||
#CONFIG_DRIVER_MACSEC_QCA=y
|
||||
|
||||
# Driver interface for Linux MACsec drivers
|
||||
#CONFIG_DRIVER_MACSEC_LINUX=y
|
||||
|
||||
# Driver interface for the Broadcom RoboSwitch family
|
||||
#CONFIG_DRIVER_ROBOSWITCH=y
|
||||
|
||||
# Driver interface for no driver (e.g., WPS ER only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# Solaris libraries
|
||||
#LIBS += -lsocket -ldlpi -lnsl
|
||||
#LIBS_c += -lsocket
|
||||
|
||||
# Enable IEEE 802.1X Supplicant (automatically included if any EAP method or
|
||||
# MACsec is included)
|
||||
CONFIG_IEEE8021X_EAPOL=y
|
||||
|
||||
# EAP-MD5
|
||||
CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-MSCHAPv2
|
||||
CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-TLS
|
||||
CONFIG_EAP_TLS=y
|
||||
|
||||
# EAL-PEAP
|
||||
CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-TTLS
|
||||
CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-FAST
|
||||
CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# EAP-GTC
|
||||
CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-OTP
|
||||
CONFIG_EAP_OTP=y
|
||||
|
||||
# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# Enable SIM simulator (Milenage) for EAP-SIM
|
||||
#CONFIG_SIM_SIMULATOR=y
|
||||
|
||||
# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd (secure authentication using only a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-PAX
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# LEAP
|
||||
CONFIG_EAP_LEAP=y
|
||||
|
||||
# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# Enable USIM simulator (Milenage) for EAP-AKA
|
||||
#CONFIG_USIM_SIMULATOR=y
|
||||
|
||||
# EAP-SAKE
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-TNC and related Trusted Network Connect support (experimental)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
CONFIG_WPS=y
|
||||
# Enable WPS external registrar functionality
|
||||
#CONFIG_WPS_ER=y
|
||||
# Disable credentials for an open network by default when acting as a WPS
|
||||
# registrar.
|
||||
#CONFIG_WPS_REG_DISABLE_OPEN=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# EAP-EKE
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# MACsec
|
||||
#CONFIG_MACSEC=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
CONFIG_PKCS12=y
|
||||
|
||||
# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
|
||||
# engine.
|
||||
CONFIG_SMARTCARD=y
|
||||
|
||||
# PC/SC interface for smartcards (USIM, GSM SIM)
|
||||
# Enable this if EAP-SIM or EAP-AKA is included
|
||||
#CONFIG_PCSC=y
|
||||
|
||||
# Support HT overrides (disable HT/HT40, mask MCS rates, etc.)
|
||||
CONFIG_HT_OVERRIDES=y
|
||||
|
||||
# Support VHT overrides (disable VHT, mask MCS rates, etc.)
|
||||
CONFIG_VHT_OVERRIDES=y
|
||||
|
||||
# Development testing
|
||||
#CONFIG_EAPOL_TEST=y
|
||||
|
||||
# Select control interface backend for external programs, e.g, wpa_cli:
|
||||
# unix = UNIX domain sockets (default for Linux/*BSD)
|
||||
# udp = UDP sockets using localhost (127.0.0.1)
|
||||
# udp6 = UDP IPv6 sockets using localhost (::1)
|
||||
# named_pipe = Windows Named Pipe (default for Windows)
|
||||
# udp-remote = UDP sockets with remote access (only for tests systems/purpose)
|
||||
# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose)
|
||||
# y = use default (backwards compatibility)
|
||||
# If this option is commented out, control interface is not included in the
|
||||
# build.
|
||||
CONFIG_CTRL_IFACE=y
|
||||
|
||||
# Include support for GNU Readline and History Libraries in wpa_cli.
|
||||
# When building a wpa_cli binary for distribution, please note that these
|
||||
# libraries are licensed under GPL and as such, BSD license may not apply for
|
||||
# the resulting binary.
|
||||
#CONFIG_READLINE=y
|
||||
|
||||
# Include internal line edit mode in wpa_cli. This can be used as a replacement
|
||||
# for GNU Readline to provide limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Remove debugging code that is printing out debug message to stdout.
|
||||
# This can be used to reduce the size of the wpa_supplicant considerably
|
||||
# if debugging code is not needed. The size reduction can be around 35%
|
||||
# (e.g., 90 kB).
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
|
||||
# 35-50 kB in code size.
|
||||
#CONFIG_NO_WPA=y
|
||||
|
||||
# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
|
||||
# This option can be used to reduce code size by removing support for
|
||||
# converting ASCII passphrases into PSK. If this functionality is removed, the
|
||||
# PSK can only be configured as the 64-octet hexstring (e.g., from
|
||||
# wpa_passphrase). This saves about 0.5 kB in code size.
|
||||
#CONFIG_NO_WPA_PASSPHRASE=y
|
||||
|
||||
# Simultaneous Authentication of Equals (SAE), WPA3-Personal
|
||||
#CONFIG_SAE=y
|
||||
|
||||
# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
|
||||
# This can be used if ap_scan=1 mode is never enabled.
|
||||
#CONFIG_NO_SCAN_PROCESSING=y
|
||||
|
||||
# Select configuration backend:
|
||||
# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
|
||||
# path is given on command line, not here; this option is just used to
|
||||
# select the backend that allows configuration files to be used)
|
||||
# winreg = Windows registry (see win_example.reg for an example)
|
||||
CONFIG_BACKEND=file
|
||||
|
||||
# Remove configuration write functionality (i.e., to allow the configuration
|
||||
# file to be updated based on runtime configuration changes). The runtime
|
||||
# configuration can still be changed, the changes are just not going to be
|
||||
# persistent over restarts. This option can be used to reduce code size by
|
||||
# about 3.5 kB.
|
||||
#CONFIG_NO_CONFIG_WRITE=y
|
||||
|
||||
# Remove support for configuration blobs to reduce code size by about 1.5 kB.
|
||||
#CONFIG_NO_CONFIG_BLOBS=y
|
||||
|
||||
# Select program entry point implementation:
|
||||
# main = UNIX/POSIX like main() function (default)
|
||||
# main_winsvc = Windows service (read parameters from registry)
|
||||
# main_none = Very basic example (development use only)
|
||||
#CONFIG_MAIN=main
|
||||
|
||||
# Select wrapper for operating system and C library specific functions
|
||||
# unix = UNIX/POSIX like systems (default)
|
||||
# win32 = Windows systems
|
||||
# none = Empty template
|
||||
#CONFIG_OS=unix
|
||||
|
||||
# Select event loop implementation
|
||||
# eloop = select() loop (default)
|
||||
# eloop_win = Windows events and WaitForMultipleObject() loop
|
||||
#CONFIG_ELOOP=eloop
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select layer 2 packet implementation
|
||||
# linux = Linux packet socket (default)
|
||||
# pcap = libpcap/libdnet/WinPcap
|
||||
# freebsd = FreeBSD libpcap
|
||||
# winpcap = WinPcap with receive thread
|
||||
# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
|
||||
# none = Empty template
|
||||
#CONFIG_L2_PACKET=linux
|
||||
|
||||
# Disable Linux packet socket workaround applicable for station interface
|
||||
# in a bridge for EAPOL frames. This should be uncommented only if the kernel
|
||||
# is known to not have the regression issue in packet socket behavior with
|
||||
# bridge interfaces (commit 'bridge: respect RFC2863 operational state')').
|
||||
CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y
|
||||
|
||||
# IEEE 802.11w (management frame protection), also known as PMF
|
||||
# Driver support is also needed for IEEE 802.11w.
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
#CONFIG_OCV=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used. It should be noted that some existing TLS v1.0 -based
|
||||
# implementation may not be compatible with TLS v1.1 message (ClientHello is
|
||||
# sent prior to negotiating which version will be used)
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms. It should be
|
||||
# noted that some existing TLS v1.0 -based implementation may not be compatible
|
||||
# with TLS v1.2 message (ClientHello is sent prior to negotiating which version
|
||||
# will be used)
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
|
||||
# This is only for Windows builds and requires WMI-related header files and
|
||||
# WbemUuid.Lib from Platform SDK even when building with MinGW.
|
||||
#CONFIG_NDIS_EVENTS_INTEGRATED=y
|
||||
#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
|
||||
|
||||
# Add support for new DBus control interface
|
||||
# (fi.w1.hostap.wpa_supplicant1)
|
||||
#CONFIG_CTRL_IFACE_DBUS_NEW=y
|
||||
|
||||
# Add introspection support for new DBus control interface
|
||||
#CONFIG_CTRL_IFACE_DBUS_INTRO=y
|
||||
|
||||
# Add support for loading EAP methods dynamically as shared libraries.
|
||||
# When this option is enabled, each EAP method can be either included
|
||||
# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
|
||||
# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
|
||||
# be loaded in the beginning of the wpa_supplicant configuration file
|
||||
# (see load_dynamic_eap parameter in the example file) before being used in
|
||||
# the network blocks.
|
||||
#
|
||||
# Note that some shared parts of EAP methods are included in the main program
|
||||
# and in order to be able to use dynamic EAP methods using these parts, the
|
||||
# main program must have been build with the EAP method enabled (=y or =dyn).
|
||||
# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
|
||||
# unless at least one of them was included in the main build to force inclusion
|
||||
# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
|
||||
# in the main build to be able to load these methods dynamically.
|
||||
#
|
||||
# Please also note that using dynamic libraries will increase the total binary
|
||||
# size. Thus, it may not be the best option for targets that have limited
|
||||
# amount of memory/flash.
|
||||
#CONFIG_DYNAMIC_EAP_METHODS=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode
|
||||
CONFIG_IEEE80211R=y
|
||||
|
||||
# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
# Set syslog facility for debug messages
|
||||
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Add support for writing debug log to Android logcat instead of standard
|
||||
# output
|
||||
#CONFIG_ANDROID_LOG=y
|
||||
|
||||
# Enable privilege separation (see README 'Privilege separation' for details)
|
||||
#CONFIG_PRIVSEP=y
|
||||
|
||||
# Enable mitigation against certain attacks against TKIP by delaying Michael
|
||||
# MIC error reports by a random amount of time between 0 and 60 seconds
|
||||
#CONFIG_DELAYED_MIC_ERROR_REPORT=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# wpa_supplicant depends on strong random number generation being available
|
||||
# from the operating system. os_get_random() function is used to fetch random
|
||||
# data when needed, e.g., for key generation. On Linux and BSD systems, this
|
||||
# works by reading /dev/urandom. It should be noted that the OS entropy pool
|
||||
# needs to be properly initialized before wpa_supplicant is started. This is
|
||||
# important especially on embedded devices that do not have a hardware random
|
||||
# number generator and may by default start up with minimal entropy available
|
||||
# for random number generation.
|
||||
#
|
||||
# As a safety net, wpa_supplicant is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data fetched
|
||||
# from the OS. This by itself is not considered to be very strong, but it may
|
||||
# help in cases where the system pool is not initialized properly. However, it
|
||||
# is very strongly recommended that the system pool is initialized with enough
|
||||
# entropy either by using hardware assisted random number generator or by
|
||||
# storing state over device reboots.
|
||||
#
|
||||
# wpa_supplicant can be configured to maintain its own entropy store over
|
||||
# restarts to enhance random number generation. This is not perfect, but it is
|
||||
# much more secure than using the same sequence of random numbers after every
|
||||
# reboot. This can be enabled with -e<entropy file> command line option. The
|
||||
# specified file needs to be readable and writable by wpa_supplicant.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal wpa_supplicant random pool can be
|
||||
# disabled. This will save some in binary size and CPU use. However, this
|
||||
# should only be considered for builds that are known to be used on devices
|
||||
# that meet the requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support (mainly for AP mode)
|
||||
#CONFIG_IEEE80211N=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode)
|
||||
# (depends on CONFIG_IEEE80211N)
|
||||
#CONFIG_IEEE80211AC=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
CONFIG_WNM=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks (GAS/ANQP to learn more about the networks and network
|
||||
# selection based on available credentials).
|
||||
CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
CONFIG_HS20=y
|
||||
|
||||
# Enable interface matching in wpa_supplicant
|
||||
#CONFIG_MATCH_IFACE=y
|
||||
|
||||
# Disable roaming in wpa_supplicant
|
||||
#CONFIG_NO_ROAMING=y
|
||||
|
||||
# AP mode operations with wpa_supplicant
|
||||
# This can be used for controlling AP mode operations with wpa_supplicant. It
|
||||
# should be noted that this is mainly aimed at simple cases like
|
||||
# WPA2-Personal while more complex configurations like WPA2-Enterprise with an
|
||||
# external RADIUS server can be supported with hostapd.
|
||||
#CONFIG_AP=y
|
||||
|
||||
# P2P (Wi-Fi Direct)
|
||||
# This can be used to enable P2P support in wpa_supplicant. See README-P2P for
|
||||
# more information on P2P operations.
|
||||
#CONFIG_P2P=y
|
||||
|
||||
# Enable TDLS support
|
||||
#CONFIG_TDLS=y
|
||||
|
||||
# Wi-Fi Display
|
||||
# This can be used to enable Wi-Fi Display extensions for P2P using an external
|
||||
# program to control the additional information exchanges in the messages.
|
||||
#CONFIG_WIFI_DISPLAY=y
|
||||
|
||||
# Autoscan
|
||||
# This can be used to enable automatic scan support in wpa_supplicant.
|
||||
# See wpa_supplicant.conf for more information on autoscan usage.
|
||||
#
|
||||
# Enabling directly a module will enable autoscan support.
|
||||
# For exponential module:
|
||||
#CONFIG_AUTOSCAN_EXPONENTIAL=y
|
||||
# For periodic module:
|
||||
#CONFIG_AUTOSCAN_PERIODIC=y
|
||||
|
||||
# Password (and passphrase, etc.) backend for external storage
|
||||
# These optional mechanisms can be used to add support for storing passwords
|
||||
# and other secrets in external (to wpa_supplicant) location. This allows, for
|
||||
# example, operating system specific key storage to be used
|
||||
#
|
||||
# External password backend for testing purposes (developer use)
|
||||
#CONFIG_EXT_PASSWORD_TEST=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# OS X builds. This is only for building eapol_test.
|
||||
#CONFIG_OSX=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow wpa_supplicant to pick the channel automatically when channel
|
||||
# is set to "0".
|
||||
#
|
||||
# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative
|
||||
# to "channel=0". This would enable us to eventually add other ACS algorithms in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with
|
||||
# a newly to create wpa_supplicant.conf variable acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Support Multi Band Operation
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Support RSN on IBSS networks
|
||||
# This is needed to be able to use mode=1 network profile with proto=RSN and
|
||||
# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None).
|
||||
CONFIG_IBSS_RSN=y
|
||||
|
||||
# External PMKSA cache control
|
||||
# This can be used to enable control interface commands that allow the current
|
||||
# PMKSA cache entries to be fetched and new entries to be added.
|
||||
#CONFIG_PMKSA_CACHE_EXTERNAL=y
|
||||
|
||||
# Mesh Networking (IEEE 802.11s)
|
||||
#CONFIG_MESH=y
|
||||
|
||||
# Background scanning modules
|
||||
# These can be used to request wpa_supplicant to perform background scanning
|
||||
# operations for roaming within an ESS (same SSID). See the bgscan parameter in
|
||||
# the wpa_supplicant.conf file for more details.
|
||||
# Periodic background scans based on signal strength
|
||||
#CONFIG_BGSCAN_SIMPLE=y
|
||||
# Learn channels used by the network and try to avoid bgscans on other
|
||||
# channels (experimental)
|
||||
#CONFIG_BGSCAN_LEARN=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Device Provisioning Protocol (DPP)
|
||||
# This requires CONFIG_IEEE80211W=y to be enabled, too. (see
|
||||
# wpa_supplicant/README-DPP for details)
|
||||
#CONFIG_DPP=y
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
CONFIG_CTRL_IFACE_MIB=y
|
||||
@@ -0,0 +1,625 @@
|
||||
# Example wpa_supplicant build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# wpa_supplicant binary. All lines starting with # are ignored. Configuration
|
||||
# option lines must be commented out complete, if they are not to be included,
|
||||
# i.e., just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cases, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
|
||||
# Uncomment following two lines and fix the paths if you have installed OpenSSL
|
||||
# or GnuTLS in non-default location
|
||||
#CFLAGS += -I/usr/local/openssl/include
|
||||
#LIBS += -L/usr/local/openssl/lib
|
||||
|
||||
# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
|
||||
# the kerberos files are not in the default include path. Following line can be
|
||||
# used to fix build issues on such systems (krb5.h not found).
|
||||
#CFLAGS += -I/usr/include/kerberos
|
||||
|
||||
# Driver interface for generic Linux wireless extensions
|
||||
# Note: WEXT is deprecated in the current Linux kernel version and no new
|
||||
# functionality is added to it. nl80211-based interface is the new
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for Windows NDIS
|
||||
#CONFIG_DRIVER_NDIS=y
|
||||
#CFLAGS += -I/usr/include/w32api/ddk
|
||||
#LIBS += -L/usr/local/lib
|
||||
# For native build using mingw
|
||||
#CONFIG_NATIVE_WINDOWS=y
|
||||
# Additional directories for cross-compilation on Linux host for mingw target
|
||||
#CFLAGS += -I/opt/mingw/mingw32/include/ddk
|
||||
#LIBS += -L/opt/mingw/mingw32/lib
|
||||
#CC=mingw32-gcc
|
||||
# By default, driver_ndis uses WinPcap for low-level operations. This can be
|
||||
# replaced with the following option which replaces WinPcap calls with NDISUIO.
|
||||
# However, this requires that WZC is disabled (net stop wzcsvc) before starting
|
||||
# wpa_supplicant.
|
||||
# CONFIG_USE_NDISUIO=y
|
||||
|
||||
# Driver interface for wired Ethernet drivers
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for MACsec capable Qualcomm Atheros drivers
|
||||
#CONFIG_DRIVER_MACSEC_QCA=y
|
||||
|
||||
# Driver interface for Linux MACsec drivers
|
||||
#CONFIG_DRIVER_MACSEC_LINUX=y
|
||||
|
||||
# Driver interface for the Broadcom RoboSwitch family
|
||||
#CONFIG_DRIVER_ROBOSWITCH=y
|
||||
|
||||
# Driver interface for no driver (e.g., WPS ER only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# Solaris libraries
|
||||
#LIBS += -lsocket -ldlpi -lnsl
|
||||
#LIBS_c += -lsocket
|
||||
|
||||
# Enable IEEE 802.1X Supplicant (automatically included if any EAP method or
|
||||
# MACsec is included)
|
||||
#CONFIG_IEEE8021X_EAPOL=y
|
||||
|
||||
# EAP-MD5
|
||||
#CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-MSCHAPv2
|
||||
#CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-TLS
|
||||
#CONFIG_EAP_TLS=y
|
||||
|
||||
# EAL-PEAP
|
||||
#CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-TTLS
|
||||
#CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-FAST
|
||||
#CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# EAP-GTC
|
||||
#CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-OTP
|
||||
#CONFIG_EAP_OTP=y
|
||||
|
||||
# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# Enable SIM simulator (Milenage) for EAP-SIM
|
||||
#CONFIG_SIM_SIMULATOR=y
|
||||
|
||||
# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd (secure authentication using only a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-PAX
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# LEAP
|
||||
#CONFIG_EAP_LEAP=y
|
||||
|
||||
# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# Enable USIM simulator (Milenage) for EAP-AKA
|
||||
#CONFIG_USIM_SIMULATOR=y
|
||||
|
||||
# EAP-SAKE
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-TNC and related Trusted Network Connect support (experimental)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
#CONFIG_WPS=y
|
||||
# Enable WPS external registrar functionality
|
||||
#CONFIG_WPS_ER=y
|
||||
# Disable credentials for an open network by default when acting as a WPS
|
||||
# registrar.
|
||||
#CONFIG_WPS_REG_DISABLE_OPEN=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# EAP-EKE
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# MACsec
|
||||
#CONFIG_MACSEC=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
#CONFIG_PKCS12=y
|
||||
|
||||
# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
|
||||
# engine.
|
||||
#CONFIG_SMARTCARD=y
|
||||
|
||||
# PC/SC interface for smartcards (USIM, GSM SIM)
|
||||
# Enable this if EAP-SIM or EAP-AKA is included
|
||||
#CONFIG_PCSC=y
|
||||
|
||||
# Support HT overrides (disable HT/HT40, mask MCS rates, etc.)
|
||||
CONFIG_HT_OVERRIDES=y
|
||||
|
||||
# Support VHT overrides (disable VHT, mask MCS rates, etc.)
|
||||
CONFIG_VHT_OVERRIDES=y
|
||||
|
||||
# Development testing
|
||||
#CONFIG_EAPOL_TEST=y
|
||||
|
||||
# Select control interface backend for external programs, e.g, wpa_cli:
|
||||
# unix = UNIX domain sockets (default for Linux/*BSD)
|
||||
# udp = UDP sockets using localhost (127.0.0.1)
|
||||
# udp6 = UDP IPv6 sockets using localhost (::1)
|
||||
# named_pipe = Windows Named Pipe (default for Windows)
|
||||
# udp-remote = UDP sockets with remote access (only for tests systems/purpose)
|
||||
# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose)
|
||||
# y = use default (backwards compatibility)
|
||||
# If this option is commented out, control interface is not included in the
|
||||
# build.
|
||||
CONFIG_CTRL_IFACE=y
|
||||
|
||||
# Include support for GNU Readline and History Libraries in wpa_cli.
|
||||
# When building a wpa_cli binary for distribution, please note that these
|
||||
# libraries are licensed under GPL and as such, BSD license may not apply for
|
||||
# the resulting binary.
|
||||
#CONFIG_READLINE=y
|
||||
|
||||
# Include internal line edit mode in wpa_cli. This can be used as a replacement
|
||||
# for GNU Readline to provide limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Remove debugging code that is printing out debug message to stdout.
|
||||
# This can be used to reduce the size of the wpa_supplicant considerably
|
||||
# if debugging code is not needed. The size reduction can be around 35%
|
||||
# (e.g., 90 kB).
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
|
||||
# 35-50 kB in code size.
|
||||
#CONFIG_NO_WPA=y
|
||||
|
||||
# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
|
||||
# This option can be used to reduce code size by removing support for
|
||||
# converting ASCII passphrases into PSK. If this functionality is removed, the
|
||||
# PSK can only be configured as the 64-octet hexstring (e.g., from
|
||||
# wpa_passphrase). This saves about 0.5 kB in code size.
|
||||
#CONFIG_NO_WPA_PASSPHRASE=y
|
||||
|
||||
# Simultaneous Authentication of Equals (SAE), WPA3-Personal
|
||||
#CONFIG_SAE=y
|
||||
|
||||
# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
|
||||
# This can be used if ap_scan=1 mode is never enabled.
|
||||
#CONFIG_NO_SCAN_PROCESSING=y
|
||||
|
||||
# Select configuration backend:
|
||||
# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
|
||||
# path is given on command line, not here; this option is just used to
|
||||
# select the backend that allows configuration files to be used)
|
||||
# winreg = Windows registry (see win_example.reg for an example)
|
||||
CONFIG_BACKEND=file
|
||||
|
||||
# Remove configuration write functionality (i.e., to allow the configuration
|
||||
# file to be updated based on runtime configuration changes). The runtime
|
||||
# configuration can still be changed, the changes are just not going to be
|
||||
# persistent over restarts. This option can be used to reduce code size by
|
||||
# about 3.5 kB.
|
||||
CONFIG_NO_CONFIG_WRITE=y
|
||||
|
||||
# Remove support for configuration blobs to reduce code size by about 1.5 kB.
|
||||
#CONFIG_NO_CONFIG_BLOBS=y
|
||||
|
||||
# Select program entry point implementation:
|
||||
# main = UNIX/POSIX like main() function (default)
|
||||
# main_winsvc = Windows service (read parameters from registry)
|
||||
# main_none = Very basic example (development use only)
|
||||
#CONFIG_MAIN=main
|
||||
|
||||
# Select wrapper for operating system and C library specific functions
|
||||
# unix = UNIX/POSIX like systems (default)
|
||||
# win32 = Windows systems
|
||||
# none = Empty template
|
||||
#CONFIG_OS=unix
|
||||
|
||||
# Select event loop implementation
|
||||
# eloop = select() loop (default)
|
||||
# eloop_win = Windows events and WaitForMultipleObject() loop
|
||||
#CONFIG_ELOOP=eloop
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select layer 2 packet implementation
|
||||
# linux = Linux packet socket (default)
|
||||
# pcap = libpcap/libdnet/WinPcap
|
||||
# freebsd = FreeBSD libpcap
|
||||
# winpcap = WinPcap with receive thread
|
||||
# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
|
||||
# none = Empty template
|
||||
#CONFIG_L2_PACKET=linux
|
||||
|
||||
# Disable Linux packet socket workaround applicable for station interface
|
||||
# in a bridge for EAPOL frames. This should be uncommented only if the kernel
|
||||
# is known to not have the regression issue in packet socket behavior with
|
||||
# bridge interfaces (commit 'bridge: respect RFC2863 operational state')').
|
||||
CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y
|
||||
|
||||
# IEEE 802.11w (management frame protection), also known as PMF
|
||||
# Driver support is also needed for IEEE 802.11w.
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
#CONFIG_OCV=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used. It should be noted that some existing TLS v1.0 -based
|
||||
# implementation may not be compatible with TLS v1.1 message (ClientHello is
|
||||
# sent prior to negotiating which version will be used)
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms. It should be
|
||||
# noted that some existing TLS v1.0 -based implementation may not be compatible
|
||||
# with TLS v1.2 message (ClientHello is sent prior to negotiating which version
|
||||
# will be used)
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
#CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
|
||||
# This is only for Windows builds and requires WMI-related header files and
|
||||
# WbemUuid.Lib from Platform SDK even when building with MinGW.
|
||||
#CONFIG_NDIS_EVENTS_INTEGRATED=y
|
||||
#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
|
||||
|
||||
# Add support for new DBus control interface
|
||||
# (fi.w1.hostap.wpa_supplicant1)
|
||||
#CONFIG_CTRL_IFACE_DBUS_NEW=y
|
||||
|
||||
# Add introspection support for new DBus control interface
|
||||
#CONFIG_CTRL_IFACE_DBUS_INTRO=y
|
||||
|
||||
# Add support for loading EAP methods dynamically as shared libraries.
|
||||
# When this option is enabled, each EAP method can be either included
|
||||
# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
|
||||
# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
|
||||
# be loaded in the beginning of the wpa_supplicant configuration file
|
||||
# (see load_dynamic_eap parameter in the example file) before being used in
|
||||
# the network blocks.
|
||||
#
|
||||
# Note that some shared parts of EAP methods are included in the main program
|
||||
# and in order to be able to use dynamic EAP methods using these parts, the
|
||||
# main program must have been build with the EAP method enabled (=y or =dyn).
|
||||
# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
|
||||
# unless at least one of them was included in the main build to force inclusion
|
||||
# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
|
||||
# in the main build to be able to load these methods dynamically.
|
||||
#
|
||||
# Please also note that using dynamic libraries will increase the total binary
|
||||
# size. Thus, it may not be the best option for targets that have limited
|
||||
# amount of memory/flash.
|
||||
#CONFIG_DYNAMIC_EAP_METHODS=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode
|
||||
#CONFIG_IEEE80211R=y
|
||||
|
||||
# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
# Set syslog facility for debug messages
|
||||
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Add support for writing debug log to Android logcat instead of standard
|
||||
# output
|
||||
#CONFIG_ANDROID_LOG=y
|
||||
|
||||
# Enable privilege separation (see README 'Privilege separation' for details)
|
||||
#CONFIG_PRIVSEP=y
|
||||
|
||||
# Enable mitigation against certain attacks against TKIP by delaying Michael
|
||||
# MIC error reports by a random amount of time between 0 and 60 seconds
|
||||
#CONFIG_DELAYED_MIC_ERROR_REPORT=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# wpa_supplicant depends on strong random number generation being available
|
||||
# from the operating system. os_get_random() function is used to fetch random
|
||||
# data when needed, e.g., for key generation. On Linux and BSD systems, this
|
||||
# works by reading /dev/urandom. It should be noted that the OS entropy pool
|
||||
# needs to be properly initialized before wpa_supplicant is started. This is
|
||||
# important especially on embedded devices that do not have a hardware random
|
||||
# number generator and may by default start up with minimal entropy available
|
||||
# for random number generation.
|
||||
#
|
||||
# As a safety net, wpa_supplicant is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data fetched
|
||||
# from the OS. This by itself is not considered to be very strong, but it may
|
||||
# help in cases where the system pool is not initialized properly. However, it
|
||||
# is very strongly recommended that the system pool is initialized with enough
|
||||
# entropy either by using hardware assisted random number generator or by
|
||||
# storing state over device reboots.
|
||||
#
|
||||
# wpa_supplicant can be configured to maintain its own entropy store over
|
||||
# restarts to enhance random number generation. This is not perfect, but it is
|
||||
# much more secure than using the same sequence of random numbers after every
|
||||
# reboot. This can be enabled with -e<entropy file> command line option. The
|
||||
# specified file needs to be readable and writable by wpa_supplicant.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal wpa_supplicant random pool can be
|
||||
# disabled. This will save some in binary size and CPU use. However, this
|
||||
# should only be considered for builds that are known to be used on devices
|
||||
# that meet the requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support (mainly for AP mode)
|
||||
#CONFIG_IEEE80211N=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode)
|
||||
# (depends on CONFIG_IEEE80211N)
|
||||
#CONFIG_IEEE80211AC=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
#CONFIG_WNM=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks (GAS/ANQP to learn more about the networks and network
|
||||
# selection based on available credentials).
|
||||
#CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
#CONFIG_HS20=y
|
||||
|
||||
# Enable interface matching in wpa_supplicant
|
||||
#CONFIG_MATCH_IFACE=y
|
||||
|
||||
# Disable roaming in wpa_supplicant
|
||||
#CONFIG_NO_ROAMING=y
|
||||
|
||||
# AP mode operations with wpa_supplicant
|
||||
# This can be used for controlling AP mode operations with wpa_supplicant. It
|
||||
# should be noted that this is mainly aimed at simple cases like
|
||||
# WPA2-Personal while more complex configurations like WPA2-Enterprise with an
|
||||
# external RADIUS server can be supported with hostapd.
|
||||
#CONFIG_AP=y
|
||||
|
||||
# P2P (Wi-Fi Direct)
|
||||
# This can be used to enable P2P support in wpa_supplicant. See README-P2P for
|
||||
# more information on P2P operations.
|
||||
#CONFIG_P2P=y
|
||||
|
||||
# Enable TDLS support
|
||||
#CONFIG_TDLS=y
|
||||
|
||||
# Wi-Fi Display
|
||||
# This can be used to enable Wi-Fi Display extensions for P2P using an external
|
||||
# program to control the additional information exchanges in the messages.
|
||||
#CONFIG_WIFI_DISPLAY=y
|
||||
|
||||
# Autoscan
|
||||
# This can be used to enable automatic scan support in wpa_supplicant.
|
||||
# See wpa_supplicant.conf for more information on autoscan usage.
|
||||
#
|
||||
# Enabling directly a module will enable autoscan support.
|
||||
# For exponential module:
|
||||
#CONFIG_AUTOSCAN_EXPONENTIAL=y
|
||||
# For periodic module:
|
||||
#CONFIG_AUTOSCAN_PERIODIC=y
|
||||
|
||||
# Password (and passphrase, etc.) backend for external storage
|
||||
# These optional mechanisms can be used to add support for storing passwords
|
||||
# and other secrets in external (to wpa_supplicant) location. This allows, for
|
||||
# example, operating system specific key storage to be used
|
||||
#
|
||||
# External password backend for testing purposes (developer use)
|
||||
#CONFIG_EXT_PASSWORD_TEST=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# OS X builds. This is only for building eapol_test.
|
||||
#CONFIG_OSX=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow wpa_supplicant to pick the channel automatically when channel
|
||||
# is set to "0".
|
||||
#
|
||||
# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative
|
||||
# to "channel=0". This would enable us to eventually add other ACS algorithms in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with
|
||||
# a newly to create wpa_supplicant.conf variable acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Support Multi Band Operation
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Support RSN on IBSS networks
|
||||
# This is needed to be able to use mode=1 network profile with proto=RSN and
|
||||
# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None).
|
||||
#CONFIG_IBSS_RSN=y
|
||||
|
||||
# External PMKSA cache control
|
||||
# This can be used to enable control interface commands that allow the current
|
||||
# PMKSA cache entries to be fetched and new entries to be added.
|
||||
#CONFIG_PMKSA_CACHE_EXTERNAL=y
|
||||
|
||||
# Mesh Networking (IEEE 802.11s)
|
||||
#CONFIG_MESH=y
|
||||
|
||||
# Background scanning modules
|
||||
# These can be used to request wpa_supplicant to perform background scanning
|
||||
# operations for roaming within an ESS (same SSID). See the bgscan parameter in
|
||||
# the wpa_supplicant.conf file for more details.
|
||||
# Periodic background scans based on signal strength
|
||||
#CONFIG_BGSCAN_SIMPLE=y
|
||||
# Learn channels used by the network and try to avoid bgscans on other
|
||||
# channels (experimental)
|
||||
#CONFIG_BGSCAN_LEARN=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Device Provisioning Protocol (DPP)
|
||||
# This requires CONFIG_IEEE80211W=y to be enabled, too. (see
|
||||
# wpa_supplicant/README-DPP for details)
|
||||
#CONFIG_DPP=y
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
#CONFIG_CTRL_IFACE_MIB=y
|
||||
625
package/network/services/hostapd/files/wpa_supplicant-p2p.config
Normal file
625
package/network/services/hostapd/files/wpa_supplicant-p2p.config
Normal file
@@ -0,0 +1,625 @@
|
||||
# Example wpa_supplicant build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# wpa_supplicant binary. All lines starting with # are ignored. Configuration
|
||||
# option lines must be commented out complete, if they are not to be included,
|
||||
# i.e., just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cases, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
|
||||
# Uncomment following two lines and fix the paths if you have installed OpenSSL
|
||||
# or GnuTLS in non-default location
|
||||
#CFLAGS += -I/usr/local/openssl/include
|
||||
#LIBS += -L/usr/local/openssl/lib
|
||||
|
||||
# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
|
||||
# the kerberos files are not in the default include path. Following line can be
|
||||
# used to fix build issues on such systems (krb5.h not found).
|
||||
#CFLAGS += -I/usr/include/kerberos
|
||||
|
||||
# Driver interface for generic Linux wireless extensions
|
||||
# Note: WEXT is deprecated in the current Linux kernel version and no new
|
||||
# functionality is added to it. nl80211-based interface is the new
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for Windows NDIS
|
||||
#CONFIG_DRIVER_NDIS=y
|
||||
#CFLAGS += -I/usr/include/w32api/ddk
|
||||
#LIBS += -L/usr/local/lib
|
||||
# For native build using mingw
|
||||
#CONFIG_NATIVE_WINDOWS=y
|
||||
# Additional directories for cross-compilation on Linux host for mingw target
|
||||
#CFLAGS += -I/opt/mingw/mingw32/include/ddk
|
||||
#LIBS += -L/opt/mingw/mingw32/lib
|
||||
#CC=mingw32-gcc
|
||||
# By default, driver_ndis uses WinPcap for low-level operations. This can be
|
||||
# replaced with the following option which replaces WinPcap calls with NDISUIO.
|
||||
# However, this requires that WZC is disabled (net stop wzcsvc) before starting
|
||||
# wpa_supplicant.
|
||||
# CONFIG_USE_NDISUIO=y
|
||||
|
||||
# Driver interface for wired Ethernet drivers
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for MACsec capable Qualcomm Atheros drivers
|
||||
#CONFIG_DRIVER_MACSEC_QCA=y
|
||||
|
||||
# Driver interface for Linux MACsec drivers
|
||||
#CONFIG_DRIVER_MACSEC_LINUX=y
|
||||
|
||||
# Driver interface for the Broadcom RoboSwitch family
|
||||
#CONFIG_DRIVER_ROBOSWITCH=y
|
||||
|
||||
# Driver interface for no driver (e.g., WPS ER only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# Solaris libraries
|
||||
#LIBS += -lsocket -ldlpi -lnsl
|
||||
#LIBS_c += -lsocket
|
||||
|
||||
# Enable IEEE 802.1X Supplicant (automatically included if any EAP method or
|
||||
# MACsec is included)
|
||||
CONFIG_IEEE8021X_EAPOL=y
|
||||
|
||||
# EAP-MD5
|
||||
CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-MSCHAPv2
|
||||
CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-TLS
|
||||
CONFIG_EAP_TLS=y
|
||||
|
||||
# EAL-PEAP
|
||||
CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-TTLS
|
||||
CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-FAST
|
||||
CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# EAP-GTC
|
||||
CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-OTP
|
||||
CONFIG_EAP_OTP=y
|
||||
|
||||
# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# Enable SIM simulator (Milenage) for EAP-SIM
|
||||
#CONFIG_SIM_SIMULATOR=y
|
||||
|
||||
# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd (secure authentication using only a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-PAX
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# LEAP
|
||||
CONFIG_EAP_LEAP=y
|
||||
|
||||
# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# Enable USIM simulator (Milenage) for EAP-AKA
|
||||
#CONFIG_USIM_SIMULATOR=y
|
||||
|
||||
# EAP-SAKE
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-TNC and related Trusted Network Connect support (experimental)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
CONFIG_WPS=y
|
||||
# Enable WPS external registrar functionality
|
||||
#CONFIG_WPS_ER=y
|
||||
# Disable credentials for an open network by default when acting as a WPS
|
||||
# registrar.
|
||||
#CONFIG_WPS_REG_DISABLE_OPEN=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# EAP-EKE
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# MACsec
|
||||
#CONFIG_MACSEC=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
CONFIG_PKCS12=y
|
||||
|
||||
# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
|
||||
# engine.
|
||||
CONFIG_SMARTCARD=y
|
||||
|
||||
# PC/SC interface for smartcards (USIM, GSM SIM)
|
||||
# Enable this if EAP-SIM or EAP-AKA is included
|
||||
#CONFIG_PCSC=y
|
||||
|
||||
# Support HT overrides (disable HT/HT40, mask MCS rates, etc.)
|
||||
CONFIG_HT_OVERRIDES=y
|
||||
|
||||
# Support VHT overrides (disable VHT, mask MCS rates, etc.)
|
||||
CONFIG_VHT_OVERRIDES=y
|
||||
|
||||
# Development testing
|
||||
#CONFIG_EAPOL_TEST=y
|
||||
|
||||
# Select control interface backend for external programs, e.g, wpa_cli:
|
||||
# unix = UNIX domain sockets (default for Linux/*BSD)
|
||||
# udp = UDP sockets using localhost (127.0.0.1)
|
||||
# udp6 = UDP IPv6 sockets using localhost (::1)
|
||||
# named_pipe = Windows Named Pipe (default for Windows)
|
||||
# udp-remote = UDP sockets with remote access (only for tests systems/purpose)
|
||||
# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose)
|
||||
# y = use default (backwards compatibility)
|
||||
# If this option is commented out, control interface is not included in the
|
||||
# build.
|
||||
CONFIG_CTRL_IFACE=y
|
||||
|
||||
# Include support for GNU Readline and History Libraries in wpa_cli.
|
||||
# When building a wpa_cli binary for distribution, please note that these
|
||||
# libraries are licensed under GPL and as such, BSD license may not apply for
|
||||
# the resulting binary.
|
||||
#CONFIG_READLINE=y
|
||||
|
||||
# Include internal line edit mode in wpa_cli. This can be used as a replacement
|
||||
# for GNU Readline to provide limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Remove debugging code that is printing out debug message to stdout.
|
||||
# This can be used to reduce the size of the wpa_supplicant considerably
|
||||
# if debugging code is not needed. The size reduction can be around 35%
|
||||
# (e.g., 90 kB).
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
|
||||
# 35-50 kB in code size.
|
||||
#CONFIG_NO_WPA=y
|
||||
|
||||
# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
|
||||
# This option can be used to reduce code size by removing support for
|
||||
# converting ASCII passphrases into PSK. If this functionality is removed, the
|
||||
# PSK can only be configured as the 64-octet hexstring (e.g., from
|
||||
# wpa_passphrase). This saves about 0.5 kB in code size.
|
||||
#CONFIG_NO_WPA_PASSPHRASE=y
|
||||
|
||||
# Simultaneous Authentication of Equals (SAE), WPA3-Personal
|
||||
#CONFIG_SAE=y
|
||||
|
||||
# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
|
||||
# This can be used if ap_scan=1 mode is never enabled.
|
||||
#CONFIG_NO_SCAN_PROCESSING=y
|
||||
|
||||
# Select configuration backend:
|
||||
# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
|
||||
# path is given on command line, not here; this option is just used to
|
||||
# select the backend that allows configuration files to be used)
|
||||
# winreg = Windows registry (see win_example.reg for an example)
|
||||
CONFIG_BACKEND=file
|
||||
|
||||
# Remove configuration write functionality (i.e., to allow the configuration
|
||||
# file to be updated based on runtime configuration changes). The runtime
|
||||
# configuration can still be changed, the changes are just not going to be
|
||||
# persistent over restarts. This option can be used to reduce code size by
|
||||
# about 3.5 kB.
|
||||
#CONFIG_NO_CONFIG_WRITE=y
|
||||
|
||||
# Remove support for configuration blobs to reduce code size by about 1.5 kB.
|
||||
#CONFIG_NO_CONFIG_BLOBS=y
|
||||
|
||||
# Select program entry point implementation:
|
||||
# main = UNIX/POSIX like main() function (default)
|
||||
# main_winsvc = Windows service (read parameters from registry)
|
||||
# main_none = Very basic example (development use only)
|
||||
#CONFIG_MAIN=main
|
||||
|
||||
# Select wrapper for operating system and C library specific functions
|
||||
# unix = UNIX/POSIX like systems (default)
|
||||
# win32 = Windows systems
|
||||
# none = Empty template
|
||||
#CONFIG_OS=unix
|
||||
|
||||
# Select event loop implementation
|
||||
# eloop = select() loop (default)
|
||||
# eloop_win = Windows events and WaitForMultipleObject() loop
|
||||
#CONFIG_ELOOP=eloop
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select layer 2 packet implementation
|
||||
# linux = Linux packet socket (default)
|
||||
# pcap = libpcap/libdnet/WinPcap
|
||||
# freebsd = FreeBSD libpcap
|
||||
# winpcap = WinPcap with receive thread
|
||||
# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
|
||||
# none = Empty template
|
||||
#CONFIG_L2_PACKET=linux
|
||||
|
||||
# Disable Linux packet socket workaround applicable for station interface
|
||||
# in a bridge for EAPOL frames. This should be uncommented only if the kernel
|
||||
# is known to not have the regression issue in packet socket behavior with
|
||||
# bridge interfaces (commit 'bridge: respect RFC2863 operational state')').
|
||||
CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y
|
||||
|
||||
# IEEE 802.11w (management frame protection), also known as PMF
|
||||
# Driver support is also needed for IEEE 802.11w.
|
||||
CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
#CONFIG_OCV=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used. It should be noted that some existing TLS v1.0 -based
|
||||
# implementation may not be compatible with TLS v1.1 message (ClientHello is
|
||||
# sent prior to negotiating which version will be used)
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms. It should be
|
||||
# noted that some existing TLS v1.0 -based implementation may not be compatible
|
||||
# with TLS v1.2 message (ClientHello is sent prior to negotiating which version
|
||||
# will be used)
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
|
||||
# This is only for Windows builds and requires WMI-related header files and
|
||||
# WbemUuid.Lib from Platform SDK even when building with MinGW.
|
||||
#CONFIG_NDIS_EVENTS_INTEGRATED=y
|
||||
#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
|
||||
|
||||
# Add support for new DBus control interface
|
||||
# (fi.w1.hostap.wpa_supplicant1)
|
||||
#CONFIG_CTRL_IFACE_DBUS_NEW=y
|
||||
|
||||
# Add introspection support for new DBus control interface
|
||||
#CONFIG_CTRL_IFACE_DBUS_INTRO=y
|
||||
|
||||
# Add support for loading EAP methods dynamically as shared libraries.
|
||||
# When this option is enabled, each EAP method can be either included
|
||||
# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
|
||||
# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
|
||||
# be loaded in the beginning of the wpa_supplicant configuration file
|
||||
# (see load_dynamic_eap parameter in the example file) before being used in
|
||||
# the network blocks.
|
||||
#
|
||||
# Note that some shared parts of EAP methods are included in the main program
|
||||
# and in order to be able to use dynamic EAP methods using these parts, the
|
||||
# main program must have been build with the EAP method enabled (=y or =dyn).
|
||||
# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
|
||||
# unless at least one of them was included in the main build to force inclusion
|
||||
# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
|
||||
# in the main build to be able to load these methods dynamically.
|
||||
#
|
||||
# Please also note that using dynamic libraries will increase the total binary
|
||||
# size. Thus, it may not be the best option for targets that have limited
|
||||
# amount of memory/flash.
|
||||
#CONFIG_DYNAMIC_EAP_METHODS=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode
|
||||
#CONFIG_IEEE80211R=y
|
||||
|
||||
# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
# Set syslog facility for debug messages
|
||||
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Add support for writing debug log to Android logcat instead of standard
|
||||
# output
|
||||
#CONFIG_ANDROID_LOG=y
|
||||
|
||||
# Enable privilege separation (see README 'Privilege separation' for details)
|
||||
#CONFIG_PRIVSEP=y
|
||||
|
||||
# Enable mitigation against certain attacks against TKIP by delaying Michael
|
||||
# MIC error reports by a random amount of time between 0 and 60 seconds
|
||||
#CONFIG_DELAYED_MIC_ERROR_REPORT=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# wpa_supplicant depends on strong random number generation being available
|
||||
# from the operating system. os_get_random() function is used to fetch random
|
||||
# data when needed, e.g., for key generation. On Linux and BSD systems, this
|
||||
# works by reading /dev/urandom. It should be noted that the OS entropy pool
|
||||
# needs to be properly initialized before wpa_supplicant is started. This is
|
||||
# important especially on embedded devices that do not have a hardware random
|
||||
# number generator and may by default start up with minimal entropy available
|
||||
# for random number generation.
|
||||
#
|
||||
# As a safety net, wpa_supplicant is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data fetched
|
||||
# from the OS. This by itself is not considered to be very strong, but it may
|
||||
# help in cases where the system pool is not initialized properly. However, it
|
||||
# is very strongly recommended that the system pool is initialized with enough
|
||||
# entropy either by using hardware assisted random number generator or by
|
||||
# storing state over device reboots.
|
||||
#
|
||||
# wpa_supplicant can be configured to maintain its own entropy store over
|
||||
# restarts to enhance random number generation. This is not perfect, but it is
|
||||
# much more secure than using the same sequence of random numbers after every
|
||||
# reboot. This can be enabled with -e<entropy file> command line option. The
|
||||
# specified file needs to be readable and writable by wpa_supplicant.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal wpa_supplicant random pool can be
|
||||
# disabled. This will save some in binary size and CPU use. However, this
|
||||
# should only be considered for builds that are known to be used on devices
|
||||
# that meet the requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support (mainly for AP mode)
|
||||
#CONFIG_IEEE80211N=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode)
|
||||
# (depends on CONFIG_IEEE80211N)
|
||||
#CONFIG_IEEE80211AC=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
#CONFIG_WNM=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks (GAS/ANQP to learn more about the networks and network
|
||||
# selection based on available credentials).
|
||||
#CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
#CONFIG_HS20=y
|
||||
|
||||
# Enable interface matching in wpa_supplicant
|
||||
#CONFIG_MATCH_IFACE=y
|
||||
|
||||
# Disable roaming in wpa_supplicant
|
||||
#CONFIG_NO_ROAMING=y
|
||||
|
||||
# AP mode operations with wpa_supplicant
|
||||
# This can be used for controlling AP mode operations with wpa_supplicant. It
|
||||
# should be noted that this is mainly aimed at simple cases like
|
||||
# WPA2-Personal while more complex configurations like WPA2-Enterprise with an
|
||||
# external RADIUS server can be supported with hostapd.
|
||||
CONFIG_AP=y
|
||||
|
||||
# P2P (Wi-Fi Direct)
|
||||
# This can be used to enable P2P support in wpa_supplicant. See README-P2P for
|
||||
# more information on P2P operations.
|
||||
CONFIG_P2P=y
|
||||
|
||||
# Enable TDLS support
|
||||
#CONFIG_TDLS=y
|
||||
|
||||
# Wi-Fi Display
|
||||
# This can be used to enable Wi-Fi Display extensions for P2P using an external
|
||||
# program to control the additional information exchanges in the messages.
|
||||
#CONFIG_WIFI_DISPLAY=y
|
||||
|
||||
# Autoscan
|
||||
# This can be used to enable automatic scan support in wpa_supplicant.
|
||||
# See wpa_supplicant.conf for more information on autoscan usage.
|
||||
#
|
||||
# Enabling directly a module will enable autoscan support.
|
||||
# For exponential module:
|
||||
#CONFIG_AUTOSCAN_EXPONENTIAL=y
|
||||
# For periodic module:
|
||||
#CONFIG_AUTOSCAN_PERIODIC=y
|
||||
|
||||
# Password (and passphrase, etc.) backend for external storage
|
||||
# These optional mechanisms can be used to add support for storing passwords
|
||||
# and other secrets in external (to wpa_supplicant) location. This allows, for
|
||||
# example, operating system specific key storage to be used
|
||||
#
|
||||
# External password backend for testing purposes (developer use)
|
||||
#CONFIG_EXT_PASSWORD_TEST=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# OS X builds. This is only for building eapol_test.
|
||||
#CONFIG_OSX=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow wpa_supplicant to pick the channel automatically when channel
|
||||
# is set to "0".
|
||||
#
|
||||
# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative
|
||||
# to "channel=0". This would enable us to eventually add other ACS algorithms in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with
|
||||
# a newly to create wpa_supplicant.conf variable acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Support Multi Band Operation
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Support RSN on IBSS networks
|
||||
# This is needed to be able to use mode=1 network profile with proto=RSN and
|
||||
# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None).
|
||||
CONFIG_IBSS_RSN=y
|
||||
|
||||
# External PMKSA cache control
|
||||
# This can be used to enable control interface commands that allow the current
|
||||
# PMKSA cache entries to be fetched and new entries to be added.
|
||||
#CONFIG_PMKSA_CACHE_EXTERNAL=y
|
||||
|
||||
# Mesh Networking (IEEE 802.11s)
|
||||
#CONFIG_MESH=y
|
||||
|
||||
# Background scanning modules
|
||||
# These can be used to request wpa_supplicant to perform background scanning
|
||||
# operations for roaming within an ESS (same SSID). See the bgscan parameter in
|
||||
# the wpa_supplicant.conf file for more details.
|
||||
# Periodic background scans based on signal strength
|
||||
#CONFIG_BGSCAN_SIMPLE=y
|
||||
# Learn channels used by the network and try to avoid bgscans on other
|
||||
# channels (experimental)
|
||||
#CONFIG_BGSCAN_LEARN=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Device Provisioning Protocol (DPP)
|
||||
# This requires CONFIG_IEEE80211W=y to be enabled, too. (see
|
||||
# wpa_supplicant/README-DPP for details)
|
||||
#CONFIG_DPP=y
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
#CONFIG_CTRL_IFACE_MIB=y
|
||||
41
package/network/services/hostapd/files/wpad.init
Normal file
41
package/network/services/hostapd/files/wpad.init
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=19
|
||||
STOP=21
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=wpad
|
||||
|
||||
start_service() {
|
||||
if [ -x "/usr/sbin/hostapd" ]; then
|
||||
mkdir -p /var/run/hostapd
|
||||
chown network:network /var/run/hostapd
|
||||
procd_open_instance hostapd
|
||||
procd_set_param command /usr/sbin/hostapd -s -g /var/run/hostapd/global
|
||||
procd_set_param respawn 3600 1 0
|
||||
[ -x /sbin/ujail -a -e /etc/capabilities/wpad.json ] && {
|
||||
procd_add_jail hostapd
|
||||
procd_set_param capabilities /etc/capabilities/wpad.json
|
||||
procd_set_param user network
|
||||
procd_set_param group network
|
||||
procd_set_param no_new_privs 1
|
||||
}
|
||||
procd_close_instance
|
||||
fi
|
||||
|
||||
if [ -x "/usr/sbin/wpa_supplicant" ]; then
|
||||
mkdir -p /var/run/wpa_supplicant
|
||||
chown network:network /var/run/wpa_supplicant
|
||||
procd_open_instance supplicant
|
||||
procd_set_param command /usr/sbin/wpa_supplicant -n -s -g /var/run/wpa_supplicant/global
|
||||
procd_set_param respawn 3600 1 0
|
||||
[ -x /sbin/ujail -a -e /etc/capabilities/wpad.json ] && {
|
||||
procd_add_jail wpa_supplicant
|
||||
procd_set_param capabilities /etc/capabilities/wpad.json
|
||||
procd_set_param user network
|
||||
procd_set_param group network
|
||||
procd_set_param no_new_privs 1
|
||||
}
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
22
package/network/services/hostapd/files/wpad.json
Normal file
22
package/network/services/hostapd/files/wpad.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"bounding": [
|
||||
"CAP_NET_ADMIN",
|
||||
"CAP_NET_RAW"
|
||||
],
|
||||
"effective": [
|
||||
"CAP_NET_ADMIN",
|
||||
"CAP_NET_RAW"
|
||||
],
|
||||
"ambient": [
|
||||
"CAP_NET_ADMIN",
|
||||
"CAP_NET_RAW"
|
||||
],
|
||||
"permitted": [
|
||||
"CAP_NET_ADMIN",
|
||||
"CAP_NET_RAW"
|
||||
],
|
||||
"inheritable": [
|
||||
"CAP_NET_ADMIN",
|
||||
"CAP_NET_RAW"
|
||||
]
|
||||
}
|
||||
10
package/network/services/hostapd/files/wpad_acl.json
Normal file
10
package/network/services/hostapd/files/wpad_acl.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"user": "network",
|
||||
"access": {
|
||||
"service": {
|
||||
"methods": [ "event" ]
|
||||
}
|
||||
},
|
||||
"publish": [ "hostapd", "hostapd.*", "wpa_supplicant", "wpa_supplicant.*" ],
|
||||
"send": [ "bss.*", "wps_credentials" ]
|
||||
}
|
||||
62
package/network/services/hostapd/files/wps-hotplug.sh
Normal file
62
package/network/services/hostapd/files/wps-hotplug.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
|
||||
wps_catch_credentials() {
|
||||
local iface ifaces ifc ifname ssid encryption key radio radios
|
||||
local found=0
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
ubus -S -t 30 listen wps_credentials | while read creds; do
|
||||
json_init
|
||||
json_load "$creds"
|
||||
json_select wps_credentials || continue
|
||||
json_get_vars ifname ssid key encryption
|
||||
local ifcname="$ifname"
|
||||
json_init
|
||||
json_load "$(ubus -S call network.wireless status)"
|
||||
json_get_keys radios
|
||||
for radio in $radios; do
|
||||
json_select $radio
|
||||
json_select interfaces
|
||||
json_get_keys ifaces
|
||||
for ifc in $ifaces; do
|
||||
json_select $ifc
|
||||
json_get_vars ifname
|
||||
[ "$ifname" = "$ifcname" ] && {
|
||||
ubus -S call uci set "{\"config\":\"wireless\", \"type\":\"wifi-iface\", \
|
||||
\"match\": { \"device\": \"$radio\", \"encryption\": \"wps\" }, \
|
||||
\"values\": { \"encryption\": \"$encryption\", \
|
||||
\"ssid\": \"$ssid\", \
|
||||
\"key\": \"$key\" } }"
|
||||
ubus -S call uci commit '{"config": "wireless"}'
|
||||
ubus -S call uci apply
|
||||
}
|
||||
json_select ..
|
||||
done
|
||||
json_select ..
|
||||
json_select ..
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then
|
||||
wps_done=0
|
||||
ubusobjs="$( ubus -S list hostapd.* )"
|
||||
for ubusobj in $ubusobjs; do
|
||||
ubus -S call $ubusobj wps_start && wps_done=1
|
||||
done
|
||||
[ $wps_done = 0 ] || return 0
|
||||
wps_done=0
|
||||
ubusobjs="$( ubus -S list wpa_supplicant.* )"
|
||||
for ubusobj in $ubusobjs; do
|
||||
ifname="$(echo $ubusobj | cut -d'.' -f2 )"
|
||||
multi_ap=""
|
||||
if [ -e "/var/run/wpa_supplicant-${ifname}.conf.is_multiap" ]; then
|
||||
ubus -S call $ubusobj wps_start '{ "multi_ap": true }' && wps_done=1
|
||||
else
|
||||
ubus -S call $ubusobj wps_start && wps_done=1
|
||||
fi
|
||||
done
|
||||
[ $wps_done = 0 ] || wps_catch_credentials &
|
||||
fi
|
||||
|
||||
return 0
|
||||
@@ -0,0 +1,43 @@
|
||||
From 21ce83b4ae2b9563175fdb4fc4312096cc399cf8 Mon Sep 17 00:00:00 2001
|
||||
From: David Bauer <mail@david-bauer.net>
|
||||
Date: Wed, 5 May 2021 00:44:34 +0200
|
||||
Subject: [PATCH] wolfssl: add RNG to EC key
|
||||
|
||||
Since upstream commit 6467de5a8840 ("Randomize z ordinates in
|
||||
scalar mult when timing resistant") WolfSSL requires a RNG for
|
||||
the EC key when built hardened which is the default.
|
||||
|
||||
Set the RNG for the EC key to fix connections for OWE clients.
|
||||
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
---
|
||||
src/crypto/crypto_wolfssl.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/src/crypto/crypto_wolfssl.c
|
||||
+++ b/src/crypto/crypto_wolfssl.c
|
||||
@@ -1303,6 +1303,7 @@ int ecc_projective_add_point(ecc_point *
|
||||
|
||||
struct crypto_ec {
|
||||
ecc_key key;
|
||||
+ WC_RNG rng;
|
||||
mp_int a;
|
||||
mp_int prime;
|
||||
mp_int order;
|
||||
@@ -1357,6 +1358,8 @@ struct crypto_ec * crypto_ec_init(int gr
|
||||
return NULL;
|
||||
|
||||
if (wc_ecc_init(&e->key) != 0 ||
|
||||
+ wc_InitRng(&e->rng) != 0 ||
|
||||
+ wc_ecc_set_rng(&e->key, &e->rng) != 0 ||
|
||||
wc_ecc_set_curve(&e->key, 0, curve_id) != 0 ||
|
||||
mp_init(&e->a) != MP_OKAY ||
|
||||
mp_init(&e->prime) != MP_OKAY ||
|
||||
@@ -1388,6 +1391,7 @@ void crypto_ec_deinit(struct crypto_ec*
|
||||
mp_clear(&e->order);
|
||||
mp_clear(&e->prime);
|
||||
mp_clear(&e->a);
|
||||
+ wc_FreeRng(&e->rng);
|
||||
wc_ecc_free(&e->key);
|
||||
os_free(e);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
From 8de8cd8380af0c43d4fde67a668d79ef73b26b26 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Tue, 30 Jun 2020 14:18:58 +0200
|
||||
Subject: [PATCH 10/19] mesh: Allow DFS channels to be selected if dfs is
|
||||
enabled
|
||||
|
||||
Note: DFS is assumed to be usable if a country code has been set
|
||||
|
||||
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/wpa_supplicant.c | 25 +++++++++++++++++++------
|
||||
1 file changed, 19 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2395,6 +2395,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
int chwidth, seg0, seg1;
|
||||
u32 vht_caps = 0;
|
||||
int is_24ghz;
|
||||
+ int dfs_enabled = wpa_s->conf->country[0] &&
|
||||
+ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
|
||||
|
||||
freq->freq = ssid->frequency;
|
||||
|
||||
@@ -2484,8 +2486,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
return;
|
||||
|
||||
/* Check primary channel flags */
|
||||
- if (pri_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (pri_chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
return;
|
||||
+ if (pri_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ return;
|
||||
|
||||
freq->channel = pri_chan->chan;
|
||||
|
||||
@@ -2518,8 +2523,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
return;
|
||||
|
||||
/* Check secondary channel flags */
|
||||
- if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (sec_chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
return;
|
||||
+ if (sec_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ return;
|
||||
|
||||
if (ht40 == -1) {
|
||||
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
|
||||
@@ -2612,8 +2620,11 @@ skip_ht40:
|
||||
return;
|
||||
|
||||
/* Back to HT configuration if channel not usable */
|
||||
- if (chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
return;
|
||||
+ if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ return;
|
||||
}
|
||||
|
||||
chwidth = CHANWIDTH_80MHZ;
|
||||
@@ -2633,10 +2644,12 @@ skip_ht40:
|
||||
if (!chan)
|
||||
continue;
|
||||
|
||||
- if (chan->flag & (HOSTAPD_CHAN_DISABLED |
|
||||
- HOSTAPD_CHAN_NO_IR |
|
||||
- HOSTAPD_CHAN_RADAR))
|
||||
+ if (chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
continue;
|
||||
+ if (chan->flag & (HOSTAPD_CHAN_RADAR |
|
||||
+ HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ continue;
|
||||
|
||||
/* Found a suitable second segment for 80+80 */
|
||||
chwidth = CHANWIDTH_80P80MHZ;
|
||||
@@ -0,0 +1,81 @@
|
||||
From fc8ea40f6130ac18d9c66797de2cf1d5af55d496 Mon Sep 17 00:00:00 2001
|
||||
From: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
Date: Tue, 30 Jun 2020 14:19:07 +0200
|
||||
Subject: [PATCH 19/19] mesh: use deterministic channel on channel switch
|
||||
|
||||
This patch uses a deterministic channel on DFS channel switch
|
||||
in mesh networks. Otherwise, when switching to a usable but not
|
||||
available channel, no CSA can be sent and a random channel is choosen
|
||||
without notification of other nodes. It is then quite likely, that
|
||||
the mesh network gets disconnected.
|
||||
|
||||
Fix this by using a deterministic number, based on the sha256 hash
|
||||
of the mesh ID, in order to use at least a different number in each
|
||||
mesh network.
|
||||
|
||||
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
---
|
||||
src/ap/dfs.c | 20 +++++++++++++++++++-
|
||||
src/drivers/driver_nl80211.c | 4 ++++
|
||||
2 files changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/src/ap/dfs.c
|
||||
+++ b/src/ap/dfs.c
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "ap_drv_ops.h"
|
||||
#include "drivers/driver.h"
|
||||
#include "dfs.h"
|
||||
+#include "crypto/crypto.h"
|
||||
|
||||
|
||||
static int dfs_get_used_n_chans(struct hostapd_iface *iface, int *seg1)
|
||||
@@ -480,9 +481,14 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
int num_available_chandefs;
|
||||
int chan_idx, chan_idx2;
|
||||
int sec_chan_idx_80p80 = -1;
|
||||
+ bool is_mesh = false;
|
||||
int i;
|
||||
u32 _rand;
|
||||
|
||||
+#ifdef CONFIG_MESH
|
||||
+ is_mesh = iface->mconf;
|
||||
+#endif
|
||||
+
|
||||
wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
|
||||
*secondary_channel = 0;
|
||||
*oper_centr_freq_seg0_idx = 0;
|
||||
@@ -502,8 +508,20 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
if (num_available_chandefs == 0)
|
||||
return NULL;
|
||||
|
||||
- if (os_get_random((u8 *) &_rand, sizeof(_rand)) < 0)
|
||||
+ /* try to use deterministic channel in mesh, so that both sides
|
||||
+ * have a chance to switch to the same channel */
|
||||
+ if (is_mesh) {
|
||||
+#ifdef CONFIG_MESH
|
||||
+ u64 hash[4];
|
||||
+ const u8 *meshid[1] = { &iface->mconf->meshid[0] };
|
||||
+ const size_t meshid_len = iface->mconf->meshid_len;
|
||||
+
|
||||
+ sha256_vector(1, meshid, &meshid_len, (u8 *)&hash[0]);
|
||||
+ _rand = hash[0] + hash[1] + hash[2] + hash[3];
|
||||
+#endif
|
||||
+ } else if (os_get_random((u8 *) &_rand, sizeof(_rand)) < 0)
|
||||
return NULL;
|
||||
+
|
||||
chan_idx = _rand % num_available_chandefs;
|
||||
dfs_find_channel(iface, &chan, chan_idx, skip_radar);
|
||||
if (!chan) {
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -9872,6 +9872,10 @@ static int nl80211_switch_channel(void *
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
+ if (drv->nlmode == NL80211_IFTYPE_MESH_POINT) {
|
||||
+ nla_put_flag(msg, NL80211_ATTR_HANDLE_DFS);
|
||||
+ }
|
||||
+
|
||||
/* beacon_csa params */
|
||||
beacon_csa = nla_nest_start(msg, NL80211_ATTR_CSA_IES);
|
||||
if (!beacon_csa)
|
||||
@@ -0,0 +1,219 @@
|
||||
From 90fe6429624fc48bc0e5d2d7eeecb7498708b5e3 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Wed, 18 Apr 2018 19:24:31 +0200
|
||||
Subject: [PATCH 18/18] mesh: make forwarding configurable
|
||||
|
||||
Allow mesh_fwding to be specified in a mesh bss config, pass that
|
||||
to the driver (only nl80211 implemented for now) and announce
|
||||
forwarding capability accordingly.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
src/ap/ap_config.h | 2 ++
|
||||
src/drivers/driver.h | 2 ++
|
||||
src/drivers/driver_nl80211.c | 3 +++
|
||||
wpa_supplicant/config.c | 4 ++++
|
||||
wpa_supplicant/config.h | 9 +++++++++
|
||||
wpa_supplicant/config_file.c | 4 ++++
|
||||
wpa_supplicant/config_ssid.h | 5 +++++
|
||||
wpa_supplicant/mesh.c | 6 ++++++
|
||||
wpa_supplicant/mesh_mpm.c | 4 ++--
|
||||
wpa_supplicant/wpa_supplicant.conf | 3 +++
|
||||
10 files changed, 40 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -51,6 +51,7 @@ struct mesh_conf {
|
||||
int dot11MeshRetryTimeout; /* msec */
|
||||
int dot11MeshConfirmTimeout; /* msec */
|
||||
int dot11MeshHoldingTimeout; /* msec */
|
||||
+ int mesh_fwding;
|
||||
};
|
||||
|
||||
#define MAX_STA_COUNT 2007
|
||||
@@ -696,6 +697,7 @@ struct hostapd_bss_config {
|
||||
|
||||
#define MESH_ENABLED BIT(0)
|
||||
int mesh;
|
||||
+ int mesh_fwding;
|
||||
|
||||
u8 radio_measurements[RRM_CAPABILITIES_IE_LEN];
|
||||
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -1584,6 +1584,7 @@ struct wpa_driver_mesh_bss_params {
|
||||
#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
|
||||
#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
|
||||
#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
|
||||
+#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
|
||||
/*
|
||||
* TODO: Other mesh configuration parameters would go here.
|
||||
* See NL80211_MESHCONF_* for all the mesh config parameters.
|
||||
@@ -1593,6 +1594,7 @@ struct wpa_driver_mesh_bss_params {
|
||||
int peer_link_timeout;
|
||||
int max_peer_links;
|
||||
int rssi_threshold;
|
||||
+ int forwarding;
|
||||
u16 ht_opmode;
|
||||
};
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -10456,6 +10456,9 @@ static int nl80211_put_mesh_config(struc
|
||||
if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) &&
|
||||
nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS,
|
||||
params->auto_plinks)) ||
|
||||
+ ((params->flags & WPA_DRIVER_MESH_CONF_FLAG_FORWARDING) &&
|
||||
+ nla_put_u8(msg, NL80211_MESHCONF_FORWARDING,
|
||||
+ params->forwarding)) ||
|
||||
((params->flags & WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS) &&
|
||||
nla_put_u16(msg, NL80211_MESHCONF_MAX_PEER_LINKS,
|
||||
params->max_peer_links)) ||
|
||||
--- a/wpa_supplicant/config.c
|
||||
+++ b/wpa_supplicant/config.c
|
||||
@@ -2527,6 +2527,7 @@ static const struct parse_data ssid_fiel
|
||||
#ifdef CONFIG_MESH
|
||||
{ INT_RANGE(mode, 0, 5) },
|
||||
{ INT_RANGE(no_auto_peer, 0, 1) },
|
||||
+ { INT_RANGE(mesh_fwding, 0, 1) },
|
||||
{ INT_RANGE(mesh_rssi_threshold, -255, 1) },
|
||||
#else /* CONFIG_MESH */
|
||||
{ INT_RANGE(mode, 0, 4) },
|
||||
@@ -3106,6 +3107,7 @@ void wpa_config_set_network_defaults(str
|
||||
ssid->dot11MeshRetryTimeout = DEFAULT_MESH_RETRY_TIMEOUT;
|
||||
ssid->dot11MeshConfirmTimeout = DEFAULT_MESH_CONFIRM_TIMEOUT;
|
||||
ssid->dot11MeshHoldingTimeout = DEFAULT_MESH_HOLDING_TIMEOUT;
|
||||
+ ssid->mesh_fwding = DEFAULT_MESH_FWDING;
|
||||
ssid->mesh_rssi_threshold = DEFAULT_MESH_RSSI_THRESHOLD;
|
||||
#endif /* CONFIG_MESH */
|
||||
#ifdef CONFIG_HT_OVERRIDES
|
||||
@@ -4347,6 +4349,7 @@ struct wpa_config * wpa_config_alloc_emp
|
||||
config->user_mpm = DEFAULT_USER_MPM;
|
||||
config->max_peer_links = DEFAULT_MAX_PEER_LINKS;
|
||||
config->mesh_max_inactivity = DEFAULT_MESH_MAX_INACTIVITY;
|
||||
+ config->mesh_fwding = DEFAULT_MESH_FWDING;
|
||||
config->dot11RSNASAERetransPeriod =
|
||||
DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD;
|
||||
config->fast_reauth = DEFAULT_FAST_REAUTH;
|
||||
@@ -5047,6 +5050,7 @@ static const struct global_parse_data gl
|
||||
{ INT(user_mpm), 0 },
|
||||
{ INT_RANGE(max_peer_links, 0, 255), 0 },
|
||||
{ INT(mesh_max_inactivity), 0 },
|
||||
+ { INT_RANGE(mesh_fwding, 0, 1), 0 },
|
||||
{ INT(dot11RSNASAERetransPeriod), 0 },
|
||||
#endif /* CONFIG_MESH */
|
||||
{ INT(disable_scan_offload), 0 },
|
||||
--- a/wpa_supplicant/config.h
|
||||
+++ b/wpa_supplicant/config.h
|
||||
@@ -18,6 +18,7 @@
|
||||
#define DEFAULT_USER_MPM 1
|
||||
#define DEFAULT_MAX_PEER_LINKS 99
|
||||
#define DEFAULT_MESH_MAX_INACTIVITY 300
|
||||
+#define DEFAULT_MESH_FWDING 1
|
||||
/*
|
||||
* The default dot11RSNASAERetransPeriod is defined as 40 ms in the standard,
|
||||
* but use 1000 ms in practice to avoid issues on low power CPUs.
|
||||
@@ -1378,6 +1379,14 @@ struct wpa_config {
|
||||
int mesh_max_inactivity;
|
||||
|
||||
/**
|
||||
+ * mesh_fwding - Mesh network layer-2 forwarding
|
||||
+ *
|
||||
+ * This controls whether to enable layer-2 forwarding.
|
||||
+ * By default: 1: enabled
|
||||
+ */
|
||||
+ int mesh_fwding;
|
||||
+
|
||||
+ /**
|
||||
* dot11RSNASAERetransPeriod - Timeout to retransmit SAE Auth frame
|
||||
*
|
||||
* This timeout value is used in mesh STA to retransmit
|
||||
--- a/wpa_supplicant/config_file.c
|
||||
+++ b/wpa_supplicant/config_file.c
|
||||
@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL
|
||||
#endif /* IEEE8021X_EAPOL */
|
||||
INT(mode);
|
||||
INT(no_auto_peer);
|
||||
+ INT(mesh_fwding);
|
||||
INT(frequency);
|
||||
INT(enable_edmg);
|
||||
INT(edmg_channel);
|
||||
@@ -1449,6 +1450,9 @@ static void wpa_config_write_global(FILE
|
||||
fprintf(f, "mesh_max_inactivity=%d\n",
|
||||
config->mesh_max_inactivity);
|
||||
|
||||
+ if (config->mesh_fwding != DEFAULT_MESH_FWDING)
|
||||
+ fprintf(f, "mesh_fwding=%d\n", config->mesh_fwding);
|
||||
+
|
||||
if (config->dot11RSNASAERetransPeriod !=
|
||||
DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD)
|
||||
fprintf(f, "dot11RSNASAERetransPeriod=%d\n",
|
||||
--- a/wpa_supplicant/config_ssid.h
|
||||
+++ b/wpa_supplicant/config_ssid.h
|
||||
@@ -546,6 +546,11 @@ struct wpa_ssid {
|
||||
int dot11MeshConfirmTimeout; /* msec */
|
||||
int dot11MeshHoldingTimeout; /* msec */
|
||||
|
||||
+ /**
|
||||
+ * Mesh network layer-2 forwarding
|
||||
+ */
|
||||
+ int mesh_fwding;
|
||||
+
|
||||
int ht;
|
||||
int ht40;
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -140,6 +140,7 @@ static struct mesh_conf * mesh_config_cr
|
||||
conf->mesh_cc_id = 0;
|
||||
conf->mesh_sp_id = MESH_SYNC_METHOD_NEIGHBOR_OFFSET;
|
||||
conf->mesh_auth_id = (conf->security & MESH_CONF_SEC_AUTH) ? 1 : 0;
|
||||
+ conf->mesh_fwding = ssid->mesh_fwding;
|
||||
conf->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries;
|
||||
conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout;
|
||||
conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout;
|
||||
@@ -441,6 +442,7 @@ static int wpa_supplicant_mesh_init(stru
|
||||
bss->conf->start_disabled = 1;
|
||||
bss->conf->mesh = MESH_ENABLED;
|
||||
bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity;
|
||||
+ bss->conf->mesh_fwding = wpa_s->conf->mesh_fwding;
|
||||
|
||||
if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes,
|
||||
wpa_s->hw.num_modes) && wpa_s->conf->country[0]) {
|
||||
@@ -655,6 +657,10 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
}
|
||||
params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity;
|
||||
|
||||
+ /* always explicitely set forwarding to on or off for now */
|
||||
+ params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_FORWARDING;
|
||||
+ params->conf.forwarding = ssid->mesh_fwding;
|
||||
+
|
||||
os_free(wpa_s->mesh_params);
|
||||
wpa_s->mesh_params = params;
|
||||
if (wpa_supplicant_mesh_init(wpa_s, ssid, ¶ms->freq)) {
|
||||
--- a/wpa_supplicant/mesh_mpm.c
|
||||
+++ b/wpa_supplicant/mesh_mpm.c
|
||||
@@ -303,9 +303,9 @@ static void mesh_mpm_send_plink_action(s
|
||||
info = (bss->num_plinks > 63 ? 63 : bss->num_plinks) << 1;
|
||||
/* TODO: Add Connected to Mesh Gate/AS subfields */
|
||||
wpabuf_put_u8(buf, info);
|
||||
- /* always forwarding & accepting plinks for now */
|
||||
+ /* set forwarding & always accepting plinks for now */
|
||||
wpabuf_put_u8(buf, MESH_CAP_ACCEPT_ADDITIONAL_PEER |
|
||||
- MESH_CAP_FORWARDING);
|
||||
+ (conf->mesh_fwding ? MESH_CAP_FORWARDING : 0));
|
||||
} else { /* Peer closing frame */
|
||||
/* IE: Mesh ID */
|
||||
wpabuf_put_u8(buf, WLAN_EID_MESH_ID);
|
||||
--- a/wpa_supplicant/wpa_supplicant.conf
|
||||
+++ b/wpa_supplicant/wpa_supplicant.conf
|
||||
@@ -150,6 +150,9 @@ ap_scan=1
|
||||
# This timeout value is used in mesh STA to clean up inactive stations.
|
||||
#mesh_max_inactivity=300
|
||||
|
||||
+# Enable 802.11s layer-2 routing and forwarding
|
||||
+#mesh_fwding=1
|
||||
+
|
||||
# cert_in_cb - Whether to include a peer certificate dump in events
|
||||
# This controls whether peer certificates for authentication server and
|
||||
# its certificate chain are included in EAP peer certificate events. This is
|
||||
@@ -0,0 +1,26 @@
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -4942,6 +4942,13 @@ static int add_associated_sta(struct hos
|
||||
* drivers to accept the STA parameter configuration. Since this is
|
||||
* after a new FT-over-DS exchange, a new TK has been derived, so key
|
||||
* reinstallation is not a concern for this case.
|
||||
+ *
|
||||
+ * If the STA was associated and authorized earlier, but came for a new
|
||||
+ * connection (!added_unassoc + !reassoc), remove the existing STA entry
|
||||
+ * so that it can be re-added. This case is rarely seen when the AP could
|
||||
+ * not receive the deauth/disassoc frame from the STA. And the STA comes
|
||||
+ * back with new connection within a short period or before the inactive
|
||||
+ * STA entry is removed from the list.
|
||||
*/
|
||||
wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR
|
||||
" (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)",
|
||||
@@ -4955,7 +4962,8 @@ static int add_associated_sta(struct hos
|
||||
(!(sta->flags & WLAN_STA_AUTHORIZED) ||
|
||||
(reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) ||
|
||||
(!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) &&
|
||||
- !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)))) {
|
||||
+ !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)) ||
|
||||
+ (!reassoc && (sta->flags & WLAN_STA_AUTHORIZED)))) {
|
||||
hostapd_drv_sta_remove(hapd, sta->addr);
|
||||
wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED);
|
||||
set = 0;
|
||||
@@ -0,0 +1,25 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 8 Jul 2021 16:33:03 +0200
|
||||
Subject: [PATCH] hostapd: fix use of uninitialized stack variables
|
||||
|
||||
When a CSA is performed on an 80 MHz channel, hostapd_change_config_freq
|
||||
unconditionally calls hostapd_set_oper_centr_freq_seg0/1_idx with seg0/1
|
||||
filled by ieee80211_freq_to_chan.
|
||||
However, if ieee80211_freq_to_chan fails (because the freq is 0 or invalid),
|
||||
seg0/1 remains uninitialized and filled with stack garbage, causing errors
|
||||
such as "hostapd: 80 MHz: center segment 1 configured"
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -3431,7 +3431,7 @@ static int hostapd_change_config_freq(st
|
||||
struct hostapd_freq_params *old_params)
|
||||
{
|
||||
int channel;
|
||||
- u8 seg0, seg1;
|
||||
+ u8 seg0 = 0, seg1 = 0;
|
||||
struct hostapd_hw_modes *mode;
|
||||
|
||||
if (!params->channel) {
|
||||
@@ -0,0 +1,19 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Wed, 28 Jul 2021 05:43:29 +0200
|
||||
Subject: [PATCH] ndisc_snoop: call dl_list_del before freeing ipv6 addresses
|
||||
|
||||
Fixes a segmentation fault on sta disconnect
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/src/ap/ndisc_snoop.c
|
||||
+++ b/src/ap/ndisc_snoop.c
|
||||
@@ -61,6 +61,7 @@ void sta_ip6addr_del(struct hostapd_data
|
||||
dl_list_for_each_safe(ip6addr, prev, &sta->ip6addr, struct ip6addr,
|
||||
list) {
|
||||
hostapd_drv_br_delete_ip_neigh(hapd, 6, (u8 *) &ip6addr->addr);
|
||||
+ dl_list_del(&ip6addr->list);
|
||||
os_free(ip6addr);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Wed, 28 Jul 2021 05:49:46 +0200
|
||||
Subject: [PATCH] driver_nl80211: rewrite neigh code to not depend on
|
||||
libnl3-route
|
||||
|
||||
Removes an unnecessary dependency and also makes the code smaller
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -16,9 +16,6 @@
|
||||
#include <net/if.h>
|
||||
#include <netlink/genl/genl.h>
|
||||
#include <netlink/genl/ctrl.h>
|
||||
-#ifdef CONFIG_LIBNL3_ROUTE
|
||||
-#include <netlink/route/neighbour.h>
|
||||
-#endif /* CONFIG_LIBNL3_ROUTE */
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <netpacket/packet.h>
|
||||
#include <linux/errqueue.h>
|
||||
@@ -5284,26 +5281,29 @@ fail:
|
||||
|
||||
static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr)
|
||||
{
|
||||
-#ifdef CONFIG_LIBNL3_ROUTE
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
- struct rtnl_neigh *rn;
|
||||
- struct nl_addr *nl_addr;
|
||||
+ struct ndmsg nhdr = {
|
||||
+ .ndm_state = NUD_PERMANENT,
|
||||
+ .ndm_ifindex = bss->ifindex,
|
||||
+ .ndm_family = AF_BRIDGE,
|
||||
+ };
|
||||
+ struct nl_msg *msg;
|
||||
int err;
|
||||
|
||||
- rn = rtnl_neigh_alloc();
|
||||
- if (!rn)
|
||||
+ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE);
|
||||
+ if (!msg)
|
||||
return;
|
||||
|
||||
- rtnl_neigh_set_family(rn, AF_BRIDGE);
|
||||
- rtnl_neigh_set_ifindex(rn, bss->ifindex);
|
||||
- nl_addr = nl_addr_build(AF_BRIDGE, (void *) addr, ETH_ALEN);
|
||||
- if (!nl_addr) {
|
||||
- rtnl_neigh_put(rn);
|
||||
- return;
|
||||
- }
|
||||
- rtnl_neigh_set_lladdr(rn, nl_addr);
|
||||
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
|
||||
+ goto errout;
|
||||
+
|
||||
+ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr))
|
||||
+ goto errout;
|
||||
+
|
||||
+ if (nl_send_auto_complete(drv->rtnl_sk, msg) < 0)
|
||||
+ goto errout;
|
||||
|
||||
- err = rtnl_neigh_delete(drv->rtnl_sk, rn, 0);
|
||||
+ err = nl_wait_for_ack(drv->rtnl_sk);
|
||||
if (err < 0) {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: bridge FDB entry delete for "
|
||||
MACSTR " ifindex=%d failed: %s", MAC2STR(addr),
|
||||
@@ -5313,9 +5313,8 @@ static void rtnl_neigh_delete_fdb_entry(
|
||||
MACSTR, MAC2STR(addr));
|
||||
}
|
||||
|
||||
- nl_addr_put(nl_addr);
|
||||
- rtnl_neigh_put(rn);
|
||||
-#endif /* CONFIG_LIBNL3_ROUTE */
|
||||
+errout:
|
||||
+ nlmsg_free(msg);
|
||||
}
|
||||
|
||||
|
||||
@@ -7691,7 +7690,6 @@ static void *i802_init(struct hostapd_da
|
||||
(params->num_bridge == 0 || !params->bridge[0]))
|
||||
add_ifidx(drv, br_ifindex, drv->ifindex);
|
||||
|
||||
-#ifdef CONFIG_LIBNL3_ROUTE
|
||||
if (bss->added_if_into_bridge || bss->already_in_bridge) {
|
||||
int err;
|
||||
|
||||
@@ -7708,7 +7706,6 @@ static void *i802_init(struct hostapd_da
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
-#endif /* CONFIG_LIBNL3_ROUTE */
|
||||
|
||||
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
@@ -10655,13 +10652,14 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
const u8 *ipaddr, int prefixlen,
|
||||
const u8 *addr)
|
||||
{
|
||||
-#ifdef CONFIG_LIBNL3_ROUTE
|
||||
struct i802_bss *bss = priv;
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
- struct rtnl_neigh *rn;
|
||||
- struct nl_addr *nl_ipaddr = NULL;
|
||||
- struct nl_addr *nl_lladdr = NULL;
|
||||
- int family, addrsize;
|
||||
+ struct ndmsg nhdr = {
|
||||
+ .ndm_state = NUD_PERMANENT,
|
||||
+ .ndm_ifindex = bss->br_ifindex,
|
||||
+ };
|
||||
+ struct nl_msg *msg;
|
||||
+ int addrsize;
|
||||
int res;
|
||||
|
||||
if (!ipaddr || prefixlen == 0 || !addr)
|
||||
@@ -10680,85 +10678,66 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
}
|
||||
|
||||
if (version == 4) {
|
||||
- family = AF_INET;
|
||||
+ nhdr.ndm_family = AF_INET;
|
||||
addrsize = 4;
|
||||
} else if (version == 6) {
|
||||
- family = AF_INET6;
|
||||
+ nhdr.ndm_family = AF_INET6;
|
||||
addrsize = 16;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- rn = rtnl_neigh_alloc();
|
||||
- if (rn == NULL)
|
||||
+ msg = nlmsg_alloc_simple(RTM_NEWNEIGH, NLM_F_CREATE);
|
||||
+ if (!msg)
|
||||
return -ENOMEM;
|
||||
|
||||
- /* set the destination ip address for neigh */
|
||||
- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize);
|
||||
- if (nl_ipaddr == NULL) {
|
||||
- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed");
|
||||
- res = -ENOMEM;
|
||||
+ res = -ENOMEM;
|
||||
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
|
||||
goto errout;
|
||||
- }
|
||||
- nl_addr_set_prefixlen(nl_ipaddr, prefixlen);
|
||||
- res = rtnl_neigh_set_dst(rn, nl_ipaddr);
|
||||
- if (res) {
|
||||
- wpa_printf(MSG_DEBUG,
|
||||
- "nl80211: neigh set destination addr failed");
|
||||
+
|
||||
+ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr))
|
||||
goto errout;
|
||||
- }
|
||||
|
||||
- /* set the corresponding lladdr for neigh */
|
||||
- nl_lladdr = nl_addr_build(AF_BRIDGE, (u8 *) addr, ETH_ALEN);
|
||||
- if (nl_lladdr == NULL) {
|
||||
- wpa_printf(MSG_DEBUG, "nl80211: neigh set lladdr failed");
|
||||
- res = -ENOMEM;
|
||||
+ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr))
|
||||
goto errout;
|
||||
- }
|
||||
- rtnl_neigh_set_lladdr(rn, nl_lladdr);
|
||||
|
||||
- rtnl_neigh_set_ifindex(rn, bss->br_ifindex);
|
||||
- rtnl_neigh_set_state(rn, NUD_PERMANENT);
|
||||
+ res = nl_send_auto_complete(drv->rtnl_sk, msg);
|
||||
+ if (res < 0)
|
||||
+ goto errout;
|
||||
|
||||
- res = rtnl_neigh_add(drv->rtnl_sk, rn, NLM_F_CREATE);
|
||||
+ res = nl_wait_for_ack(drv->rtnl_sk);
|
||||
if (res) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"nl80211: Adding bridge ip neigh failed: %s",
|
||||
nl_geterror(res));
|
||||
}
|
||||
errout:
|
||||
- if (nl_lladdr)
|
||||
- nl_addr_put(nl_lladdr);
|
||||
- if (nl_ipaddr)
|
||||
- nl_addr_put(nl_ipaddr);
|
||||
- if (rn)
|
||||
- rtnl_neigh_put(rn);
|
||||
+ nlmsg_free(msg);
|
||||
return res;
|
||||
-#else /* CONFIG_LIBNL3_ROUTE */
|
||||
- return -1;
|
||||
-#endif /* CONFIG_LIBNL3_ROUTE */
|
||||
}
|
||||
|
||||
|
||||
static int wpa_driver_br_delete_ip_neigh(void *priv, u8 version,
|
||||
const u8 *ipaddr)
|
||||
{
|
||||
-#ifdef CONFIG_LIBNL3_ROUTE
|
||||
struct i802_bss *bss = priv;
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
- struct rtnl_neigh *rn;
|
||||
- struct nl_addr *nl_ipaddr;
|
||||
- int family, addrsize;
|
||||
+ struct ndmsg nhdr = {
|
||||
+ .ndm_state = NUD_PERMANENT,
|
||||
+ .ndm_ifindex = bss->br_ifindex,
|
||||
+ };
|
||||
+ struct nl_msg *msg;
|
||||
+ int addrsize;
|
||||
int res;
|
||||
|
||||
if (!ipaddr)
|
||||
return -EINVAL;
|
||||
|
||||
if (version == 4) {
|
||||
- family = AF_INET;
|
||||
+ nhdr.ndm_family = AF_INET;
|
||||
addrsize = 4;
|
||||
} else if (version == 6) {
|
||||
- family = AF_INET6;
|
||||
+ nhdr.ndm_family = AF_INET6;
|
||||
addrsize = 16;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
@@ -10776,41 +10755,30 @@ static int wpa_driver_br_delete_ip_neigh
|
||||
return -1;
|
||||
}
|
||||
|
||||
- rn = rtnl_neigh_alloc();
|
||||
- if (rn == NULL)
|
||||
+ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE);
|
||||
+ if (!msg)
|
||||
return -ENOMEM;
|
||||
|
||||
- /* set the destination ip address for neigh */
|
||||
- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize);
|
||||
- if (nl_ipaddr == NULL) {
|
||||
- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed");
|
||||
- res = -ENOMEM;
|
||||
+ res = -ENOMEM;
|
||||
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
|
||||
goto errout;
|
||||
- }
|
||||
- res = rtnl_neigh_set_dst(rn, nl_ipaddr);
|
||||
- if (res) {
|
||||
- wpa_printf(MSG_DEBUG,
|
||||
- "nl80211: neigh set destination addr failed");
|
||||
+
|
||||
+ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr))
|
||||
goto errout;
|
||||
- }
|
||||
|
||||
- rtnl_neigh_set_ifindex(rn, bss->br_ifindex);
|
||||
+ res = nl_send_auto_complete(drv->rtnl_sk, msg);
|
||||
+ if (res < 0)
|
||||
+ goto errout;
|
||||
|
||||
- res = rtnl_neigh_delete(drv->rtnl_sk, rn, 0);
|
||||
+ res = nl_wait_for_ack(drv->rtnl_sk);
|
||||
if (res) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"nl80211: Deleting bridge ip neigh failed: %s",
|
||||
nl_geterror(res));
|
||||
}
|
||||
errout:
|
||||
- if (nl_ipaddr)
|
||||
- nl_addr_put(nl_ipaddr);
|
||||
- if (rn)
|
||||
- rtnl_neigh_put(rn);
|
||||
+ nlmsg_free(msg);
|
||||
return res;
|
||||
-#else /* CONFIG_LIBNL3_ROUTE */
|
||||
- return -1;
|
||||
-#endif /* CONFIG_LIBNL3_ROUTE */
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
--- a/src/utils/os_unix.c
|
||||
+++ b/src/utils/os_unix.c
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/wait.h>
|
||||
+#include <fcntl.h>
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <sys/capability.h>
|
||||
@@ -188,59 +189,46 @@ int os_gmtime(os_time_t t, struct os_tm
|
||||
return 0;
|
||||
}
|
||||
|
||||
-
|
||||
-#ifdef __APPLE__
|
||||
-#include <fcntl.h>
|
||||
-static int os_daemon(int nochdir, int noclose)
|
||||
+int os_daemonize(const char *pid_file)
|
||||
{
|
||||
- int devnull;
|
||||
+ int pid = 0, i, devnull;
|
||||
|
||||
- if (chdir("/") < 0)
|
||||
- return -1;
|
||||
+#if defined(__uClinux__) || defined(__sun__)
|
||||
+ return -1;
|
||||
+#else /* defined(__uClinux__) || defined(__sun__) */
|
||||
|
||||
- devnull = open("/dev/null", O_RDWR);
|
||||
- if (devnull < 0)
|
||||
+#ifndef __APPLE__
|
||||
+ pid = fork();
|
||||
+ if (pid < 0)
|
||||
return -1;
|
||||
+#endif
|
||||
|
||||
- if (dup2(devnull, STDIN_FILENO) < 0) {
|
||||
- close(devnull);
|
||||
- return -1;
|
||||
+ if (pid > 0) {
|
||||
+ if (pid_file) {
|
||||
+ FILE *f = fopen(pid_file, "w");
|
||||
+ if (f) {
|
||||
+ fprintf(f, "%u\n", pid);
|
||||
+ fclose(f);
|
||||
+ }
|
||||
+ }
|
||||
+ _exit(0);
|
||||
}
|
||||
|
||||
- if (dup2(devnull, STDOUT_FILENO) < 0) {
|
||||
- close(devnull);
|
||||
+ if (setsid() < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
- if (dup2(devnull, STDERR_FILENO) < 0) {
|
||||
- close(devnull);
|
||||
+ if (chdir("/") < 0)
|
||||
return -1;
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-#else /* __APPLE__ */
|
||||
-#define os_daemon daemon
|
||||
-#endif /* __APPLE__ */
|
||||
|
||||
-
|
||||
-int os_daemonize(const char *pid_file)
|
||||
-{
|
||||
-#if defined(__uClinux__) || defined(__sun__)
|
||||
- return -1;
|
||||
-#else /* defined(__uClinux__) || defined(__sun__) */
|
||||
- if (os_daemon(0, 0)) {
|
||||
- perror("daemon");
|
||||
+ devnull = open("/dev/null", O_RDWR);
|
||||
+ if (devnull < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
- if (pid_file) {
|
||||
- FILE *f = fopen(pid_file, "w");
|
||||
- if (f) {
|
||||
- fprintf(f, "%u\n", getpid());
|
||||
- fclose(f);
|
||||
- }
|
||||
- }
|
||||
+ for (i = 0; i <= STDERR_FILENO; i++)
|
||||
+ dup2(devnull, i);
|
||||
+
|
||||
+ if (devnull > 2)
|
||||
+ close(devnull);
|
||||
|
||||
return -0;
|
||||
#endif /* defined(__uClinux__) || defined(__sun__) */
|
||||
355
package/network/services/hostapd/patches/200-multicall.patch
Normal file
355
package/network/services/hostapd/patches/200-multicall.patch
Normal file
@@ -0,0 +1,355 @@
|
||||
--- a/hostapd/Makefile
|
||||
+++ b/hostapd/Makefile
|
||||
@@ -1,6 +1,7 @@
|
||||
ALL=hostapd hostapd_cli
|
||||
CONFIG_FILE = .config
|
||||
|
||||
+-include $(if $(MULTICALL), ../wpa_supplicant/.config)
|
||||
include ../src/build.rules
|
||||
|
||||
ifdef LIBS
|
||||
@@ -199,7 +200,8 @@ endif
|
||||
|
||||
ifdef CONFIG_NO_VLAN
|
||||
CFLAGS += -DCONFIG_NO_VLAN
|
||||
-else
|
||||
+endif
|
||||
+ifneq ($(findstring CONFIG_NO_VLAN,$(CFLAGS)), CONFIG_NO_VLAN)
|
||||
OBJS += ../src/ap/vlan_init.o
|
||||
OBJS += ../src/ap/vlan_ifconfig.o
|
||||
OBJS += ../src/ap/vlan.o
|
||||
@@ -349,10 +351,14 @@ CFLAGS += -DCONFIG_MBO
|
||||
OBJS += ../src/ap/mbo_ap.o
|
||||
endif
|
||||
|
||||
+ifndef MULTICALL
|
||||
+CFLAGS += -DNO_SUPPLICANT
|
||||
+endif
|
||||
+
|
||||
include ../src/drivers/drivers.mak
|
||||
-OBJS += $(DRV_AP_OBJS)
|
||||
-CFLAGS += $(DRV_AP_CFLAGS)
|
||||
-LDFLAGS += $(DRV_AP_LDFLAGS)
|
||||
+OBJS += $(sort $(DRV_AP_OBJS) $(if $(MULTICALL),$(DRV_WPA_OBJS)))
|
||||
+CFLAGS += $(DRV_AP_CFLAGS) $(if $(MULTICALL),$(DRV_WPA_CFLAGS))
|
||||
+LDFLAGS += $(DRV_AP_LDFLAGS) $(if $(MULTICALL),$(DRV_WPA_LDFLAGS))
|
||||
LIBS += $(DRV_AP_LIBS)
|
||||
|
||||
ifdef CONFIG_L2_PACKET
|
||||
@@ -1277,6 +1283,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
|
||||
_OBJS_VAR := OBJS
|
||||
include ../src/objs.mk
|
||||
|
||||
+hostapd_multi.a: $(BCHECK) $(OBJS)
|
||||
+ $(Q)$(CC) -c -o hostapd_multi.o -Dmain=hostapd_main $(CFLAGS) main.c
|
||||
+ @$(E) " CC " $<
|
||||
+ @rm -f $@
|
||||
+ @$(AR) cr $@ hostapd_multi.o $(OBJS)
|
||||
+
|
||||
hostapd: $(OBJS)
|
||||
$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
|
||||
@$(E) " LD " $@
|
||||
@@ -1351,6 +1363,12 @@ include ../src/objs.mk
|
||||
_OBJS_VAR := SOBJS
|
||||
include ../src/objs.mk
|
||||
|
||||
+dump_cflags:
|
||||
+ @printf "%s " "$(CFLAGS)"
|
||||
+
|
||||
+dump_ldflags:
|
||||
+ @printf "%s " "$(LDFLAGS) $(LIBS) $(EXTRALIBS)"
|
||||
+
|
||||
nt_password_hash: $(NOBJS)
|
||||
$(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
|
||||
@$(E) " LD " $@
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -17,6 +17,7 @@ endif
|
||||
EXTRA_TARGETS=dynamic_eap_methods
|
||||
|
||||
CONFIG_FILE=.config
|
||||
+-include $(if $(MULTICALL),../hostapd/.config)
|
||||
include ../src/build.rules
|
||||
|
||||
ifdef LIBS
|
||||
@@ -359,7 +360,9 @@ endif
|
||||
ifdef CONFIG_IBSS_RSN
|
||||
NEED_RSN_AUTHENTICATOR=y
|
||||
CFLAGS += -DCONFIG_IBSS_RSN
|
||||
+ifndef MULTICALL
|
||||
CFLAGS += -DCONFIG_NO_VLAN
|
||||
+endif
|
||||
OBJS += ibss_rsn.o
|
||||
endif
|
||||
|
||||
@@ -897,6 +900,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
|
||||
CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
|
||||
LIBS += -ldl -rdynamic
|
||||
endif
|
||||
+else
|
||||
+ ifdef MULTICALL
|
||||
+ OBJS += ../src/eap_common/eap_common.o
|
||||
+ endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_AP
|
||||
@@ -904,9 +911,11 @@ NEED_EAP_COMMON=y
|
||||
NEED_RSN_AUTHENTICATOR=y
|
||||
CFLAGS += -DCONFIG_AP
|
||||
OBJS += ap.o
|
||||
+ifndef MULTICALL
|
||||
CFLAGS += -DCONFIG_NO_RADIUS
|
||||
CFLAGS += -DCONFIG_NO_ACCOUNTING
|
||||
CFLAGS += -DCONFIG_NO_VLAN
|
||||
+endif
|
||||
OBJS += ../src/ap/hostapd.o
|
||||
OBJS += ../src/ap/wpa_auth_glue.o
|
||||
OBJS += ../src/ap/utils.o
|
||||
@@ -986,6 +995,12 @@ endif
|
||||
ifdef CONFIG_HS20
|
||||
OBJS += ../src/ap/hs20.o
|
||||
endif
|
||||
+else
|
||||
+ ifdef MULTICALL
|
||||
+ OBJS += ../src/eap_server/eap_server.o
|
||||
+ OBJS += ../src/eap_server/eap_server_identity.o
|
||||
+ OBJS += ../src/eap_server/eap_server_methods.o
|
||||
+ endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_MBO
|
||||
@@ -994,7 +1009,9 @@ CFLAGS += -DCONFIG_MBO
|
||||
endif
|
||||
|
||||
ifdef NEED_RSN_AUTHENTICATOR
|
||||
+ifndef MULTICALL
|
||||
CFLAGS += -DCONFIG_NO_RADIUS
|
||||
+endif
|
||||
NEED_AES_WRAP=y
|
||||
OBJS += ../src/ap/wpa_auth.o
|
||||
OBJS += ../src/ap/wpa_auth_ie.o
|
||||
@@ -1889,6 +1906,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
|
||||
|
||||
_OBJS_VAR := OBJS
|
||||
include ../src/objs.mk
|
||||
+wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
|
||||
+ $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c
|
||||
+ @$(E) " CC " $<
|
||||
+ @rm -f $@
|
||||
+ @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
|
||||
+
|
||||
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
|
||||
$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
|
||||
@$(E) " LD " $@
|
||||
@@ -2021,6 +2044,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK)
|
||||
$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
|
||||
@$(E) " sed" $<
|
||||
|
||||
+dump_cflags:
|
||||
+ @printf "%s " "$(CFLAGS)"
|
||||
+
|
||||
+dump_ldflags:
|
||||
+ @printf "%s " "$(LDFLAGS) $(LIBS) $(EXTRALIBS)"
|
||||
+
|
||||
wpa_supplicant.exe: wpa_supplicant
|
||||
mv -f $< $@
|
||||
wpa_cli.exe: wpa_cli
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -6025,8 +6025,8 @@ union wpa_event_data {
|
||||
* Driver wrapper code should call this function whenever an event is received
|
||||
* from the driver.
|
||||
*/
|
||||
-void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
- union wpa_event_data *data);
|
||||
+extern void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data);
|
||||
|
||||
/**
|
||||
* wpa_supplicant_event_global - Report a driver event for wpa_supplicant
|
||||
@@ -6038,7 +6038,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
* Same as wpa_supplicant_event(), but we search for the interface in
|
||||
* wpa_global.
|
||||
*/
|
||||
-void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
|
||||
+extern void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
|
||||
union wpa_event_data *data);
|
||||
|
||||
/*
|
||||
--- a/src/ap/drv_callbacks.c
|
||||
+++ b/src/ap/drv_callbacks.c
|
||||
@@ -1836,8 +1836,8 @@ err:
|
||||
#endif /* CONFIG_OWE */
|
||||
|
||||
|
||||
-void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
- union wpa_event_data *data)
|
||||
+void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data)
|
||||
{
|
||||
struct hostapd_data *hapd = ctx;
|
||||
#ifndef CONFIG_NO_STDOUT_DEBUG
|
||||
@@ -2082,7 +2082,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
}
|
||||
|
||||
|
||||
-void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
|
||||
+void hostapd_wpa_event_global(void *ctx, enum wpa_event_type event,
|
||||
union wpa_event_data *data)
|
||||
{
|
||||
struct hapd_interfaces *interfaces = ctx;
|
||||
--- a/wpa_supplicant/wpa_priv.c
|
||||
+++ b/wpa_supplicant/wpa_priv.c
|
||||
@@ -1038,8 +1038,8 @@ static void wpa_priv_send_ft_response(st
|
||||
}
|
||||
|
||||
|
||||
-void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
- union wpa_event_data *data)
|
||||
+static void supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data)
|
||||
{
|
||||
struct wpa_priv_interface *iface = ctx;
|
||||
|
||||
@@ -1102,7 +1102,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
}
|
||||
|
||||
|
||||
-void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
|
||||
+void supplicant_event_global(void *ctx, enum wpa_event_type event,
|
||||
union wpa_event_data *data)
|
||||
{
|
||||
struct wpa_priv_global *global = ctx;
|
||||
@@ -1215,6 +1215,8 @@ int main(int argc, char *argv[])
|
||||
if (os_program_init())
|
||||
return -1;
|
||||
|
||||
+ wpa_supplicant_event = supplicant_event;
|
||||
+ wpa_supplicant_event_global = supplicant_event_global;
|
||||
wpa_priv_fd_workaround();
|
||||
|
||||
os_memset(&global, 0, sizeof(global));
|
||||
--- a/wpa_supplicant/events.c
|
||||
+++ b/wpa_supplicant/events.c
|
||||
@@ -4665,8 +4665,8 @@ static void wpas_event_unprot_beacon(str
|
||||
}
|
||||
|
||||
|
||||
-void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
- union wpa_event_data *data)
|
||||
+void supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = ctx;
|
||||
int resched;
|
||||
@@ -5511,7 +5511,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
}
|
||||
|
||||
|
||||
-void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
|
||||
+void supplicant_event_global(void *ctx, enum wpa_event_type event,
|
||||
union wpa_event_data *data)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s;
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -6819,7 +6819,6 @@ struct wpa_interface * wpa_supplicant_ma
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-
|
||||
/**
|
||||
* wpa_supplicant_match_existing - Match existing interfaces
|
||||
* @global: Pointer to global data from wpa_supplicant_init()
|
||||
@@ -6854,6 +6853,11 @@ static int wpa_supplicant_match_existing
|
||||
|
||||
#endif /* CONFIG_MATCH_IFACE */
|
||||
|
||||
+extern void supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data);
|
||||
+
|
||||
+extern void supplicant_event_global(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data);
|
||||
|
||||
/**
|
||||
* wpa_supplicant_add_iface - Add a new network interface
|
||||
@@ -7110,6 +7114,8 @@ struct wpa_global * wpa_supplicant_init(
|
||||
#ifndef CONFIG_NO_WPA_MSG
|
||||
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
|
||||
#endif /* CONFIG_NO_WPA_MSG */
|
||||
+ wpa_supplicant_event = supplicant_event;
|
||||
+ wpa_supplicant_event_global = supplicant_event_global;
|
||||
|
||||
if (params->wpa_debug_file_path)
|
||||
wpa_debug_open_file(params->wpa_debug_file_path);
|
||||
--- a/hostapd/main.c
|
||||
+++ b/hostapd/main.c
|
||||
@@ -590,6 +590,11 @@ fail:
|
||||
return -1;
|
||||
}
|
||||
|
||||
+void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data);
|
||||
+
|
||||
+void hostapd_wpa_event_global(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data);
|
||||
|
||||
#ifdef CONFIG_WPS
|
||||
static int gen_uuid(const char *txt_addr)
|
||||
@@ -683,6 +688,8 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
#endif /* CONFIG_DPP */
|
||||
|
||||
+ wpa_supplicant_event = hostapd_wpa_event;
|
||||
+ wpa_supplicant_event_global = hostapd_wpa_event_global;
|
||||
for (;;) {
|
||||
c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:");
|
||||
if (c < 0)
|
||||
--- a/src/drivers/drivers.c
|
||||
+++ b/src/drivers/drivers.c
|
||||
@@ -10,6 +10,10 @@
|
||||
#include "utils/common.h"
|
||||
#include "driver.h"
|
||||
|
||||
+void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data);
|
||||
+void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data);
|
||||
|
||||
const struct wpa_driver_ops *const wpa_drivers[] =
|
||||
{
|
||||
--- a/wpa_supplicant/eapol_test.c
|
||||
+++ b/wpa_supplicant/eapol_test.c
|
||||
@@ -30,7 +30,12 @@
|
||||
#include "ctrl_iface.h"
|
||||
#include "pcsc_funcs.h"
|
||||
#include "wpas_glue.h"
|
||||
+#include "drivers/driver.h"
|
||||
|
||||
+void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data);
|
||||
+void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data);
|
||||
|
||||
const struct wpa_driver_ops *const wpa_drivers[] = { NULL };
|
||||
|
||||
@@ -1291,6 +1296,10 @@ static void usage(void)
|
||||
"option several times.\n");
|
||||
}
|
||||
|
||||
+extern void supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data);
|
||||
+extern void supplicant_event_global(void *ctx, enum wpa_event_type event,
|
||||
+ union wpa_event_data *data);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -1311,6 +1320,8 @@ int main(int argc, char *argv[])
|
||||
if (os_program_init())
|
||||
return -1;
|
||||
|
||||
+ wpa_supplicant_event = supplicant_event;
|
||||
+ wpa_supplicant_event_global = supplicant_event_global;
|
||||
hostapd_logger_register_cb(hostapd_logger_cb);
|
||||
|
||||
os_memset(&eapol_test, 0, sizeof(eapol_test));
|
||||
58
package/network/services/hostapd/patches/300-noscan.patch
Normal file
58
package/network/services/hostapd/patches/300-noscan.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3459,6 +3459,10 @@ static int hostapd_config_fill(struct ho
|
||||
if (bss->ocv && !bss->ieee80211w)
|
||||
bss->ieee80211w = 1;
|
||||
#endif /* CONFIG_OCV */
|
||||
+ } else if (os_strcmp(buf, "noscan") == 0) {
|
||||
+ conf->noscan = atoi(pos);
|
||||
+ } else if (os_strcmp(buf, "ht_coex") == 0) {
|
||||
+ conf->no_ht_coex = !atoi(pos);
|
||||
} else if (os_strcmp(buf, "ieee80211n") == 0) {
|
||||
conf->ieee80211n = atoi(pos);
|
||||
} else if (os_strcmp(buf, "ht_capab") == 0) {
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -1009,6 +1009,8 @@ struct hostapd_config {
|
||||
|
||||
int ht_op_mode_fixed;
|
||||
u16 ht_capab;
|
||||
+ int noscan;
|
||||
+ int no_ht_coex;
|
||||
int ieee80211n;
|
||||
int secondary_channel;
|
||||
int no_pri_sec_switch;
|
||||
--- a/src/ap/hw_features.c
|
||||
+++ b/src/ap/hw_features.c
|
||||
@@ -517,7 +517,8 @@ static int ieee80211n_check_40mhz(struct
|
||||
int ret;
|
||||
|
||||
/* Check that HT40 is used and PRI / SEC switch is allowed */
|
||||
- if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch)
|
||||
+ if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch ||
|
||||
+ iface->conf->noscan)
|
||||
return 0;
|
||||
|
||||
hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
|
||||
--- a/src/ap/ieee802_11_ht.c
|
||||
+++ b/src/ap/ieee802_11_ht.c
|
||||
@@ -230,6 +230,9 @@ void hostapd_2040_coex_action(struct hos
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (iface->conf->noscan || iface->conf->no_ht_coex)
|
||||
+ return;
|
||||
+
|
||||
if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie)) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"Ignore too short 20/40 BSS Coexistence Management frame");
|
||||
@@ -390,6 +393,9 @@ void ht40_intolerant_add(struct hostapd_
|
||||
if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
|
||||
return;
|
||||
|
||||
+ if (iface->conf->noscan || iface->conf->no_ht_coex)
|
||||
+ return;
|
||||
+
|
||||
wpa_printf(MSG_INFO, "HT: Forty MHz Intolerant is set by STA " MACSTR
|
||||
" in Association Request", MAC2STR(sta->addr));
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
--- a/wpa_supplicant/config.c
|
||||
+++ b/wpa_supplicant/config.c
|
||||
@@ -2532,6 +2532,7 @@ static const struct parse_data ssid_fiel
|
||||
#else /* CONFIG_MESH */
|
||||
{ INT_RANGE(mode, 0, 4) },
|
||||
#endif /* CONFIG_MESH */
|
||||
+ { INT_RANGE(noscan, 0, 1) },
|
||||
{ INT_RANGE(proactive_key_caching, 0, 1) },
|
||||
{ INT_RANGE(disabled, 0, 2) },
|
||||
{ STR(id_str) },
|
||||
--- a/wpa_supplicant/config_file.c
|
||||
+++ b/wpa_supplicant/config_file.c
|
||||
@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL
|
||||
#endif /* IEEE8021X_EAPOL */
|
||||
INT(mode);
|
||||
INT(no_auto_peer);
|
||||
+ INT(noscan);
|
||||
INT(mesh_fwding);
|
||||
INT(frequency);
|
||||
INT(enable_edmg);
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -474,6 +474,8 @@ static int wpa_supplicant_mesh_init(stru
|
||||
frequency);
|
||||
goto out_free;
|
||||
}
|
||||
+ if (ssid->noscan)
|
||||
+ conf->noscan = 1;
|
||||
|
||||
if (ssid->mesh_basic_rates == NULL) {
|
||||
/*
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2384,12 +2384,12 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode);
|
||||
enum hostapd_hw_mode hw_mode;
|
||||
struct hostapd_hw_modes *mode = NULL;
|
||||
- int ht40plus[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
|
||||
+ int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
|
||||
184, 192 };
|
||||
int vht80[] = { 36, 52, 100, 116, 132, 149 };
|
||||
struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL;
|
||||
u8 channel;
|
||||
- int i, chan_idx, ht40 = -1, res, obss_scan = 1;
|
||||
+ int i, chan_idx, ht40 = -1, res, obss_scan = !(ssid->noscan);
|
||||
unsigned int j, k;
|
||||
struct hostapd_freq_params vht_freq;
|
||||
int chwidth, seg0, seg1;
|
||||
@@ -2473,7 +2473,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
#endif /* CONFIG_HE_OVERRIDES */
|
||||
|
||||
/* Setup higher BW only for 5 GHz */
|
||||
- if (mode->mode != HOSTAPD_MODE_IEEE80211A)
|
||||
+ if (mode->mode != HOSTAPD_MODE_IEEE80211A && !(ssid->noscan))
|
||||
return;
|
||||
|
||||
for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) {
|
||||
--- a/wpa_supplicant/config_ssid.h
|
||||
+++ b/wpa_supplicant/config_ssid.h
|
||||
@@ -971,6 +971,8 @@ struct wpa_ssid {
|
||||
*/
|
||||
int no_auto_peer;
|
||||
|
||||
+ int noscan;
|
||||
+
|
||||
/**
|
||||
* mesh_rssi_threshold - Set mesh parameter mesh_rssi_threshold (dBm)
|
||||
*
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -5154,7 +5154,7 @@ wpa_supplicant_alloc(struct wpa_supplica
|
||||
if (wpa_s == NULL)
|
||||
return NULL;
|
||||
wpa_s->scan_req = INITIAL_SCAN_REQ;
|
||||
- wpa_s->scan_interval = 5;
|
||||
+ wpa_s->scan_interval = 1;
|
||||
wpa_s->new_connection = 1;
|
||||
wpa_s->parent = parent ? parent : wpa_s;
|
||||
wpa_s->p2pdev = wpa_s->parent;
|
||||
@@ -0,0 +1,61 @@
|
||||
--- a/src/drivers/drivers.mak
|
||||
+++ b/src/drivers/drivers.mak
|
||||
@@ -54,7 +54,6 @@ NEED_SME=y
|
||||
NEED_AP_MLME=y
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
-NEED_RFKILL=y
|
||||
NEED_RADIOTAP=y
|
||||
NEED_LIBNL=y
|
||||
endif
|
||||
@@ -111,7 +110,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
|
||||
CONFIG_WIRELESS_EXTENSION=y
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
-NEED_RFKILL=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_NDIS
|
||||
@@ -137,7 +135,6 @@ endif
|
||||
ifdef CONFIG_WIRELESS_EXTENSION
|
||||
DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
|
||||
DRV_WPA_OBJS += ../src/drivers/driver_wext.o
|
||||
-NEED_RFKILL=y
|
||||
endif
|
||||
|
||||
ifdef NEED_NETLINK
|
||||
@@ -146,6 +143,7 @@ endif
|
||||
|
||||
ifdef NEED_RFKILL
|
||||
DRV_OBJS += ../src/drivers/rfkill.o
|
||||
+DRV_WPA_CFLAGS += -DCONFIG_RFKILL
|
||||
endif
|
||||
|
||||
ifdef NEED_RADIOTAP
|
||||
--- a/src/drivers/rfkill.h
|
||||
+++ b/src/drivers/rfkill.h
|
||||
@@ -18,8 +18,24 @@ struct rfkill_config {
|
||||
void (*unblocked_cb)(void *ctx);
|
||||
};
|
||||
|
||||
+#ifdef CONFIG_RFKILL
|
||||
struct rfkill_data * rfkill_init(struct rfkill_config *cfg);
|
||||
void rfkill_deinit(struct rfkill_data *rfkill);
|
||||
int rfkill_is_blocked(struct rfkill_data *rfkill);
|
||||
+#else
|
||||
+static inline struct rfkill_data * rfkill_init(struct rfkill_config *cfg)
|
||||
+{
|
||||
+ return (void *) 1;
|
||||
+}
|
||||
+
|
||||
+static inline void rfkill_deinit(struct rfkill_data *rfkill)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static inline int rfkill_is_blocked(struct rfkill_data *rfkill)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
|
||||
#endif /* RFKILL_H */
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -4970,7 +4970,7 @@ static int nl80211_set_channel(struct i8
|
||||
freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled,
|
||||
freq->bandwidth, freq->center_freq1, freq->center_freq2);
|
||||
|
||||
- msg = nl80211_drv_msg(drv, 0, set_chan ? NL80211_CMD_SET_CHANNEL :
|
||||
+ msg = nl80211_bss_msg(bss, 0, set_chan ? NL80211_CMD_SET_CHANNEL :
|
||||
NL80211_CMD_SET_WIPHY);
|
||||
if (!msg || nl80211_put_freq_params(msg, freq) < 0) {
|
||||
nlmsg_free(msg);
|
||||
@@ -0,0 +1,75 @@
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -115,6 +115,28 @@ static void hostapd_reload_bss(struct ho
|
||||
#endif /* CONFIG_NO_RADIUS */
|
||||
|
||||
ssid = &hapd->conf->ssid;
|
||||
+
|
||||
+ hostapd_set_freq(hapd, hapd->iconf->hw_mode, hapd->iface->freq,
|
||||
+ hapd->iconf->channel,
|
||||
+ hapd->iconf->enable_edmg,
|
||||
+ hapd->iconf->edmg_channel,
|
||||
+ hapd->iconf->ieee80211n,
|
||||
+ hapd->iconf->ieee80211ac,
|
||||
+ hapd->iconf->ieee80211ax,
|
||||
+ hapd->iconf->secondary_channel,
|
||||
+ hostapd_get_oper_chwidth(hapd->iconf),
|
||||
+ hostapd_get_oper_centr_freq_seg0_idx(hapd->iconf),
|
||||
+ hostapd_get_oper_centr_freq_seg1_idx(hapd->iconf));
|
||||
+
|
||||
+ if (hapd->iface->current_mode) {
|
||||
+ if (hostapd_prepare_rates(hapd->iface, hapd->iface->current_mode)) {
|
||||
+ wpa_printf(MSG_ERROR, "Failed to prepare rates table.");
|
||||
+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
|
||||
+ HOSTAPD_LEVEL_WARNING,
|
||||
+ "Failed to prepare rates table.");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
|
||||
ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
|
||||
/*
|
||||
@@ -216,6 +238,7 @@ int hostapd_reload_config(struct hostapd
|
||||
struct hostapd_data *hapd = iface->bss[0];
|
||||
struct hostapd_config *newconf, *oldconf;
|
||||
size_t j;
|
||||
+ int i;
|
||||
|
||||
if (iface->config_fname == NULL) {
|
||||
/* Only in-memory config in use - assume it has been updated */
|
||||
@@ -266,24 +289,20 @@ int hostapd_reload_config(struct hostapd
|
||||
}
|
||||
iface->conf = newconf;
|
||||
|
||||
+ for (i = 0; i < iface->num_hw_features; i++) {
|
||||
+ struct hostapd_hw_modes *mode = &iface->hw_features[i];
|
||||
+ if (mode->mode == iface->conf->hw_mode) {
|
||||
+ iface->current_mode = mode;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (iface->conf->channel)
|
||||
+ iface->freq = hostapd_hw_get_freq(hapd, iface->conf->channel);
|
||||
+
|
||||
for (j = 0; j < iface->num_bss; j++) {
|
||||
hapd = iface->bss[j];
|
||||
hapd->iconf = newconf;
|
||||
- hapd->iconf->channel = oldconf->channel;
|
||||
- hapd->iconf->acs = oldconf->acs;
|
||||
- hapd->iconf->secondary_channel = oldconf->secondary_channel;
|
||||
- hapd->iconf->ieee80211n = oldconf->ieee80211n;
|
||||
- hapd->iconf->ieee80211ac = oldconf->ieee80211ac;
|
||||
- hapd->iconf->ht_capab = oldconf->ht_capab;
|
||||
- hapd->iconf->vht_capab = oldconf->vht_capab;
|
||||
- hostapd_set_oper_chwidth(hapd->iconf,
|
||||
- hostapd_get_oper_chwidth(oldconf));
|
||||
- hostapd_set_oper_centr_freq_seg0_idx(
|
||||
- hapd->iconf,
|
||||
- hostapd_get_oper_centr_freq_seg0_idx(oldconf));
|
||||
- hostapd_set_oper_centr_freq_seg1_idx(
|
||||
- hapd->iconf,
|
||||
- hostapd_get_oper_centr_freq_seg1_idx(oldconf));
|
||||
hapd->conf = newconf->bss[j];
|
||||
hostapd_reload_bss(hapd);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
--- a/wpa_supplicant/ap.c
|
||||
+++ b/wpa_supplicant/ap.c
|
||||
@@ -1513,15 +1513,35 @@ int ap_switch_channel(struct wpa_supplic
|
||||
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE
|
||||
+
|
||||
+static int __ap_ctrl_iface_chanswitch(struct hostapd_iface *iface,
|
||||
+ struct csa_settings *settings)
|
||||
+{
|
||||
+#ifdef NEED_AP_MLME
|
||||
+ if (!iface || !iface->bss[0])
|
||||
+ return 0;
|
||||
+
|
||||
+ return hostapd_switch_channel(iface->bss[0], settings);
|
||||
+#else
|
||||
+ return -1;
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+
|
||||
int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *pos)
|
||||
{
|
||||
struct csa_settings settings;
|
||||
int ret = hostapd_parse_csa_settings(pos, &settings);
|
||||
|
||||
+ if (!(wpa_s->ap_iface && wpa_s->ap_iface->bss[0]) &&
|
||||
+ !(wpa_s->ifmsh && wpa_s->ifmsh->bss[0]))
|
||||
+ return -1;
|
||||
+
|
||||
+ ret = __ap_ctrl_iface_chanswitch(wpa_s->ap_iface, &settings);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- return ap_switch_channel(wpa_s, &settings);
|
||||
+ return __ap_ctrl_iface_chanswitch(wpa_s->ifmsh, &settings);
|
||||
}
|
||||
#endif /* CONFIG_CTRL_IFACE */
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -2915,10 +2915,15 @@ static int wpa_driver_nl80211_del_beacon
|
||||
struct nl_msg *msg;
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
|
||||
+ if (!bss->beacon_set)
|
||||
+ return 0;
|
||||
+
|
||||
+ bss->beacon_set = 0;
|
||||
+
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
|
||||
- drv->ifindex);
|
||||
+ bss->ifindex);
|
||||
nl80211_put_wiphy_data_ap(bss);
|
||||
- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
|
||||
+ msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON);
|
||||
return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -5601,7 +5606,7 @@ static void nl80211_teardown_ap(struct i
|
||||
nl80211_mgmt_unsubscribe(bss, "AP teardown");
|
||||
|
||||
nl80211_put_wiphy_data_ap(bss);
|
||||
- bss->beacon_set = 0;
|
||||
+ wpa_driver_nl80211_del_beacon(bss);
|
||||
}
|
||||
|
||||
|
||||
@@ -8048,8 +8053,6 @@ static int wpa_driver_nl80211_if_remove(
|
||||
} else {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
|
||||
nl80211_teardown_ap(bss);
|
||||
- if (!bss->added_if && !drv->first_bss->next)
|
||||
- wpa_driver_nl80211_del_beacon(bss);
|
||||
nl80211_destroy_bss(bss);
|
||||
if (!bss->added_if)
|
||||
i802_set_iface_flags(bss, 0);
|
||||
@@ -8446,7 +8449,6 @@ static int wpa_driver_nl80211_deinit_ap(
|
||||
if (!is_ap_interface(drv->nlmode))
|
||||
return -1;
|
||||
wpa_driver_nl80211_del_beacon(bss);
|
||||
- bss->beacon_set = 0;
|
||||
|
||||
/*
|
||||
* If the P2P GO interface was dynamically added, then it is
|
||||
@@ -8466,7 +8468,6 @@ static int wpa_driver_nl80211_stop_ap(vo
|
||||
if (!is_ap_interface(drv->nlmode))
|
||||
return -1;
|
||||
wpa_driver_nl80211_del_beacon(bss);
|
||||
- bss->beacon_set = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
--- a/hostapd/ctrl_iface.c
|
||||
+++ b/hostapd/ctrl_iface.c
|
||||
@@ -67,6 +67,7 @@
|
||||
#include "fst/fst_ctrl_iface.h"
|
||||
#include "config_file.h"
|
||||
#include "ctrl_iface.h"
|
||||
+#include "config_file.h"
|
||||
|
||||
|
||||
#define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256
|
||||
@@ -82,6 +83,7 @@ static void hostapd_ctrl_iface_send(stru
|
||||
enum wpa_msg_type type,
|
||||
const char *buf, size_t len);
|
||||
|
||||
+static char *reload_opts = NULL;
|
||||
|
||||
static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd,
|
||||
struct sockaddr_storage *from,
|
||||
@@ -133,6 +135,61 @@ static int hostapd_ctrl_iface_new_sta(st
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static char *get_option(char *opt, char *str)
|
||||
+{
|
||||
+ int len = strlen(str);
|
||||
+
|
||||
+ if (!strncmp(opt, str, len))
|
||||
+ return opt + len;
|
||||
+ else
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
|
||||
+{
|
||||
+ struct hostapd_config *conf;
|
||||
+ char *opt, *val;
|
||||
+
|
||||
+ conf = hostapd_config_read(fname);
|
||||
+ if (!conf)
|
||||
+ return NULL;
|
||||
+
|
||||
+ for (opt = strtok(reload_opts, " ");
|
||||
+ opt;
|
||||
+ opt = strtok(NULL, " ")) {
|
||||
+
|
||||
+ if ((val = get_option(opt, "channel=")))
|
||||
+ conf->channel = atoi(val);
|
||||
+ else if ((val = get_option(opt, "ht_capab=")))
|
||||
+ conf->ht_capab = atoi(val);
|
||||
+ else if ((val = get_option(opt, "ht_capab_mask=")))
|
||||
+ conf->ht_capab &= atoi(val);
|
||||
+ else if ((val = get_option(opt, "sec_chan=")))
|
||||
+ conf->secondary_channel = atoi(val);
|
||||
+ else if ((val = get_option(opt, "hw_mode=")))
|
||||
+ conf->hw_mode = atoi(val);
|
||||
+ else if ((val = get_option(opt, "ieee80211n=")))
|
||||
+ conf->ieee80211n = atoi(val);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return conf;
|
||||
+}
|
||||
+
|
||||
+static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
|
||||
+{
|
||||
+ struct hostapd_config * (*config_read_cb)(const char *config_fname);
|
||||
+ struct hostapd_iface *iface = hapd->iface;
|
||||
+
|
||||
+ config_read_cb = iface->interfaces->config_read_cb;
|
||||
+ iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read;
|
||||
+ reload_opts = txt;
|
||||
+
|
||||
+ hostapd_reload_config(iface);
|
||||
+
|
||||
+ iface->interfaces->config_read_cb = config_read_cb;
|
||||
+}
|
||||
|
||||
#ifdef NEED_AP_MLME
|
||||
static int hostapd_ctrl_iface_sa_query(struct hostapd_data *hapd,
|
||||
@@ -3754,6 +3811,8 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
|
||||
reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
|
||||
reply_size);
|
||||
+ } else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
|
||||
+ hostapd_ctrl_iface_update(hapd, buf + 7);
|
||||
} else if (os_strcmp(buf, "ERP_FLUSH") == 0) {
|
||||
ieee802_1x_erp_flush(hapd);
|
||||
#ifdef RADIUS_SERVER
|
||||
--- a/src/ap/ctrl_iface_ap.c
|
||||
+++ b/src/ap/ctrl_iface_ap.c
|
||||
@@ -919,7 +919,13 @@ int hostapd_parse_csa_settings(const cha
|
||||
|
||||
int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
|
||||
{
|
||||
- return hostapd_drv_stop_ap(hapd);
|
||||
+ struct hostapd_iface *iface = hapd->iface;
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < iface->num_bss; i++)
|
||||
+ hostapd_drv_stop_ap(iface->bss[i]);
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,392 @@
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -108,6 +108,8 @@ OBJS_c += ../src/utils/common.o
|
||||
OBJS_c += ../src/common/cli.o
|
||||
OBJS += wmm_ac.o
|
||||
|
||||
+OBJS += ../src/common/wpa_ctrl.o
|
||||
+
|
||||
ifndef CONFIG_OS
|
||||
ifdef CONFIG_NATIVE_WINDOWS
|
||||
CONFIG_OS=win32
|
||||
--- a/wpa_supplicant/bss.c
|
||||
+++ b/wpa_supplicant/bss.c
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "utils/common.h"
|
||||
#include "utils/eloop.h"
|
||||
#include "common/ieee802_11_defs.h"
|
||||
+#include "common/ieee802_11_common.h"
|
||||
#include "drivers/driver.h"
|
||||
#include "eap_peer/eap.h"
|
||||
#include "wpa_supplicant_i.h"
|
||||
@@ -282,6 +283,10 @@ void calculate_update_time(const struct
|
||||
static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
|
||||
struct os_reltime *fetch_time)
|
||||
{
|
||||
+ struct ieee80211_ht_capabilities *capab;
|
||||
+ struct ieee80211_ht_operation *oper;
|
||||
+ struct ieee802_11_elems elems;
|
||||
+
|
||||
dst->flags = src->flags;
|
||||
os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
|
||||
dst->freq = src->freq;
|
||||
@@ -294,6 +299,15 @@ static void wpa_bss_copy_res(struct wpa_
|
||||
dst->est_throughput = src->est_throughput;
|
||||
dst->snr = src->snr;
|
||||
|
||||
+ memset(&elems, 0, sizeof(elems));
|
||||
+ ieee802_11_parse_elems((u8 *) (src + 1), src->ie_len, &elems, 0);
|
||||
+ capab = (struct ieee80211_ht_capabilities *) elems.ht_capabilities;
|
||||
+ oper = (struct ieee80211_ht_operation *) elems.ht_operation;
|
||||
+ if (capab)
|
||||
+ dst->ht_capab = le_to_host16(capab->ht_capabilities_info);
|
||||
+ if (oper)
|
||||
+ dst->ht_param = oper->ht_param;
|
||||
+
|
||||
calculate_update_time(fetch_time, src->age, &dst->last_update);
|
||||
}
|
||||
|
||||
--- a/wpa_supplicant/bss.h
|
||||
+++ b/wpa_supplicant/bss.h
|
||||
@@ -94,6 +94,10 @@ struct wpa_bss {
|
||||
u8 ssid[SSID_MAX_LEN];
|
||||
/** Length of SSID */
|
||||
size_t ssid_len;
|
||||
+ /** HT capabilities */
|
||||
+ u16 ht_capab;
|
||||
+ /* Five octets of HT Operation Information */
|
||||
+ u8 ht_param;
|
||||
/** Frequency of the channel in MHz (e.g., 2412 = channel 1) */
|
||||
int freq;
|
||||
/** Beacon interval in TUs (host byte order) */
|
||||
--- a/wpa_supplicant/main.c
|
||||
+++ b/wpa_supplicant/main.c
|
||||
@@ -34,7 +34,7 @@ static void usage(void)
|
||||
"vW] [-P<pid file>] "
|
||||
"[-g<global ctrl>] \\\n"
|
||||
" [-G<group>] \\\n"
|
||||
- " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] "
|
||||
+ " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-H<hostapd path>] "
|
||||
"[-p<driver_param>] \\\n"
|
||||
" [-b<br_ifname>] [-e<entropy file>]"
|
||||
#ifdef CONFIG_DEBUG_FILE
|
||||
@@ -74,6 +74,7 @@ static void usage(void)
|
||||
" -g = global ctrl_interface\n"
|
||||
" -G = global ctrl_interface group\n"
|
||||
" -h = show this help text\n"
|
||||
+ " -H = connect to a hostapd instance to manage state changes\n"
|
||||
" -i = interface name\n"
|
||||
" -I = additional configuration file\n"
|
||||
" -K = include keys (passwords, etc.) in debug output\n"
|
||||
@@ -201,7 +202,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (;;) {
|
||||
c = getopt(argc, argv,
|
||||
- "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW");
|
||||
+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuvW");
|
||||
if (c < 0)
|
||||
break;
|
||||
switch (c) {
|
||||
@@ -248,6 +249,9 @@ int main(int argc, char *argv[])
|
||||
usage();
|
||||
exitcode = 0;
|
||||
goto out;
|
||||
+ case 'H':
|
||||
+ iface->hostapd_ctrl = optarg;
|
||||
+ break;
|
||||
case 'i':
|
||||
iface->ifname = optarg;
|
||||
break;
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -130,6 +130,54 @@ static void wpas_update_fils_connect_par
|
||||
static void wpas_update_owe_connect_params(struct wpa_supplicant *wpa_s);
|
||||
#endif /* CONFIG_OWE */
|
||||
|
||||
+static int hostapd_stop(struct wpa_supplicant *wpa_s)
|
||||
+{
|
||||
+ const char *cmd = "STOP_AP";
|
||||
+ char buf[256];
|
||||
+ size_t len = sizeof(buf);
|
||||
+
|
||||
+ if (wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL) < 0) {
|
||||
+ wpa_printf(MSG_ERROR, "\nFailed to stop hostapd AP interfaces\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int hostapd_reload(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
|
||||
+{
|
||||
+ char *cmd = NULL;
|
||||
+ char buf[256];
|
||||
+ size_t len = sizeof(buf);
|
||||
+ enum hostapd_hw_mode hw_mode;
|
||||
+ u8 channel;
|
||||
+ int sec_chan = 0;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!bss)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (bss->ht_param & HT_INFO_HT_PARAM_STA_CHNL_WIDTH) {
|
||||
+ int sec = bss->ht_param & HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK;
|
||||
+ if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE)
|
||||
+ sec_chan = 1;
|
||||
+ else if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW)
|
||||
+ sec_chan = -1;
|
||||
+ }
|
||||
+
|
||||
+ hw_mode = ieee80211_freq_to_chan(bss->freq, &channel);
|
||||
+ if (asprintf(&cmd, "UPDATE channel=%d sec_chan=%d hw_mode=%d",
|
||||
+ channel, sec_chan, hw_mode) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ ret = wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL);
|
||||
+ free(cmd);
|
||||
+
|
||||
+ if (ret < 0) {
|
||||
+ wpa_printf(MSG_ERROR, "\nFailed to reload hostapd AP interfaces\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
/* Configure default/group WEP keys for static WEP */
|
||||
@@ -1007,6 +1055,8 @@ void wpa_supplicant_set_state(struct wpa
|
||||
|
||||
sme_sched_obss_scan(wpa_s, 1);
|
||||
|
||||
+ if (wpa_s->hostapd)
|
||||
+ hostapd_reload(wpa_s, wpa_s->current_bss);
|
||||
#if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL)
|
||||
if (!fils_hlp_sent && ssid && ssid->eap.erp)
|
||||
update_fils_connect_params = true;
|
||||
@@ -1017,6 +1067,8 @@ void wpa_supplicant_set_state(struct wpa
|
||||
#endif /* CONFIG_OWE */
|
||||
} else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING ||
|
||||
state == WPA_ASSOCIATED) {
|
||||
+ if (wpa_s->hostapd)
|
||||
+ hostapd_stop(wpa_s);
|
||||
wpa_s->new_connection = 1;
|
||||
wpa_drv_set_operstate(wpa_s, 0);
|
||||
#ifndef IEEE8021X_EAPOL
|
||||
@@ -2276,6 +2328,8 @@ void wpa_supplicant_associate(struct wpa
|
||||
return;
|
||||
}
|
||||
wpa_s->current_bss = bss;
|
||||
+ if (wpa_s->hostapd)
|
||||
+ hostapd_reload(wpa_s, wpa_s->current_bss);
|
||||
#else /* CONFIG_MESH */
|
||||
wpa_msg(wpa_s, MSG_ERROR,
|
||||
"mesh mode support not included in the build");
|
||||
@@ -6426,6 +6480,16 @@ static int wpa_supplicant_init_iface(str
|
||||
sizeof(wpa_s->bridge_ifname));
|
||||
}
|
||||
|
||||
+ if (iface->hostapd_ctrl) {
|
||||
+ wpa_s->hostapd = wpa_ctrl_open(iface->hostapd_ctrl);
|
||||
+ if (!wpa_s->hostapd) {
|
||||
+ wpa_printf(MSG_ERROR, "\nFailed to connect to hostapd\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (hostapd_stop(wpa_s) < 0)
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
/* RSNA Supplicant Key Management - INITIALIZE */
|
||||
eapol_sm_notify_portEnabled(wpa_s->eapol, false);
|
||||
eapol_sm_notify_portValid(wpa_s->eapol, false);
|
||||
@@ -6763,6 +6827,11 @@ static void wpa_supplicant_deinit_iface(
|
||||
if (terminate)
|
||||
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
|
||||
|
||||
+ if (wpa_s->hostapd) {
|
||||
+ wpa_ctrl_close(wpa_s->hostapd);
|
||||
+ wpa_s->hostapd = NULL;
|
||||
+ }
|
||||
+
|
||||
wpa_supplicant_ctrl_iface_deinit(wpa_s, wpa_s->ctrl_iface);
|
||||
wpa_s->ctrl_iface = NULL;
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant_i.h
|
||||
+++ b/wpa_supplicant/wpa_supplicant_i.h
|
||||
@@ -103,6 +103,11 @@ struct wpa_interface {
|
||||
const char *ifname;
|
||||
|
||||
/**
|
||||
+ * hostapd_ctrl - path to hostapd control socket for notification
|
||||
+ */
|
||||
+ const char *hostapd_ctrl;
|
||||
+
|
||||
+ /**
|
||||
* bridge_ifname - Optional bridge interface name
|
||||
*
|
||||
* If the driver interface (ifname) is included in a Linux bridge
|
||||
@@ -615,6 +620,8 @@ struct wpa_supplicant {
|
||||
#endif /* CONFIG_CTRL_IFACE_BINDER */
|
||||
char bridge_ifname[16];
|
||||
|
||||
+ struct wpa_ctrl *hostapd;
|
||||
+
|
||||
char *confname;
|
||||
char *confanother;
|
||||
|
||||
--- a/hostapd/ctrl_iface.c
|
||||
+++ b/hostapd/ctrl_iface.c
|
||||
@@ -2883,6 +2883,11 @@ static int hostapd_ctrl_iface_chan_switc
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ if (os_strstr(pos, " auto-ht")) {
|
||||
+ settings.freq_params.ht_enabled = iface->conf->ieee80211n;
|
||||
+ settings.freq_params.vht_enabled = iface->conf->ieee80211ac;
|
||||
+ }
|
||||
+
|
||||
for (i = 0; i < iface->num_bss; i++) {
|
||||
|
||||
/* Save CHAN_SWITCH VHT and HE config */
|
||||
--- a/src/ap/beacon.c
|
||||
+++ b/src/ap/beacon.c
|
||||
@@ -1758,11 +1758,6 @@ int ieee802_11_set_beacon(struct hostapd
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (hapd->csa_in_progress) {
|
||||
- wpa_printf(MSG_ERROR, "Cannot set beacons during CSA period");
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
hapd->beacon_set_done = 1;
|
||||
|
||||
if (ieee802_11_build_ap_params(hapd, ¶ms) < 0)
|
||||
--- a/wpa_supplicant/events.c
|
||||
+++ b/wpa_supplicant/events.c
|
||||
@@ -4665,6 +4665,60 @@ static void wpas_event_unprot_beacon(str
|
||||
}
|
||||
|
||||
|
||||
+static void
|
||||
+supplicant_ch_switch_started(struct wpa_supplicant *wpa_s,
|
||||
+ union wpa_event_data *data)
|
||||
+{
|
||||
+ char buf[256];
|
||||
+ size_t len = sizeof(buf);
|
||||
+ char *cmd = NULL;
|
||||
+ int width = 20;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!wpa_s->hostapd)
|
||||
+ return;
|
||||
+
|
||||
+ wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_CHANNEL_SWITCH
|
||||
+ "count=%d freq=%d ht_enabled=%d ch_offset=%d ch_width=%s cf1=%d cf2=%d",
|
||||
+ data->ch_switch.count,
|
||||
+ data->ch_switch.freq,
|
||||
+ data->ch_switch.ht_enabled,
|
||||
+ data->ch_switch.ch_offset,
|
||||
+ channel_width_to_string(data->ch_switch.ch_width),
|
||||
+ data->ch_switch.cf1,
|
||||
+ data->ch_switch.cf2);
|
||||
+
|
||||
+ switch (data->ch_switch.ch_width) {
|
||||
+ case CHAN_WIDTH_20_NOHT:
|
||||
+ case CHAN_WIDTH_20:
|
||||
+ width = 20;
|
||||
+ break;
|
||||
+ case CHAN_WIDTH_40:
|
||||
+ width = 40;
|
||||
+ break;
|
||||
+ case CHAN_WIDTH_80:
|
||||
+ width = 80;
|
||||
+ break;
|
||||
+ case CHAN_WIDTH_160:
|
||||
+ case CHAN_WIDTH_80P80:
|
||||
+ width = 160;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ asprintf(&cmd, "CHAN_SWITCH %d %d sec_channel_offset=%d center_freq1=%d center_freq2=%d, bandwidth=%d auto-ht\n",
|
||||
+ data->ch_switch.count - 1,
|
||||
+ data->ch_switch.freq,
|
||||
+ data->ch_switch.ch_offset,
|
||||
+ data->ch_switch.cf1,
|
||||
+ data->ch_switch.cf2,
|
||||
+ width);
|
||||
+ ret = wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL);
|
||||
+ free(cmd);
|
||||
+
|
||||
+ if (ret < 0)
|
||||
+ wpa_printf(MSG_ERROR, "\nFailed to reload hostapd AP interfaces\n");
|
||||
+}
|
||||
+
|
||||
void supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
union wpa_event_data *data)
|
||||
{
|
||||
@@ -4980,8 +5034,10 @@ void supplicant_event(void *ctx, enum wp
|
||||
channel_width_to_string(data->ch_switch.ch_width),
|
||||
data->ch_switch.cf1,
|
||||
data->ch_switch.cf2);
|
||||
- if (event == EVENT_CH_SWITCH_STARTED)
|
||||
+ if (event == EVENT_CH_SWITCH_STARTED) {
|
||||
+ supplicant_ch_switch_started(wpa_s, data);
|
||||
break;
|
||||
+ }
|
||||
|
||||
wpa_s->assoc_freq = data->ch_switch.freq;
|
||||
wpa_s->current_ssid->frequency = data->ch_switch.freq;
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -5829,6 +5829,7 @@ union wpa_event_data {
|
||||
|
||||
/**
|
||||
* struct ch_switch
|
||||
+ * @count: Count until channel switch activates
|
||||
* @freq: Frequency of new channel in MHz
|
||||
* @ht_enabled: Whether this is an HT channel
|
||||
* @ch_offset: Secondary channel offset
|
||||
@@ -5837,6 +5838,7 @@ union wpa_event_data {
|
||||
* @cf2: Center frequency 2
|
||||
*/
|
||||
struct ch_switch {
|
||||
+ int count;
|
||||
int freq;
|
||||
int ht_enabled;
|
||||
int ch_offset;
|
||||
--- a/src/drivers/driver_nl80211_event.c
|
||||
+++ b/src/drivers/driver_nl80211_event.c
|
||||
@@ -684,7 +684,7 @@ static void mlme_event_ch_switch(struct
|
||||
struct nlattr *ifindex, struct nlattr *freq,
|
||||
struct nlattr *type, struct nlattr *bw,
|
||||
struct nlattr *cf1, struct nlattr *cf2,
|
||||
- int finished)
|
||||
+ struct nlattr *count, int finished)
|
||||
{
|
||||
struct i802_bss *bss;
|
||||
union wpa_event_data data;
|
||||
@@ -745,6 +745,8 @@ static void mlme_event_ch_switch(struct
|
||||
data.ch_switch.cf1 = nla_get_u32(cf1);
|
||||
if (cf2)
|
||||
data.ch_switch.cf2 = nla_get_u32(cf2);
|
||||
+ if (count)
|
||||
+ data.ch_switch.count = nla_get_u32(count);
|
||||
|
||||
if (finished)
|
||||
bss->freq = data.ch_switch.freq;
|
||||
@@ -3003,6 +3005,7 @@ static void do_process_drv_event(struct
|
||||
tb[NL80211_ATTR_CHANNEL_WIDTH],
|
||||
tb[NL80211_ATTR_CENTER_FREQ1],
|
||||
tb[NL80211_ATTR_CENTER_FREQ2],
|
||||
+ tb[NL80211_ATTR_CH_SWITCH_COUNT],
|
||||
0);
|
||||
break;
|
||||
case NL80211_CMD_CH_SWITCH_NOTIFY:
|
||||
@@ -3013,6 +3016,7 @@ static void do_process_drv_event(struct
|
||||
tb[NL80211_ATTR_CHANNEL_WIDTH],
|
||||
tb[NL80211_ATTR_CENTER_FREQ1],
|
||||
tb[NL80211_ATTR_CENTER_FREQ2],
|
||||
+ NULL,
|
||||
1);
|
||||
break;
|
||||
case NL80211_CMD_DISCONNECT:
|
||||
@@ -0,0 +1,193 @@
|
||||
--- a/hostapd/Makefile
|
||||
+++ b/hostapd/Makefile
|
||||
@@ -221,6 +221,9 @@ endif
|
||||
ifdef CONFIG_NO_CTRL_IFACE
|
||||
CFLAGS += -DCONFIG_NO_CTRL_IFACE
|
||||
else
|
||||
+ifdef CONFIG_CTRL_IFACE_MIB
|
||||
+CFLAGS += -DCONFIG_CTRL_IFACE_MIB
|
||||
+endif
|
||||
ifeq ($(CONFIG_CTRL_IFACE), udp)
|
||||
CFLAGS += -DCONFIG_CTRL_IFACE_UDP
|
||||
else
|
||||
--- a/hostapd/ctrl_iface.c
|
||||
+++ b/hostapd/ctrl_iface.c
|
||||
@@ -3569,6 +3569,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
reply_size);
|
||||
} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
|
||||
reply_len = hostapd_drv_status(hapd, reply, reply_size);
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
} else if (os_strcmp(buf, "MIB") == 0) {
|
||||
reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
|
||||
if (reply_len >= 0) {
|
||||
@@ -3610,6 +3611,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
|
||||
reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
|
||||
reply_size);
|
||||
+#endif
|
||||
} else if (os_strcmp(buf, "ATTACH") == 0) {
|
||||
if (hostapd_ctrl_iface_attach(hapd, from, fromlen, NULL))
|
||||
reply_len = -1;
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -955,6 +955,9 @@ ifdef CONFIG_FILS
|
||||
OBJS += ../src/ap/fils_hlp.o
|
||||
endif
|
||||
ifdef CONFIG_CTRL_IFACE
|
||||
+ifdef CONFIG_CTRL_IFACE_MIB
|
||||
+CFLAGS += -DCONFIG_CTRL_IFACE_MIB
|
||||
+endif
|
||||
OBJS += ../src/ap/ctrl_iface_ap.o
|
||||
endif
|
||||
|
||||
--- a/wpa_supplicant/ctrl_iface.c
|
||||
+++ b/wpa_supplicant/ctrl_iface.c
|
||||
@@ -2308,7 +2308,7 @@ static int wpa_supplicant_ctrl_iface_sta
|
||||
pos += ret;
|
||||
}
|
||||
|
||||
-#ifdef CONFIG_AP
|
||||
+#if defined(CONFIG_AP) && defined(CONFIG_CTRL_IFACE_MIB)
|
||||
if (wpa_s->ap_iface) {
|
||||
pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
|
||||
end - pos,
|
||||
@@ -10919,6 +10919,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_len = -1;
|
||||
} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
|
||||
wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
} else if (os_strcmp(buf, "MIB") == 0) {
|
||||
reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
|
||||
if (reply_len >= 0) {
|
||||
@@ -10931,6 +10932,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_size - reply_len);
|
||||
#endif /* CONFIG_MACSEC */
|
||||
}
|
||||
+#endif
|
||||
} else if (os_strncmp(buf, "STATUS", 6) == 0) {
|
||||
reply_len = wpa_supplicant_ctrl_iface_status(
|
||||
wpa_s, buf + 6, reply, reply_size);
|
||||
@@ -11419,6 +11421,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_len = wpa_supplicant_ctrl_iface_bss(
|
||||
wpa_s, buf + 4, reply, reply_size);
|
||||
#ifdef CONFIG_AP
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
} else if (os_strcmp(buf, "STA-FIRST") == 0) {
|
||||
reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
|
||||
} else if (os_strncmp(buf, "STA ", 4) == 0) {
|
||||
@@ -11427,12 +11430,15 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
|
||||
reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
|
||||
reply_size);
|
||||
+#endif
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
} else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) {
|
||||
if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15))
|
||||
reply_len = -1;
|
||||
} else if (os_strncmp(buf, "DISASSOCIATE ", 13) == 0) {
|
||||
if (ap_ctrl_iface_sta_disassociate(wpa_s, buf + 13))
|
||||
reply_len = -1;
|
||||
+#endif
|
||||
} else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) {
|
||||
if (ap_ctrl_iface_chanswitch(wpa_s, buf + 12))
|
||||
reply_len = -1;
|
||||
--- a/src/ap/ctrl_iface_ap.c
|
||||
+++ b/src/ap/ctrl_iface_ap.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "mbo_ap.h"
|
||||
#include "taxonomy.h"
|
||||
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
|
||||
static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen,
|
||||
size_t curr_len, const u8 *mcs_set)
|
||||
@@ -451,6 +452,7 @@ int hostapd_ctrl_iface_sta_next(struct h
|
||||
return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
|
||||
}
|
||||
|
||||
+#endif
|
||||
|
||||
#ifdef CONFIG_P2P_MANAGER
|
||||
static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
|
||||
@@ -807,12 +809,12 @@ int hostapd_ctrl_iface_status(struct hos
|
||||
return len;
|
||||
len += ret;
|
||||
}
|
||||
-
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
if (iface->conf->ieee80211n && !hapd->conf->disable_11n && mode) {
|
||||
len = hostapd_write_ht_mcs_bitmask(buf, buflen, len,
|
||||
mode->mcs_set);
|
||||
}
|
||||
-
|
||||
+#endif /* CONFIG_CTRL_IFACE_MIB */
|
||||
if (iface->current_rates && iface->num_rates) {
|
||||
ret = os_snprintf(buf + len, buflen - len, "supported_rates=");
|
||||
if (os_snprintf_error(buflen - len, ret))
|
||||
--- a/src/ap/ieee802_1x.c
|
||||
+++ b/src/ap/ieee802_1x.c
|
||||
@@ -2712,6 +2712,7 @@ static const char * bool_txt(bool val)
|
||||
return val ? "TRUE" : "FALSE";
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
|
||||
int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
|
||||
{
|
||||
@@ -2898,6 +2899,7 @@ int ieee802_1x_get_mib_sta(struct hostap
|
||||
return len;
|
||||
}
|
||||
|
||||
+#endif
|
||||
|
||||
#ifdef CONFIG_HS20
|
||||
static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
|
||||
--- a/src/ap/wpa_auth.c
|
||||
+++ b/src/ap/wpa_auth.c
|
||||
@@ -4519,6 +4519,7 @@ static const char * wpa_bool_txt(int val
|
||||
return val ? "TRUE" : "FALSE";
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
|
||||
#define RSN_SUITE "%02x-%02x-%02x-%d"
|
||||
#define RSN_SUITE_ARG(s) \
|
||||
@@ -4669,7 +4670,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
|
||||
|
||||
return len;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
|
||||
void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth)
|
||||
{
|
||||
--- a/src/rsn_supp/wpa.c
|
||||
+++ b/src/rsn_supp/wpa.c
|
||||
@@ -2767,6 +2767,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
|
||||
}
|
||||
|
||||
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
+
|
||||
#define RSN_SUITE "%02x-%02x-%02x-%d"
|
||||
#define RSN_SUITE_ARG(s) \
|
||||
((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
|
||||
@@ -2848,6 +2850,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
|
||||
|
||||
return (int) len;
|
||||
}
|
||||
+#endif
|
||||
#endif /* CONFIG_CTRL_IFACE */
|
||||
|
||||
|
||||
--- a/wpa_supplicant/ap.c
|
||||
+++ b/wpa_supplicant/ap.c
|
||||
@@ -1364,7 +1364,7 @@ int wpas_ap_wps_nfc_report_handover(stru
|
||||
#endif /* CONFIG_WPS */
|
||||
|
||||
|
||||
-#ifdef CONFIG_CTRL_IFACE
|
||||
+#if defined(CONFIG_CTRL_IFACE) && defined(CONFIG_CTRL_IFACE_MIB)
|
||||
|
||||
int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s,
|
||||
char *buf, size_t buflen)
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/hostapd/hostapd_cli.c
|
||||
+++ b/hostapd/hostapd_cli.c
|
||||
@@ -744,7 +744,7 @@ static int wpa_ctrl_command_sta(struct w
|
||||
}
|
||||
|
||||
buf[len] = '\0';
|
||||
- if (memcmp(buf, "FAIL", 4) == 0)
|
||||
+ if (memcmp(buf, "FAIL", 4) == 0 || memcmp(buf, "UNKNOWN COMMAND", 15) == 0)
|
||||
return -1;
|
||||
if (print)
|
||||
printf("%s", buf);
|
||||
@@ -0,0 +1,56 @@
|
||||
--- a/src/common/wpa_common.c
|
||||
+++ b/src/common/wpa_common.c
|
||||
@@ -2444,6 +2444,31 @@ u32 wpa_akm_to_suite(int akm)
|
||||
}
|
||||
|
||||
|
||||
+static void wpa_fixup_wpa_ie_rsn(u8 *assoc_ie, const u8 *wpa_msg_ie,
|
||||
+ size_t rsn_ie_len)
|
||||
+{
|
||||
+ int pos, count;
|
||||
+
|
||||
+ pos = sizeof(struct rsn_ie_hdr) + RSN_SELECTOR_LEN;
|
||||
+ if (rsn_ie_len < pos + 2)
|
||||
+ return;
|
||||
+
|
||||
+ count = WPA_GET_LE16(wpa_msg_ie + pos);
|
||||
+ pos += 2 + count * RSN_SELECTOR_LEN;
|
||||
+ if (rsn_ie_len < pos + 2)
|
||||
+ return;
|
||||
+
|
||||
+ count = WPA_GET_LE16(wpa_msg_ie + pos);
|
||||
+ pos += 2 + count * RSN_SELECTOR_LEN;
|
||||
+ if (rsn_ie_len < pos + 2)
|
||||
+ return;
|
||||
+
|
||||
+ if (!assoc_ie[pos] && !assoc_ie[pos + 1] &&
|
||||
+ (wpa_msg_ie[pos] || wpa_msg_ie[pos + 1]))
|
||||
+ memcpy(&assoc_ie[pos], &wpa_msg_ie[pos], 2);
|
||||
+}
|
||||
+
|
||||
+
|
||||
int wpa_compare_rsn_ie(int ft_initial_assoc,
|
||||
const u8 *ie1, size_t ie1len,
|
||||
const u8 *ie2, size_t ie2len)
|
||||
@@ -2451,8 +2476,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
|
||||
if (ie1 == NULL || ie2 == NULL)
|
||||
return -1;
|
||||
|
||||
- if (ie1len == ie2len && os_memcmp(ie1, ie2, ie1len) == 0)
|
||||
- return 0; /* identical IEs */
|
||||
+ if (ie1len == ie2len) {
|
||||
+ u8 *ie_tmp;
|
||||
+
|
||||
+ if (os_memcmp(ie1, ie2, ie1len) == 0)
|
||||
+ return 0; /* identical IEs */
|
||||
+
|
||||
+ ie_tmp = alloca(ie1len);
|
||||
+ memcpy(ie_tmp, ie1, ie1len);
|
||||
+ wpa_fixup_wpa_ie_rsn(ie_tmp, ie2, ie1len);
|
||||
+
|
||||
+ if (os_memcmp(ie_tmp, ie2, ie1len) == 0)
|
||||
+ return 0; /* only mismatch in RSN capabilties */
|
||||
+ }
|
||||
|
||||
#ifdef CONFIG_IEEE80211R
|
||||
if (ft_initial_assoc) {
|
||||
@@ -0,0 +1,23 @@
|
||||
--- a/src/ap/wps_hostapd.c
|
||||
+++ b/src/ap/wps_hostapd.c
|
||||
@@ -394,9 +394,8 @@ static int hapd_wps_reconfig_in_memory(s
|
||||
bss->wpa_pairwise |= WPA_CIPHER_GCMP;
|
||||
else
|
||||
bss->wpa_pairwise |= WPA_CIPHER_CCMP;
|
||||
- }
|
||||
#ifndef CONFIG_NO_TKIP
|
||||
- if (cred->encr_type & WPS_ENCR_TKIP)
|
||||
+ } else if (cred->encr_type & WPS_ENCR_TKIP)
|
||||
bss->wpa_pairwise |= WPA_CIPHER_TKIP;
|
||||
#endif /* CONFIG_NO_TKIP */
|
||||
bss->rsn_pairwise = bss->wpa_pairwise;
|
||||
@@ -1178,8 +1177,7 @@ int hostapd_init_wps(struct hostapd_data
|
||||
WPA_CIPHER_GCMP_256)) {
|
||||
wps->encr_types |= WPS_ENCR_AES;
|
||||
wps->encr_types_rsn |= WPS_ENCR_AES;
|
||||
- }
|
||||
- if (conf->rsn_pairwise & WPA_CIPHER_TKIP) {
|
||||
+ } else if (conf->rsn_pairwise & WPA_CIPHER_TKIP) {
|
||||
#ifdef CONFIG_NO_TKIP
|
||||
wpa_printf(MSG_INFO, "WPS: TKIP not supported");
|
||||
goto fail;
|
||||
@@ -0,0 +1,210 @@
|
||||
--- a/src/utils/wpa_debug.c
|
||||
+++ b/src/utils/wpa_debug.c
|
||||
@@ -206,7 +206,7 @@ void wpa_debug_close_linux_tracing(void)
|
||||
*
|
||||
* Note: New line '\n' is added to the end of the text when printing to stdout.
|
||||
*/
|
||||
-void wpa_printf(int level, const char *fmt, ...)
|
||||
+void _wpa_printf(int level, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@@ -255,7 +255,7 @@ void wpa_printf(int level, const char *f
|
||||
}
|
||||
|
||||
|
||||
-static void _wpa_hexdump(int level, const char *title, const u8 *buf,
|
||||
+void _wpa_hexdump(int level, const char *title, const u8 *buf,
|
||||
size_t len, int show, int only_syslog)
|
||||
{
|
||||
size_t i;
|
||||
@@ -382,19 +382,7 @@ static void _wpa_hexdump(int level, cons
|
||||
#endif /* CONFIG_ANDROID_LOG */
|
||||
}
|
||||
|
||||
-void wpa_hexdump(int level, const char *title, const void *buf, size_t len)
|
||||
-{
|
||||
- _wpa_hexdump(level, title, buf, len, 1, 0);
|
||||
-}
|
||||
-
|
||||
-
|
||||
-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len)
|
||||
-{
|
||||
- _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys, 0);
|
||||
-}
|
||||
-
|
||||
-
|
||||
-static void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
|
||||
+void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
|
||||
size_t len, int show)
|
||||
{
|
||||
size_t i, llen;
|
||||
@@ -507,20 +495,6 @@ file_done:
|
||||
}
|
||||
|
||||
|
||||
-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
|
||||
- size_t len)
|
||||
-{
|
||||
- _wpa_hexdump_ascii(level, title, buf, len, 1);
|
||||
-}
|
||||
-
|
||||
-
|
||||
-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
|
||||
- size_t len)
|
||||
-{
|
||||
- _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys);
|
||||
-}
|
||||
-
|
||||
-
|
||||
#ifdef CONFIG_DEBUG_FILE
|
||||
static char *last_path = NULL;
|
||||
#endif /* CONFIG_DEBUG_FILE */
|
||||
@@ -636,7 +610,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
|
||||
}
|
||||
|
||||
|
||||
-void wpa_msg(void *ctx, int level, const char *fmt, ...)
|
||||
+void _wpa_msg(void *ctx, int level, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char *buf;
|
||||
@@ -674,7 +648,7 @@ void wpa_msg(void *ctx, int level, const
|
||||
}
|
||||
|
||||
|
||||
-void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
|
||||
+void _wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char *buf;
|
||||
--- a/src/utils/wpa_debug.h
|
||||
+++ b/src/utils/wpa_debug.h
|
||||
@@ -50,6 +50,17 @@ int wpa_debug_reopen_file(void);
|
||||
void wpa_debug_close_file(void);
|
||||
void wpa_debug_setup_stdout(void);
|
||||
|
||||
+/* internal */
|
||||
+void _wpa_hexdump(int level, const char *title, const u8 *buf,
|
||||
+ size_t len, int show, int only_syslog);
|
||||
+void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
|
||||
+ size_t len, int show);
|
||||
+extern int wpa_debug_show_keys;
|
||||
+
|
||||
+#ifndef CONFIG_MSG_MIN_PRIORITY
|
||||
+#define CONFIG_MSG_MIN_PRIORITY 0
|
||||
+#endif
|
||||
+
|
||||
/**
|
||||
* wpa_debug_printf_timestamp - Print timestamp for debug output
|
||||
*
|
||||
@@ -70,9 +81,15 @@ void wpa_debug_print_timestamp(void);
|
||||
*
|
||||
* Note: New line '\n' is added to the end of the text when printing to stdout.
|
||||
*/
|
||||
-void wpa_printf(int level, const char *fmt, ...)
|
||||
+void _wpa_printf(int level, const char *fmt, ...)
|
||||
PRINTF_FORMAT(2, 3);
|
||||
|
||||
+#define wpa_printf(level, ...) \
|
||||
+ do { \
|
||||
+ if (level >= CONFIG_MSG_MIN_PRIORITY) \
|
||||
+ _wpa_printf(level, __VA_ARGS__); \
|
||||
+ } while(0)
|
||||
+
|
||||
/**
|
||||
* wpa_hexdump - conditional hex dump
|
||||
* @level: priority level (MSG_*) of the message
|
||||
@@ -84,7 +101,13 @@ PRINTF_FORMAT(2, 3);
|
||||
* output may be directed to stdout, stderr, and/or syslog based on
|
||||
* configuration. The contents of buf is printed out has hex dump.
|
||||
*/
|
||||
-void wpa_hexdump(int level, const char *title, const void *buf, size_t len);
|
||||
+static inline void wpa_hexdump(int level, const char *title, const void *buf, size_t len)
|
||||
+{
|
||||
+ if (level < CONFIG_MSG_MIN_PRIORITY)
|
||||
+ return;
|
||||
+
|
||||
+ _wpa_hexdump(level, title, buf, len, 1, 1);
|
||||
+}
|
||||
|
||||
static inline void wpa_hexdump_buf(int level, const char *title,
|
||||
const struct wpabuf *buf)
|
||||
@@ -106,7 +129,13 @@ static inline void wpa_hexdump_buf(int l
|
||||
* like wpa_hexdump(), but by default, does not include secret keys (passwords,
|
||||
* etc.) in debug output.
|
||||
*/
|
||||
-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len);
|
||||
+static inline void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
|
||||
+{
|
||||
+ if (level < CONFIG_MSG_MIN_PRIORITY)
|
||||
+ return;
|
||||
+
|
||||
+ _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys, 1);
|
||||
+}
|
||||
|
||||
static inline void wpa_hexdump_buf_key(int level, const char *title,
|
||||
const struct wpabuf *buf)
|
||||
@@ -128,8 +157,14 @@ static inline void wpa_hexdump_buf_key(i
|
||||
* the hex numbers and ASCII characters (for printable range) are shown. 16
|
||||
* bytes per line will be shown.
|
||||
*/
|
||||
-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
|
||||
- size_t len);
|
||||
+static inline void wpa_hexdump_ascii(int level, const char *title,
|
||||
+ const u8 *buf, size_t len)
|
||||
+{
|
||||
+ if (level < CONFIG_MSG_MIN_PRIORITY)
|
||||
+ return;
|
||||
+
|
||||
+ _wpa_hexdump_ascii(level, title, buf, len, 1);
|
||||
+}
|
||||
|
||||
/**
|
||||
* wpa_hexdump_ascii_key - conditional hex dump, hide keys
|
||||
@@ -145,8 +180,14 @@ void wpa_hexdump_ascii(int level, const
|
||||
* bytes per line will be shown. This works like wpa_hexdump_ascii(), but by
|
||||
* default, does not include secret keys (passwords, etc.) in debug output.
|
||||
*/
|
||||
-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
|
||||
- size_t len);
|
||||
+static inline void wpa_hexdump_ascii_key(int level, const char *title,
|
||||
+ const u8 *buf, size_t len)
|
||||
+{
|
||||
+ if (level < CONFIG_MSG_MIN_PRIORITY)
|
||||
+ return;
|
||||
+
|
||||
+ _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys);
|
||||
+}
|
||||
|
||||
/*
|
||||
* wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce
|
||||
@@ -183,7 +224,12 @@ void wpa_hexdump_ascii_key(int level, co
|
||||
*
|
||||
* Note: New line '\n' is added to the end of the text when printing to stdout.
|
||||
*/
|
||||
-void wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4);
|
||||
+void _wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4);
|
||||
+#define wpa_msg(ctx, level, ...) \
|
||||
+ do { \
|
||||
+ if (level >= CONFIG_MSG_MIN_PRIORITY) \
|
||||
+ _wpa_msg(ctx, level, __VA_ARGS__); \
|
||||
+ } while(0)
|
||||
|
||||
/**
|
||||
* wpa_msg_ctrl - Conditional printf for ctrl_iface monitors
|
||||
@@ -197,8 +243,13 @@ void wpa_msg(void *ctx, int level, const
|
||||
* attached ctrl_iface monitors. In other words, it can be used for frequent
|
||||
* events that do not need to be sent to syslog.
|
||||
*/
|
||||
-void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
|
||||
+void _wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
|
||||
PRINTF_FORMAT(3, 4);
|
||||
+#define wpa_msg_ctrl(ctx, level, ...) \
|
||||
+ do { \
|
||||
+ if (level >= CONFIG_MSG_MIN_PRIORITY) \
|
||||
+ _wpa_msg_ctrl(ctx, level, __VA_ARGS__); \
|
||||
+ } while(0)
|
||||
|
||||
/**
|
||||
* wpa_msg_global - Global printf for ctrl_iface monitors
|
||||
@@ -0,0 +1,62 @@
|
||||
--- a/hostapd/main.c
|
||||
+++ b/hostapd/main.c
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "utils/common.h"
|
||||
#include "utils/eloop.h"
|
||||
#include "utils/uuid.h"
|
||||
+#include "utils/build_features.h"
|
||||
#include "crypto/random.h"
|
||||
#include "crypto/tls.h"
|
||||
#include "common/version.h"
|
||||
@@ -691,7 +692,7 @@ int main(int argc, char *argv[])
|
||||
wpa_supplicant_event = hostapd_wpa_event;
|
||||
wpa_supplicant_event_global = hostapd_wpa_event_global;
|
||||
for (;;) {
|
||||
- c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:");
|
||||
+ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:v::");
|
||||
if (c < 0)
|
||||
break;
|
||||
switch (c) {
|
||||
@@ -728,6 +729,8 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
#endif /* CONFIG_DEBUG_LINUX_TRACING */
|
||||
case 'v':
|
||||
+ if (optarg)
|
||||
+ exit(!has_feature(optarg));
|
||||
show_version();
|
||||
exit(1);
|
||||
break;
|
||||
--- a/wpa_supplicant/main.c
|
||||
+++ b/wpa_supplicant/main.c
|
||||
@@ -12,6 +12,7 @@
|
||||
#endif /* __linux__ */
|
||||
|
||||
#include "common.h"
|
||||
+#include "build_features.h"
|
||||
#include "fst/fst.h"
|
||||
#include "wpa_supplicant_i.h"
|
||||
#include "driver_i.h"
|
||||
@@ -202,7 +203,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (;;) {
|
||||
c = getopt(argc, argv,
|
||||
- "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuvW");
|
||||
+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuv::W");
|
||||
if (c < 0)
|
||||
break;
|
||||
switch (c) {
|
||||
@@ -305,8 +306,12 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
case 'v':
|
||||
- printf("%s\n", wpa_supplicant_version);
|
||||
- exitcode = 0;
|
||||
+ if (optarg) {
|
||||
+ exitcode = !has_feature(optarg);
|
||||
+ } else {
|
||||
+ printf("%s\n", wpa_supplicant_version);
|
||||
+ exitcode = 0;
|
||||
+ }
|
||||
goto out;
|
||||
case 'W':
|
||||
params.wait_for_monitor++;
|
||||
@@ -0,0 +1,56 @@
|
||||
--- a/hostapd/hostapd_cli.c
|
||||
+++ b/hostapd/hostapd_cli.c
|
||||
@@ -388,7 +388,6 @@ static int hostapd_cli_cmd_disassociate(
|
||||
}
|
||||
|
||||
|
||||
-#ifdef CONFIG_TAXONOMY
|
||||
static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc,
|
||||
char *argv[])
|
||||
{
|
||||
@@ -401,7 +400,6 @@ static int hostapd_cli_cmd_signature(str
|
||||
os_snprintf(buf, sizeof(buf), "SIGNATURE %s", argv[0]);
|
||||
return wpa_ctrl_command(ctrl, buf);
|
||||
}
|
||||
-#endif /* CONFIG_TAXONOMY */
|
||||
|
||||
|
||||
static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc,
|
||||
@@ -418,7 +416,6 @@ static int hostapd_cli_cmd_sa_query(stru
|
||||
}
|
||||
|
||||
|
||||
-#ifdef CONFIG_WPS
|
||||
static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
|
||||
char *argv[])
|
||||
{
|
||||
@@ -644,7 +641,6 @@ static int hostapd_cli_cmd_wps_config(st
|
||||
ssid_hex, argv[1]);
|
||||
return wpa_ctrl_command(ctrl, buf);
|
||||
}
|
||||
-#endif /* CONFIG_WPS */
|
||||
|
||||
|
||||
static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
|
||||
@@ -1579,13 +1575,10 @@ static const struct hostapd_cli_cmd host
|
||||
{ "disassociate", hostapd_cli_cmd_disassociate,
|
||||
hostapd_complete_stations,
|
||||
"<addr> = disassociate a station" },
|
||||
-#ifdef CONFIG_TAXONOMY
|
||||
{ "signature", hostapd_cli_cmd_signature, hostapd_complete_stations,
|
||||
"<addr> = get taxonomy signature for a station" },
|
||||
-#endif /* CONFIG_TAXONOMY */
|
||||
{ "sa_query", hostapd_cli_cmd_sa_query, hostapd_complete_stations,
|
||||
"<addr> = send SA Query to a station" },
|
||||
-#ifdef CONFIG_WPS
|
||||
{ "wps_pin", hostapd_cli_cmd_wps_pin, NULL,
|
||||
"<uuid> <pin> [timeout] [addr] = add WPS Enrollee PIN" },
|
||||
{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL,
|
||||
@@ -1610,7 +1603,6 @@ static const struct hostapd_cli_cmd host
|
||||
"<SSID> <auth> <encr> <key> = configure AP" },
|
||||
{ "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL,
|
||||
"= show current WPS status" },
|
||||
-#endif /* CONFIG_WPS */
|
||||
{ "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL,
|
||||
"= send Disassociation Imminent notification" },
|
||||
{ "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL,
|
||||
@@ -0,0 +1,18 @@
|
||||
--- a/wpa_supplicant/wpa_cli.c
|
||||
+++ b/wpa_supplicant/wpa_cli.c
|
||||
@@ -26,6 +26,15 @@
|
||||
#include <cutils/properties.h>
|
||||
#endif /* ANDROID */
|
||||
|
||||
+#ifndef CONFIG_P2P
|
||||
+#define CONFIG_P2P
|
||||
+#endif
|
||||
+#ifndef CONFIG_AP
|
||||
+#define CONFIG_AP
|
||||
+#endif
|
||||
+#ifndef CONFIG_MESH
|
||||
+#define CONFIG_MESH
|
||||
+#endif
|
||||
|
||||
static const char *const wpa_cli_version =
|
||||
"wpa_cli v" VERSION_STR "\n"
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/src/drivers/linux_wext.h
|
||||
+++ b/src/drivers/linux_wext.h
|
||||
@@ -26,6 +26,7 @@ typedef int32_t __s32;
|
||||
typedef uint16_t __u16;
|
||||
typedef int16_t __s16;
|
||||
typedef uint8_t __u8;
|
||||
+typedef int8_t __s8;
|
||||
#ifndef __user
|
||||
#define __user
|
||||
#endif /* __user */
|
||||
73
package/network/services/hostapd/patches/450-scan_wait.patch
Normal file
73
package/network/services/hostapd/patches/450-scan_wait.patch
Normal file
@@ -0,0 +1,73 @@
|
||||
--- a/hostapd/main.c
|
||||
+++ b/hostapd/main.c
|
||||
@@ -39,6 +39,8 @@ struct hapd_global {
|
||||
};
|
||||
|
||||
static struct hapd_global global;
|
||||
+static int daemonize = 0;
|
||||
+static char *pid_file = NULL;
|
||||
|
||||
|
||||
#ifndef CONFIG_NO_HOSTAPD_LOGGER
|
||||
@@ -146,6 +148,14 @@ static void hostapd_logger_cb(void *ctx,
|
||||
}
|
||||
#endif /* CONFIG_NO_HOSTAPD_LOGGER */
|
||||
|
||||
+static void hostapd_setup_complete_cb(void *ctx)
|
||||
+{
|
||||
+ if (daemonize && os_daemonize(pid_file)) {
|
||||
+ perror("daemon");
|
||||
+ return;
|
||||
+ }
|
||||
+ daemonize = 0;
|
||||
+}
|
||||
|
||||
/**
|
||||
* hostapd_driver_init - Preparate driver interface
|
||||
@@ -164,6 +174,8 @@ static int hostapd_driver_init(struct ho
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ hapd->setup_complete_cb = hostapd_setup_complete_cb;
|
||||
+
|
||||
/* Initialize the driver interface */
|
||||
if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5]))
|
||||
b = NULL;
|
||||
@@ -404,8 +416,6 @@ static void hostapd_global_deinit(const
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
|
||||
eap_server_unregister_methods();
|
||||
-
|
||||
- os_daemonize_terminate(pid_file);
|
||||
}
|
||||
|
||||
|
||||
@@ -431,18 +441,6 @@ static int hostapd_global_run(struct hap
|
||||
}
|
||||
#endif /* EAP_SERVER_TNC */
|
||||
|
||||
- if (daemonize) {
|
||||
- if (os_daemonize(pid_file)) {
|
||||
- wpa_printf(MSG_ERROR, "daemon: %s", strerror(errno));
|
||||
- return -1;
|
||||
- }
|
||||
- if (eloop_sock_requeue()) {
|
||||
- wpa_printf(MSG_ERROR, "eloop_sock_requeue: %s",
|
||||
- strerror(errno));
|
||||
- return -1;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
eloop_run();
|
||||
|
||||
return 0;
|
||||
@@ -645,8 +643,7 @@ int main(int argc, char *argv[])
|
||||
struct hapd_interfaces interfaces;
|
||||
int ret = 1;
|
||||
size_t i, j;
|
||||
- int c, debug = 0, daemonize = 0;
|
||||
- char *pid_file = NULL;
|
||||
+ int c, debug = 0;
|
||||
const char *log_file = NULL;
|
||||
const char *entropy_file = NULL;
|
||||
char **bss_config = NULL, **tmp_bss;
|
||||
@@ -0,0 +1,189 @@
|
||||
From 4bb69d15477e0f2b00e166845341dc933de47c58 Mon Sep 17 00:00:00 2001
|
||||
From: Antonio Quartulli <ordex@autistici.org>
|
||||
Date: Sun, 3 Jun 2012 18:22:56 +0200
|
||||
Subject: [PATCHv2 601/602] wpa_supplicant: add new config params to be used
|
||||
with the ibss join command
|
||||
|
||||
Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
---
|
||||
src/drivers/driver.h | 6 +++
|
||||
wpa_supplicant/config.c | 96 +++++++++++++++++++++++++++++++++++++++
|
||||
wpa_supplicant/config_ssid.h | 6 +++
|
||||
wpa_supplicant/wpa_supplicant.c | 23 +++++++---
|
||||
4 files changed, 124 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#define WPA_SUPPLICANT_DRIVER_VERSION 4
|
||||
|
||||
+#include "ap/sta_info.h"
|
||||
#include "common/defs.h"
|
||||
#include "common/ieee802_11_defs.h"
|
||||
#include "common/wpa_common.h"
|
||||
@@ -851,6 +852,9 @@ struct wpa_driver_associate_params {
|
||||
* responsible for selecting with which BSS to associate. */
|
||||
const u8 *bssid;
|
||||
|
||||
+ unsigned char rates[WLAN_SUPP_RATES_MAX];
|
||||
+ int mcast_rate;
|
||||
+
|
||||
/**
|
||||
* bssid_hint - BSSID of a proposed AP
|
||||
*
|
||||
--- a/wpa_supplicant/config.c
|
||||
+++ b/wpa_supplicant/config.c
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "eap_peer/eap.h"
|
||||
#include "p2p/p2p.h"
|
||||
#include "fst/fst.h"
|
||||
+#include "ap/sta_info.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
@@ -2321,6 +2322,97 @@ static char * wpa_config_write_peerkey(c
|
||||
#endif /* NO_CONFIG_WRITE */
|
||||
|
||||
|
||||
+static int wpa_config_parse_mcast_rate(const struct parse_data *data,
|
||||
+ struct wpa_ssid *ssid, int line,
|
||||
+ const char *value)
|
||||
+{
|
||||
+ ssid->mcast_rate = (int)(strtod(value, NULL) * 10);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#ifndef NO_CONFIG_WRITE
|
||||
+static char * wpa_config_write_mcast_rate(const struct parse_data *data,
|
||||
+ struct wpa_ssid *ssid)
|
||||
+{
|
||||
+ char *value;
|
||||
+ int res;
|
||||
+
|
||||
+ if (!ssid->mcast_rate == 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ value = os_malloc(6); /* longest: 300.0 */
|
||||
+ if (value == NULL)
|
||||
+ return NULL;
|
||||
+ res = os_snprintf(value, 5, "%.1f", (double)ssid->mcast_rate / 10);
|
||||
+ if (res < 0) {
|
||||
+ os_free(value);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ return value;
|
||||
+}
|
||||
+#endif /* NO_CONFIG_WRITE */
|
||||
+
|
||||
+static int wpa_config_parse_rates(const struct parse_data *data,
|
||||
+ struct wpa_ssid *ssid, int line,
|
||||
+ const char *value)
|
||||
+{
|
||||
+ int i;
|
||||
+ char *pos, *r, *sptr, *end;
|
||||
+ double rate;
|
||||
+
|
||||
+ pos = (char *)value;
|
||||
+ r = strtok_r(pos, ",", &sptr);
|
||||
+ i = 0;
|
||||
+ while (pos && i < WLAN_SUPP_RATES_MAX) {
|
||||
+ rate = 0.0;
|
||||
+ if (r)
|
||||
+ rate = strtod(r, &end);
|
||||
+ ssid->rates[i] = rate * 2;
|
||||
+ if (*end != '\0' || rate * 2 != ssid->rates[i])
|
||||
+ return 1;
|
||||
+
|
||||
+ i++;
|
||||
+ r = strtok_r(NULL, ",", &sptr);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#ifndef NO_CONFIG_WRITE
|
||||
+static char * wpa_config_write_rates(const struct parse_data *data,
|
||||
+ struct wpa_ssid *ssid)
|
||||
+{
|
||||
+ char *value, *pos;
|
||||
+ int res, i;
|
||||
+
|
||||
+ if (ssid->rates[0] <= 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ value = os_malloc(6 * WLAN_SUPP_RATES_MAX + 1);
|
||||
+ if (value == NULL)
|
||||
+ return NULL;
|
||||
+ pos = value;
|
||||
+ for (i = 0; i < WLAN_SUPP_RATES_MAX - 1; i++) {
|
||||
+ res = os_snprintf(pos, 6, "%.1f,", (double)ssid->rates[i] / 2);
|
||||
+ if (res < 0) {
|
||||
+ os_free(value);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ pos += res;
|
||||
+ }
|
||||
+ res = os_snprintf(pos, 6, "%.1f",
|
||||
+ (double)ssid->rates[WLAN_SUPP_RATES_MAX - 1] / 2);
|
||||
+ if (res < 0) {
|
||||
+ os_free(value);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ value[6 * WLAN_SUPP_RATES_MAX] = '\0';
|
||||
+ return value;
|
||||
+}
|
||||
+#endif /* NO_CONFIG_WRITE */
|
||||
+
|
||||
/* Helper macros for network block parser */
|
||||
|
||||
#ifdef OFFSET
|
||||
@@ -2606,6 +2698,8 @@ static const struct parse_data ssid_fiel
|
||||
{ INT(ap_max_inactivity) },
|
||||
{ INT(dtim_period) },
|
||||
{ INT(beacon_int) },
|
||||
+ { FUNC(rates) },
|
||||
+ { FUNC(mcast_rate) },
|
||||
#ifdef CONFIG_MACSEC
|
||||
{ INT_RANGE(macsec_policy, 0, 1) },
|
||||
{ INT_RANGE(macsec_integ_only, 0, 1) },
|
||||
--- a/wpa_supplicant/config_ssid.h
|
||||
+++ b/wpa_supplicant/config_ssid.h
|
||||
@@ -10,8 +10,10 @@
|
||||
#define CONFIG_SSID_H
|
||||
|
||||
#include "common/defs.h"
|
||||
+#include "ap/sta_info.h"
|
||||
#include "utils/list.h"
|
||||
#include "eap_peer/eap_config.h"
|
||||
+#include "drivers/nl80211_copy.h"
|
||||
|
||||
|
||||
#define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
|
||||
@@ -843,6 +845,9 @@ struct wpa_ssid {
|
||||
*/
|
||||
void *parent_cred;
|
||||
|
||||
+ unsigned char rates[WLAN_SUPP_RATES_MAX];
|
||||
+ double mcast_rate;
|
||||
+
|
||||
#ifdef CONFIG_MACSEC
|
||||
/**
|
||||
* macsec_policy - Determines the policy for MACsec secure session
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -3726,6 +3726,12 @@ static void wpas_start_assoc_cb(struct w
|
||||
params.beacon_int = ssid->beacon_int;
|
||||
else
|
||||
params.beacon_int = wpa_s->conf->beacon_int;
|
||||
+ int i = 0;
|
||||
+ while (i < WLAN_SUPP_RATES_MAX) {
|
||||
+ params.rates[i] = ssid->rates[i];
|
||||
+ i++;
|
||||
+ }
|
||||
+ params.mcast_rate = ssid->mcast_rate;
|
||||
}
|
||||
|
||||
if (bss && ssid->enable_edmg)
|
||||
@@ -0,0 +1,59 @@
|
||||
From ffc4445958a3ed4064f2e1bf73fa478a61c5cf7b Mon Sep 17 00:00:00 2001
|
||||
From: Antonio Quartulli <ordex@autistici.org>
|
||||
Date: Sun, 3 Jun 2012 18:42:25 +0200
|
||||
Subject: [PATCHv2 602/602] driver_nl80211: use new parameters during ibss join
|
||||
|
||||
Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
---
|
||||
src/drivers/driver_nl80211.c | 33 ++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 32 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -5950,7 +5950,7 @@ static int wpa_driver_nl80211_ibss(struc
|
||||
struct wpa_driver_associate_params *params)
|
||||
{
|
||||
struct nl_msg *msg;
|
||||
- int ret = -1;
|
||||
+ int ret = -1, i;
|
||||
int count = 0;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
|
||||
@@ -5977,6 +5977,37 @@ retry:
|
||||
nl80211_put_beacon_int(msg, params->beacon_int))
|
||||
goto fail;
|
||||
|
||||
+ if (params->fixed_freq) {
|
||||
+ wpa_printf(MSG_DEBUG, " * fixed_freq");
|
||||
+ nla_put_flag(msg, NL80211_ATTR_FREQ_FIXED);
|
||||
+ }
|
||||
+
|
||||
+ if (params->beacon_int > 0) {
|
||||
+ wpa_printf(MSG_DEBUG, " * beacon_int=%d",
|
||||
+ params->beacon_int);
|
||||
+ nla_put_u32(msg, NL80211_ATTR_BEACON_INTERVAL,
|
||||
+ params->beacon_int);
|
||||
+ }
|
||||
+
|
||||
+ if (params->rates[0] > 0) {
|
||||
+ wpa_printf(MSG_DEBUG, " * basic_rates:");
|
||||
+ i = 0;
|
||||
+ while (i < NL80211_MAX_SUPP_RATES &&
|
||||
+ params->rates[i] > 0) {
|
||||
+ wpa_printf(MSG_DEBUG, " %.1f",
|
||||
+ (double)params->rates[i] / 2);
|
||||
+ i++;
|
||||
+ }
|
||||
+ nla_put(msg, NL80211_ATTR_BSS_BASIC_RATES, i,
|
||||
+ params->rates);
|
||||
+ }
|
||||
+
|
||||
+ if (params->mcast_rate > 0) {
|
||||
+ wpa_printf(MSG_DEBUG, " * mcast_rate=%.1f",
|
||||
+ (double)params->mcast_rate / 10);
|
||||
+ nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
|
||||
+ }
|
||||
+
|
||||
ret = nl80211_set_conn_keys(params, msg);
|
||||
if (ret)
|
||||
goto fail;
|
||||
@@ -0,0 +1,68 @@
|
||||
From: Sven Eckelmann <sven.eckelmann@openmesh.com>
|
||||
Date: Thu, 11 May 2017 08:21:45 +0200
|
||||
Subject: [PATCH] set mcast_rate in mesh mode
|
||||
|
||||
The wpa_supplicant code for IBSS allows to set the mcast rate. It is
|
||||
recommended to increase this value from 1 or 6 Mbit/s to something higher
|
||||
when using a mesh protocol on top which uses the multicast packet loss as
|
||||
indicator for the link quality.
|
||||
|
||||
This setting was unfortunately not applied for mesh mode. But it would be
|
||||
beneficial when wpa_supplicant would behave similar to IBSS mode and set
|
||||
this argument during mesh join like authsae already does. At least it is
|
||||
helpful for companies/projects which are currently switching to 802.11s
|
||||
(without mesh_fwding and with mesh_ttl set to 1) as replacement for IBSS
|
||||
because newer drivers seem to support 802.11s but not IBSS anymore.
|
||||
|
||||
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
|
||||
Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -1618,6 +1618,7 @@ struct wpa_driver_mesh_join_params {
|
||||
#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
|
||||
unsigned int flags;
|
||||
bool handle_dfs;
|
||||
+ int mcast_rate;
|
||||
};
|
||||
|
||||
struct wpa_driver_set_key_params {
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -10473,6 +10473,18 @@ static int nl80211_put_mesh_id(struct nl
|
||||
}
|
||||
|
||||
|
||||
+static int nl80211_put_mcast_rate(struct nl_msg *msg, int mcast_rate)
|
||||
+{
|
||||
+ if (mcast_rate > 0) {
|
||||
+ wpa_printf(MSG_DEBUG, " * mcast_rate=%.1f",
|
||||
+ (double)mcast_rate / 10);
|
||||
+ return nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, mcast_rate);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int nl80211_put_mesh_config(struct nl_msg *msg,
|
||||
struct wpa_driver_mesh_bss_params *params)
|
||||
{
|
||||
@@ -10534,6 +10546,7 @@ static int nl80211_join_mesh(struct i802
|
||||
nl80211_put_basic_rates(msg, params->basic_rates) ||
|
||||
nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
|
||||
nl80211_put_beacon_int(msg, params->beacon_int) ||
|
||||
+ nl80211_put_mcast_rate(msg, params->mcast_rate) ||
|
||||
nl80211_put_dtim_period(msg, params->dtim_period))
|
||||
goto fail;
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -600,6 +600,7 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
|
||||
params->meshid = ssid->ssid;
|
||||
params->meshid_len = ssid->ssid_len;
|
||||
+ params->mcast_rate = ssid->mcast_rate;
|
||||
ibss_mesh_setup_freq(wpa_s, ssid, ¶ms->freq);
|
||||
wpa_s->mesh_ht_enabled = !!params->freq.ht_enabled;
|
||||
wpa_s->mesh_vht_enabled = !!params->freq.vht_enabled;
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2457,11 +2457,13 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
for (j = 0; j < wpa_s->last_scan_res_used; j++) {
|
||||
struct wpa_bss *bss = wpa_s->last_scan_res[j];
|
||||
|
||||
- if (ssid->mode != WPAS_MODE_IBSS)
|
||||
+ /* Don't adjust control freq in case of fixed_freq */
|
||||
+ if (ssid->fixed_freq) {
|
||||
+ obss_scan = 0;
|
||||
break;
|
||||
+ }
|
||||
|
||||
- /* Don't adjust control freq in case of fixed_freq */
|
||||
- if (ssid->fixed_freq)
|
||||
+ if (ssid->mode != WPAS_MODE_IBSS)
|
||||
break;
|
||||
|
||||
if (!bss_is_ibss(bss))
|
||||
@@ -0,0 +1,45 @@
|
||||
--- a/src/ap/acs.c
|
||||
+++ b/src/ap/acs.c
|
||||
@@ -302,18 +302,12 @@ static void acs_fail(struct hostapd_ifac
|
||||
static long double
|
||||
acs_survey_interference_factor(struct freq_survey *survey, s8 min_nf)
|
||||
{
|
||||
- long double factor, busy, total;
|
||||
+ long double factor, busy = 0, total;
|
||||
|
||||
if (survey->filled & SURVEY_HAS_CHAN_TIME_BUSY)
|
||||
busy = survey->channel_time_busy;
|
||||
else if (survey->filled & SURVEY_HAS_CHAN_TIME_RX)
|
||||
busy = survey->channel_time_rx;
|
||||
- else {
|
||||
- /* This shouldn't really happen as survey data is checked in
|
||||
- * acs_sanity_check() */
|
||||
- wpa_printf(MSG_ERROR, "ACS: Survey data missing");
|
||||
- return 0;
|
||||
- }
|
||||
|
||||
total = survey->channel_time;
|
||||
|
||||
@@ -422,20 +416,19 @@ static int acs_usable_bw160_chan(const s
|
||||
static int acs_survey_is_sufficient(struct freq_survey *survey)
|
||||
{
|
||||
if (!(survey->filled & SURVEY_HAS_NF)) {
|
||||
+ survey->nf = -95;
|
||||
wpa_printf(MSG_INFO, "ACS: Survey is missing noise floor");
|
||||
- return 0;
|
||||
}
|
||||
|
||||
if (!(survey->filled & SURVEY_HAS_CHAN_TIME)) {
|
||||
+ survey->channel_time = 0;
|
||||
wpa_printf(MSG_INFO, "ACS: Survey is missing channel time");
|
||||
- return 0;
|
||||
}
|
||||
|
||||
if (!(survey->filled & SURVEY_HAS_CHAN_TIME_BUSY) &&
|
||||
!(survey->filled & SURVEY_HAS_CHAN_TIME_RX)) {
|
||||
wpa_printf(MSG_INFO,
|
||||
"ACS: Survey is missing RX and busy time (at least one is required)");
|
||||
- return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -0,0 +1,59 @@
|
||||
--- a/hostapd/Makefile
|
||||
+++ b/hostapd/Makefile
|
||||
@@ -1293,7 +1293,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS)
|
||||
@$(AR) cr $@ hostapd_multi.o $(OBJS)
|
||||
|
||||
hostapd: $(OBJS)
|
||||
- $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
|
||||
+ +$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
|
||||
@$(E) " LD " $@
|
||||
|
||||
ifdef CONFIG_WPA_TRACE
|
||||
@@ -1304,7 +1304,7 @@ _OBJS_VAR := OBJS_c
|
||||
include ../src/objs.mk
|
||||
|
||||
hostapd_cli: $(OBJS_c)
|
||||
- $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
|
||||
+ +$(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
|
||||
@$(E) " LD " $@
|
||||
|
||||
NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -1918,31 +1918,31 @@ wpa_supplicant_multi.a: .config $(BCHECK
|
||||
@$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
|
||||
|
||||
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
|
||||
- $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
|
||||
+ +$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
|
||||
@$(E) " LD " $@
|
||||
|
||||
_OBJS_VAR := OBJS_t
|
||||
include ../src/objs.mk
|
||||
eapol_test: $(OBJS_t)
|
||||
- $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
|
||||
+ +$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
|
||||
@$(E) " LD " $@
|
||||
|
||||
_OBJS_VAR := OBJS_t2
|
||||
include ../src/objs.mk
|
||||
preauth_test: $(OBJS_t2)
|
||||
- $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
|
||||
+ +$(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
|
||||
@$(E) " LD " $@
|
||||
|
||||
_OBJS_VAR := OBJS_p
|
||||
include ../src/objs.mk
|
||||
wpa_passphrase: $(OBJS_p)
|
||||
- $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS)
|
||||
+ +$(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS)
|
||||
@$(E) " LD " $@
|
||||
|
||||
_OBJS_VAR := OBJS_c
|
||||
include ../src/objs.mk
|
||||
wpa_cli: $(OBJS_c)
|
||||
- $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
|
||||
+ +$(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
|
||||
@$(E) " LD " $@
|
||||
|
||||
LIBCTRL += ../src/common/wpa_ctrl.o
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/wpa_supplicant/wps_supplicant.h
|
||||
+++ b/wpa_supplicant/wps_supplicant.h
|
||||
@@ -9,6 +9,7 @@
|
||||
#ifndef WPS_SUPPLICANT_H
|
||||
#define WPS_SUPPLICANT_H
|
||||
|
||||
+struct wpa_bss;
|
||||
struct wpa_scan_results;
|
||||
|
||||
#ifdef CONFIG_WPS
|
||||
@@ -16,8 +17,6 @@ struct wpa_scan_results;
|
||||
#include "wps/wps.h"
|
||||
#include "wps/wps_defs.h"
|
||||
|
||||
-struct wpa_bss;
|
||||
-
|
||||
struct wps_new_ap_settings {
|
||||
const char *ssid_hex;
|
||||
const char *auth;
|
||||
546
package/network/services/hostapd/patches/600-ubus_support.patch
Normal file
546
package/network/services/hostapd/patches/600-ubus_support.patch
Normal file
@@ -0,0 +1,546 @@
|
||||
--- a/hostapd/Makefile
|
||||
+++ b/hostapd/Makefile
|
||||
@@ -166,6 +166,11 @@ OBJS += ../src/common/hw_features_common
|
||||
|
||||
OBJS += ../src/eapol_auth/eapol_auth_sm.o
|
||||
|
||||
+ifdef CONFIG_UBUS
|
||||
+CFLAGS += -DUBUS_SUPPORT
|
||||
+OBJS += ../src/ap/ubus.o
|
||||
+LIBS += -lubox -lubus
|
||||
+endif
|
||||
|
||||
ifdef CONFIG_CODE_COVERAGE
|
||||
CFLAGS += -O0 -fprofile-arcs -ftest-coverage
|
||||
--- a/src/ap/hostapd.h
|
||||
+++ b/src/ap/hostapd.h
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "utils/list.h"
|
||||
#include "ap_config.h"
|
||||
#include "drivers/driver.h"
|
||||
+#include "ubus.h"
|
||||
|
||||
#define OCE_STA_CFON_ENABLED(hapd) \
|
||||
((hapd->conf->oce & OCE_STA_CFON) && \
|
||||
@@ -80,7 +81,7 @@ struct hapd_interfaces {
|
||||
#ifdef CONFIG_CTRL_IFACE_UDP
|
||||
unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN];
|
||||
#endif /* CONFIG_CTRL_IFACE_UDP */
|
||||
-
|
||||
+ struct ubus_object ubus;
|
||||
};
|
||||
|
||||
enum hostapd_chan_status {
|
||||
@@ -154,6 +155,7 @@ struct hostapd_data {
|
||||
struct hostapd_iface *iface;
|
||||
struct hostapd_config *iconf;
|
||||
struct hostapd_bss_config *conf;
|
||||
+ struct hostapd_ubus_bss ubus;
|
||||
int interface_added; /* virtual interface added for this BSS */
|
||||
unsigned int started:1;
|
||||
unsigned int disabled:1;
|
||||
@@ -610,6 +612,7 @@ hostapd_alloc_bss_data(struct hostapd_if
|
||||
struct hostapd_bss_config *bss);
|
||||
int hostapd_setup_interface(struct hostapd_iface *iface);
|
||||
int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
|
||||
+void hostapd_set_own_neighbor_report(struct hostapd_data *hapd);
|
||||
void hostapd_interface_deinit(struct hostapd_iface *iface);
|
||||
void hostapd_interface_free(struct hostapd_iface *iface);
|
||||
struct hostapd_iface * hostapd_alloc_iface(void);
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -396,6 +396,7 @@ void hostapd_free_hapd_data(struct hosta
|
||||
hapd->beacon_set_done = 0;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
|
||||
+ hostapd_ubus_free_bss(hapd);
|
||||
accounting_deinit(hapd);
|
||||
hostapd_deinit_wpa(hapd);
|
||||
vlan_deinit(hapd);
|
||||
@@ -1422,6 +1423,8 @@ static int hostapd_setup_bss(struct host
|
||||
if (hapd->driver && hapd->driver->set_operstate)
|
||||
hapd->driver->set_operstate(hapd->drv_priv, 1);
|
||||
|
||||
+ hostapd_ubus_add_bss(hapd);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2028,6 +2031,7 @@ static int hostapd_setup_interface_compl
|
||||
if (err)
|
||||
goto fail;
|
||||
|
||||
+ hostapd_ubus_add_iface(iface);
|
||||
wpa_printf(MSG_DEBUG, "Completing interface initialization");
|
||||
if (iface->freq) {
|
||||
#ifdef NEED_AP_MLME
|
||||
@@ -2225,6 +2229,7 @@ dfs_offload:
|
||||
|
||||
fail:
|
||||
wpa_printf(MSG_ERROR, "Interface initialization failed");
|
||||
+ hostapd_ubus_free_iface(iface);
|
||||
hostapd_set_state(iface, HAPD_IFACE_DISABLED);
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
|
||||
#ifdef CONFIG_FST
|
||||
@@ -2700,6 +2705,7 @@ void hostapd_interface_deinit_free(struc
|
||||
(unsigned int) iface->conf->num_bss);
|
||||
driver = iface->bss[0]->driver;
|
||||
drv_priv = iface->bss[0]->drv_priv;
|
||||
+ hostapd_ubus_free_iface(iface);
|
||||
hostapd_interface_deinit(iface);
|
||||
wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit",
|
||||
__func__, driver, drv_priv);
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -3553,13 +3553,18 @@ static void handle_auth(struct hostapd_d
|
||||
u16 auth_alg, auth_transaction, status_code;
|
||||
u16 resp = WLAN_STATUS_SUCCESS;
|
||||
struct sta_info *sta = NULL;
|
||||
- int res, reply_res;
|
||||
+ int res, reply_res, ubus_resp;
|
||||
u16 fc;
|
||||
const u8 *challenge = NULL;
|
||||
u8 resp_ies[2 + WLAN_AUTH_CHALLENGE_LEN];
|
||||
size_t resp_ies_len = 0;
|
||||
u16 seq_ctrl;
|
||||
struct radius_sta rad_info;
|
||||
+ struct hostapd_ubus_request req = {
|
||||
+ .type = HOSTAPD_UBUS_AUTH_REQ,
|
||||
+ .mgmt_frame = mgmt,
|
||||
+ .ssi_signal = rssi,
|
||||
+ };
|
||||
|
||||
if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) {
|
||||
wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)",
|
||||
@@ -3727,6 +3732,13 @@ static void handle_auth(struct hostapd_d
|
||||
resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
goto fail;
|
||||
}
|
||||
+ ubus_resp = hostapd_ubus_handle_event(hapd, &req);
|
||||
+ if (ubus_resp) {
|
||||
+ wpa_printf(MSG_DEBUG, "Station " MACSTR " rejected by ubus handler.\n",
|
||||
+ MAC2STR(mgmt->sa));
|
||||
+ resp = ubus_resp > 0 ? (u16) ubus_resp : WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
+ goto fail;
|
||||
+ }
|
||||
if (res == HOSTAPD_ACL_PENDING)
|
||||
return;
|
||||
|
||||
@@ -5454,7 +5466,7 @@ static void handle_assoc(struct hostapd_
|
||||
int resp = WLAN_STATUS_SUCCESS;
|
||||
u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
const u8 *pos;
|
||||
- int left, i;
|
||||
+ int left, i, ubus_resp;
|
||||
struct sta_info *sta;
|
||||
u8 *tmp = NULL;
|
||||
#ifdef CONFIG_FILS
|
||||
@@ -5667,6 +5679,11 @@ static void handle_assoc(struct hostapd_
|
||||
left = res;
|
||||
}
|
||||
#endif /* CONFIG_FILS */
|
||||
+ struct hostapd_ubus_request req = {
|
||||
+ .type = HOSTAPD_UBUS_ASSOC_REQ,
|
||||
+ .mgmt_frame = mgmt,
|
||||
+ .ssi_signal = rssi,
|
||||
+ };
|
||||
|
||||
/* followed by SSID and Supported rates; and HT capabilities if 802.11n
|
||||
* is used */
|
||||
@@ -5831,6 +5848,14 @@ static void handle_assoc(struct hostapd_
|
||||
pos, left, rssi, omit_rsnxe);
|
||||
os_free(tmp);
|
||||
|
||||
+ ubus_resp = hostapd_ubus_handle_event(hapd, &req);
|
||||
+ if (ubus_resp) {
|
||||
+ wpa_printf(MSG_DEBUG, "Station " MACSTR " assoc rejected by ubus handler.\n",
|
||||
+ MAC2STR(mgmt->sa));
|
||||
+ resp = ubus_resp > 0 ? (u16) ubus_resp : WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Remove the station in case transmission of a success response fails
|
||||
* (the STA was added associated to the driver) or if the station was
|
||||
@@ -5858,6 +5883,7 @@ static void handle_disassoc(struct hosta
|
||||
wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d",
|
||||
MAC2STR(mgmt->sa),
|
||||
le_to_host16(mgmt->u.disassoc.reason_code));
|
||||
+ hostapd_ubus_notify(hapd, "disassoc", mgmt->sa);
|
||||
|
||||
sta = ap_get_sta(hapd, mgmt->sa);
|
||||
if (sta == NULL) {
|
||||
@@ -5927,6 +5953,8 @@ static void handle_deauth(struct hostapd
|
||||
/* Clear the PTKSA cache entries for PASN */
|
||||
ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE);
|
||||
|
||||
+ hostapd_ubus_notify(hapd, "deauth", mgmt->sa);
|
||||
+
|
||||
sta = ap_get_sta(hapd, mgmt->sa);
|
||||
if (sta == NULL) {
|
||||
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
|
||||
--- a/src/ap/beacon.c
|
||||
+++ b/src/ap/beacon.c
|
||||
@@ -823,6 +823,12 @@ void handle_probe_req(struct hostapd_dat
|
||||
u16 csa_offs[2];
|
||||
size_t csa_offs_len;
|
||||
struct radius_sta rad_info;
|
||||
+ struct hostapd_ubus_request req = {
|
||||
+ .type = HOSTAPD_UBUS_PROBE_REQ,
|
||||
+ .mgmt_frame = mgmt,
|
||||
+ .ssi_signal = ssi_signal,
|
||||
+ .elems = &elems,
|
||||
+ };
|
||||
|
||||
if (hapd->iconf->rssi_ignore_probe_request && ssi_signal &&
|
||||
ssi_signal < hapd->iconf->rssi_ignore_probe_request)
|
||||
@@ -1009,6 +1015,12 @@ void handle_probe_req(struct hostapd_dat
|
||||
}
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
+ if (hostapd_ubus_handle_event(hapd, &req)) {
|
||||
+ wpa_printf(MSG_DEBUG, "Probe request for " MACSTR " rejected by ubus handler.\n",
|
||||
+ MAC2STR(mgmt->sa));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/* TODO: verify that supp_rates contains at least one matching rate
|
||||
* with AP configuration */
|
||||
|
||||
--- a/src/ap/drv_callbacks.c
|
||||
+++ b/src/ap/drv_callbacks.c
|
||||
@@ -145,6 +145,10 @@ int hostapd_notif_assoc(struct hostapd_d
|
||||
u16 reason = WLAN_REASON_UNSPECIFIED;
|
||||
int status = WLAN_STATUS_SUCCESS;
|
||||
const u8 *p2p_dev_addr = NULL;
|
||||
+ struct hostapd_ubus_request req = {
|
||||
+ .type = HOSTAPD_UBUS_ASSOC_REQ,
|
||||
+ .addr = addr,
|
||||
+ };
|
||||
|
||||
if (addr == NULL) {
|
||||
/*
|
||||
@@ -237,6 +241,12 @@ int hostapd_notif_assoc(struct hostapd_d
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+ if (hostapd_ubus_handle_event(hapd, &req)) {
|
||||
+ wpa_printf(MSG_DEBUG, "Station " MACSTR " assoc rejected by ubus handler.\n",
|
||||
+ MAC2STR(req.addr));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
#ifdef CONFIG_P2P
|
||||
if (elems.p2p) {
|
||||
wpabuf_free(sta->p2p_ie);
|
||||
--- a/src/ap/sta_info.c
|
||||
+++ b/src/ap/sta_info.c
|
||||
@@ -459,6 +459,7 @@ void ap_handle_timer(void *eloop_ctx, vo
|
||||
HOSTAPD_LEVEL_INFO, "deauthenticated due to "
|
||||
"local deauth request");
|
||||
ap_free_sta(hapd, sta);
|
||||
+ hostapd_ubus_notify(hapd, "local-deauth", sta->addr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -614,6 +615,7 @@ skip_poll:
|
||||
hapd, sta,
|
||||
WLAN_REASON_PREV_AUTH_NOT_VALID);
|
||||
ap_free_sta(hapd, sta);
|
||||
+ hostapd_ubus_notify(hapd, "inactive-deauth", sta->addr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1329,6 +1331,7 @@ void ap_sta_set_authorized(struct hostap
|
||||
buf, ip_addr, keyid_buf);
|
||||
} else {
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf);
|
||||
+ hostapd_ubus_notify(hapd, "disassoc", sta->addr);
|
||||
|
||||
if (hapd->msg_ctx_parent &&
|
||||
hapd->msg_ctx_parent != hapd->msg_ctx)
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -265,6 +265,7 @@ static void hostapd_wpa_auth_psk_failure
|
||||
struct hostapd_data *hapd = ctx;
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR,
|
||||
MAC2STR(addr));
|
||||
+ hostapd_ubus_notify(hapd, "key-mismatch", addr);
|
||||
}
|
||||
|
||||
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -176,6 +176,12 @@ ifdef CONFIG_EAPOL_TEST
|
||||
CFLAGS += -Werror -DEAPOL_TEST
|
||||
endif
|
||||
|
||||
+ifdef CONFIG_UBUS
|
||||
+CFLAGS += -DUBUS_SUPPORT
|
||||
+OBJS += ubus.o
|
||||
+LIBS += -lubox -lubus
|
||||
+endif
|
||||
+
|
||||
ifdef CONFIG_CODE_COVERAGE
|
||||
CFLAGS += -O0 -fprofile-arcs -ftest-coverage
|
||||
LIBS += -lgcov
|
||||
@@ -959,6 +965,9 @@ ifdef CONFIG_CTRL_IFACE_MIB
|
||||
CFLAGS += -DCONFIG_CTRL_IFACE_MIB
|
||||
endif
|
||||
OBJS += ../src/ap/ctrl_iface_ap.o
|
||||
+ifdef CONFIG_UBUS
|
||||
+OBJS += ../src/ap/ubus.o
|
||||
+endif
|
||||
endif
|
||||
|
||||
CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -7017,6 +7017,8 @@ struct wpa_supplicant * wpa_supplicant_a
|
||||
}
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
+ wpas_ubus_add_bss(wpa_s);
|
||||
+
|
||||
return wpa_s;
|
||||
}
|
||||
|
||||
@@ -7043,6 +7045,8 @@ int wpa_supplicant_remove_iface(struct w
|
||||
struct wpa_supplicant *parent = wpa_s->parent;
|
||||
#endif /* CONFIG_MESH */
|
||||
|
||||
+ wpas_ubus_free_bss(wpa_s);
|
||||
+
|
||||
/* Remove interface from the global list of interfaces */
|
||||
prev = global->ifaces;
|
||||
if (prev == wpa_s) {
|
||||
@@ -7346,8 +7350,12 @@ int wpa_supplicant_run(struct wpa_global
|
||||
eloop_register_signal_terminate(wpa_supplicant_terminate, global);
|
||||
eloop_register_signal_reconfig(wpa_supplicant_reconfig, global);
|
||||
|
||||
+ wpas_ubus_add(global);
|
||||
+
|
||||
eloop_run();
|
||||
|
||||
+ wpas_ubus_free(global);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant_i.h
|
||||
+++ b/wpa_supplicant/wpa_supplicant_i.h
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "wps/wps_defs.h"
|
||||
#include "config_ssid.h"
|
||||
#include "wmm_ac.h"
|
||||
+#include "ubus.h"
|
||||
|
||||
extern const char *const wpa_supplicant_version;
|
||||
extern const char *const wpa_supplicant_license;
|
||||
@@ -321,6 +322,8 @@ struct wpa_global {
|
||||
#endif /* CONFIG_WIFI_DISPLAY */
|
||||
|
||||
struct psk_list_entry *add_psk; /* From group formation */
|
||||
+
|
||||
+ struct ubus_object ubus_global;
|
||||
};
|
||||
|
||||
|
||||
@@ -605,6 +608,7 @@ struct wpa_supplicant {
|
||||
unsigned char own_addr[ETH_ALEN];
|
||||
unsigned char perm_addr[ETH_ALEN];
|
||||
char ifname[100];
|
||||
+ struct wpas_ubus_bss ubus;
|
||||
#ifdef CONFIG_MATCH_IFACE
|
||||
int matched;
|
||||
#endif /* CONFIG_MATCH_IFACE */
|
||||
--- a/wpa_supplicant/wps_supplicant.c
|
||||
+++ b/wpa_supplicant/wps_supplicant.c
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "p2p/p2p.h"
|
||||
#include "p2p_supplicant.h"
|
||||
#include "wps_supplicant.h"
|
||||
+#include "ubus.h"
|
||||
|
||||
|
||||
#ifndef WPS_PIN_SCAN_IGNORE_SEL_REG
|
||||
@@ -392,6 +393,8 @@ static int wpa_supplicant_wps_cred(void
|
||||
wpa_hexdump_key(MSG_DEBUG, "WPS: Received Credential attribute",
|
||||
cred->cred_attr, cred->cred_attr_len);
|
||||
|
||||
+ wpas_ubus_notify(wpa_s, cred);
|
||||
+
|
||||
if (wpa_s->conf->wps_cred_processing == 1)
|
||||
return 0;
|
||||
|
||||
--- a/hostapd/main.c
|
||||
+++ b/hostapd/main.c
|
||||
@@ -895,6 +895,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
hostapd_global_ctrl_iface_init(&interfaces);
|
||||
+ hostapd_ubus_add(&interfaces);
|
||||
|
||||
if (hostapd_global_run(&interfaces, daemonize, pid_file)) {
|
||||
wpa_printf(MSG_ERROR, "Failed to start eloop");
|
||||
@@ -904,6 +905,7 @@ int main(int argc, char *argv[])
|
||||
ret = 0;
|
||||
|
||||
out:
|
||||
+ hostapd_ubus_free(&interfaces);
|
||||
hostapd_global_ctrl_iface_deinit(&interfaces);
|
||||
/* Deinitialize all interfaces */
|
||||
for (i = 0; i < interfaces.count; i++) {
|
||||
--- a/wpa_supplicant/main.c
|
||||
+++ b/wpa_supplicant/main.c
|
||||
@@ -203,7 +203,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (;;) {
|
||||
c = getopt(argc, argv,
|
||||
- "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuv::W");
|
||||
+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:nNo:O:p:P:qsTtuv::W");
|
||||
if (c < 0)
|
||||
break;
|
||||
switch (c) {
|
||||
@@ -271,6 +271,9 @@ int main(int argc, char *argv[])
|
||||
params.conf_p2p_dev = optarg;
|
||||
break;
|
||||
#endif /* CONFIG_P2P */
|
||||
+ case 'n':
|
||||
+ iface_count = 0;
|
||||
+ break;
|
||||
case 'o':
|
||||
params.override_driver = optarg;
|
||||
break;
|
||||
--- a/src/ap/rrm.c
|
||||
+++ b/src/ap/rrm.c
|
||||
@@ -89,6 +89,9 @@ static void hostapd_handle_beacon_report
|
||||
return;
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO, BEACON_RESP_RX MACSTR " %u %02x %s",
|
||||
MAC2STR(addr), token, rep_mode, report);
|
||||
+ if (len < sizeof(struct rrm_measurement_beacon_report))
|
||||
+ return;
|
||||
+ hostapd_ubus_notify_beacon_report(hapd, addr, token, rep_mode, (struct rrm_measurement_beacon_report*) pos, len);
|
||||
}
|
||||
|
||||
|
||||
--- a/src/ap/vlan_init.c
|
||||
+++ b/src/ap/vlan_init.c
|
||||
@@ -22,6 +22,7 @@
|
||||
static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
|
||||
int existsok)
|
||||
{
|
||||
+ bool vlan_exists = iface_exists(vlan->ifname);
|
||||
int ret;
|
||||
#ifdef CONFIG_WEP
|
||||
int i;
|
||||
@@ -36,7 +37,7 @@ static int vlan_if_add(struct hostapd_da
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
- if (!iface_exists(vlan->ifname))
|
||||
+ if (!vlan_exists)
|
||||
ret = hostapd_vlan_if_add(hapd, vlan->ifname);
|
||||
else if (!existsok)
|
||||
return -1;
|
||||
@@ -51,6 +52,9 @@ static int vlan_if_add(struct hostapd_da
|
||||
if (hapd->wpa_auth)
|
||||
ret = wpa_auth_ensure_group(hapd->wpa_auth, vlan->vlan_id);
|
||||
|
||||
+ if (!ret && !vlan_exists)
|
||||
+ hostapd_ubus_add_vlan(hapd, vlan);
|
||||
+
|
||||
if (ret == 0)
|
||||
return ret;
|
||||
|
||||
@@ -77,6 +81,8 @@ int vlan_if_remove(struct hostapd_data *
|
||||
"WPA deinitialization for VLAN %d failed (%d)",
|
||||
vlan->vlan_id, ret);
|
||||
|
||||
+ hostapd_ubus_remove_vlan(hapd, vlan);
|
||||
+
|
||||
return hostapd_vlan_if_remove(hapd, vlan->ifname);
|
||||
}
|
||||
|
||||
--- a/src/ap/dfs.c
|
||||
+++ b/src/ap/dfs.c
|
||||
@@ -1193,6 +1193,8 @@ int hostapd_dfs_radar_detected(struct ho
|
||||
"freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d",
|
||||
freq, ht_enabled, chan_offset, chan_width, cf1, cf2);
|
||||
|
||||
+ hostapd_ubus_notify_radar_detected(iface, freq, chan_width, cf1, cf2);
|
||||
+
|
||||
/* Proceed only if DFS is not offloaded to the driver */
|
||||
if (iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD)
|
||||
return 0;
|
||||
--- a/src/ap/airtime_policy.c
|
||||
+++ b/src/ap/airtime_policy.c
|
||||
@@ -112,8 +112,14 @@ static void set_sta_weights(struct hosta
|
||||
{
|
||||
struct sta_info *sta;
|
||||
|
||||
- for (sta = hapd->sta_list; sta; sta = sta->next)
|
||||
- sta_set_airtime_weight(hapd, sta, weight);
|
||||
+ for (sta = hapd->sta_list; sta; sta = sta->next) {
|
||||
+ unsigned int sta_weight = weight;
|
||||
+
|
||||
+ if (sta->dyn_airtime_weight)
|
||||
+ sta_weight = (weight * sta->dyn_airtime_weight) / 256;
|
||||
+
|
||||
+ sta_set_airtime_weight(hapd, sta, sta_weight);
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +250,10 @@ int airtime_policy_new_sta(struct hostap
|
||||
unsigned int weight;
|
||||
|
||||
if (hapd->iconf->airtime_mode == AIRTIME_MODE_STATIC) {
|
||||
- weight = get_weight_for_sta(hapd, sta->addr);
|
||||
+ if (sta->dyn_airtime_weight)
|
||||
+ weight = sta->dyn_airtime_weight;
|
||||
+ else
|
||||
+ weight = get_weight_for_sta(hapd, sta->addr);
|
||||
if (weight)
|
||||
return sta_set_airtime_weight(hapd, sta, weight);
|
||||
}
|
||||
--- a/src/ap/sta_info.h
|
||||
+++ b/src/ap/sta_info.h
|
||||
@@ -324,6 +324,7 @@ struct sta_info {
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
#ifdef CONFIG_AIRTIME_POLICY
|
||||
unsigned int airtime_weight;
|
||||
+ unsigned int dyn_airtime_weight;
|
||||
struct os_reltime backlogged_until;
|
||||
#endif /* CONFIG_AIRTIME_POLICY */
|
||||
|
||||
--- a/src/ap/wnm_ap.c
|
||||
+++ b/src/ap/wnm_ap.c
|
||||
@@ -463,7 +463,7 @@ static void ieee802_11_rx_bss_trans_mgmt
|
||||
size_t len)
|
||||
{
|
||||
u8 dialog_token, status_code, bss_termination_delay;
|
||||
- const u8 *pos, *end;
|
||||
+ const u8 *pos, *end, *target_bssid;
|
||||
int enabled = hapd->conf->bss_transition;
|
||||
struct sta_info *sta;
|
||||
|
||||
@@ -510,6 +510,7 @@ static void ieee802_11_rx_bss_trans_mgmt
|
||||
wpa_printf(MSG_DEBUG, "WNM: not enough room for Target BSSID field");
|
||||
return;
|
||||
}
|
||||
+ target_bssid = pos;
|
||||
sta->agreed_to_steer = 1;
|
||||
eloop_cancel_timeout(ap_sta_reset_steer_flag_timer, hapd, sta);
|
||||
eloop_register_timeout(2, 0, ap_sta_reset_steer_flag_timer,
|
||||
@@ -529,6 +530,10 @@ static void ieee802_11_rx_bss_trans_mgmt
|
||||
MAC2STR(addr), status_code, bss_termination_delay);
|
||||
}
|
||||
|
||||
+ hostapd_ubus_notify_bss_transition_response(hapd, sta->addr, dialog_token,
|
||||
+ status_code, bss_termination_delay,
|
||||
+ target_bssid, pos, end - pos);
|
||||
+
|
||||
wpa_hexdump(MSG_DEBUG, "WNM: BSS Transition Candidate List Entries",
|
||||
pos, end - pos);
|
||||
}
|
||||
220
package/network/services/hostapd/patches/700-wifi-reload.patch
Normal file
220
package/network/services/hostapd/patches/700-wifi-reload.patch
Normal file
@@ -0,0 +1,220 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -2453,6 +2453,8 @@ static int hostapd_config_fill(struct ho
|
||||
bss->isolate = atoi(pos);
|
||||
} else if (os_strcmp(buf, "ap_max_inactivity") == 0) {
|
||||
bss->ap_max_inactivity = atoi(pos);
|
||||
+ } else if (os_strcmp(buf, "config_id") == 0) {
|
||||
+ bss->config_id = os_strdup(pos);
|
||||
} else if (os_strcmp(buf, "skip_inactivity_poll") == 0) {
|
||||
bss->skip_inactivity_poll = atoi(pos);
|
||||
} else if (os_strcmp(buf, "country_code") == 0) {
|
||||
@@ -3153,6 +3155,8 @@ static int hostapd_config_fill(struct ho
|
||||
}
|
||||
} else if (os_strcmp(buf, "acs_exclude_dfs") == 0) {
|
||||
conf->acs_exclude_dfs = atoi(pos);
|
||||
+ } else if (os_strcmp(buf, "radio_config_id") == 0) {
|
||||
+ conf->config_id = os_strdup(pos);
|
||||
} else if (os_strcmp(buf, "op_class") == 0) {
|
||||
conf->op_class = atoi(pos);
|
||||
} else if (os_strcmp(buf, "channel") == 0) {
|
||||
--- a/src/ap/ap_config.c
|
||||
+++ b/src/ap/ap_config.c
|
||||
@@ -791,6 +791,7 @@ void hostapd_config_free_bss(struct host
|
||||
os_free(conf->radius_req_attr_sqlite);
|
||||
os_free(conf->rsn_preauth_interfaces);
|
||||
os_free(conf->ctrl_interface);
|
||||
+ os_free(conf->config_id);
|
||||
os_free(conf->ca_cert);
|
||||
os_free(conf->server_cert);
|
||||
os_free(conf->server_cert2);
|
||||
@@ -987,6 +988,7 @@ void hostapd_config_free(struct hostapd_
|
||||
|
||||
for (i = 0; i < conf->num_bss; i++)
|
||||
hostapd_config_free_bss(conf->bss[i]);
|
||||
+ os_free(conf->config_id);
|
||||
os_free(conf->bss);
|
||||
os_free(conf->supported_rates);
|
||||
os_free(conf->basic_rates);
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -279,6 +279,8 @@ struct hostapd_bss_config {
|
||||
char vlan_bridge[IFNAMSIZ + 1];
|
||||
char wds_bridge[IFNAMSIZ + 1];
|
||||
|
||||
+ char *config_id;
|
||||
+
|
||||
enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
|
||||
|
||||
unsigned int logger_syslog; /* module bitfield */
|
||||
@@ -938,6 +940,7 @@ struct spatial_reuse {
|
||||
struct hostapd_config {
|
||||
struct hostapd_bss_config **bss, *last_bss;
|
||||
size_t num_bss;
|
||||
+ char *config_id;
|
||||
|
||||
u16 beacon_int;
|
||||
int rts_threshold;
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -219,6 +219,10 @@ static int hostapd_iface_conf_changed(st
|
||||
{
|
||||
size_t i;
|
||||
|
||||
+ if (newconf->config_id != oldconf->config_id)
|
||||
+ if (strcmp(newconf->config_id, oldconf->config_id))
|
||||
+ return 1;
|
||||
+
|
||||
if (newconf->num_bss != oldconf->num_bss)
|
||||
return 1;
|
||||
|
||||
@@ -232,7 +236,7 @@ static int hostapd_iface_conf_changed(st
|
||||
}
|
||||
|
||||
|
||||
-int hostapd_reload_config(struct hostapd_iface *iface)
|
||||
+int hostapd_reload_config(struct hostapd_iface *iface, int reconf)
|
||||
{
|
||||
struct hapd_interfaces *interfaces = iface->interfaces;
|
||||
struct hostapd_data *hapd = iface->bss[0];
|
||||
@@ -255,13 +259,16 @@ int hostapd_reload_config(struct hostapd
|
||||
if (newconf == NULL)
|
||||
return -1;
|
||||
|
||||
- hostapd_clear_old(iface);
|
||||
-
|
||||
oldconf = hapd->iconf;
|
||||
if (hostapd_iface_conf_changed(newconf, oldconf)) {
|
||||
char *fname;
|
||||
int res;
|
||||
|
||||
+ if (reconf)
|
||||
+ return -1;
|
||||
+
|
||||
+ hostapd_clear_old(iface);
|
||||
+
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"Configuration changes include interface/BSS modification - force full disable+enable sequence");
|
||||
fname = os_strdup(iface->config_fname);
|
||||
@@ -286,6 +293,24 @@ int hostapd_reload_config(struct hostapd
|
||||
wpa_printf(MSG_ERROR,
|
||||
"Failed to enable interface on config reload");
|
||||
return res;
|
||||
+ } else {
|
||||
+ for (j = 0; j < iface->num_bss; j++) {
|
||||
+ hapd = iface->bss[j];
|
||||
+ if (!hapd->config_id || strcmp(hapd->config_id, newconf->bss[j]->config_id)) {
|
||||
+ hostapd_flush_old_stations(iface->bss[j],
|
||||
+ WLAN_REASON_PREV_AUTH_NOT_VALID);
|
||||
+#ifdef CONFIG_WEP
|
||||
+ hostapd_broadcast_wep_clear(iface->bss[j]);
|
||||
+#endif
|
||||
+
|
||||
+#ifndef CONFIG_NO_RADIUS
|
||||
+ /* TODO: update dynamic data based on changed configuration
|
||||
+ * items (e.g., open/close sockets, etc.) */
|
||||
+ radius_client_flush(iface->bss[j]->radius, 0);
|
||||
+#endif /* CONFIG_NO_RADIUS */
|
||||
+ wpa_printf(MSG_INFO, "bss %zu changed", j);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
iface->conf = newconf;
|
||||
|
||||
@@ -302,6 +327,12 @@ int hostapd_reload_config(struct hostapd
|
||||
|
||||
for (j = 0; j < iface->num_bss; j++) {
|
||||
hapd = iface->bss[j];
|
||||
+ if (hapd->config_id) {
|
||||
+ os_free(hapd->config_id);
|
||||
+ hapd->config_id = NULL;
|
||||
+ }
|
||||
+ if (newconf->bss[j]->config_id)
|
||||
+ hapd->config_id = strdup(newconf->bss[j]->config_id);
|
||||
hapd->iconf = newconf;
|
||||
hapd->conf = newconf->bss[j];
|
||||
hostapd_reload_bss(hapd);
|
||||
@@ -2397,6 +2428,10 @@ hostapd_alloc_bss_data(struct hostapd_if
|
||||
hapd->iconf = conf;
|
||||
hapd->conf = bss;
|
||||
hapd->iface = hapd_iface;
|
||||
+ if (bss && bss->config_id)
|
||||
+ hapd->config_id = strdup(bss->config_id);
|
||||
+ else
|
||||
+ hapd->config_id = NULL;
|
||||
if (conf)
|
||||
hapd->driver = conf->driver;
|
||||
hapd->ctrl_sock = -1;
|
||||
--- a/src/ap/hostapd.h
|
||||
+++ b/src/ap/hostapd.h
|
||||
@@ -46,7 +46,7 @@ struct mesh_conf;
|
||||
struct hostapd_iface;
|
||||
|
||||
struct hapd_interfaces {
|
||||
- int (*reload_config)(struct hostapd_iface *iface);
|
||||
+ int (*reload_config)(struct hostapd_iface *iface, int reconf);
|
||||
struct hostapd_config * (*config_read_cb)(const char *config_fname);
|
||||
int (*ctrl_iface_init)(struct hostapd_data *hapd);
|
||||
void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
|
||||
@@ -156,6 +156,7 @@ struct hostapd_data {
|
||||
struct hostapd_config *iconf;
|
||||
struct hostapd_bss_config *conf;
|
||||
struct hostapd_ubus_bss ubus;
|
||||
+ char *config_id;
|
||||
int interface_added; /* virtual interface added for this BSS */
|
||||
unsigned int started:1;
|
||||
unsigned int disabled:1;
|
||||
@@ -604,7 +605,7 @@ struct hostapd_iface {
|
||||
int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
|
||||
int (*cb)(struct hostapd_iface *iface,
|
||||
void *ctx), void *ctx);
|
||||
-int hostapd_reload_config(struct hostapd_iface *iface);
|
||||
+int hostapd_reload_config(struct hostapd_iface *iface, int reconf);
|
||||
void hostapd_reconfig_encryption(struct hostapd_data *hapd);
|
||||
struct hostapd_data *
|
||||
hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -4817,6 +4817,9 @@ static int wpa_driver_nl80211_set_ap(voi
|
||||
if (ret) {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)",
|
||||
ret, strerror(-ret));
|
||||
+ if (!bss->beacon_set)
|
||||
+ ret = 0;
|
||||
+ bss->beacon_set = 0;
|
||||
} else {
|
||||
bss->beacon_set = 1;
|
||||
nl80211_set_bss(bss, params->cts_protect, params->preamble,
|
||||
--- a/hostapd/ctrl_iface.c
|
||||
+++ b/hostapd/ctrl_iface.c
|
||||
@@ -186,7 +186,7 @@ static int hostapd_ctrl_iface_update(str
|
||||
iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read;
|
||||
reload_opts = txt;
|
||||
|
||||
- hostapd_reload_config(iface);
|
||||
+ hostapd_reload_config(iface, 0);
|
||||
|
||||
iface->interfaces->config_read_cb = config_read_cb;
|
||||
}
|
||||
--- a/hostapd/main.c
|
||||
+++ b/hostapd/main.c
|
||||
@@ -317,7 +317,7 @@ static void handle_term(int sig, void *s
|
||||
|
||||
static int handle_reload_iface(struct hostapd_iface *iface, void *ctx)
|
||||
{
|
||||
- if (hostapd_reload_config(iface) < 0) {
|
||||
+ if (hostapd_reload_config(iface, 0) < 0) {
|
||||
wpa_printf(MSG_WARNING, "Failed to read new configuration "
|
||||
"file - continuing with old.");
|
||||
}
|
||||
--- a/src/ap/wps_hostapd.c
|
||||
+++ b/src/ap/wps_hostapd.c
|
||||
@@ -315,7 +315,7 @@ static void wps_reload_config(void *eloo
|
||||
|
||||
wpa_printf(MSG_DEBUG, "WPS: Reload configuration data");
|
||||
if (iface->interfaces == NULL ||
|
||||
- iface->interfaces->reload_config(iface) < 0) {
|
||||
+ iface->interfaces->reload_config(iface, 1) < 0) {
|
||||
wpa_printf(MSG_WARNING, "WPS: Failed to reload the updated "
|
||||
"configuration");
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -115,6 +115,7 @@ struct hostapd_ssid {
|
||||
#define DYNAMIC_VLAN_OPTIONAL 1
|
||||
#define DYNAMIC_VLAN_REQUIRED 2
|
||||
int dynamic_vlan;
|
||||
+ int vlan_no_bridge;
|
||||
#define DYNAMIC_VLAN_NAMING_WITHOUT_DEVICE 0
|
||||
#define DYNAMIC_VLAN_NAMING_WITH_DEVICE 1
|
||||
#define DYNAMIC_VLAN_NAMING_END 2
|
||||
--- a/src/ap/vlan_full.c
|
||||
+++ b/src/ap/vlan_full.c
|
||||
@@ -475,6 +475,9 @@ void vlan_newlink(const char *ifname, st
|
||||
if (!vlan)
|
||||
return;
|
||||
|
||||
+ if (hapd->conf->ssid.vlan_no_bridge)
|
||||
+ goto out;
|
||||
+
|
||||
vlan->configured = 1;
|
||||
|
||||
notempty = vlan->vlan_desc.notempty;
|
||||
@@ -506,6 +509,7 @@ void vlan_newlink(const char *ifname, st
|
||||
ifname, br_name, tagged[i], hapd);
|
||||
}
|
||||
|
||||
+out:
|
||||
ifconfig_up(ifname);
|
||||
}
|
||||
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3366,6 +3366,8 @@ static int hostapd_config_fill(struct ho
|
||||
#ifndef CONFIG_NO_VLAN
|
||||
} else if (os_strcmp(buf, "dynamic_vlan") == 0) {
|
||||
bss->ssid.dynamic_vlan = atoi(pos);
|
||||
+ } else if (os_strcmp(buf, "vlan_no_bridge") == 0) {
|
||||
+ bss->ssid.vlan_no_bridge = atoi(pos);
|
||||
} else if (os_strcmp(buf, "per_sta_vif") == 0) {
|
||||
bss->ssid.per_sta_vif = atoi(pos);
|
||||
} else if (os_strcmp(buf, "vlan_file") == 0) {
|
||||
@@ -0,0 +1,30 @@
|
||||
From 5a24286ed6315e1fef755ca1970792554f59b1fc Mon Sep 17 00:00:00 2001
|
||||
From: David Bauer <mail@david-bauer.net>
|
||||
Date: Wed, 26 May 2021 22:15:35 +0200
|
||||
Subject: [PATCH] ACS: fix channel 100 frequency
|
||||
|
||||
Channel 100 is a valid channel to choose for 80MHz operation. However,
|
||||
it's assigned to 5500 MHz, not 5550MHz. In fact, there is no channel
|
||||
assigned to this frequency.
|
||||
|
||||
Fix this obbvious typo to allow ACS to select channel 100 for 80 MHz
|
||||
operation again.
|
||||
|
||||
Fixes commit bef5eee4f7b2 ("Convert channel to frequency based selection for AP mode ACS")
|
||||
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
---
|
||||
src/ap/acs.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/src/ap/acs.c
|
||||
+++ b/src/ap/acs.c
|
||||
@@ -386,7 +386,7 @@ static int acs_usable_bw40_chan(const st
|
||||
|
||||
static int acs_usable_bw80_chan(const struct hostapd_channel_data *chan)
|
||||
{
|
||||
- const int allowed[] = { 5180, 5260, 5550, 5580, 5660, 5745, 5955, 6035,
|
||||
+ const int allowed[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, 6035,
|
||||
6115, 6195, 6275, 6355, 6435, 6515, 6595, 6675,
|
||||
6755, 6835, 6915, 6995 };
|
||||
unsigned int i;
|
||||
@@ -0,0 +1,82 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -2873,6 +2873,14 @@ static int hostapd_config_fill(struct ho
|
||||
line, bss->max_num_sta, MAX_STA_COUNT);
|
||||
return 1;
|
||||
}
|
||||
+ } else if (os_strcmp(buf, "iface_max_num_sta") == 0) {
|
||||
+ conf->max_num_sta = atoi(pos);
|
||||
+ if (conf->max_num_sta < 0 ||
|
||||
+ conf->max_num_sta > MAX_STA_COUNT) {
|
||||
+ wpa_printf(MSG_ERROR, "Line %d: Invalid max_num_sta=%d; allowed range 0..%d",
|
||||
+ line, conf->max_num_sta, MAX_STA_COUNT);
|
||||
+ return 1;
|
||||
+ }
|
||||
} else if (os_strcmp(buf, "wpa") == 0) {
|
||||
bss->wpa = atoi(pos);
|
||||
} else if (os_strcmp(buf, "extended_key_id") == 0) {
|
||||
--- a/src/ap/hostapd.h
|
||||
+++ b/src/ap/hostapd.h
|
||||
@@ -648,6 +648,7 @@ void hostapd_cleanup_cs_params(struct ho
|
||||
void hostapd_periodic_iface(struct hostapd_iface *iface);
|
||||
int hostapd_owe_trans_get_info(struct hostapd_data *hapd);
|
||||
void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx);
|
||||
+int hostapd_check_max_sta(struct hostapd_data *hapd);
|
||||
|
||||
/* utils.c */
|
||||
int hostapd_register_probereq_cb(struct hostapd_data *hapd,
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -236,6 +236,30 @@ static int hostapd_iface_conf_changed(st
|
||||
}
|
||||
|
||||
|
||||
+static inline int hostapd_iface_num_sta(struct hostapd_iface *iface)
|
||||
+{
|
||||
+ int num_sta = 0;
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < iface->num_bss; i++)
|
||||
+ num_sta += iface->bss[i]->num_sta;
|
||||
+
|
||||
+ return num_sta;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+int hostapd_check_max_sta(struct hostapd_data *hapd)
|
||||
+{
|
||||
+ if (hapd->num_sta >= hapd->conf->max_num_sta)
|
||||
+ return 1;
|
||||
+
|
||||
+ if (hapd->iconf->max_num_sta &&
|
||||
+ hostapd_iface_num_sta(hapd->iface) >= hapd->iconf->max_num_sta)
|
||||
+ return 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
int hostapd_reload_config(struct hostapd_iface *iface, int reconf)
|
||||
{
|
||||
struct hapd_interfaces *interfaces = iface->interfaces;
|
||||
--- a/src/ap/beacon.c
|
||||
+++ b/src/ap/beacon.c
|
||||
@@ -1042,7 +1042,7 @@ void handle_probe_req(struct hostapd_dat
|
||||
if (hapd->conf->no_probe_resp_if_max_sta &&
|
||||
is_multicast_ether_addr(mgmt->da) &&
|
||||
is_multicast_ether_addr(mgmt->bssid) &&
|
||||
- hapd->num_sta >= hapd->conf->max_num_sta &&
|
||||
+ hostapd_check_max_sta(hapd) &&
|
||||
!ap_get_sta(hapd, mgmt->sa)) {
|
||||
wpa_printf(MSG_MSGDUMP, "%s: Ignore Probe Request from " MACSTR
|
||||
" since no room for additional STA",
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -976,6 +976,8 @@ struct hostapd_config {
|
||||
unsigned int track_sta_max_num;
|
||||
unsigned int track_sta_max_age;
|
||||
|
||||
+ int max_num_sta;
|
||||
+
|
||||
char country[3]; /* first two octets: country code as described in
|
||||
* ISO/IEC 3166-1. Third octet:
|
||||
* ' ' (ascii 32): all environments
|
||||
38
package/network/services/hostapd/patches/730-ft_iface.patch
Normal file
38
package/network/services/hostapd/patches/730-ft_iface.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3031,6 +3031,8 @@ static int hostapd_config_fill(struct ho
|
||||
wpa_printf(MSG_INFO,
|
||||
"Line %d: Obsolete peerkey parameter ignored", line);
|
||||
#ifdef CONFIG_IEEE80211R_AP
|
||||
+ } else if (os_strcmp(buf, "ft_iface") == 0) {
|
||||
+ os_strlcpy(bss->ft_iface, pos, sizeof(bss->ft_iface));
|
||||
} else if (os_strcmp(buf, "mobility_domain") == 0) {
|
||||
if (os_strlen(pos) != 2 * MOBILITY_DOMAIN_ID_LEN ||
|
||||
hexstr2bin(pos, bss->mobility_domain,
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -277,6 +277,7 @@ struct airtime_sta_weight {
|
||||
struct hostapd_bss_config {
|
||||
char iface[IFNAMSIZ + 1];
|
||||
char bridge[IFNAMSIZ + 1];
|
||||
+ char ft_iface[IFNAMSIZ + 1];
|
||||
char vlan_bridge[IFNAMSIZ + 1];
|
||||
char wds_bridge[IFNAMSIZ + 1];
|
||||
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -1565,8 +1565,12 @@ int hostapd_setup_wpa(struct hostapd_dat
|
||||
wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) {
|
||||
const char *ft_iface;
|
||||
|
||||
- ft_iface = hapd->conf->bridge[0] ? hapd->conf->bridge :
|
||||
- hapd->conf->iface;
|
||||
+ if (hapd->conf->ft_iface[0])
|
||||
+ ft_iface = hapd->conf->ft_iface;
|
||||
+ else if (hapd->conf->bridge[0])
|
||||
+ ft_iface = hapd->conf->bridge;
|
||||
+ else
|
||||
+ ft_iface = hapd->conf->iface;
|
||||
hapd->l2 = l2_packet_init(ft_iface, NULL, ETH_P_RRB,
|
||||
hostapd_rrb_receive, hapd, 1);
|
||||
if (!hapd->l2) {
|
||||
@@ -0,0 +1,66 @@
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -278,6 +278,7 @@ struct hostapd_bss_config {
|
||||
char iface[IFNAMSIZ + 1];
|
||||
char bridge[IFNAMSIZ + 1];
|
||||
char ft_iface[IFNAMSIZ + 1];
|
||||
+ char snoop_iface[IFNAMSIZ + 1];
|
||||
char vlan_bridge[IFNAMSIZ + 1];
|
||||
char wds_bridge[IFNAMSIZ + 1];
|
||||
|
||||
--- a/src/ap/x_snoop.c
|
||||
+++ b/src/ap/x_snoop.c
|
||||
@@ -31,14 +31,16 @@ int x_snoop_init(struct hostapd_data *ha
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_HAIRPIN_MODE,
|
||||
+ if (!conf->snoop_iface[0] &&
|
||||
+ hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_HAIRPIN_MODE,
|
||||
1)) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"x_snoop: Failed to enable hairpin_mode on the bridge port");
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_PROXYARP, 1)) {
|
||||
+ if (!conf->snoop_iface[0] &&
|
||||
+ hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_PROXYARP, 1)) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"x_snoop: Failed to enable proxyarp on the bridge port");
|
||||
return -1;
|
||||
@@ -52,7 +54,8 @@ int x_snoop_init(struct hostapd_data *ha
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IPV6
|
||||
- if (hostapd_drv_br_set_net_param(hapd, DRV_BR_MULTICAST_SNOOPING, 1)) {
|
||||
+ if (!conf->snoop_iface[0] &&
|
||||
+ hostapd_drv_br_set_net_param(hapd, DRV_BR_MULTICAST_SNOOPING, 1)) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"x_snoop: Failed to enable multicast snooping on the bridge");
|
||||
return -1;
|
||||
@@ -71,8 +74,12 @@ x_snoop_get_l2_packet(struct hostapd_dat
|
||||
{
|
||||
struct hostapd_bss_config *conf = hapd->conf;
|
||||
struct l2_packet_data *l2;
|
||||
+ const char *ifname = conf->bridge;
|
||||
|
||||
- l2 = l2_packet_init(conf->bridge, NULL, ETH_P_ALL, handler, hapd, 1);
|
||||
+ if (conf->snoop_iface[0])
|
||||
+ ifname = conf->snoop_iface;
|
||||
+
|
||||
+ l2 = l2_packet_init(ifname, NULL, ETH_P_ALL, handler, hapd, 1);
|
||||
if (l2 == NULL) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"x_snoop: Failed to initialize L2 packet processing %s",
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -2357,6 +2357,8 @@ static int hostapd_config_fill(struct ho
|
||||
sizeof(conf->bss[0]->iface));
|
||||
} else if (os_strcmp(buf, "bridge") == 0) {
|
||||
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
|
||||
+ } else if (os_strcmp(buf, "snoop_iface") == 0) {
|
||||
+ os_strlcpy(bss->snoop_iface, pos, sizeof(bss->snoop_iface));
|
||||
} else if (os_strcmp(buf, "vlan_bridge") == 0) {
|
||||
os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge));
|
||||
} else if (os_strcmp(buf, "wds_bridge") == 0) {
|
||||
@@ -0,0 +1,51 @@
|
||||
From ad694836b2ded6b97b426bf331627537cdbff591 Mon Sep 17 00:00:00 2001
|
||||
From: David Bauer <mail@david-bauer.net>
|
||||
Date: Thu, 19 Aug 2021 00:52:04 +0200
|
||||
Subject: [PATCH] proxyarp: fix compilation with Hotspot 2.0 disabled
|
||||
|
||||
The disable_dgaf config fiels is only available in case Hostapd is
|
||||
compiled with Hotspot 2.0 support, however Proxy-ARP does not depend on
|
||||
Hotspot 2.0.
|
||||
|
||||
Only add the code related to this config field when Hotspot 2.0 is
|
||||
enabled to fix compilation with the aformentioned preconditions.
|
||||
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
---
|
||||
src/ap/dhcp_snoop.c | 2 ++
|
||||
src/ap/ndisc_snoop.c | 2 ++
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
--- a/src/ap/dhcp_snoop.c
|
||||
+++ b/src/ap/dhcp_snoop.c
|
||||
@@ -88,6 +88,7 @@ static void handle_dhcp(void *ctx, const
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_HS20
|
||||
if (hapd->conf->disable_dgaf && is_broadcast_ether_addr(buf)) {
|
||||
for (sta = hapd->sta_list; sta; sta = sta->next) {
|
||||
if (!(sta->flags & WLAN_STA_AUTHORIZED))
|
||||
@@ -96,6 +97,7 @@ static void handle_dhcp(void *ctx, const
|
||||
(u8 *) buf, len);
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (msgtype == DHCPACK) {
|
||||
if (b->your_ip == 0)
|
||||
--- a/src/ap/ndisc_snoop.c
|
||||
+++ b/src/ap/ndisc_snoop.c
|
||||
@@ -151,10 +151,12 @@ static void handle_ndisc(void *ctx, cons
|
||||
return;
|
||||
}
|
||||
break;
|
||||
+#ifdef CONFIG_HS20
|
||||
case ROUTER_ADVERTISEMENT:
|
||||
if (hapd->conf->disable_dgaf)
|
||||
ucast_to_stas(hapd, buf, len);
|
||||
break;
|
||||
+#endif
|
||||
case NEIGHBOR_ADVERTISEMENT:
|
||||
if (hapd->conf->na_mcast_to_ucast)
|
||||
ucast_to_stas(hapd, buf, len);
|
||||
1864
package/network/services/hostapd/src/src/ap/ubus.c
Normal file
1864
package/network/services/hostapd/src/src/ap/ubus.c
Normal file
File diff suppressed because it is too large
Load Diff
130
package/network/services/hostapd/src/src/ap/ubus.h
Normal file
130
package/network/services/hostapd/src/src/ap/ubus.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* hostapd / ubus support
|
||||
* Copyright (c) 2013, Felix Fietkau <nbd@nbd.name>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
#ifndef __HOSTAPD_UBUS_H
|
||||
#define __HOSTAPD_UBUS_H
|
||||
|
||||
enum hostapd_ubus_event_type {
|
||||
HOSTAPD_UBUS_PROBE_REQ,
|
||||
HOSTAPD_UBUS_AUTH_REQ,
|
||||
HOSTAPD_UBUS_ASSOC_REQ,
|
||||
HOSTAPD_UBUS_TYPE_MAX
|
||||
};
|
||||
|
||||
struct hostapd_ubus_request {
|
||||
enum hostapd_ubus_event_type type;
|
||||
const struct ieee80211_mgmt *mgmt_frame;
|
||||
const struct ieee802_11_elems *elems;
|
||||
int ssi_signal; /* dBm */
|
||||
const u8 *addr;
|
||||
};
|
||||
|
||||
struct hostapd_iface;
|
||||
struct hostapd_data;
|
||||
struct hapd_interfaces;
|
||||
struct rrm_measurement_beacon_report;
|
||||
|
||||
#ifdef UBUS_SUPPORT
|
||||
|
||||
#include <libubox/avl.h>
|
||||
#include <libubus.h>
|
||||
|
||||
struct hostapd_ubus_bss {
|
||||
struct ubus_object obj;
|
||||
struct avl_tree banned;
|
||||
int notify_response;
|
||||
};
|
||||
|
||||
void hostapd_ubus_add_iface(struct hostapd_iface *iface);
|
||||
void hostapd_ubus_free_iface(struct hostapd_iface *iface);
|
||||
void hostapd_ubus_add_bss(struct hostapd_data *hapd);
|
||||
void hostapd_ubus_free_bss(struct hostapd_data *hapd);
|
||||
void hostapd_ubus_add_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan);
|
||||
void hostapd_ubus_remove_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan);
|
||||
|
||||
int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req);
|
||||
void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac);
|
||||
void hostapd_ubus_notify_beacon_report(struct hostapd_data *hapd,
|
||||
const u8 *addr, u8 token, u8 rep_mode,
|
||||
struct rrm_measurement_beacon_report *rep,
|
||||
size_t len);
|
||||
void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequency,
|
||||
int chan_width, int cf1, int cf2);
|
||||
|
||||
void hostapd_ubus_notify_bss_transition_response(
|
||||
struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 status_code,
|
||||
u8 bss_termination_delay, const u8 *target_bssid,
|
||||
const u8 *candidate_list, u16 candidate_list_len);
|
||||
void hostapd_ubus_add(struct hapd_interfaces *interfaces);
|
||||
void hostapd_ubus_free(struct hapd_interfaces *interfaces);
|
||||
|
||||
#else
|
||||
|
||||
struct hostapd_ubus_bss {};
|
||||
|
||||
static inline void hostapd_ubus_add_iface(struct hostapd_iface *iface)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_free_iface(struct hostapd_iface *iface)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_add_bss(struct hostapd_data *hapd)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_free_bss(struct hostapd_data *hapd)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_add_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_remove_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_notify_beacon_report(struct hostapd_data *hapd,
|
||||
const u8 *addr, u8 token,
|
||||
u8 rep_mode,
|
||||
struct rrm_measurement_beacon_report *rep,
|
||||
size_t len)
|
||||
{
|
||||
}
|
||||
static inline void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequency,
|
||||
int chan_width, int cf1, int cf2)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_notify_bss_transition_response(
|
||||
struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 status_code,
|
||||
u8 bss_termination_delay, const u8 *target_bssid,
|
||||
const u8 *candidate_list, u16 candidate_list_len)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_add(struct hapd_interfaces *interfaces)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hostapd_ubus_free(struct hapd_interfaces *interfaces)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,57 @@
|
||||
#ifndef BUILD_FEATURES_H
|
||||
#define BUILD_FEATURES_H
|
||||
|
||||
static inline int has_feature(const char *feat)
|
||||
{
|
||||
#if defined(IEEE8021X_EAPOL) || (defined(HOSTAPD) && !defined(CONFIG_NO_RADIUS))
|
||||
if (!strcmp(feat, "eap"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_IEEE80211N
|
||||
if (!strcmp(feat, "11n"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_IEEE80211AC
|
||||
if (!strcmp(feat, "11ac"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_IEEE80211AX
|
||||
if (!strcmp(feat, "11ax"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_IEEE80211R
|
||||
if (!strcmp(feat, "11r"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_ACS
|
||||
if (!strcmp(feat, "acs"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_SAE
|
||||
if (!strcmp(feat, "sae"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_OWE
|
||||
if (!strcmp(feat, "owe"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_SUITEB192
|
||||
if (!strcmp(feat, "suiteb192"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_WEP
|
||||
if (!strcmp(feat, "wep"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_HS20
|
||||
if (!strcmp(feat, "hs20"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_WPS
|
||||
if (!strcmp(feat, "wps"))
|
||||
return 1;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* BUILD_FEATURES_H */
|
||||
430
package/network/services/hostapd/src/wpa_supplicant/ubus.c
Normal file
430
package/network/services/hostapd/src/wpa_supplicant/ubus.c
Normal file
@@ -0,0 +1,430 @@
|
||||
/*
|
||||
* wpa_supplicant / ubus support
|
||||
* Copyright (c) 2018, Daniel Golle <daniel@makrotopia.org>
|
||||
* Copyright (c) 2013, Felix Fietkau <nbd@nbd.name>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#include "utils/includes.h"
|
||||
#include "utils/common.h"
|
||||
#include "utils/eloop.h"
|
||||
#include "utils/wpabuf.h"
|
||||
#include "common/ieee802_11_defs.h"
|
||||
#include "wpa_supplicant_i.h"
|
||||
#include "wps_supplicant.h"
|
||||
#include "ubus.h"
|
||||
|
||||
static struct ubus_context *ctx;
|
||||
static struct blob_buf b;
|
||||
static int ctx_ref;
|
||||
|
||||
static inline struct wpa_global *get_wpa_global_from_object(struct ubus_object *obj)
|
||||
{
|
||||
return container_of(obj, struct wpa_global, ubus_global);
|
||||
}
|
||||
|
||||
static inline struct wpa_supplicant *get_wpas_from_object(struct ubus_object *obj)
|
||||
{
|
||||
return container_of(obj, struct wpa_supplicant, ubus.obj);
|
||||
}
|
||||
|
||||
static void ubus_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
{
|
||||
struct ubus_context *ctx = eloop_ctx;
|
||||
ubus_handle_event(ctx);
|
||||
}
|
||||
|
||||
static void ubus_reconnect_timeout(void *eloop_data, void *user_ctx)
|
||||
{
|
||||
if (ubus_reconnect(ctx, NULL)) {
|
||||
eloop_register_timeout(1, 0, ubus_reconnect_timeout, ctx, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
eloop_register_read_sock(ctx->sock.fd, ubus_receive, ctx, NULL);
|
||||
}
|
||||
|
||||
static void wpas_ubus_connection_lost(struct ubus_context *ctx)
|
||||
{
|
||||
eloop_unregister_read_sock(ctx->sock.fd);
|
||||
eloop_register_timeout(1, 0, ubus_reconnect_timeout, ctx, NULL);
|
||||
}
|
||||
|
||||
static bool wpas_ubus_init(void)
|
||||
{
|
||||
if (ctx)
|
||||
return true;
|
||||
|
||||
ctx = ubus_connect(NULL);
|
||||
if (!ctx)
|
||||
return false;
|
||||
|
||||
ctx->connection_lost = wpas_ubus_connection_lost;
|
||||
eloop_register_read_sock(ctx->sock.fd, ubus_receive, ctx, NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void wpas_ubus_ref_inc(void)
|
||||
{
|
||||
ctx_ref++;
|
||||
}
|
||||
|
||||
static void wpas_ubus_ref_dec(void)
|
||||
{
|
||||
ctx_ref--;
|
||||
if (!ctx)
|
||||
return;
|
||||
|
||||
if (ctx_ref)
|
||||
return;
|
||||
|
||||
eloop_unregister_read_sock(ctx->sock.fd);
|
||||
ubus_free(ctx);
|
||||
ctx = NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
wpas_bss_get_features(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *req, const char *method,
|
||||
struct blob_attr *msg)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = get_wpas_from_object(obj);
|
||||
|
||||
blob_buf_init(&b, 0);
|
||||
blobmsg_add_u8(&b, "ht_supported", ht_supported(wpa_s->hw.modes));
|
||||
blobmsg_add_u8(&b, "vht_supported", vht_supported(wpa_s->hw.modes));
|
||||
ubus_send_reply(ctx, req, b.head);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
wpas_bss_reload(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *req, const char *method,
|
||||
struct blob_attr *msg)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = get_wpas_from_object(obj);
|
||||
|
||||
if (wpa_supplicant_reload_configuration(wpa_s))
|
||||
return UBUS_STATUS_UNKNOWN_ERROR;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WPS
|
||||
enum {
|
||||
WPS_START_MULTI_AP,
|
||||
__WPS_START_MAX
|
||||
};
|
||||
|
||||
static const struct blobmsg_policy wps_start_policy[] = {
|
||||
[WPS_START_MULTI_AP] = { "multi_ap", BLOBMSG_TYPE_BOOL },
|
||||
};
|
||||
|
||||
static int
|
||||
wpas_bss_wps_start(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *req, const char *method,
|
||||
struct blob_attr *msg)
|
||||
{
|
||||
int rc;
|
||||
struct wpa_supplicant *wpa_s = get_wpas_from_object(obj);
|
||||
struct blob_attr *tb[__WPS_START_MAX], *cur;
|
||||
int multi_ap = 0;
|
||||
|
||||
blobmsg_parse(wps_start_policy, __WPS_START_MAX, tb, blobmsg_data(msg), blobmsg_data_len(msg));
|
||||
|
||||
if (tb[WPS_START_MULTI_AP])
|
||||
multi_ap = blobmsg_get_bool(tb[WPS_START_MULTI_AP]);
|
||||
|
||||
rc = wpas_wps_start_pbc(wpa_s, NULL, 0, multi_ap);
|
||||
|
||||
if (rc != 0)
|
||||
return UBUS_STATUS_NOT_SUPPORTED;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
wpas_bss_wps_cancel(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *req, const char *method,
|
||||
struct blob_attr *msg)
|
||||
{
|
||||
int rc;
|
||||
struct wpa_supplicant *wpa_s = get_wpas_from_object(obj);
|
||||
|
||||
rc = wpas_wps_cancel(wpa_s);
|
||||
|
||||
if (rc != 0)
|
||||
return UBUS_STATUS_NOT_SUPPORTED;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct ubus_method bss_methods[] = {
|
||||
UBUS_METHOD_NOARG("reload", wpas_bss_reload),
|
||||
UBUS_METHOD_NOARG("get_features", wpas_bss_get_features),
|
||||
#ifdef CONFIG_WPS
|
||||
UBUS_METHOD_NOARG("wps_start", wpas_bss_wps_start),
|
||||
UBUS_METHOD_NOARG("wps_cancel", wpas_bss_wps_cancel),
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct ubus_object_type bss_object_type =
|
||||
UBUS_OBJECT_TYPE("wpas_bss", bss_methods);
|
||||
|
||||
void wpas_ubus_add_bss(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
struct ubus_object *obj = &wpa_s->ubus.obj;
|
||||
char *name;
|
||||
int ret;
|
||||
|
||||
if (!wpas_ubus_init())
|
||||
return;
|
||||
|
||||
if (asprintf(&name, "wpa_supplicant.%s", wpa_s->ifname) < 0)
|
||||
return;
|
||||
|
||||
obj->name = name;
|
||||
obj->type = &bss_object_type;
|
||||
obj->methods = bss_object_type.methods;
|
||||
obj->n_methods = bss_object_type.n_methods;
|
||||
ret = ubus_add_object(ctx, obj);
|
||||
wpas_ubus_ref_inc();
|
||||
}
|
||||
|
||||
void wpas_ubus_free_bss(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
struct ubus_object *obj = &wpa_s->ubus.obj;
|
||||
char *name = (char *) obj->name;
|
||||
|
||||
if (!ctx)
|
||||
return;
|
||||
|
||||
if (obj->id) {
|
||||
ubus_remove_object(ctx, obj);
|
||||
wpas_ubus_ref_dec();
|
||||
}
|
||||
|
||||
free(name);
|
||||
}
|
||||
|
||||
enum {
|
||||
WPAS_CONFIG_DRIVER,
|
||||
WPAS_CONFIG_IFACE,
|
||||
WPAS_CONFIG_BRIDGE,
|
||||
WPAS_CONFIG_HOSTAPD_CTRL,
|
||||
WPAS_CONFIG_CTRL,
|
||||
WPAS_CONFIG_FILE,
|
||||
__WPAS_CONFIG_MAX
|
||||
};
|
||||
|
||||
static const struct blobmsg_policy wpas_config_add_policy[__WPAS_CONFIG_MAX] = {
|
||||
[WPAS_CONFIG_DRIVER] = { "driver", BLOBMSG_TYPE_STRING },
|
||||
[WPAS_CONFIG_IFACE] = { "iface", BLOBMSG_TYPE_STRING },
|
||||
[WPAS_CONFIG_BRIDGE] = { "bridge", BLOBMSG_TYPE_STRING },
|
||||
[WPAS_CONFIG_HOSTAPD_CTRL] = { "hostapd_ctrl", BLOBMSG_TYPE_STRING },
|
||||
[WPAS_CONFIG_CTRL] = { "ctrl", BLOBMSG_TYPE_STRING },
|
||||
[WPAS_CONFIG_FILE] = { "config", BLOBMSG_TYPE_STRING },
|
||||
};
|
||||
|
||||
static int
|
||||
wpas_config_add(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *req, const char *method,
|
||||
struct blob_attr *msg)
|
||||
{
|
||||
struct blob_attr *tb[__WPAS_CONFIG_MAX];
|
||||
struct wpa_global *global = get_wpa_global_from_object(obj);
|
||||
struct wpa_interface *iface;
|
||||
|
||||
blobmsg_parse(wpas_config_add_policy, __WPAS_CONFIG_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
|
||||
if (!tb[WPAS_CONFIG_FILE] || !tb[WPAS_CONFIG_IFACE] || !tb[WPAS_CONFIG_DRIVER])
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
iface = os_zalloc(sizeof(struct wpa_interface));
|
||||
if (iface == NULL)
|
||||
return UBUS_STATUS_UNKNOWN_ERROR;
|
||||
|
||||
iface->driver = blobmsg_get_string(tb[WPAS_CONFIG_DRIVER]);
|
||||
iface->ifname = blobmsg_get_string(tb[WPAS_CONFIG_IFACE]);
|
||||
iface->confname = blobmsg_get_string(tb[WPAS_CONFIG_FILE]);
|
||||
|
||||
if (tb[WPAS_CONFIG_BRIDGE])
|
||||
iface->bridge_ifname = blobmsg_get_string(tb[WPAS_CONFIG_BRIDGE]);
|
||||
|
||||
if (tb[WPAS_CONFIG_CTRL])
|
||||
iface->ctrl_interface = blobmsg_get_string(tb[WPAS_CONFIG_CTRL]);
|
||||
|
||||
if (tb[WPAS_CONFIG_HOSTAPD_CTRL])
|
||||
iface->hostapd_ctrl = blobmsg_get_string(tb[WPAS_CONFIG_HOSTAPD_CTRL]);
|
||||
|
||||
if (!wpa_supplicant_add_iface(global, iface, NULL))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
blob_buf_init(&b, 0);
|
||||
blobmsg_add_u32(&b, "pid", getpid());
|
||||
ubus_send_reply(ctx, req, b.head);
|
||||
|
||||
return UBUS_STATUS_OK;
|
||||
}
|
||||
|
||||
enum {
|
||||
WPAS_CONFIG_REM_IFACE,
|
||||
__WPAS_CONFIG_REM_MAX
|
||||
};
|
||||
|
||||
static const struct blobmsg_policy wpas_config_remove_policy[__WPAS_CONFIG_REM_MAX] = {
|
||||
[WPAS_CONFIG_REM_IFACE] = { "iface", BLOBMSG_TYPE_STRING },
|
||||
};
|
||||
|
||||
static int
|
||||
wpas_config_remove(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *req, const char *method,
|
||||
struct blob_attr *msg)
|
||||
{
|
||||
struct blob_attr *tb[__WPAS_CONFIG_REM_MAX];
|
||||
struct wpa_global *global = get_wpa_global_from_object(obj);
|
||||
struct wpa_supplicant *wpa_s = NULL;
|
||||
unsigned int found = 0;
|
||||
|
||||
blobmsg_parse(wpas_config_remove_policy, __WPAS_CONFIG_REM_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
|
||||
if (!tb[WPAS_CONFIG_REM_IFACE])
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
/* find wpa_s object for to-be-removed interface */
|
||||
for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
|
||||
if (!strncmp(wpa_s->ifname,
|
||||
blobmsg_get_string(tb[WPAS_CONFIG_REM_IFACE]),
|
||||
sizeof(wpa_s->ifname)))
|
||||
{
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (wpa_supplicant_remove_iface(global, wpa_s, 0))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
return UBUS_STATUS_OK;
|
||||
}
|
||||
|
||||
static const struct ubus_method wpas_daemon_methods[] = {
|
||||
UBUS_METHOD("config_add", wpas_config_add, wpas_config_add_policy),
|
||||
UBUS_METHOD("config_remove", wpas_config_remove, wpas_config_remove_policy),
|
||||
};
|
||||
|
||||
static struct ubus_object_type wpas_daemon_object_type =
|
||||
UBUS_OBJECT_TYPE("wpa_supplicant", wpas_daemon_methods);
|
||||
|
||||
void wpas_ubus_add(struct wpa_global *global)
|
||||
{
|
||||
struct ubus_object *obj = &global->ubus_global;
|
||||
int ret;
|
||||
|
||||
if (!wpas_ubus_init())
|
||||
return;
|
||||
|
||||
obj->name = strdup("wpa_supplicant");
|
||||
|
||||
obj->type = &wpas_daemon_object_type;
|
||||
obj->methods = wpas_daemon_object_type.methods;
|
||||
obj->n_methods = wpas_daemon_object_type.n_methods;
|
||||
ret = ubus_add_object(ctx, obj);
|
||||
wpas_ubus_ref_inc();
|
||||
}
|
||||
|
||||
void wpas_ubus_free(struct wpa_global *global)
|
||||
{
|
||||
struct ubus_object *obj = &global->ubus_global;
|
||||
char *name = (char *) obj->name;
|
||||
|
||||
if (!ctx)
|
||||
return;
|
||||
|
||||
if (obj->id) {
|
||||
ubus_remove_object(ctx, obj);
|
||||
wpas_ubus_ref_dec();
|
||||
}
|
||||
|
||||
free(name);
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_WPS
|
||||
void wpas_ubus_notify(struct wpa_supplicant *wpa_s, const struct wps_credential *cred)
|
||||
{
|
||||
u16 auth_type;
|
||||
char *ifname, *encryption, *ssid, *key;
|
||||
size_t ifname_len;
|
||||
|
||||
if (!cred)
|
||||
return;
|
||||
|
||||
auth_type = cred->auth_type;
|
||||
|
||||
if (auth_type == (WPS_AUTH_WPAPSK | WPS_AUTH_WPA2PSK))
|
||||
auth_type = WPS_AUTH_WPA2PSK;
|
||||
|
||||
if (auth_type != WPS_AUTH_OPEN &&
|
||||
auth_type != WPS_AUTH_WPAPSK &&
|
||||
auth_type != WPS_AUTH_WPA2PSK) {
|
||||
wpa_printf(MSG_DEBUG, "WPS: Ignored credentials for "
|
||||
"unsupported authentication type 0x%x",
|
||||
auth_type);
|
||||
return;
|
||||
}
|
||||
|
||||
if (auth_type == WPS_AUTH_WPAPSK || auth_type == WPS_AUTH_WPA2PSK) {
|
||||
if (cred->key_len < 8 || cred->key_len > 2 * PMK_LEN) {
|
||||
wpa_printf(MSG_ERROR, "WPS: Reject PSK credential with "
|
||||
"invalid Network Key length %lu",
|
||||
(unsigned long) cred->key_len);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
blob_buf_init(&b, 0);
|
||||
|
||||
ifname_len = strlen(wpa_s->ifname);
|
||||
ifname = blobmsg_alloc_string_buffer(&b, "ifname", ifname_len + 1);
|
||||
memcpy(ifname, wpa_s->ifname, ifname_len + 1);
|
||||
ifname[ifname_len] = '\0';
|
||||
blobmsg_add_string_buffer(&b);
|
||||
|
||||
switch (auth_type) {
|
||||
case WPS_AUTH_WPA2PSK:
|
||||
encryption = "psk2";
|
||||
break;
|
||||
case WPS_AUTH_WPAPSK:
|
||||
encryption = "psk";
|
||||
break;
|
||||
default:
|
||||
encryption = "none";
|
||||
break;
|
||||
}
|
||||
|
||||
blobmsg_add_string(&b, "encryption", encryption);
|
||||
|
||||
ssid = blobmsg_alloc_string_buffer(&b, "ssid", cred->ssid_len + 1);
|
||||
memcpy(ssid, cred->ssid, cred->ssid_len);
|
||||
ssid[cred->ssid_len] = '\0';
|
||||
blobmsg_add_string_buffer(&b);
|
||||
|
||||
if (cred->key_len > 0) {
|
||||
key = blobmsg_alloc_string_buffer(&b, "key", cred->key_len + 1);
|
||||
memcpy(key, cred->key, cred->key_len);
|
||||
key[cred->key_len] = '\0';
|
||||
blobmsg_add_string_buffer(&b);
|
||||
}
|
||||
|
||||
// ubus_notify(ctx, &wpa_s->ubus.obj, "wps_credentials", b.head, -1);
|
||||
ubus_send_event(ctx, "wps_credentials", b.head);
|
||||
}
|
||||
#endif /* CONFIG_WPS */
|
||||
66
package/network/services/hostapd/src/wpa_supplicant/ubus.h
Normal file
66
package/network/services/hostapd/src/wpa_supplicant/ubus.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* wpa_supplicant / ubus support
|
||||
* Copyright (c) 2018, Daniel Golle <daniel@makrotopia.org>
|
||||
* Copyright (c) 2013, Felix Fietkau <nbd@nbd.name>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
#ifndef __WPAS_UBUS_H
|
||||
#define __WPAS_UBUS_H
|
||||
|
||||
struct wpa_supplicant;
|
||||
struct wpa_global;
|
||||
|
||||
#include "wps_supplicant.h"
|
||||
|
||||
#ifdef UBUS_SUPPORT
|
||||
#include <libubus.h>
|
||||
|
||||
struct wpas_ubus_bss {
|
||||
struct ubus_object obj;
|
||||
};
|
||||
|
||||
void wpas_ubus_add_bss(struct wpa_supplicant *wpa_s);
|
||||
void wpas_ubus_free_bss(struct wpa_supplicant *wpa_s);
|
||||
|
||||
void wpas_ubus_add(struct wpa_global *global);
|
||||
void wpas_ubus_free(struct wpa_global *global);
|
||||
|
||||
#ifdef CONFIG_WPS
|
||||
void wpas_ubus_notify(struct wpa_supplicant *wpa_s, const struct wps_credential *cred);
|
||||
#endif
|
||||
|
||||
#else
|
||||
struct wpas_ubus_bss {};
|
||||
|
||||
static inline void wpas_ubus_add_iface(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_ubus_free_iface(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_ubus_add_bss(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_ubus_free_bss(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_ubus_notify(struct wpa_supplicant *wpa_s, struct wps_credential *cred)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_ubus_add(struct wpa_global *global)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_ubus_free(struct wpa_global *global)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user