aboutsummaryrefslogtreecommitdiffstats
path: root/package/hostapd
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-07-08 18:36:17 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-07-08 18:36:17 +0000
commitca4a8b1bee22646319f8e2aeb1ed59062403a9b8 (patch)
treea564e331397dba07eb504951ab54088430a48d9c /package/hostapd
parent3e75044a95d42c948dc84d4a88776c7923c20055 (diff)
downloadupstream-ca4a8b1bee22646319f8e2aeb1ed59062403a9b8.tar.gz
upstream-ca4a8b1bee22646319f8e2aeb1ed59062403a9b8.tar.bz2
upstream-ca4a8b1bee22646319f8e2aeb1ed59062403a9b8.zip
hostapd: add preliminary wps script support (push-button only, does not handle multi-bss yet)
SVN-Revision: 22100
Diffstat (limited to 'package/hostapd')
-rw-r--r--package/hostapd/Makefile3
-rw-r--r--package/hostapd/files/hostapd.sh11
-rw-r--r--package/hostapd/files/wps-hotplug.sh6
3 files changed, 18 insertions, 2 deletions
diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile
index 4189922561..dcbe9e53a6 100644
--- a/package/hostapd/Makefile
+++ b/package/hostapd/Makefile
@@ -294,8 +294,9 @@ Package/hostapd-mini/install = $(Package/hostapd/install)
ifneq ($(LOCAL_TYPE),supplicant)
define Package/hostapd-utils/install
- $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/hotplug.d/button
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/
+ $(INSTALL_DATA) ./files/wps-hotplug.sh $(1)/etc/hotplug.d/button/50-wps
endef
endif
diff --git a/package/hostapd/files/hostapd.sh b/package/hostapd/files/hostapd.sh
index fdb047be6a..c4e91689da 100644
--- a/package/hostapd/files/hostapd.sh
+++ b/package/hostapd/files/hostapd.sh
@@ -1,7 +1,7 @@
hostapd_set_bss_options() {
local var="$1"
local vif="$2"
- local enc wpa_group_rekey
+ local enc wpa_group_rekey wps_possible
config_get enc "$vif" encryption
config_get wpa_group_rekey "$vif" wpa_group_rekey
@@ -60,6 +60,7 @@ hostapd_set_bss_options() {
else
append "$var" "wpa_passphrase=$psk" "$N"
fi
+ wps_possible=1
;;
*wpa*)
# required fields? formats?
@@ -116,6 +117,14 @@ hostapd_set_bss_options() {
config_get bridge "$vif" bridge
config_get ieee80211d "$vif" ieee80211d
+ config_get_bool wps_pbc "$vif" wps_pushbutton 0
+ [ -n "$wps_possible" -a "$wps_pbc" -gt 0 ] && {
+ append "$var" "eap_server=1" "$N"
+ append "$var" "wps_state=2" "$N"
+ append "$var" "ap_setup_locked=1" "$N"
+ append "$var" "config_methods=push_button" "$N"
+ }
+
append "$var" "ssid=$ssid" "$N"
[ -n "$bridge" ] && append "$var" "bridge=$bridge" "$N"
[ -n "$ieee80211d" ] && append "$var" "ieee80211d=$ieee80211d" "$N"
diff --git a/package/hostapd/files/wps-hotplug.sh b/package/hostapd/files/wps-hotplug.sh
new file mode 100644
index 0000000000..b5376cc55b
--- /dev/null
+++ b/package/hostapd/files/wps-hotplug.sh
@@ -0,0 +1,6 @@
+if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then
+ for dir in /var/run/hostapd-*; do
+ [ -d "$dir" ] || continue
+ hostapd_cli -p "$dir" wps_pbc
+ done
+fi