From aab973fd38f8146096c7afa0984b0302e46d0aa4 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sat, 15 Sep 2007 21:01:43 +0000 Subject: [PATCH] Add support for IP over ATM SVN-Revision: 8782 --- package/linux-atm/Makefile | 20 ++++++++ package/linux-atm/files/ipoa.sh | 34 +++++++++++++ .../linux-atm/patches/500-reenable_arpd.patch | 49 +++++++++++++++++++ .../linux-atm/patches/600-arpd_includes.patch | 45 +++++++++++++++++ 4 files changed, 148 insertions(+) create mode 100644 package/linux-atm/files/ipoa.sh create mode 100644 package/linux-atm/patches/500-reenable_arpd.patch create mode 100644 package/linux-atm/patches/600-arpd_includes.patch diff --git a/package/linux-atm/Makefile b/package/linux-atm/Makefile index f7d52141f3..ecadb3d6ad 100644 --- a/package/linux-atm/Makefile +++ b/package/linux-atm/Makefile @@ -29,6 +29,18 @@ define Package/linux-atm/description This package contains a library for accessing the Linux ATM subsystem. endef +define Package/atm-tools + SECTION:=net + CATEGORY:=Network + DEPENDS:=linux-atm + TITLE:=Linux ATM tools + URL:=http://linux-atm.sourceforge.net/ +endef + +define Package/atm-tools/description + This package contains the Linux ATM tools. +endef + define Build/Configure $(call Build/Configure/Default) # prevent autoheader invocation @@ -62,4 +74,12 @@ define Package/linux-atm/install cp -f $(PKG_INSTALL_DIR)/usr/lib/libatm.so.1 $(1)/usr/lib endef +define Package/atm-tools/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/atmarp{,d} $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/lib/network + $(INSTALL_BIN) ./files/ipoa.sh $(1)/lib/network/ +endef + $(eval $(call BuildPackage,linux-atm)) +$(eval $(call BuildPackage,atm-tools)) 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 +} diff --git a/package/linux-atm/patches/500-reenable_arpd.patch b/package/linux-atm/patches/500-reenable_arpd.patch new file mode 100644 index 0000000000..1e42f75a5a --- /dev/null +++ b/package/linux-atm/patches/500-reenable_arpd.patch @@ -0,0 +1,49 @@ +diff -urN linux-atm-2.4.1/configure linux-atm-2.4.1.new/configure +--- linux-atm-2.4.1/configure 2007-09-15 21:07:25.000000000 +0200 ++++ linux-atm-2.4.1.new/configure 2007-09-15 22:07:22.000000000 +0200 +@@ -8825,7 +8825,7 @@ + fi; + + +- ac_config_files="$ac_config_files Makefile doc/Makefile m4/Makefile src/Makefile src/include/Makefile src/lib/Makefile" ++ ac_config_files="$ac_config_files Makefile doc/Makefile m4/Makefile src/Makefile src/include/Makefile src/lib/Makefile src/arpd/Makefile" + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure + # tests run on this system so they can be shared between configure +@@ -9367,6 +9367,7 @@ + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;; + "src/lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;; ++ "src/arpd/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/arpd/Makefile" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +diff -urN linux-atm-2.4.1/configure.in linux-atm-2.4.1.new/configure.in +--- linux-atm-2.4.1/configure.in 2007-09-15 21:07:13.000000000 +0200 ++++ linux-atm-2.4.1.new/configure.in 2007-09-15 21:08:16.000000000 +0200 +@@ -153,5 +153,6 @@ + src/Makefile \ + src/include/Makefile \ + src/lib/Makefile \ ++ src/arpd/Makefile \ + ) + +diff -urN linux-atm-2.4.1/src/Makefile.am linux-atm-2.4.1.new/src/Makefile.am +--- linux-atm-2.4.1/src/Makefile.am 2007-09-15 21:07:13.000000000 +0200 ++++ linux-atm-2.4.1.new/src/Makefile.am 2007-09-15 21:08:27.000000000 +0200 +@@ -1,2 +1,2 @@ +-SUBDIRS = include lib ++SUBDIRS = include lib arpd + +diff -urN linux-atm-2.4.1/src/Makefile.in linux-atm-2.4.1.new/src/Makefile.in +--- linux-atm-2.4.1/src/Makefile.in 2007-09-15 21:07:25.000000000 +0200 ++++ linux-atm-2.4.1.new/src/Makefile.in 2007-09-15 22:10:03.000000000 +0200 +@@ -96,7 +96,7 @@ + VERSION = @VERSION@ + YACC = @YACC@ + +-SUBDIRS = include lib ++SUBDIRS = include lib arpd + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = ../config.h + CONFIG_CLEAN_FILES = diff --git a/package/linux-atm/patches/600-arpd_includes.patch b/package/linux-atm/patches/600-arpd_includes.patch new file mode 100644 index 0000000000..c753802766 --- /dev/null +++ b/package/linux-atm/patches/600-arpd_includes.patch @@ -0,0 +1,45 @@ +diff -Nru linux-atm-2.4.1.orig/src/arpd/io.c linux-atm-2.4.1/src/arpd/io.c +--- linux-atm-2.4.1.orig/src/arpd/io.c 2001-09-03 21:41:05.000000000 +0300 ++++ linux-atm-2.4.1/src/arpd/io.c 2007-04-14 18:30:54.000000000 +0300 +@@ -16,7 +16,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include /* for CLIP_DEFAULT_IDLETIMER */ +diff -urN linux-atm-2.4.1/src/arpd/arp.c linux-atm-2.4.1.new/src/arpd/arp.c +--- linux-atm-2.4.1/src/arpd/arp.c 2001-09-03 20:41:05.000000000 +0200 ++++ linux-atm-2.4.1.new/src/arpd/arp.c 2007-09-15 22:15:05.000000000 +0200 +@@ -15,7 +15,6 @@ + #include + #include /* for linux/if_arp.h */ + #include /* for ntohs, etc. */ +-#define _LINUX_NETDEVICE_H /* very crude hack for glibc2 */ + #include + #include + #include +diff -urN linux-atm-2.4.1/src/arpd/io.c linux-atm-2.4.1.new/src/arpd/io.c +--- linux-atm-2.4.1/src/arpd/io.c 2001-09-03 20:41:05.000000000 +0200 ++++ linux-atm-2.4.1.new/src/arpd/io.c 2007-09-15 22:15:05.000000000 +0200 +@@ -21,7 +21,6 @@ + #include + #include /* for CLIP_DEFAULT_IDLETIMER */ + #include +-#define _LINUX_NETDEVICE_H /* glibc2 */ + #include + + #include "atmd.h" +diff -urN linux-atm-2.4.1/src/arpd/itf.c linux-atm-2.4.1.new/src/arpd/itf.c +--- linux-atm-2.4.1/src/arpd/itf.c 2001-09-03 20:41:05.000000000 +0200 ++++ linux-atm-2.4.1.new/src/arpd/itf.c 2007-09-15 22:15:05.000000000 +0200 +@@ -12,7 +12,6 @@ + #include + #include + #include +-#define _LINUX_NETDEVICE_H /* glibc2 */ + #include + + #include "atmd.h" -- 2.30.2