Date: Wed, 30 Jan 2013 16:29:16 +0000 (UTC) From: Hajimu UMEMOTO <ume@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r311234 - in head/net: . u6rd u6rd/files Message-ID: <201301301629.r0UGTGsx002946@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ume Date: Wed Jan 30 16:29:16 2013 New Revision: 311234 URL: http://svnweb.freebsd.org/changeset/ports/311234 Log: Add new port -- User-space 6rd (RFC 5569) implementation Added: head/net/u6rd/ head/net/u6rd/Makefile (contents, props changed) head/net/u6rd/distinfo (contents, props changed) head/net/u6rd/files/ head/net/u6rd/files/u6rd.in (contents, props changed) head/net/u6rd/pkg-descr (contents, props changed) Modified: head/net/Makefile Modified: head/net/Makefile ============================================================================== --- head/net/Makefile Wed Jan 30 16:24:11 2013 (r311233) +++ head/net/Makefile Wed Jan 30 16:29:16 2013 (r311234) @@ -1177,6 +1177,7 @@ SUBDIR += tucan SUBDIR += twinkle SUBDIR += twitux + SUBDIR += u6rd SUBDIR += ucarp SUBDIR += udptunnel SUBDIR += udpxy Added: head/net/u6rd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/u6rd/Makefile Wed Jan 30 16:29:16 2013 (r311234) @@ -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> Added: head/net/u6rd/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/u6rd/distinfo Wed Jan 30 16:29:16 2013 (r311234) @@ -0,0 +1,2 @@ +SHA256 (u6rd-1.5.tar.gz) = d6918c6c8d192e0b62d5e9035542865ea06b10d9d5684695dea7c5a35d620b61 +SIZE (u6rd-1.5.tar.gz) = 30466 Added: head/net/u6rd/files/u6rd.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/u6rd/files/u6rd.in Wed Jan 30 16:29:16 2013 (r311234) @@ -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" Added: head/net/u6rd/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/u6rd/pkg-descr Wed Jan 30 16:29:16 2013 (r311234) @@ -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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301301629.r0UGTGsx002946>