1178361Ssam#! /bin/sh
2178361Ssam#
3178361Ssam# Setup an ap that accepts wds traffic from associated stations.
4178361Ssam# This can be used as the "back end" for setup.extender and/or
5178361Ssam# setup.repeater.  Note that the wds vap's are created by the
6178361Ssam# wlanwds program that listens for wds discovery events (to create
7178361Ssam# wds vaps) and for sta leave events (to destroy wds vaps it
8178361Ssam# created).  The WDSUP script is invoked for each wds vap that
9178361Ssam# gets created--to add the vap to a bridge.
10178361Ssam#
11178361Ssam# $FreeBSD: releng/10.2/tools/tools/net80211/scripts/setup.wdsmain 191128 2009-04-15 22:11:04Z sam $
12178361Ssam#
13178361SsamPATH=.:$PATH
14178361Ssam. config
15178361Ssam
16178361SsamSSID='freebsd+wdsmain'
17178361SsamWDSUP=$TMPDIR/wdsup$$
18178361Ssam
19178361Ssam#mwldebug state+node+reset+xmit+recv+beacon+hal+hal2
20178361SsamWLAN_AP=`ifconfig wlan create wlanmode hostap wlandev $WIRELESS`
21178361Ssamifconfig $WLAN_AP ssid "$SSID" channel $CHANNEL mtu 1500
22178361Ssamifconfig $WLAN_AP dwds -apbridge
23178361Ssamwlandebug -i $WLAN_AP state+scan+assoc+auth+wds+11n
24178361Ssam
25178361SsamBRIDGE=`ifconfig bridge create`
26178361Ssam
27178361Ssam# NB: start wlanwds first to avoid races.
28178361Ssamrm -f $WDSUP
29178361Ssamcat >$WDSUP <<EOF
30178361Ssam#! /bin/sh
31178361SsamDEV=\$1
32178361Ssamifconfig $BRIDGE addm \$DEV
33178361Ssamifconfig \$DEV up
34178361SsamEOF
35178361Ssamchmod +x $WDSUP
36191128Ssam$WLANWDS -v -s $WDSUP &
37178361Ssam
38178361Ssamifconfig $BRIDGE addm $WLAN_AP addm $WIRED up
39178361Ssamifconfig $WIRED up
40178361Ssamifconfig $WLAN_AP up
41