Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / tools / tools / net80211 / scripts / setup.wdsmain
1 #! /bin/sh
2 #
3 # Setup an ap that accepts wds traffic from associated stations.
4 # This can be used as the "back end" for setup.extender and/or
5 # setup.repeater.  Note that the wds vap's are created by the
6 # wlanwds program that listens for wds discovery events (to create
7 # wds vaps) and for sta leave events (to destroy wds vaps it
8 # created).  The WDSUP script is invoked for each wds vap that
9 # gets created--to add the vap to a bridge.
10 #
11 # $FreeBSD: src/tools/tools/net80211/scripts/setup.wdsmain,v 1.2 2009/04/15 22:11:04 sam Exp $
12 #
13 PATH=.:$PATH
14 . config
15
16 SSID='freebsd+wdsmain'
17 WDSUP=$TMPDIR/wdsup$$
18
19 #mwldebug state+node+reset+xmit+recv+beacon+hal+hal2
20 WLAN_AP=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
21 ifconfig $WLAN_AP ssid "$SSID" channel $CHANNEL mtu 1500
22 ifconfig $WLAN_AP dwds -apbridge
23 wlandebug -i $WLAN_AP state+scan+assoc+auth+wds+11n
24
25 BRIDGE=`ifconfig bridge create`
26
27 # NB: start wlanwds first to avoid races.
28 rm -f $WDSUP
29 cat >$WDSUP <<EOF
30 #! /bin/sh
31 DEV=\$1
32 ifconfig $BRIDGE addm \$DEV
33 ifconfig \$DEV up
34 EOF
35 chmod +x $WDSUP
36 $WLANWDS -v -s $WDSUP &
37
38 ifconfig $BRIDGE addm $WLAN_AP addm $WIRED up
39 ifconfig $WIRED up
40 ifconfig $WLAN_AP up