]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/tools/net80211/scripts/setup.tsn
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / tools / net80211 / scripts / setup.tsn
1 #! /bin/sh
2 #
3 # Script for testing TSN support.
4 #
5 # $FreeBSD$
6 #
7 PATH=.:$PATH
8 . config
9
10 BRIDGE=bridge0
11 SSID=$SSID-tsn
12 WLAN=wlan0
13 CONF=$TMPDIR/tsn-$WLAN.conf
14
15 makeconf()
16 {
17         conf=$1
18         rm -f $conf
19         cat >$1 <<EOF
20 interface=$WLAN
21 logger_syslog=-1
22 logger_syslog_level=0
23 logger_stdout=-1
24 logger_stdout_level=0
25 debug=4
26 wpa=1
27 wpa_pairwise=TKIP
28 wpa_key_mgmt=WPA-PSK
29 wpa_passphrase=$WPA_PASSPHRASE
30 tsn=1
31 wep_key0=0123456789
32 EOF
33 }
34
35 trap "ifconfig $BRIDGE destroy; ifconfig $WLAN destroy; \
36         rm -f $CONF" 0
37
38 ifconfig $WLAN create wlandev $WIRELESS wlanmode hostap
39 #wlandebug -i $WLAN assoc+crypto
40 wlandebug -i $WLAN state+assoc+11n+crypto
41 ifconfig $WLAN ssid $SSID
42 ifconfig $WLAN channel $CHANNEL
43 ifconfig $WLAN mtu 1500         # NB: if_bridge requires matching mtu's
44 ifconfig $WLAN tsn
45
46 ifconfig $BRIDGE create
47 ifconfig $BRIDGE addm $WIRED addm $WLAN up
48 ifconfig $WLAN up
49 ifconfig $WIRED up
50
51 ifconfig
52
53 makeconf $CONF
54 #mwldebug -i $WIRELESS keycache
55 start_hostapd -K $CONF