aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2013-01-31 00:29:16 +0800
committerume <ume@FreeBSD.org>2013-01-31 00:29:16 +0800
commit7e06fb2dbf269ad920e2d30eddf0025b17b37278 (patch)
tree7962e9ff83634da29d7846460d458366f7b3a41f /net
parenta848b55a6339334818088f3ed697f33a4dd8d7be (diff)
downloadfreebsd-ports-gnome-7e06fb2dbf269ad920e2d30eddf0025b17b37278.tar.gz
freebsd-ports-gnome-7e06fb2dbf269ad920e2d30eddf0025b17b37278.tar.zst
freebsd-ports-gnome-7e06fb2dbf269ad920e2d30eddf0025b17b37278.zip
Add new port -- User-space 6rd (RFC 5569) implementation
Diffstat (limited to 'net')
-rw-r--r--net/Makefile1
-rw-r--r--net/u6rd/Makefile35
-rw-r--r--net/u6rd/distinfo2
-rw-r--r--net/u6rd/files/u6rd.in83
-rw-r--r--net/u6rd/pkg-descr7
5 files changed, 128 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile
index 8c4b2bf80e3f..c5b4bb9e3453 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -1177,6 +1177,7 @@
SUBDIR += tucan
SUBDIR += twinkle
SUBDIR += twitux
+ SUBDIR += u6rd
SUBDIR += ucarp
SUBDIR += udptunnel
SUBDIR += udpxy
diff --git a/net/u6rd/Makefile b/net/u6rd/Makefile
new file mode 100644
index 000000000000..04ed4f5edb09
--- /dev/null
+++ b/net/u6rd/Makefile
@@ -0,0 +1,35 @@
+# $FreeBSD$
+
+PORTNAME= u6rd
+PORTVERSION= 1.5
+#PORTREVISION= 0
+CATEGORIES= net ipv6
+MASTER_SITES= http://ftp.scythe.jp/pub/u6rd/release/
+
+MAINTAINER= ume@FreeBSD.org
+COMMENT= User-space 6rd (RFC 5569) implementation
+
+LICENSE= BSD
+
+GNU_CONFIGURE= yes
+USE_RC_SUBR= u6rd
+
+MAN8= u6rd.8
+
+PLIST_FILES= sbin/u6rd
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MDOCS}
+PORTDOCS= NEWS README
+.endif
+
+post-install:
+.if ${PORT_OPTIONS:MDOCS}
+ @${MKDIR} ${DOCSDIR}
+.for f in ${PORTDOCS}
+ ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
+.endfor
+.endif
+
+.include <bsd.port.mk>
diff --git a/net/u6rd/distinfo b/net/u6rd/distinfo
new file mode 100644
index 000000000000..6c26e59c3d03
--- /dev/null
+++ b/net/u6rd/distinfo
@@ -0,0 +1,2 @@
+SHA256 (u6rd-1.5.tar.gz) = d6918c6c8d192e0b62d5e9035542865ea06b10d9d5684695dea7c5a35d620b61
+SIZE (u6rd-1.5.tar.gz) = 30466
diff --git a/net/u6rd/files/u6rd.in b/net/u6rd/files/u6rd.in
new file mode 100644
index 000000000000..faa156b0154f
--- /dev/null
+++ b/net/u6rd/files/u6rd.in
@@ -0,0 +1,83 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: u6rd
+# REQUIRE: SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+u6rd_enable=${u6rd_enable:-"NO"}
+u6rd_prefix=${u6rd_prefix:-""} # 6rd prefix from your ISP (prefix/len)
+u6rd_relay_v4_addr=${u6rd_relay_v4_addr:-""} # 6rd relay router of your ISP
+u6rd_my_v4_addr=${u6rd_my_v4_addr:-""} # Your global IPv4 address
+u6rd_my_v6_addr=${u6rd_my_v6_addr:-""} # Your global IPv6 address (addr/len)
+u6rd_defaultrouter=${u6rd_defaultrouter:-""}
+u6rd_interface=${u6rd_interface:-"tun0"}
+u6rd_username=${u6rd_username:-"nobody"}
+
+. /etc/rc.subr
+
+name="u6rd"
+rcvar=u6rd_enable
+command="%%PREFIX%%/sbin/${name}"
+pidfile="/var/run/${name}.pid"
+
+start_precmd=start_precmd
+stop_postcmd=stop_postcmd
+
+get_plen()
+{
+ local prefix plen
+ prefix="$1"
+ plen=$(expr "${prefix}" : '.*/\([0-9]*\)')
+ if [ -z "${plen}" ]; then
+ plen=64
+ fi
+ echo ${plen}
+}
+
+plen_equal()
+{
+ if [ -z "$1" -o -z "$2" ]; then
+ return 1
+ fi
+ if [ $(get_plen "$1") -ne $(get_plen "$2") ]; then
+ return 1
+ fi
+ return 0
+}
+
+start_precmd()
+{
+ ifconfig ${u6rd_interface} create
+ ifconfig ${u6rd_interface} inet6 -nud -ifdisabled
+ if [ -n "${u6rd_my_v6_addr}" ]; then
+ ifconfig ${u6rd_interface} inet6 ${u6rd_my_v6_addr}
+ fi
+ ifconfig ${u6rd_interface} up
+ if ! plen_equal ${u6rd_prefix} ${u6rd_my_v6_addr}; then
+ route delete -inet6 ${u6rd_prefix} >/dev/null 2>&1
+ route add -inet6 ${u6rd_prefix} ::1 -ifp ${u6rd_interface}
+ fi
+ if [ -n "${u6rd_defaultrouter}" ]; then
+ route delete -inet6 default >/dev/null 2>&1
+ route add -inet6 default ${u6rd_defaultrouter}
+ fi
+}
+
+stop_postcmd()
+{
+ if [ -n "${u6rd_defaultrouter}" ]; then
+ route delete -inet6 default
+ fi
+ if ! plen_equal ${u6rd_prefix} ${u6rd_my_v6_addr}; then
+ route delete -inet6 ${u6rd_prefix}
+ fi
+ ifconfig ${u6rd_interface} destroy
+}
+
+load_rc_config ${name}
+command_args="-u ${u6rd_username} ${u6rd_interface} ${u6rd_prefix} ${u6rd_relay_v4_addr} ${u6rd_my_v4_addr}"
+run_rc_command "$1"
diff --git a/net/u6rd/pkg-descr b/net/u6rd/pkg-descr
new file mode 100644
index 000000000000..550ce9e1e9e0
--- /dev/null
+++ b/net/u6rd/pkg-descr
@@ -0,0 +1,7 @@
+The u6rd is a user-space 6rd (RFC 5569) implementation, which uses
+tun(4) and the raw socket interface.
+The u6rd daemon runs on the 6rd border router of a 6rd site that is
+isolated from the native IPv6 Internet. It does not provide the
+functionality of 6rd "relay" routers.
+
+WWW: http://www.scythe.jp/lab/u6rd/