diff options
author | Florian Fainelli <florian@openwrt.org> | 2007-09-15 21:01:43 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2007-09-15 21:01:43 +0000 |
commit | ea48798b9fab8cf30f83eb3d397f6be5c3ba187a (patch) | |
tree | 60aaa10ad79c553f7204f63abe95a93279a21e41 /package/linux-atm/files | |
parent | 5011d6129c138c5a2597357efe27ba5629058819 (diff) | |
download | mtk-20170518-ea48798b9fab8cf30f83eb3d397f6be5c3ba187a.zip mtk-20170518-ea48798b9fab8cf30f83eb3d397f6be5c3ba187a.tar.gz mtk-20170518-ea48798b9fab8cf30f83eb3d397f6be5c3ba187a.tar.bz2 |
Add support for IP over ATM
SVN-Revision: 8782
Diffstat (limited to 'package/linux-atm/files')
-rw-r--r-- | package/linux-atm/files/ipoa.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/package/linux-atm/files/ipoa.sh b/package/linux-atm/files/ipoa.sh new file mode 100644 index 0000000..5d6da1e --- /dev/null +++ b/package/linux-atm/files/ipoa.sh @@ -0,0 +1,34 @@ +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 +} |