Projet

Général

Profil

Télécharger (819 octets) Statistiques
| Branche: | Tag: | Révision:

univnautes / sbin / athctrl.sh @ master

1
#!/bin/sh
2
#
3
# Set the IFS parameters for an interface configured for
4
# point-to-point use at a specific distance.  Based on a
5
# program by Gunter Burchardt.
6
#
7
DEV=ath0
8
d=0
9

    
10
usage()
11
{
12
	echo "Usage: $0 [-i athX] [-d meters]"
13
	exit 2
14
}
15

    
16
args=`getopt d:i: $*`
17
test $? -ne 0 && usage
18

    
19
set -- $args
20
for i; do
21
	case "$i" in
22
	-i)	DEV="$2"; shift; shift;;
23
	-d)	d="$2"; shift; shift;;
24
	--)	shift; break;
25
	esac
26
done
27

    
28
test $d -eq 0 && usage
29

    
30
slottime=`expr 9 + \( $d / 300 \)`
31
if expr \( $d % 300 \) != 0 >/dev/null 2>&1; then
32
	slottime=`expr $slottime + 1`
33
fi
34
timeout=`expr $slottime \* 2 + 3`
35

    
36
printf "Setup IFS parameters on interface ${DEV} for %i meter p-2-p link\n" $d
37
ATHN=`echo $DEV | sed 's/ath//'`
38
sysctl dev.ath.$ATHN.slottime=$slottime
39
sysctl dev.ath.$ATHN.acktimeout=$timeout
40
sysctl dev.ath.$ATHN.ctstimeout=$timeout
41

    
(1-1/2)