diff --git a/tools/tools/net80211/scripts/config b/tools/tools/net80211/scripts/config new file mode 100644 index 00000000000..cff91347567 --- /dev/null +++ b/tools/tools/net80211/scripts/config @@ -0,0 +1,54 @@ +# +# Common configuration settings for vap test scripts. +# +# $FreeBSD$ +# + +# +# Auto-detect WIRED and WIRELESS. +# NB: takes first device of each type; to fix +# either specify them before . config. +# +for i in `ifconfig -l`; do + case $i in + bge*|em*|re*|nfe*|fxp*|vr*|msk*|tx*|dc*) + test -z "$WIRED" && WIRED=$i + ;; + ath*|ral*|zyd*|ural*|rum*|bwi*) + test -z "$WIRELESS" && WIRELESS=$i + ;; + esac +done +test -z "$WIRED" && { echo "No wired device detected!"; exit; } +test -z "$WIRELESS" && { echo "No wireless device detected!"; exit; } + +# fixed channel +#CHANNEL=${1:-36:a} +#CHANNEL=${1:-36:ht/20} +CHANNEL=${1:-36} +#CHANNEL=${1:-6:g} +#CHANNEL=${1:-6:b} + +# default WPA passphrase +test -z "$WPA_PASSPHRASE" && WPA_PASSPHRASE='I am not a geek' + +# default ssid for ap vaps +test -z "$SSID" && SSID=freebsd-ap + +# directory to create files like hostapd.conf +test -z "$TMPDIR" && TMPDIR=. + +test -z "$HOSTAPD_CTRL_INTERFACE" && HOSTAPD_CTRL_INTERFACE=/var/run/hostapd + +# applications (may want ../ for wlan test apps) +test -z "$HOSTAPD" && HOSTAPD=/usr/sbin/hostapd +test -z "$WLANWATCH" && WLANWATCH=/usr/local/bin/wlanwatch +test -z "$WLANWDS" && WLANWDS=/usr/local/bin/wlanwds + +start_hostapd() +{ + for m in wlan_xauth wlan_ccmp wlan_tkip wlan_wep; do + kldstat -q -m $m || kldload $m + done + $HOSTAPD $* +} diff --git a/tools/tools/net80211/scripts/setup.dfs b/tools/tools/net80211/scripts/setup.dfs new file mode 100644 index 00000000000..a771977c814 --- /dev/null +++ b/tools/tools/net80211/scripts/setup.dfs @@ -0,0 +1,25 @@ +#! /bin/sh +# +# Scrip for testing DFS; setup an AP vap on a DFS channel +# then simulate a radar event and verify operation. +# +# $FreeBSD$ +# +PATH=.:$PATH +. config + +COUNTRY=dk +CHANNEL=64:a + +sysctl net.wlan.nol_timeout=60 +#mwldebug state+node+reset+xmit+recv+beacon+hal+hal2 +WLAN=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS` +ifconfig $WLAN country $COUNTRY +ifconfig $WLAN ssid $SSID-$COUNTRY channel $CHANNEL mtu 1500 +BRIDGE=`ifconfig bridge create` +ifconfig $BRIDGE addm $WLAN addm $WIRED up +ifconfig $WIRED up +wlandebug -i $WLAN state+scan+assoc+11n +ifconfig $WLAN up + +sleep 5; sysctl dev.mwl.0.radar=1 diff --git a/tools/tools/net80211/scripts/setup.fixed b/tools/tools/net80211/scripts/setup.fixed new file mode 100644 index 00000000000..d0008002dc9 --- /dev/null +++ b/tools/tools/net80211/scripts/setup.fixed @@ -0,0 +1,17 @@ +#! /bin/sh +# +# Script for testing fixed xmit rate handling. +# +# $FreeBSD$ +# +PATH=.:$PATH +. config + +WLAN=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS` +ifconfig $WLAN ssid $SSID channel $CHANNEL mtu 1500 +ifconfig $WLAN ucastrate 24:a ucastrate 7 +BRIDGE=`ifconfig bridge create` +ifconfig $BRIDGE addm $WLAN addm $WIRED up +ifconfig $WIRED up +wlandebug -i $WLAN state+scan+assoc +ifconfig $WLAN up diff --git a/tools/tools/net80211/scripts/setup.local b/tools/tools/net80211/scripts/setup.local new file mode 100644 index 00000000000..f56e9d58533 --- /dev/null +++ b/tools/tools/net80211/scripts/setup.local @@ -0,0 +1,16 @@ +#! /bin/sh +# +# Script for testing traffic to the local host (as opposed to bridged). +# +# $FreeBSD$ +# +PATH=.:$PATH +. config + +WLAN=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS` +ifconfig $WLAN ssid $SSID channel $CHANNEL mtu 1500 +ifconfig $WIRED down delete +route flush +wlandebug -i $WLAN state+scan+assoc+11n +#mwldebug tso +ifconfig $WLAN 192.168.0.21/24 diff --git a/tools/tools/net80211/scripts/setup.mixed b/tools/tools/net80211/scripts/setup.mixed new file mode 100644 index 00000000000..423c5342e7d --- /dev/null +++ b/tools/tools/net80211/scripts/setup.mixed @@ -0,0 +1,62 @@ +#! /bin/sh +# +# Script for testing multi-bss open+WPA1+WPA2. +# +# $FreeBSD$ +# +PATH=.:$PATH +. config + +BRIDGE=bridge0 +WPA_WLAN=wlan0 +CONF=$TMPDIR/bsd-$WPA_WLAN.conf +WPA_SSID=$SSID-wpa +OPEN_WLAN=wlan1 + +makeconf() +{ + conf=$1 + rm -f $conf + cat >$conf <$1 <$1 <$WDSUP <$1 <$1 <$1 <$1 <$1 <