-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaxup
52 lines (45 loc) · 1.98 KB
/
axup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
#
# This script is written to help configure an axport
set -e
if [ -z "$1" ] || [ -z "$2" ]
then echo "Usage: $0 [tty] [axport]"
exit 1;
fi
# Init TNC (optional)
if [ -n "$TNC_INIT_CMD" ]; then
eval "$TNC_INIT_CMD"
fi
if [ "$3" -eq "9600" ]; then
/usr/sbin/kissattach -l $1 $2
/usr/sbin/kissparms -p $2 -t 100 -l 10 -s 0 -r 255 -f n
echo 7 > /proc/sys/net/ax25/ax0/standard_window_size # 2-7 (max frames)
echo 255 > /proc/sys/net/ax25/ax0/maximum_packet_length # 1-512 (paclen)
echo 3100 > /proc/sys/net/ax25/ax0/t1_timeout # (Frack /1000 = seconds)
echo 800 > /proc/sys/net/ax25/ax0/t2_timeout # (RESPtime /1000 = seconds)
echo 300000 > /proc/sys/net/ax25/ax0/t3_timeout # (Check /1000 = seconds)
echo 100000 > /proc/sys/net/ax25/ax0/idle_timeout # (/10000(?) = seconds)
echo 5 > /proc/sys/net/ax25/ax0/maximum_retry_count # n
echo 2 > /proc/sys/net/ax25/ax0/connect_mode # 0 = None, 1 = Network, 2 = All
echo 10000 > /proc/sys/net/ipv4/neigh/ax0/retrans_time_ms #crank ARP transmit time to 10s
elif [ "$3" -eq "1200" ]; then
/usr/sbin/kissattach -l $1 $2
/usr/sbin/kissparms -p $2 -t 250 -l 10 -s 20 -r 80 -f n
echo 1 > /proc/sys/net/ax25/ax0/standard_window_size
echo 1 > /proc/sys/net/ax25/ax0/extended_window_size
echo 255 > /proc/sys/net/ax25/ax0/maximum_packet_length
echo 2000 > /proc/sys/net/ax25/ax0/t1_timeout
echo 1000 > /proc/sys/net/ax25/ax0/t2_timeout
echo 300000 > /proc/sys/net/ax25/ax0/t3_timeout
echo 100000 > /proc/sys/net/ax25/ax0/idle_timeout
echo 5 > /proc/sys/net/ax25/ax0/maximum_retry_count
echo 2 > /proc/sys/net/ax25/ax0/connect_mode
echo 10000 > /proc/sys/net/ipv4/neigh/ax0/retrans_time_ms #crank ARP transmit time to 10s
else
echo "Invalid HBAUD $3"
return 1;
fi
if [ -z "$4" ]
then exit 0; #user does not require an ip, exit
fi
/sbin/ip addr add $4 dev ax0 #should find a way to have interface name more dynamic