aboutsummaryrefslogtreecommitdiffstats
path: root/package/linux-atm/files
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2007-09-15 21:01:43 +0000
committerFlorian Fainelli <florian@openwrt.org>2007-09-15 21:01:43 +0000
commita37e5a6bf16cf108d21c174af0a6bb9a25b51a2f (patch)
treef1b9304875a516fda2352e9c9dabd111a4112cad /package/linux-atm/files
parent7437b1ce7d860d3d0501942d6d3536c07d1ef4aa (diff)
downloadupstream-a37e5a6bf16cf108d21c174af0a6bb9a25b51a2f.tar.gz
upstream-a37e5a6bf16cf108d21c174af0a6bb9a25b51a2f.tar.bz2
upstream-a37e5a6bf16cf108d21c174af0a6bb9a25b51a2f.zip
Add support for IP over ATM
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8782 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/linux-atm/files')
-rw-r--r--package/linux-atm/files/ipoa.sh34
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 0000000000..5d6da1ef95
--- /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
+}