version 1.1.1.1, 2012/02/21 23:16:02
|
version 1.1.1.2, 2012/05/29 12:55:57
|
Line 2
|
Line 2
|
# $Id$ |
# $Id$ |
# miniupnp daemon |
# miniupnp daemon |
# http://miniupnp.free.fr or http://miniupnp.tuxfamily.org/ |
# http://miniupnp.free.fr or http://miniupnp.tuxfamily.org/ |
# (c) 2006-2010 Thomas Bernard | # (c) 2006-2011 Thomas Bernard |
# This software is subject to the conditions detailed in the |
# This software is subject to the conditions detailed in the |
# LICENCE file provided within the distribution |
# LICENCE file provided within the distribution |
|
|
Line 28 if [ -f /etc/platform ]; then
|
Line 28 if [ -f /etc/platform ]; then
|
fi |
fi |
fi |
fi |
|
|
|
# OpenWRT special case |
|
if [ -f ./os.openwrt ]; then |
|
OS_NAME=OpenWRT |
|
OS_VERSION=$(cat ./os.openwrt) |
|
fi |
|
|
${RM} ${CONFIGFILE} |
${RM} ${CONFIGFILE} |
|
|
echo "/* MiniUPnP Project" >> ${CONFIGFILE} |
echo "/* MiniUPnP Project" >> ${CONFIGFILE} |
echo " * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/" >> ${CONFIGFILE} |
echo " * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/" >> ${CONFIGFILE} |
echo " * (c) 2006-2010 Thomas Bernard" >> ${CONFIGFILE} | echo " * (c) 2006-2011 Thomas Bernard" >> ${CONFIGFILE} |
echo " * generated by $0 on `date` */" >> ${CONFIGFILE} |
echo " * generated by $0 on `date` */" >> ${CONFIGFILE} |
echo "#ifndef $CONFIGMACRO" >> ${CONFIGFILE} |
echo "#ifndef $CONFIGMACRO" >> ${CONFIGFILE} |
echo "#define $CONFIGMACRO" >> ${CONFIGFILE} |
echo "#define $CONFIGMACRO" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
echo "#include <inttypes.h>" >> ${CONFIGFILE} |
echo "#include <inttypes.h>" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
|
echo "#define MINIUPNPD_VERSION \"`cat VERSION`\"" >> ${CONFIGFILE} |
|
echo "" >> ${CONFIGFILE} |
echo "#define UPNP_VERSION \"$UPNP_VERSION\"" >> ${CONFIGFILE} |
echo "#define UPNP_VERSION \"$UPNP_VERSION\"" >> ${CONFIGFILE} |
|
|
# OS Specific stuff |
# OS Specific stuff |
Line 61 case $OS_NAME in
|
Line 69 case $OS_NAME in
|
fi |
fi |
echo "#define USE_PF 1" >> ${CONFIGFILE} |
echo "#define USE_PF 1" >> ${CONFIGFILE} |
FW=pf |
FW=pf |
|
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} |
OS_URL=http://www.openbsd.org/ |
OS_URL=http://www.openbsd.org/ |
;; |
;; |
FreeBSD) |
FreeBSD) |
Line 70 case $OS_NAME in
|
Line 79 case $OS_NAME in
|
fi |
fi |
# new way to see which one to use PF or IPF. |
# new way to see which one to use PF or IPF. |
# see http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=957 |
# see http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=957 |
# source file with handy subroutines like checkyesno | # source file wource config file so we can probe vars |
. /etc/rc.subr | if [ -f /etc/rc.subr ] && [ -f /etc/rc.conf ]; then |
# source config file so we can probe vars | # source file with handy subroutines like checkyesno |
. /etc/rc.conf | . /etc/rc.subr |
if checkyesno ipfilter_enable; then | # source config file so we can probe vars |
echo "Using ipf" | . /etc/rc.conf |
FW=ipf | if checkyesno ipfilter_enable; then |
echo "#define USE_IPF 1" >> ${CONFIGFILE} | echo "Using ipf" |
elif checkyesno pf_enable; then | FW=ipf |
echo "Using pf" | echo "#define USE_IPF 1" >> ${CONFIGFILE} |
FW=pf | elif checkyesno pf_enable; then |
echo "#define USE_PF 1" >> ${CONFIGFILE} | echo "Using pf" |
| FW=pf |
| echo "#define USE_PF 1" >> ${CONFIGFILE} |
| else |
| echo "Could not detect usage of ipf or pf. Compiling for pf by default" |
| FW=pf |
| echo "#define USE_PF 1" >> ${CONFIGFILE} |
| fi |
# TODO : Add support for IPFW |
# TODO : Add support for IPFW |
# echo "#define USE_IPFW 1" >> ${CONFIGFILE} |
# echo "#define USE_IPFW 1" >> ${CONFIGFILE} |
# FW=ipfw |
# FW=ipfw |
Line 90 case $OS_NAME in
|
Line 106 case $OS_NAME in
|
FW=pf |
FW=pf |
echo "#define USE_PF 1" >> ${CONFIGFILE} |
echo "#define USE_PF 1" >> ${CONFIGFILE} |
fi |
fi |
|
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} |
OS_URL=http://www.freebsd.org/ |
OS_URL=http://www.freebsd.org/ |
;; |
;; |
pfSense) |
pfSense) |
# we need to detect if PFRULE_INOUT_COUNTS macro is needed |
# we need to detect if PFRULE_INOUT_COUNTS macro is needed |
echo "#define USE_PF 1" >> ${CONFIGFILE} |
echo "#define USE_PF 1" >> ${CONFIGFILE} |
FW=pf |
FW=pf |
|
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} |
OS_URL=http://www.pfsense.com/ |
OS_URL=http://www.pfsense.com/ |
;; |
;; |
NetBSD) |
NetBSD) |
Line 114 case $OS_NAME in
|
Line 132 case $OS_NAME in
|
echo "#define USE_PF 1" >> ${CONFIGFILE} |
echo "#define USE_PF 1" >> ${CONFIGFILE} |
FW=pf |
FW=pf |
fi |
fi |
|
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} |
OS_URL=http://www.netbsd.org/ |
OS_URL=http://www.netbsd.org/ |
;; |
;; |
DragonFly) |
DragonFly) |
Line 132 case $OS_NAME in
|
Line 151 case $OS_NAME in
|
echo "#define USE_PF 1" >> ${CONFIGFILE} |
echo "#define USE_PF 1" >> ${CONFIGFILE} |
FW=pf |
FW=pf |
fi |
fi |
echo "#define USE_PF 1" >> ${CONFIGFILE} | echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} |
OS_URL=http://www.dragonflybsd.org/ |
OS_URL=http://www.dragonflybsd.org/ |
;; |
;; |
SunOS) |
SunOS) |
echo "#define USE_IPF 1" >> ${CONFIGFILE} |
echo "#define USE_IPF 1" >> ${CONFIGFILE} |
|
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} |
FW=ipf |
FW=ipf |
echo "#define LOG_PERROR 0" >> ${CONFIGFILE} |
echo "#define LOG_PERROR 0" >> ${CONFIGFILE} |
echo "#define SOLARIS_KSTATS 1" >> ${CONFIGFILE} |
echo "#define SOLARIS_KSTATS 1" >> ${CONFIGFILE} |
Line 155 case $OS_NAME in
|
Line 175 case $OS_NAME in
|
OS_VERSION=`cat /etc/debian_version` |
OS_VERSION=`cat /etc/debian_version` |
OS_URL=http://www.debian.org/ |
OS_URL=http://www.debian.org/ |
fi |
fi |
|
# same thing for Gentoo linux |
|
if [ -f /etc/gentoo-release ]; then |
|
OS_NAME=Gentoo |
|
OS_VERSION=`cat /etc/gentoo-release` |
|
OS_URL=http://www.gentoo.org/ |
|
fi |
# use lsb_release (Linux Standard Base) when available |
# use lsb_release (Linux Standard Base) when available |
LSB_RELEASE=`which lsb_release` |
LSB_RELEASE=`which lsb_release` |
if [ 0 -eq $? ]; then |
if [ 0 -eq $? ]; then |
Line 169 case $OS_NAME in
|
Line 195 case $OS_NAME in
|
OS_URL=http://www.ubuntu.com/ |
OS_URL=http://www.ubuntu.com/ |
OS_VERSION=`${LSB_RELEASE} -c -s` |
OS_VERSION=`${LSB_RELEASE} -c -s` |
;; |
;; |
|
Gentoo) |
|
OS_URL=http://www.gentoo.org/ |
|
;; |
esac |
esac |
fi |
fi |
echo "#define USE_NETFILTER 1" >> ${CONFIGFILE} |
echo "#define USE_NETFILTER 1" >> ${CONFIGFILE} |
|
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} |
FW=netfilter |
FW=netfilter |
;; |
;; |
|
OpenWRT) |
|
OS_URL=http://www.openwrt.org/ |
|
echo "#define USE_NETFILTER 1" >> ${CONFIGFILE} |
|
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} |
|
FW=netfilter |
|
;; |
Darwin) |
Darwin) |
echo "#define USE_IPFW 1" >> ${CONFIGFILE} |
echo "#define USE_IPFW 1" >> ${CONFIGFILE} |
|
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} |
FW=ipfw |
FW=ipfw |
OS_URL=http://developer.apple.com/macosx |
OS_URL=http://developer.apple.com/macosx |
;; |
;; |
Line 189 esac
|
Line 226 esac
|
echo "Configuring compilation for [$OS_NAME] [$OS_VERSION] with [$FW] firewall software." |
echo "Configuring compilation for [$OS_NAME] [$OS_VERSION] with [$FW] firewall software." |
echo "Please edit config.h for more compilation options." |
echo "Please edit config.h for more compilation options." |
|
|
|
# define SUPPORT_REMOTEHOST if the FW related code really supports setting |
|
# a RemoteHost |
|
if [ \( "$FW" = "netfilter" \) -o \( "$FW" = "pf" \) -o \( "$FW" = "ipfw" \) ] ; then |
|
echo "#define SUPPORT_REMOTEHOST" >> ${CONFIGFILE} |
|
fi |
|
|
|
echo "" >> ${CONFIGFILE} |
echo "#define OS_NAME \"$OS_NAME\"" >> ${CONFIGFILE} |
echo "#define OS_NAME \"$OS_NAME\"" >> ${CONFIGFILE} |
echo "#define OS_VERSION \"$OS_NAME/$OS_VERSION\"" >> ${CONFIGFILE} |
echo "#define OS_VERSION \"$OS_NAME/$OS_VERSION\"" >> ${CONFIGFILE} |
echo "#define OS_URL \"${OS_URL}\"" >> ${CONFIGFILE} |
echo "#define OS_URL \"${OS_URL}\"" >> ${CONFIGFILE} |
Line 209 echo "" >> ${CONFIGFILE}
|
Line 253 echo "" >> ${CONFIGFILE}
|
|
|
echo "/* Uncomment the following line to enable generation of" >> ${CONFIGFILE} |
echo "/* Uncomment the following line to enable generation of" >> ${CONFIGFILE} |
echo " * filter rules with pf */" >> ${CONFIGFILE} |
echo " * filter rules with pf */" >> ${CONFIGFILE} |
echo "/*#define PF_ENABLE_FILTER_RULES*/">> ${CONFIGFILE} | echo "#define PF_ENABLE_FILTER_RULES">> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
|
|
echo "/* Uncomment the following line to enable caching of results of" >> ${CONFIGFILE} |
echo "/* Uncomment the following line to enable caching of results of" >> ${CONFIGFILE} |
Line 243 echo "/*#define HAS_DUMMY_SERVICE*/" >> ${CONFIGFILE}
|
Line 287 echo "/*#define HAS_DUMMY_SERVICE*/" >> ${CONFIGFILE}
|
echo "#define ENABLE_L3F_SERVICE" >> ${CONFIGFILE} |
echo "#define ENABLE_L3F_SERVICE" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
|
|
echo "/* Experimental UPnP Events support. */" >> ${CONFIGFILE} | echo "/* Enable IP v6 support */" >> ${CONFIGFILE} |
echo "/*#define ENABLE_EVENTS*/" >> ${CONFIGFILE} | echo "/*#define ENABLE_IPV6*/" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
|
|
|
echo "/* Enable the support of IGD v2 specification." >> ${CONFIGFILE} |
|
echo " * This is not fully tested yet and can cause incompatibilities with some" >> ${CONFIGFILE} |
|
echo " * control points, so enable with care. */" >> ${CONFIGFILE} |
|
echo "/*#define IGD_V2*/" >> ${CONFIGFILE} |
|
echo "" >> ${CONFIGFILE} |
|
|
|
echo "#ifdef IGD_V2" >> ${CONFIGFILE} |
|
echo "/* Enable DeviceProtection service (IGDv2) */" >> ${CONFIGFILE} |
|
echo "#define ENABLE_DP_SERVICE" >> ${CONFIGFILE} |
|
echo "" >> ${CONFIGFILE} |
|
echo "/* Enable WANIPv6FirewallControl service (IGDv2). needs IPv6 */" >> ${CONFIGFILE} |
|
echo "#ifdef ENABLE_IPV6" >> ${CONFIGFILE} |
|
echo "#define ENABLE_6FC_SERVICE" >> ${CONFIGFILE} |
|
echo "#endif /* ENABLE_IPV6 */" >> ${CONFIGFILE} |
|
echo "#endif /* IGD_V2 */" >> ${CONFIGFILE} |
|
echo "" >> ${CONFIGFILE} |
|
|
|
echo "/* UPnP Events support. Working well enough to be enabled by default." >> ${CONFIGFILE} |
|
echo " * It can be disabled to save a few bytes. */" >> ${CONFIGFILE} |
|
echo "#define ENABLE_EVENTS" >> ${CONFIGFILE} |
|
echo "" >> ${CONFIGFILE} |
|
|
echo "/* include interface name in pf and ipf rules */" >> ${CONFIGFILE} |
echo "/* include interface name in pf and ipf rules */" >> ${CONFIGFILE} |
echo "#define USE_IFNAME_IN_RULES" >> ${CONFIGFILE} |
echo "#define USE_IFNAME_IN_RULES" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
|
|
echo "/* Experimental NFQUEUE support. */" >> ${CONFIGFILE} |
echo "/* Experimental NFQUEUE support. */" >> ${CONFIGFILE} |
echo "/*#define ENABLE_NFQUEUE*/" >> ${CONFIGFILE} |
echo "/*#define ENABLE_NFQUEUE*/" >> ${CONFIGFILE} |
|
echo "" >> ${CONFIGFILE} |
|
|
|
echo "/* Enable to make MiniUPnPd more strict about UPnP conformance" >> ${CONFIGFILE} |
|
echo " * and the messages it receives from control points */" >> ${CONFIGFILE} |
|
echo "/*#define UPNP_STRICT*/" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
echo "" >> ${CONFIGFILE} |
|
|
echo "#endif" >> ${CONFIGFILE} |
echo "#endif" >> ${CONFIGFILE} |