1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-26 00:32:25 +02:00
openwrt-xburst/package/linux-atm/files/ipoa.sh
florian 49e910b9cd Add support for IP over ATM
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8782 3c298f89-4303-0410-b956-a3cf2f4a3e73
2007-09-15 21:01:43 +00:00

35 lines
709 B
Bash

scan_ipoa() {
config_get ifname "$1" ifname
ipoadev="${ipoadev:-0}"
config_get unit "$1" unit
[ -z "$unit" ] && {
config_set "$1" ifname "atm$ipoadev"
config_set "$1" unit "$ipoadev"
ipoadev="$(($ipoadev + 1))"
}
}
setup_interface_ipoa() {
local iface="$1"
local config="$2"
config_get device "$config" device
config_get vpi "$config" vpi
vpi=${vpi:-8}
config_get vci "$config" vci
vci=${vci:-36}
config_get encaps "$config" encaps
case "$encaps" in
1|vc) ENCAPS="vc-encaps" ;;
*) ENCAPS="llc-encaps" ;;
esac
config_get mtu "$cfg" mtu
mtu=${mtu:-1500}
atmarp -c $device
ifconfig $device $ip netmask $mask mtu $mtu up
atmarp -s $gw $vpi.$vci null
route add default gw $gw
}