Merge remote-tracking branch 'miniupnp/master'
This commit is contained in:
commit
d63a51b9a9
|
@ -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 <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <net/if.h>
|
||||
#ifdef __linux__
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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 <string.h>
|
||||
#include <stdio.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <io.h>
|
||||
|
@ -21,7 +21,7 @@
|
|||
#define snprintf _snprintf
|
||||
#define herror
|
||||
#define socklen_t int
|
||||
#else /* #ifdef WIN32 */
|
||||
#else /* #ifdef _WIN32 */
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#include <errno.h>
|
||||
|
@ -34,10 +34,10 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#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));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#include <winsock2.h>
|
||||
#define snprintf _snprintf
|
||||
|
@ -24,7 +24,7 @@
|
|||
/* only for malloc */
|
||||
#include <stdlib.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)
|
||||
|
@ -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*/
|
||||
|
|
|
@ -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 <syslog.h>*/
|
||||
|
@ -10,8 +11,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#if defined(WIN32) || defined(__amigaos__) || defined(__amigaos4__)
|
||||
#ifdef WIN32
|
||||
#if defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__)
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <io.h>
|
||||
|
|
|
@ -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 <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
/* Win32 Specific includes and defines */
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
|
@ -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 <unistd.h>
|
||||
#if defined(__amigaos__) && !defined(__amigaos4__)
|
||||
|
@ -60,7 +61,7 @@
|
|||
#include <strings.h>
|
||||
#include <errno.h>
|
||||
#define closesocket close
|
||||
#endif /* #else WIN32 */
|
||||
#endif /* #else _WIN32 */
|
||||
#ifdef MINIUPNPC_SET_SOCKET_TIMEOUT
|
||||
#include <sys/time.h>
|
||||
#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));
|
||||
|
|
|
@ -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 <Python.h>
|
||||
|
@ -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)
|
||||
|
|
|
@ -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 <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <io.h>
|
||||
|
@ -24,7 +25,7 @@
|
|||
#define strncasecmp memicmp
|
||||
#endif /* defined(_MSC_VER) && (_MSC_VER >= 1400) */
|
||||
#endif /* #ifndef strncasecmp */
|
||||
#else /* #ifdef WIN32 */
|
||||
#else /* #ifdef _WIN32 */
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#if defined(__amigaos__) && !defined(__amigaos4__)
|
||||
|
@ -33,13 +34,14 @@
|
|||
#include <sys/select.h>
|
||||
#endif /* #else defined(__amigaos__) && !defined(__amigaos4__) */
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#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)
|
||||
|
|
|
@ -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 <sys/queue.h>
|
||||
|
|
|
@ -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 <stdio.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#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);
|
||||
|
|
|
@ -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 <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
@ -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;
|
||||
|
|
|
@ -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 <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#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)
|
||||
|
|
|
@ -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 <sys/queue.h>
|
||||
|
|
|
@ -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 <netinet/in.h> before #include <arpa/inet.h> (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
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
#include <net/if_var.h>
|
||||
#endif
|
||||
|
|
|
@ -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 <tomato_config.h>" >> ${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}
|
||||
|
|
|
@ -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 <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#if defined(sun)
|
||||
#include <sys/sockio.h>
|
||||
#endif
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/param.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <syslog.h>
|
||||
#include <ctype.h>
|
||||
|
|
|
@ -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 <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#include "config.h"
|
||||
|
|
|
@ -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 <unistd.h>
|
||||
#include <syslog.h>
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include "config.h"
|
||||
|
|
Loading…
Reference in New Issue