summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2017-05-16 15:26:38 (GMT)
committerKevin Smith <kevin.smith@isode.com>2017-05-17 08:04:04 (GMT)
commitc2abb2e8c248bb57c7478606f941223322983a8e (patch)
treed4c0f39c2933bcf4e3fb96230da60b09d9aabfdd /3rdParty/LibNATPMP/src
parentedf519a67a28f9acb61af6d442d94f1aa43df688 (diff)
downloadswift-c2abb2e8c248bb57c7478606f941223322983a8e.zip
swift-c2abb2e8c248bb57c7478606f941223322983a8e.tar.bz2
Update 3rdParty/LibNATPMP to libnatpmp-20150609
Furthermore applied current patches. Test-Information: Builds on macOS 10.12.5 with Qt 5.4.2 and all unit and integration tests pass. Change-Id: I7a8a3b7e8b37b20532e3ed5fe32f1cef5b09b1f6
Diffstat (limited to '3rdParty/LibNATPMP/src')
-rw-r--r--3rdParty/LibNATPMP/src/libnatpmp/getgateway.c18
-rw-r--r--3rdParty/LibNATPMP/src/libnatpmp/getgateway.h8
-rw-r--r--3rdParty/LibNATPMP/src/libnatpmp/natpmp.c10
-rw-r--r--3rdParty/LibNATPMP/src/libnatpmp/natpmp.h14
4 files changed, 28 insertions, 22 deletions
diff --git a/3rdParty/LibNATPMP/src/libnatpmp/getgateway.c b/3rdParty/LibNATPMP/src/libnatpmp/getgateway.c
index 3a3f9a6..dfb9f3e 100644
--- a/3rdParty/LibNATPMP/src/libnatpmp/getgateway.c
+++ b/3rdParty/LibNATPMP/src/libnatpmp/getgateway.c
@@ -1,7 +1,7 @@
-/* $Id: getgateway.c,v 1.24 2014/03/31 12:41:35 nanard Exp $ */
+/* $Id: getgateway.c,v 1.25 2014/04/22 10:28:57 nanard Exp $ */
/* libnatpmp
-Copyright (c) 2007-2011, Thomas BERNARD
+Copyright (c) 2007-2014, Thomas BERNARD
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -67,13 +67,6 @@ POSSIBILITY OF SUCH DAMAGE.
#undef USE_SYSCTL_NET_ROUTE
#endif
-#if !defined(USE_PROC_NET_ROUTE) && !defined(USE_SOCKET_ROUTE) && !defined(USE_SYSCTL_NET_ROUTE) && !defined(WIN32)
-int getdefaultgateway(in_addr_t * addr)
-{
- return -1;
-}
-#endif
-
#ifdef WIN32
#undef USE_PROC_NET_ROUTE
#undef USE_SOCKET_ROUTE
@@ -572,4 +565,9 @@ fail:
}
#endif /* #ifdef USE_HAIKU_CODE */
-
+#if !defined(USE_PROC_NET_ROUTE) && !defined(USE_SOCKET_ROUTE) && !defined(USE_SYSCTL_NET_ROUTE) && !defined(USE_WIN32_CODE) && !defined(USE_WIN32_CODE_2) && !defined(USE_HAIKU_CODE)
+int getdefaultgateway(in_addr_t * addr)
+{
+ return -1;
+}
+#endif
diff --git a/3rdParty/LibNATPMP/src/libnatpmp/getgateway.h b/3rdParty/LibNATPMP/src/libnatpmp/getgateway.h
index da98d1a..6eb1f93 100644
--- a/3rdParty/LibNATPMP/src/libnatpmp/getgateway.h
+++ b/3rdParty/LibNATPMP/src/libnatpmp/getgateway.h
@@ -1,6 +1,6 @@
-/* $Id: getgateway.h,v 1.7 2013/09/10 20:09:04 nanard Exp $ */
+/* $Id: getgateway.h,v 1.8 2014/04/22 09:15:40 nanard Exp $ */
/* libnatpmp
-Copyright (c) 2007-2013, Thomas BERNARD
+Copyright (c) 2007-2014, Thomas BERNARD
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@ typedef unsigned short uint16_t;
#endif
#define in_addr_t uint32_t
#endif
-#include "declspec.h"
+/* #include "declspec.h" */
#ifdef ANDROID
#include <arpa/inet.h>
@@ -49,6 +49,6 @@ typedef unsigned short uint16_t;
* return value :
* 0 : success
* -1 : failure */
-LIBSPEC int getdefaultgateway(in_addr_t * addr);
+/* LIBSPEC */int getdefaultgateway(in_addr_t * addr);
#endif
diff --git a/3rdParty/LibNATPMP/src/libnatpmp/natpmp.c b/3rdParty/LibNATPMP/src/libnatpmp/natpmp.c
index a09f217..3a49812 100644
--- a/3rdParty/LibNATPMP/src/libnatpmp/natpmp.c
+++ b/3rdParty/LibNATPMP/src/libnatpmp/natpmp.c
@@ -1,6 +1,6 @@
-/* $Id: natpmp.c,v 1.18 2013/11/26 08:47:36 nanard Exp $ */
+/* $Id: natpmp.c,v 1.20 2015/05/27 12:43:15 nanard Exp $ */
/* libnatpmp
-Copyright (c) 2007-2013, Thomas BERNARD
+Copyright (c) 2007-2015, Thomas BERNARD
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -116,7 +116,7 @@ int sendpendingrequest(natpmp_t * p)
addr.sin_addr.s_addr = p->gateway;
r = (int)sendto(p->s, p->pending_request, p->pending_request_len, 0,
(struct sockaddr *)&addr, sizeof(addr));*/
- r = (int)send(p->s, p->pending_request, p->pending_request_len, 0);
+ r = (int)send(p->s, (const char *)p->pending_request, p->pending_request_len, 0);
return (r<0) ? NATPMP_ERR_SENDERR : r;
}
@@ -125,7 +125,7 @@ int sendnatpmprequest(natpmp_t * p)
int n;
if(!p)
return NATPMP_ERR_INVALIDARGS;
- /* TODO : check if no request is allready pending */
+ /* TODO : check if no request is already pending */
p->has_pending_request = 1;
p->try_number = 1;
n = sendpendingrequest(p);
@@ -204,7 +204,7 @@ LIBSPEC int readnatpmpresponse(natpmp_t * p, natpmpresp_t * response)
int n;
if(!p)
return NATPMP_ERR_INVALIDARGS;
- n = recvfrom(p->s, buf, sizeof(buf), 0,
+ n = recvfrom(p->s, (char *)buf, sizeof(buf), 0,
(struct sockaddr *)&addr, &addrlen);
if(n<0)
#ifdef WIN32
diff --git a/3rdParty/LibNATPMP/src/libnatpmp/natpmp.h b/3rdParty/LibNATPMP/src/libnatpmp/natpmp.h
index 6791c76..41325c9 100644
--- a/3rdParty/LibNATPMP/src/libnatpmp/natpmp.h
+++ b/3rdParty/LibNATPMP/src/libnatpmp/natpmp.h
@@ -1,6 +1,6 @@
-/* $Id: natpmp.h,v 1.19 2014/04/01 09:39:29 nanard Exp $ */
+/* $Id: natpmp.h,v 1.20 2014/04/22 09:15:40 nanard Exp $ */
/* libnatpmp
-Copyright (c) 2007-2013, Thomas BERNARD
+Copyright (c) 2007-2014, Thomas BERNARD
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -48,10 +48,18 @@ typedef unsigned short uint16_t;
#define in_addr_t uint32_t
#include "declspec.h"
#else /* WIN32 */
+#define LIBSPEC
#include <netinet/in.h>
#endif /* WIN32 */
-#include "declspec.h"
+/* causes problem when installing. Maybe should it be inlined ? */
+/* #include "declspec.h" */
+
+#ifdef ANDROID
+#include <arpa/inet.h>
+#define in_addr_t uint32_t
+#endif
+
#ifdef ANDROID
#include <arpa/inet.h>