Add ptrtd (#1402)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@6388 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
aebcd3b68b
commit
6229f2c2aa
49
ipv6/ptrtd/Makefile
Normal file
49
ipv6/ptrtd/Makefile
Normal file
@ -0,0 +1,49 @@
|
||||
#
|
||||
# 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:=ptrtd
|
||||
PKG_VERSION:=0.5.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://v6web.litech.org/ptrtd/dist/
|
||||
PKG_MD5SUM:=bfe026445fdc4fe509a9c70ec4551744
|
||||
PKG_CAT:=zcat
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ptrtd
|
||||
SECTION:=ipv6
|
||||
CATEGORY:=IPv6
|
||||
DEPENDS:=+kmod-ipv6 +kmod-tun +ip
|
||||
TITLE:=Portable Transport Relay Translator Daemon
|
||||
DESCRIPTION:=\
|
||||
The Portable Transport Relay Translator Daemon (pTRTd)\\\
|
||||
is a method of allowing IPv6 hosts to communicate with IPv4 hosts.
|
||||
URL:=http://v6web.litech.org/ptrtd/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
CC=$(TARGET_CC) \
|
||||
all
|
||||
endef
|
||||
|
||||
define Package/ptrtd/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/ptrtd.init $(1)/etc/init.d/ptrtd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ptrtd))
|
26
ipv6/ptrtd/files/ptrtd.init
Normal file
26
ipv6/ptrtd/files/ptrtd.init
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
|
||||
START=60
|
||||
BIN=ptrtd
|
||||
RUN_D=/var/run
|
||||
PID_F=$RUN_D/$BIN.pid
|
||||
|
||||
PREFIX="3ffe:abcd:1234:9876::"
|
||||
LEN=64
|
||||
|
||||
|
||||
start() {
|
||||
mkdir -p $RUN_D
|
||||
$BIN -p $PREFIX -l $LEN
|
||||
}
|
||||
|
||||
stop() {
|
||||
[ -f $PID_F ] && kill $(cat $PID_F)
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
41
ipv6/ptrtd/patches/100-ptrtd-0.5.2-openwrt.patch
Normal file
41
ipv6/ptrtd/patches/100-ptrtd-0.5.2-openwrt.patch
Normal file
@ -0,0 +1,41 @@
|
||||
--- ptrtd-0.5.2/ptrtd.old 2007-02-22 16:10:57.896689015 +0100
|
||||
+++ ptrtd-0.5.2/ptrtd.c 2007-02-22 16:11:39.194388792 +0100
|
||||
@@ -201,13 +201,13 @@
|
||||
if( do_config )
|
||||
{
|
||||
printf( "Tunnel: %s\n", ifname );
|
||||
- sprintf( cmd, "/sbin/ip link set %s up", ifname );
|
||||
+ sprintf( cmd, "/usr/sbin/ip link set %s up", ifname );
|
||||
printf( "command: %s\n", cmd );
|
||||
system( cmd );
|
||||
- sprintf( cmd, "/sbin/ip addr add fe80::1/64 dev %s", ifname );
|
||||
+ sprintf( cmd, "/usr/sbin/ip addr add fe80::1/64 dev %s", ifname );
|
||||
printf( "command: %s\n", cmd );
|
||||
system( cmd );
|
||||
- sprintf( cmd, "/sbin/ip route add %s/%d dev %s via fe80::5",
|
||||
+ sprintf( cmd, "/usr/sbin/ip route add %s/%d dev %s via fe80::5",
|
||||
prefix, plen, ifname );
|
||||
printf( "command: %s\n", cmd );
|
||||
system( cmd );
|
||||
--- ptrtd-0.5.2/tap802ipd.old 2007-02-22 16:11:22.600920230 +0100
|
||||
+++ ptrtd-0.5.2/tap802ipd.c 2007-02-22 16:11:51.040581581 +0100
|
||||
@@ -125,16 +125,16 @@
|
||||
|
||||
tap_get_name( (struct iface *)tap_iface, ifname );
|
||||
printf( "Tunnel: %s\n", ifname );
|
||||
- sprintf( cmd, "/sbin/ip link set %s address %02x:%02x:%02x:%02x:%02x:%02x up\n", ifname,
|
||||
+ sprintf( cmd, "/usr/sbin/ip link set %s address %02x:%02x:%02x:%02x:%02x:%02x up\n", ifname,
|
||||
ip_iface->hwaddr[0], ip_iface->hwaddr[1],
|
||||
ip_iface->hwaddr[2], ip_iface->hwaddr[3],
|
||||
ip_iface->hwaddr[4], ip_iface->hwaddr[5] );
|
||||
printf( "command: %s\n", cmd );
|
||||
system( cmd );
|
||||
- //sprintf( cmd, "/sbin/ip addr add fe80::1/64 dev %s", ifname );
|
||||
+ //sprintf( cmd, "/usr/sbin/ip addr add fe80::1/64 dev %s", ifname );
|
||||
//printf( "command: %s\n", cmd );
|
||||
//system( cmd );
|
||||
- //sprintf( cmd, "/sbin/ip route add %s/%d dev %s via fe80::5", prefix, plen, ifname );
|
||||
+ //sprintf( cmd, "/usr/sbin/ip route add %s/%d dev %s via fe80::5", prefix, plen, ifname );
|
||||
//printf( "command: %s\n", cmd );
|
||||
//system( cmd );
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user