summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-08-30 22:05:50 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-08-30 22:05:50 +0000
commita60a5619f3e4f88d11deacd1d66a48d90cd8ea8e (patch)
tree80974ffe6fabf9cfc2ece6d549b242afd91bb188 /sbin
parentc0819d14d875b0de179ae9fa19f74fbe6c8e8354 (diff)
downloadpfsense-a60a5619f3e4f88d11deacd1d66a48d90cd8ea8e.zip
pfsense-a60a5619f3e4f88d11deacd1d66a48d90cd8ea8e.tar.gz
Add athctrl.sh which helps in setting distance
Diffstat (limited to 'sbin')
-rwxr-xr-xsbin/athctrl.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/sbin/athctrl.sh b/sbin/athctrl.sh
new file mode 100755
index 0000000..6a42ae1
--- /dev/null
+++ b/sbin/athctrl.sh
@@ -0,0 +1,41 @@
+#! /bin/sh
+#
+# Set the IFS parameters for an interface configured for
+# point-to-point use at a specific distance. Based on a
+# program by Gunter Burchardt.
+#
+DEV=ath0
+d=0
+
+usage()
+{
+ echo "Usage: $0 [-i athX] [-d meters]"
+ exit 2
+}
+
+args=`getopt d:i: $*`
+test $? -ne 0 && usage
+
+set -- $args
+for i; do
+ case "$i" in
+ -i) DEV="$2"; shift; shift;;
+ -d) d="$2"; shift; shift;;
+ --) shift; break;
+ esac
+done
+
+test $d -eq 0 && usage
+
+slottime=`expr 9 + \( $d / 300 \)`
+if expr \( $d % 300 \) != 0 >/dev/null 2>&1; then
+ slottime=`expr $slottime + 1`
+fi
+timeout=`expr $slottime \* 2 + 3`
+
+printf "Setup IFS parameters on interface ${DEV} for %i meter p-2-p link\n" $d
+ATHN=`echo $DEV | sed 's/ath//'`
+sysctl dev.ath.$ATHN.slottime=$slottime
+sysctl dev.ath.$ATHN.acktimeout=$timeout
+sysctl dev.ath.$ATHN.ctstimeout=$timeout
+
OpenPOWER on IntegriCloud