nstxd allows a nstx client daemon to tunnel IP traffic through DNS requests

to the machine running nstxd.

PR:		ports/110716
Submitted by:	nagilum
This commit is contained in:
Martin Wilke
2007-03-23 17:53:36 +00:00
parent 003831588b
commit eaf6d87756
7 changed files with 120 additions and 0 deletions

View File

@@ -360,6 +360,7 @@
SUBDIR += nph
SUBDIR += ns
SUBDIR += nss_ldap
SUBDIR += nstxd
SUBDIR += ntalk
SUBDIR += ntop
SUBDIR += ntp

40
net/nstxd/Makefile Normal file
View File

@@ -0,0 +1,40 @@
# New ports collection makefile for: nstxd
# Date created: 1 April 2007
# Whom: nagilum
#
# $FreeBSD$
#
PORTNAME= nstxd
PORTVERSION= 1.1b6
CATEGORIES= net
MASTER_SITES= http://www.nagilum.org/nstx/ \
http://ftp.debian.org/debian/pool/main/n/nstx/
DISTNAME= nstx_1.1-beta6.orig
PATCH_SITES= http://www.nagilum.org/nstx/ \
http://ftp.debian.org/debian/pool/main/n/nstx/
PATCH_DIST_STRIP= -p1
PATCHFILES= nstx_1.1-beta6-4.diff.gz
MAINTAINER= freebsd@nagilum.org
COMMENT= DNS tunnel server
MAN8= nstxd.8
USE_RC_SUBR+= nstxd
WRKSRC= ${WRKDIR}/nstx-1.1-beta6
ALL_TARGET= nstxd
INSTALL_TARGET= nstxd
post-install:
${INSTALL_PROGRAM} ${WRKSRC}/nstxd ${PREFIX}/sbin
${INSTALL_MAN} ${WRKSRC}/nstxd.8 ${PREFIX}/man/man8/
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}/
@${CAT} pkg-message
.endif #NOPORTDOCS
.include <bsd.port.mk>

6
net/nstxd/distinfo Normal file
View File

@@ -0,0 +1,6 @@
MD5 (nstx_1.1-beta6.orig.tar.gz) = 275abd75a856b07a798b1f2360088cf5
SHA256 (nstx_1.1-beta6.orig.tar.gz) = 57a1962a66e9cb64fe70839d852c56cd253092260eab589a8173740b75b21450
SIZE (nstx_1.1-beta6.orig.tar.gz) = 20458
MD5 (nstx_1.1-beta6-4.diff.gz) = 6c071c5179bfa62917842dd32080c139
SHA256 (nstx_1.1-beta6-4.diff.gz) = f2fc046cc08831599f2a95c874b7a028238c73e1f2cd4964ee86aa4c4307b8a8
SIZE (nstx_1.1-beta6-4.diff.gz) = 7743

65
net/nstxd/files/nstxd.in Normal file
View File

@@ -0,0 +1,65 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nstxd
# REQUIRE: DAEMON
#
# Add the following lines to /etc/rc.conf to enable nstxd:
#
#nstxd_domain="<your nstx domain>"
#
# You can disable automatic startup specifying:
#
#nstxd_enable="NO"
#
# See nstxd(8) for flags.
#
# The default behavour of this script is to bind nstxd to the IP
# of the interface with default route.
# If you want it bind to the IP of a different interface you
# specify this interface in /etc/rc.conf:
#nstxd_interface="fxp0"
# If you have static IPs or you want nstxd to listen only a
# specific IP (e.g. 127.0.0.1) you can specify:
#nstxd_ip="127.0.0.1"
# in /etc/rc.conf
#
# This script can also take care of the tun interface configuration
# you simply put something like
#nstxd_ifconfig="172.16.1.1 172.16.1.2"
# in /etc/rc.conf to have this script automatically run
# ifconfig with the above parameter on the device opened by nstxd.
#
. %%RC_SUBR%%
name=nstxd
rcvar=`set_rcvar`
command=%%PREFIX%%/sbin/nstxd
load_rc_config ${name}
# set defaults
nstxd_interface=${nstxd_interface:-$(route get default|grep interface|cut -d: -f2)}
nstxd_ip=${nstxd_ip:-$(ifconfig ${nstxd_interface}|grep "inet "|xargs|cut -d' ' -f 2)}
if [ -n "${nstxd_domain}" ]
then nstxd_enable=${nstxd_enable:-"YES"}
else nstxd_enable="NO"
fi
nstxd_flags=${nstxd_flags:-"-D -i ${nstxd_ip} ${nstxd_domain}"}
tmpfile=$(mktemp /tmp/$(basename $0).XXXXXX) || exit 1
run_rc_command "$1" 2>&1|tee ${tmpfile}
nstx_if=$(grep "using device" ${tmpfile}|cut -d' ' -f5)
rm -f ${tmpfile}
if [ -n "${nstxd_ifconfig}" -a -n "${nstx_if}" ]
then echo "Configuring nstx interface: ifconfig ${nstx_if} ${nstxd_ifconfig} up"
ifconfig ${nstx_if} ${nstxd_ifconfig}
fi

3
net/nstxd/pkg-descr Normal file
View File

@@ -0,0 +1,3 @@
nstxd allows a nstx client daemon to tunnel IP traffic through DNS requests
to the machine running nstxd.
See %%PREFIX%%/share/doc/nstxd/README for more!

2
net/nstxd/pkg-message Normal file
View File

@@ -0,0 +1,2 @@
You need to be able to specify this host in the NS record of a domainname to use this program.
See ${PREFIX}/share/doc/nstxd/README for details!

3
net/nstxd/pkg-plist Normal file
View File

@@ -0,0 +1,3 @@
sbin/nstxd
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%@dirrm %%DOCSDIR%%