Port parprouted to -ng
authorFlorian Fainelli <florian@openwrt.org>
Sun, 6 Aug 2006 14:27:00 +0000 (14:27 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Sun, 6 Aug 2006 14:27:00 +0000 (14:27 +0000)
SVN-Revision: 4490

net/parprouted/Makefile [new file with mode: 0644]
net/parprouted/files/parprouted.default [new file with mode: 0755]
net/parprouted/files/parprouted.init [new file with mode: 0755]
net/parprouted/patches/parprouted.patch [new file with mode: 0644]

diff --git a/net/parprouted/Makefile b/net/parprouted/Makefile
new file mode 100644 (file)
index 0000000..455802a
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=parprouted
+PKG_VERSION:=0.63
+PKG_RELEASE:=1
+PKG_MD5SUM:=12753098a22e82997d1941d6d2284750
+
+PKG_SOURCE_URL:=http://www.hazard.maks.net/parprouted/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_CAT:=zcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/parprouted
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Proxy ARP daemon
+  DESCRIPTION:=parprouted is a daemon for transparent IP (Layer 3) proxy ARP bridging.\\\
+       This is useful for creation of transparent firewalls and bridging networks\\\
+       with different MAC protocols. Also, unlike standard bridging, proxy ARP\\\
+       bridging allows to bridge Ethernet networks behind wireless nodes without\\\
+       using WDS or layer 2 bridging.\\\
+ URL:=http://www.hazard.maks.net/parprouted/
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="" \
+               all
+endef
+
+define Package/parprouted/install      
+       install -d -m0755 $(1)/etc/default
+       install -m0755 ./files/parprouted.default $(1)/etc/default/parprouted
+       install -d -m0755 $(1)/etc/init.d
+       install -m0755 ./files/parprouted.init $(1)/etc/init.d/parprouted
+       ln -sf parprouted $(1)/etc/init.d/S50parpouted
+       install -d -m0755 $(1)/usr/sbin
+       install -m0755 $(PKG_BUILD_DIR)/parprouted $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,parprouted))
diff --git a/net/parprouted/files/parprouted.default b/net/parprouted/files/parprouted.default
new file mode 100755 (executable)
index 0000000..7128a56
--- /dev/null
@@ -0,0 +1 @@
+OPTIONS="$lan_ifname $wifi_ifname"
diff --git a/net/parprouted/files/parprouted.init b/net/parprouted/files/parprouted.init
new file mode 100755 (executable)
index 0000000..2422657
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+BIN=parprouted
+DEFAULT=/etc/default/$BIN
+[ -f $DEFAULT ] && . $DEFAULT
+
+case $1 in
+ start)
+  $BIN $OPTIONS
+  ;;
+ *)
+  echo "usage: $0 (start)"
+  exit 1
+esac
+
+exit $?
diff --git a/net/parprouted/patches/parprouted.patch b/net/parprouted/patches/parprouted.patch
new file mode 100644 (file)
index 0000000..17fbdec
--- /dev/null
@@ -0,0 +1,33 @@
+diff -rupw parprouted-0.63/arp.c parprouted-0.63-1/arp.c
+--- parprouted-0.63/arp.c      2004-05-23 14:06:31.000000000 +0200
++++ parprouted-0.63-1/arp.c    2005-03-13 16:10:18.000000000 +0100
+@@ -366,7 +366,7 @@ void *arp(char *ifname) 
+     do {
+       pthread_testcancel();
+       /* Sleep a bit in order not to overload the system */
+-      usleep(300);
++      usleep(3000);
+       if (arp_recv(sock, &frame) <= 0)
+           continue;
+diff -rupw parprouted-0.63/parprouted.c parprouted-0.63-1/parprouted.c
+--- parprouted-0.63/parprouted.c       2004-01-30 02:45:43.000000000 +0100
++++ parprouted-0.63-1/parprouted.c     2005-03-20 09:14:35.000000000 +0100
+@@ -93,7 +93,7 @@ void processarp(int cleanup) 
+           /* added route to the kernel */
+           if (snprintf(routecmd_str, ROUTE_CMD_LEN-1, 
+-                   "/sbin/ip route add %s/32 metric 50 dev %s scope link",
++                   "/sbin/route add -host %s metric 50 dev %s",
+                    inet_ntoa(cur_entry->ipaddr_ia), cur_entry->ifname) > ROUTE_CMD_LEN-1) 
+           {
+               syslog(LOG_INFO, "ip route command too large to fit in buffer!");
+@@ -112,7 +112,7 @@ void processarp(int cleanup) 
+           /* remove entry from arp table and remove route from kernel */
+           if (snprintf(routecmd_str, ROUTE_CMD_LEN-1, 
+-                   "/sbin/ip route del %s/32 metric 50 dev %s scope link",
++                   "/sbin/route del -host %s metric 50 dev %s",
+                    inet_ntoa(cur_entry->ipaddr_ia), cur_entry->ifname) > ROUTE_CMD_LEN-1) 
+           {
+               syslog(LOG_INFO, "ip route command too large to fit in buffer!");