diff --git a/minissdpd/ifacewatch.c b/minissdpd/ifacewatch.c index 44c0cd9..12bfc24 100644 --- a/minissdpd/ifacewatch.c +++ b/minissdpd/ifacewatch.c @@ -1,4 +1,4 @@ -/* $Id: ifacewatch.c,v 1.2 2011/07/30 13:10:05 nanard Exp $ */ +/* $Id: ifacewatch.c,v 1.3 2012/01/20 22:08:07 nanard Exp $ */ /* MiniUPnP project * (c) 2011 Thomas Bernard * website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #ifdef __linux__ diff --git a/miniupnpc/Changelog.txt b/miniupnpc/Changelog.txt index 9d00083..b82986f 100644 --- a/miniupnpc/Changelog.txt +++ b/miniupnpc/Changelog.txt @@ -1,6 +1,15 @@ -$Id: Changelog.txt,v 1.157 2012/01/07 10:13:24 nanard Exp $ +$Id: Changelog.txt,v 1.160 2012/01/21 13:30:31 nanard Exp $ miniUPnP client Changelog. +2012/01/21: + Replace WIN32 macro by _WIN32 + +2012/01/19: + Fixes in java wrappers thanks to Alexey Kuznetsov : + https://github.com/axet/miniupnp/tree/fix-javatest/miniupnpc + Make and install .deb packages (python) thanks to Alexey Kuznetsov : + https://github.com/axet/miniupnp/tree/feature-debbuild/miniupnpc + 2012/01/07: The multicast interface can now be specified by name with IPv4. diff --git a/miniupnpc/connecthostport.c b/miniupnpc/connecthostport.c index 76e8e37..a86e0f8 100644 --- a/miniupnpc/connecthostport.c +++ b/miniupnpc/connecthostport.c @@ -1,7 +1,7 @@ -/* $Id: connecthostport.c,v 1.5 2011/04/09 08:49:50 nanard Exp $ */ +/* $Id: connecthostport.c,v 1.6 2012/01/21 13:30:31 nanard Exp $ */ /* Project : miniupnp * Author : Thomas Bernard - * Copyright (c) 2010-2011 Thomas Bernard + * Copyright (c) 2010-2012 Thomas Bernard * This software is subject to the conditions detailed in the * LICENCE file provided in this distribution. */ @@ -13,7 +13,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #include @@ -21,7 +21,7 @@ #define snprintf _snprintf #define herror #define socklen_t int -#else /* #ifdef WIN32 */ +#else /* #ifdef _WIN32 */ #include #include #include @@ -34,10 +34,10 @@ #include #include #endif /* #ifndef USE_GETHOSTBYNAME */ -#endif /* #else WIN32 */ +#endif /* #else _WIN32 */ /* definition of PRINT_SOCKET_ERROR */ -#ifdef WIN32 +#ifdef _WIN32 #define PRINT_SOCKET_ERROR(x) printf("Socket error: %s, %d\n", x, WSAGetLastError()); #else #define PRINT_SOCKET_ERROR(x) perror(x) @@ -160,7 +160,7 @@ int connecthostport(const char * host, unsigned short port) n = getaddrinfo(tmp_host, port_str, &hints, &ai); if(n != 0) { -#ifdef WIN32 +#ifdef _WIN32 fprintf(stderr, "getaddrinfo() error : %d\n", n); #else fprintf(stderr, "getaddrinfo() error : %s\n", gai_strerror(n)); diff --git a/miniupnpc/declspec.h b/miniupnpc/declspec.h index b804247..2638faa 100644 --- a/miniupnpc/declspec.h +++ b/miniupnpc/declspec.h @@ -1,7 +1,7 @@ #ifndef __DECLSPEC_H__ #define __DECLSPEC_H__ -#if defined(WIN32) && !defined(STATICLIB) +#if defined(_WIN32) && !defined(STATICLIB) #ifdef MINIUPNP_EXPORTS #define LIBSPEC __declspec(dllexport) #else diff --git a/miniupnpc/minisoap.c b/miniupnpc/minisoap.c index 8889bf0..e45a481 100644 --- a/miniupnpc/minisoap.c +++ b/miniupnpc/minisoap.c @@ -1,7 +1,7 @@ -/* $Id: minisoap.c,v 1.21 2011/03/22 19:15:35 nanard Exp $ */ +/* $Id: minisoap.c,v 1.22 2012/01/21 13:30:31 nanard Exp $ */ /* Project : miniupnp * Author : Thomas Bernard - * Copyright (c) 2005-2009 Thomas Bernard + * Copyright (c) 2005-2012 Thomas Bernard * This software is subject to the conditions detailed in the * LICENCE file provided in this distribution. * @@ -9,7 +9,7 @@ */ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #define snprintf _snprintf @@ -24,7 +24,7 @@ /* only for malloc */ #include -#ifdef WIN32 +#ifdef _WIN32 #define PRINT_SOCKET_ERROR(x) printf("Socket error: %s, %d\n", x, WSAGetLastError()); #else #define PRINT_SOCKET_ERROR(x) perror(x) @@ -57,7 +57,7 @@ httpWrite(int fd, const char * body, int bodysize, /* disable send on the socket */ /* draytek routers dont seems to like that... */ #if 0 -#ifdef WIN32 +#ifdef _WIN32 if(shutdown(fd, SD_SEND)<0) { #else if(shutdown(fd, SHUT_WR)<0) { /*SD_SEND*/ diff --git a/miniupnpc/minissdpc.c b/miniupnpc/minissdpc.c index e5e8528..7ec42d2 100644 --- a/miniupnpc/minissdpc.c +++ b/miniupnpc/minissdpc.c @@ -1,7 +1,8 @@ -/* $Id: minissdpc.c,v 1.14 2010/11/25 09:57:25 nanard Exp $ */ +/* $Id: minissdpc.c,v 1.15 2012/01/21 13:30:31 nanard Exp $ */ /* Project : miniupnp + * Web : http://miniupnp.free.fr/ * Author : Thomas BERNARD - * copyright (c) 2005-2009 Thomas Bernard + * copyright (c) 2005-2012 Thomas Bernard * This software is subjet to the conditions detailed in the * provided LICENCE file. */ /*#include */ @@ -10,8 +11,8 @@ #include #include #include -#if defined(WIN32) || defined(__amigaos__) || defined(__amigaos4__) -#ifdef WIN32 +#if defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__) +#ifdef _WIN32 #include #include #include diff --git a/miniupnpc/miniupnpc.c b/miniupnpc/miniupnpc.c index 6656925..5ba7d0b 100644 --- a/miniupnpc/miniupnpc.c +++ b/miniupnpc/miniupnpc.c @@ -1,7 +1,8 @@ -/* $Id: miniupnpc.c,v 1.100 2012/01/12 09:54:34 nanard Exp $ */ +/* $Id: miniupnpc.c,v 1.101 2012/01/21 13:30:31 nanard Exp $ */ /* Project : miniupnp + * Web : http://miniupnp.free.fr/ * Author : Thomas BERNARD - * copyright (c) 2005-2011 Thomas Bernard + * copyright (c) 2005-2012 Thomas Bernard * This software is subjet to the conditions detailed in the * provided LICENSE file. */ #define __EXTENSIONS__ 1 @@ -23,7 +24,7 @@ #include #include #include -#ifdef WIN32 +#ifdef _WIN32 /* Win32 Specific includes and defines */ #include #include @@ -38,7 +39,7 @@ #endif /* defined(_MSC_VER) && (_MSC_VER >= 1400) */ #endif /* #ifndef strncasecmp */ #define MAXHOSTNAMELEN 64 -#else /* #ifdef WIN32 */ +#else /* #ifdef _WIN32 */ /* Standard POSIX includes */ #include #if defined(__amigaos__) && !defined(__amigaos4__) @@ -60,7 +61,7 @@ #include #include #define closesocket close -#endif /* #else WIN32 */ +#endif /* #else _WIN32 */ #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT #include #endif @@ -78,7 +79,7 @@ #include "connecthostport.h" #include "receivedata.h" -#ifdef WIN32 +#ifdef _WIN32 #define PRINT_SOCKET_ERROR(x) printf("Socket error: %s, %d\n", x, WSAGetLastError()); #else #define PRINT_SOCKET_ERROR(x) perror(x) @@ -357,14 +358,14 @@ upnpDiscover(int delay, const char * multicastif, int rv; struct addrinfo hints, *servinfo, *p; #endif -#ifdef WIN32 +#ifdef _WIN32 MIB_IPFORWARDROW ip_forward; #endif int linklocal = 1; if(error) *error = UPNPDISCOVER_UNKNOWN_ERROR; -#if !defined(WIN32) && !defined(__amigaos__) && !defined(__amigaos4__) +#if !defined(_WIN32) && !defined(__amigaos__) && !defined(__amigaos4__) /* first try to get infos from minissdpd ! */ if(!minissdpdsock) minissdpdsock = "/var/run/minissdpd.sock"; @@ -382,7 +383,7 @@ upnpDiscover(int delay, const char * multicastif, deviceIndex = 0; #endif /* fallback to direct discovery */ -#ifdef WIN32 +#ifdef _WIN32 sudp = socket(ipv6 ? PF_INET6 : PF_INET, SOCK_DGRAM, IPPROTO_UDP); #else sudp = socket(ipv6 ? PF_INET6 : PF_INET, SOCK_DGRAM, 0); @@ -409,7 +410,7 @@ upnpDiscover(int delay, const char * multicastif, p->sin_port = htons(PORT); p->sin_addr.s_addr = INADDR_ANY; } -#ifdef WIN32 +#ifdef _WIN32 /* This code could help us to use the right Network interface for * SSDP multicast traffic */ /* Get IP associated with the index given in the ip_forward struct @@ -469,7 +470,7 @@ upnpDiscover(int delay, const char * multicastif, } #endif -#ifdef WIN32 +#ifdef _WIN32 if (setsockopt(sudp, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof (opt)) < 0) #else if (setsockopt(sudp, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof (opt)) < 0) @@ -484,7 +485,7 @@ upnpDiscover(int delay, const char * multicastif, if(multicastif) { if(ipv6) { -#if !defined(WIN32) +#if !defined(_WIN32) /* according to MSDN, if_nametoindex() is supported since * MS Windows Vista and MS Windows Server 2008. * http://msdn.microsoft.com/en-us/library/bb408409%28v=vs.85%29.aspx */ @@ -594,7 +595,7 @@ upnpDiscover(int delay, const char * multicastif, XSTR(PORT), &hints, &servinfo)) != 0) { if(error) *error = UPNPDISCOVER_SOCKET_ERROR; -#ifdef WIN32 +#ifdef _WIN32 fprintf(stderr, "getaddrinfo() failed: %d\n", rv); #else fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv)); diff --git a/miniupnpc/miniupnpcmodule.c b/miniupnpc/miniupnpcmodule.c index 08a61d2..a000bcb 100644 --- a/miniupnpc/miniupnpcmodule.c +++ b/miniupnpc/miniupnpcmodule.c @@ -1,8 +1,8 @@ -/* $Id: miniupnpcmodule.c,v 1.18 2011/04/10 11:21:23 nanard Exp $*/ +/* $Id: miniupnpcmodule.c,v 1.19 2012/01/21 13:30:32 nanard Exp $*/ /* Project : miniupnp * Author : Thomas BERNARD * website : http://miniupnp.tuxfamily.org/ - * copyright (c) 2007-2009 Thomas Bernard + * copyright (c) 2007-2012 Thomas Bernard * This software is subjet to the conditions detailed in the * provided LICENCE file. */ #include @@ -472,7 +472,7 @@ static PyTypeObject UPnPType = { 0, /* tp_dictoffset */ 0,/*(initproc)UPnP_init,*/ /* tp_init */ 0, /* tp_alloc */ -#ifndef WIN32 +#ifndef _WIN32 PyType_GenericNew,/*UPnP_new,*/ /* tp_new */ #else 0, @@ -492,7 +492,7 @@ initminiupnpc(void) { PyObject* m; -#ifdef WIN32 +#ifdef _WIN32 UPnPType.tp_new = PyType_GenericNew; #endif if (PyType_Ready(&UPnPType) < 0) diff --git a/miniupnpc/miniwget.c b/miniupnpc/miniwget.c index 87f6155..edb3722 100644 --- a/miniupnpc/miniwget.c +++ b/miniupnpc/miniwget.c @@ -1,7 +1,8 @@ -/* $Id: miniwget.c,v 1.52 2011/06/17 22:59:42 nanard Exp $ */ +/* $Id: miniwget.c,v 1.54 2012/01/21 13:30:32 nanard Exp $ */ /* Project : miniupnp + * Website : http://miniupnp.free.fr/ * Author : Thomas Bernard - * Copyright (c) 2005-2011 Thomas Bernard + * Copyright (c) 2005-2012 Thomas Bernard * This software is subject to the conditions detailed in the * LICENCE file provided in this distribution. */ @@ -9,7 +10,7 @@ #include #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #include @@ -24,7 +25,7 @@ #define strncasecmp memicmp #endif /* defined(_MSC_VER) && (_MSC_VER >= 1400) */ #endif /* #ifndef strncasecmp */ -#else /* #ifdef WIN32 */ +#else /* #ifdef _WIN32 */ #include #include #if defined(__amigaos__) && !defined(__amigaos4__) @@ -33,13 +34,14 @@ #include #endif /* #else defined(__amigaos__) && !defined(__amigaos4__) */ #include +#include #include #include #define closesocket close /* defining MINIUPNPC_IGNORE_EINTR enable the ignore of interruptions * during the connect() call */ #define MINIUPNPC_IGNORE_EINTR -#endif /* #else WIN32 */ +#endif /* #else _WIN32 */ #if defined(__sun) || defined(sun) #define MIN(x,y) (((x)<(y))?(x):(y)) #endif @@ -343,7 +345,7 @@ miniwget3(const char * url, const char * host, NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV); if(n != 0) { -#ifdef WIN32 +#ifdef _WIN32 fprintf(stderr, "getnameinfo() failed : %d\n", n); #else fprintf(stderr, "getnameinfo() failed : %s\n", gai_strerror(n)); @@ -507,7 +509,7 @@ void * miniwget_getaddr(const char * url, int * size, char * addr, int addrlen) { unsigned short port; char * path; - /* protocol://host:port/chemin */ + /* protocol://host:port/path */ char hostname[MAXHOSTNAMELEN+1]; *size = 0; if(addr) diff --git a/miniupnpc/portlistingparse.h b/miniupnpc/portlistingparse.h index 1852478..6e5efa2 100644 --- a/miniupnpc/portlistingparse.h +++ b/miniupnpc/portlistingparse.h @@ -1,7 +1,7 @@ -/* $Id: portlistingparse.h,v 1.4 2011/02/15 23:03:56 nanard Exp $ */ +/* $Id: portlistingparse.h,v 1.5 2012/01/21 13:30:33 nanard Exp $ */ /* MiniUPnP project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ - * (c) 2011 Thomas Bernard + * (c) 2011-2012 Thomas Bernard * This software is subject to the conditions detailed * in the LICENCE file provided within the distribution */ #ifndef __PORTLISTINGPARSE_H__ @@ -11,7 +11,7 @@ /* for the definition of UNSIGNED_INTEGER */ #include "miniupnpctypes.h" -#if defined(NO_SYS_QUEUE_H) || defined(WIN32) || defined(__HAIKU__) +#if defined(NO_SYS_QUEUE_H) || defined(_WIN32) || defined(__HAIKU__) #include "bsdqueue.h" #else #include diff --git a/miniupnpc/receivedata.c b/miniupnpc/receivedata.c index a1eadfc..d09171a 100644 --- a/miniupnpc/receivedata.c +++ b/miniupnpc/receivedata.c @@ -1,12 +1,13 @@ -/* $Id: receivedata.c,v 1.1 2011/04/11 08:21:47 nanard Exp $ */ +/* $Id: receivedata.c,v 1.2 2012/01/21 13:30:33 nanard Exp $ */ /* Project : miniupnp + * Website : http://miniupnp.free.fr/ * Author : Thomas Bernard - * Copyright (c) 2011 Thomas Bernard + * Copyright (c) 2011-2012 Thomas Bernard * This software is subject to the conditions detailed in the * LICENCE file provided in this distribution. */ #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #else @@ -24,7 +25,7 @@ #define MINIUPNPC_IGNORE_EINTR #endif -#ifdef WIN32 +#ifdef _WIN32 #define PRINT_SOCKET_ERROR(x) printf("Socket error: %s, %d\n", x, WSAGetLastError()); #else #define PRINT_SOCKET_ERROR(x) perror(x) @@ -36,7 +37,7 @@ int receivedata(int socket, char * data, int length, int timeout) { int n; -#if !defined(WIN32) && !defined(__amigaos__) && !defined(__amigaos4__) +#if !defined(_WIN32) && !defined(__amigaos__) && !defined(__amigaos4__) /* using poll */ struct pollfd fds[1]; /* for the poll */ #ifdef MINIUPNPC_IGNORE_EINTR @@ -55,8 +56,8 @@ receivedata(int socket, char * data, int length, int timeout) /* timeout */ return 0; } -#else /* !defined(WIN32) && !defined(__amigaos__) && !defined(__amigaos4__) */ - /* using select under WIN32 and amigaos */ +#else /* !defined(_WIN32) && !defined(__amigaos__) && !defined(__amigaos4__) */ + /* using select under _WIN32 and amigaos */ fd_set socketSet; TIMEVAL timeval; FD_ZERO(&socketSet); diff --git a/miniupnpc/testminixml.c b/miniupnpc/testminixml.c index 3d82527..d1075ed 100644 --- a/miniupnpc/testminixml.c +++ b/miniupnpc/testminixml.c @@ -1,7 +1,11 @@ -/* $Id: testminixml.c,v 1.6 2006/11/19 22:32:35 nanard Exp $ +/* $Id: testminixml.c,v 1.7 2012/01/21 13:30:33 nanard Exp $ + * MiniUPnP project + * Website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ + * Author : Thomas Bernard. + * Copyright (c) 2005-2012 Thomas Bernard + * * testminixml.c * test program for the "minixml" functions. - * Author : Thomas Bernard. */ #include #include @@ -9,14 +13,6 @@ #include "minixml.h" #include "igd_desc_parse.h" -#ifdef WIN32 -#define NO_BZERO -#endif - -#ifdef NO_BZERO -#define bzero(p, n) memset(p, 0, n) -#endif - /* ---------------------------------------------------------------------- */ void printeltname1(void * d, const char * name, int l) { @@ -47,7 +43,7 @@ void burptest(const char * buffer, int bufsize) struct IGDdatas data; struct xmlparser parser; /*objet IGDdatas */ - bzero(&data, sizeof(struct IGDdatas)); + memset(&data, 0, sizeof(struct IGDdatas)); /* objet xmlparser */ parser.xmlstart = buffer; parser.xmlsize = bufsize; diff --git a/miniupnpc/upnpc.c b/miniupnpc/upnpc.c index 56c6411..b96deb9 100644 --- a/miniupnpc/upnpc.c +++ b/miniupnpc/upnpc.c @@ -1,7 +1,7 @@ -/* $Id: upnpc.c,v 1.90 2012/01/07 10:13:26 nanard Exp $ */ +/* $Id: upnpc.c,v 1.91 2012/01/21 13:30:33 nanard Exp $ */ /* Project : miniupnp * Author : Thomas Bernard - * Copyright (c) 2005-2011 Thomas Bernard + * Copyright (c) 2005-2012 Thomas Bernard * This software is subject to the conditions detailed in the * LICENCE file provided in this distribution. */ @@ -9,7 +9,7 @@ #include #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #define snprintf _snprintf #endif @@ -466,7 +466,7 @@ int main(int argc, char ** argv) int error = 0; int ipv6 = 0; -#ifdef WIN32 +#ifdef _WIN32 WSADATA wsaData; int nResult = WSAStartup(MAKEWORD(2,2), &wsaData); if(nResult != NO_ERROR) diff --git a/miniupnpc/upnpreplyparse.h b/miniupnpc/upnpreplyparse.h index 267ea87..851ebaf 100644 --- a/miniupnpc/upnpreplyparse.h +++ b/miniupnpc/upnpreplyparse.h @@ -1,14 +1,14 @@ -/* $Id: upnpreplyparse.h,v 1.11 2011/02/07 16:17:06 nanard Exp $ */ +/* $Id: upnpreplyparse.h,v 1.12 2012/01/21 13:30:33 nanard Exp $ */ /* MiniUPnP project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ - * (c) 2006-2011 Thomas Bernard + * (c) 2006-2012 Thomas Bernard * This software is subject to the conditions detailed * in the LICENCE file provided within the distribution */ #ifndef __UPNPREPLYPARSE_H__ #define __UPNPREPLYPARSE_H__ -#if defined(NO_SYS_QUEUE_H) || defined(WIN32) || defined(__HAIKU__) +#if defined(NO_SYS_QUEUE_H) || defined(_WIN32) || defined(__HAIKU__) #include "bsdqueue.h" #else #include diff --git a/miniupnpd/Changelog.txt b/miniupnpd/Changelog.txt index 41f7435..b339b84 100644 --- a/miniupnpd/Changelog.txt +++ b/miniupnpd/Changelog.txt @@ -1,13 +1,19 @@ -$Id: Changelog.txt,v 1.242 2011/11/18 11:21:20 nanard Exp $ +$Id: Changelog.txt,v 1.248 2012/01/20 21:57:45 nanard Exp $ + +2012/01/20: + Always #include before #include (for OpenBSD) + .onrdomain field was added in ps with OpenBSD 5.0. Add PFRULE_HAS_ONRDOMAIN 2012/01/02: Fixing netfilter/iptables_*.sh scripts for new ifconfig output format. getifaddr.c: added additional checks on structure returned by getifaddrs() + Fixing Mac OS X makefile for installation 2011/11/18: avoid infinite loop in SendResp_upnphttp() in case of error Replaced SendResp_upnphttp() + CloseSocket_upnphttp() by SendRespAndClose_upnphttp() + Tomato specifics in genconfig.sh 2011/07/30: netfilter : Added a tiny_nf_nat.h file to compile with iptables diff --git a/miniupnpd/bsd/getifstats.c b/miniupnpd/bsd/getifstats.c index f10b60c..780523e 100644 --- a/miniupnpd/bsd/getifstats.c +++ b/miniupnpd/bsd/getifstats.c @@ -9,8 +9,8 @@ #include #include #include -#include #include +#include #if defined(__FreeBSD__) || defined(__DragonFly__) #include #endif diff --git a/miniupnpd/genconfig.sh b/miniupnpd/genconfig.sh index 17a9795..d3e69a8 100755 --- a/miniupnpd/genconfig.sh +++ b/miniupnpd/genconfig.sh @@ -1,5 +1,5 @@ #! /bin/sh -# $Id: genconfig.sh,v 1.50 2011/07/25 16:03:46 nanard Exp $ +# $Id: genconfig.sh,v 1.51 2011/11/18 11:54:00 nanard Exp $ # miniupnp daemon # http://miniupnp.free.fr or http://miniupnp.tuxfamily.org/ # (c) 2006-2011 Thomas Bernard @@ -34,6 +34,12 @@ if [ -f ./os.openwrt ]; then OS_VERSION=$(cat ./os.openwrt) fi +# Tomato USB special case +if [ -f ../shared/tomato_version ]; then + OS_NAME=Tomato + OS_VERSION="Tomato $(cat ../shared/tomato_version)" +fi + ${RM} ${CONFIGFILE} echo "/* MiniUPnP Project" >> ${CONFIGFILE} @@ -67,6 +73,10 @@ case $OS_NAME in if [ \( $MAJORVER -ge 5 \) -o \( $MAJORVER -eq 4 -a $MINORVER -ge 7 \) ]; then echo "#define PF_NEWSTYLE" >> ${CONFIGFILE} fi + # onrdomain was introduced in OpenBSD 5.0 + if [ $MAJORVER -ge 5 ]; then + echo "#define PFRULE_HAS_ONRDOMAIN" >> ${CONFIGFILE} + fi echo "#define USE_PF 1" >> ${CONFIGFILE} FW=pf echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} @@ -203,6 +213,21 @@ case $OS_NAME in echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} FW=netfilter ;; + Tomato) + OS_NAME=UPnP + OS_URL=http://tomatousb.org/ + echo "" >> ${CONFIGFILE} + echo "#include " >> ${CONFIGFILE} + echo "" >> ${CONFIGFILE} + echo "#define USE_NETFILTER 1" >> ${CONFIGFILE} + echo "#ifdef LINUX26" >> ${CONFIGFILE} + echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} + echo "#endif" >> ${CONFIGFILE} + echo "#ifdef TCONFIG_IPV6" >> ${CONFIGFILE} + echo "#define ENABLE_IPV6" >> ${CONFIGFILE} + echo "#endif" >> ${CONFIGFILE} + FW=netfilter + ;; Darwin) echo "#define USE_IPFW 1" >> ${CONFIGFILE} echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} diff --git a/miniupnpd/getifaddr.c b/miniupnpd/getifaddr.c index a3a24ae..e988001 100644 --- a/miniupnpd/getifaddr.c +++ b/miniupnpd/getifaddr.c @@ -1,4 +1,4 @@ -/* $Id: getifaddr.c,v 1.12 2012/01/02 10:08:42 nanard Exp $ */ +/* $Id: getifaddr.c,v 1.13 2012/01/20 21:45:57 nanard Exp $ */ /* MiniUPnP project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * (c) 2006-2011 Thomas Bernard @@ -13,8 +13,8 @@ #include #include #include -#include #include +#include #if defined(sun) #include #endif diff --git a/miniupnpd/pf/obsdrdr.c b/miniupnpd/pf/obsdrdr.c index 9c1f2b1..b611ba2 100644 --- a/miniupnpd/pf/obsdrdr.c +++ b/miniupnpd/pf/obsdrdr.c @@ -247,6 +247,9 @@ add_redirect_rule2(const char * ifname, pcr.rule.log = (GETFLAG(LOGPACKETSMASK))?1:0; /*logpackets;*/ #ifdef PFRULE_HAS_RTABLEID pcr.rule.rtableid = -1; /* first appeared in OpenBSD 4.0 */ +#endif +#ifdef PFRULE_HAS_ONRDOMAIN + pcr.rule.onrdomain = -1; /* first appeared in OpenBSD 5.0 */ #endif pcr.rule.quick = 1; pcr.rule.keep_state = PF_STATE_NORMAL; @@ -377,6 +380,9 @@ add_filter_rule2(const char * ifname, pcr.rule.flagset = (TH_SYN|TH_ACK); #ifdef PFRULE_HAS_RTABLEID pcr.rule.rtableid = -1; /* first appeared in OpenBSD 4.0 */ +#endif +#ifdef PFRULE_HAS_ONRDOMAIN + pcr.rule.onrdomain = -1; /* first appeared in OpenBSD 5.0 */ #endif pcr.rule.keep_state = 1; strlcpy(pcr.rule.label, desc, PF_RULE_LABEL_SIZE); diff --git a/miniupnpd/upnphttp.c b/miniupnpd/upnphttp.c index 3a20af1..96d4455 100644 --- a/miniupnpd/upnphttp.c +++ b/miniupnpd/upnphttp.c @@ -1,4 +1,4 @@ -/* $Id: upnphttp.c,v 1.64 2011/11/18 11:21:17 nanard Exp $ */ +/* $Id: upnphttp.c,v 1.65 2012/01/20 21:45:57 nanard Exp $ */ /* Project : miniupnp * Website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * Author : Thomas Bernard @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/miniupnpd/upnppermissions.c b/miniupnpd/upnppermissions.c index b15ae23..35b43a3 100644 --- a/miniupnpd/upnppermissions.c +++ b/miniupnpd/upnppermissions.c @@ -1,4 +1,4 @@ -/* $Id: upnppermissions.c,v 1.14 2009/12/22 17:21:43 nanard Exp $ */ +/* $Id: upnppermissions.c,v 1.15 2012/01/20 21:45:58 nanard Exp $ */ /* MiniUPnP project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * (c) 2006 Thomas Bernard @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include "config.h" diff --git a/miniupnpd/upnpsoap.c b/miniupnpd/upnpsoap.c index 7d6c387..cb634a4 100644 --- a/miniupnpd/upnpsoap.c +++ b/miniupnpd/upnpsoap.c @@ -1,4 +1,4 @@ -/* $Id: upnpsoap.c,v 1.88 2011/11/18 11:21:18 nanard Exp $ */ +/* $Id: upnpsoap.c,v 1.89 2012/01/20 21:45:58 nanard Exp $ */ /* MiniUPnP project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * (c) 2006-2011 Thomas Bernard @@ -12,8 +12,8 @@ #include #include #include -#include #include +#include #include #include "config.h"