]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/tools/net80211/scripts/mesh/topology.tree
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / tools / net80211 / scripts / mesh / topology.tree
1 #! /bin/sh
2 #
3 # Script for creating a mesh in tree (hirearchical) topology.
4 #
5 #       node1
6 #         ^
7 #         |
8 #        / \
9 #       v   v
10 #    node2  node3
11 #      ^      ^
12 #      |      |
13 #      v      v
14 #    node4  node5
15 #
16 # $FreeBSD$
17 #
18 PATH=../:.:$PATH
19 . config
20 . config.mesh
21
22 . common
23 ifconfig $WLAN mac:allow
24 MAC=`ifconfig $WLAN | grep ether | awk '{ print $2 }'`
25 case $MAC in
26         $NODE1_MAC)
27                 ifconfig $WLAN inet $NODE1_IP
28                 ifconfig $WLAN mac:add $NODE2_MAC mac:add $NODE3_MAC
29                 ;;
30         $NODE2_MAC)
31                 ifconfig $WLAN inet $NODE2_IP
32                 ifconfig $WLAN mac:add $NODE1_MAC mac:add $NODE4_MAC
33                 ;;
34         $NODE3_MAC)
35                 ifconfig $WLAN inet $NODE3_IP
36                 ifconfig $WLAN mac:add $NODE1_MAC mac:add $NODE5_MAC
37                 ;;
38         $NODE4_MAC)
39                 ifconfig $WLAN inet $NODE4_IP
40                 ifconfig $WLAN mac:add $NODE2_MAC
41                 ;;
42         $NODE5_MAC)
43                 ifconfig $WLAN inet $NODE5_IP
44                 ifconfig $WLAN mac:add $NODE3_MAC
45                 ;;
46 esac
47 ifconfig $WLAN up