1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
http://megaglest.svn.sourceforge.net/viewvc/megaglest?view=revision&revision=3958
https://bugs.gentoo.org/show_bug.cgi?id=456952
--- trunk/source/shared_lib/CMakeLists.txt 2012/12/24 18:05:13 3957
+++ trunk/source/shared_lib/CMakeLists.txt 2012/12/26 01:11:11 3958
@@ -297,7 +297,12 @@
ADD_DEFINITIONS(-DMINIUPNPC_VERSION_PRE1_6)
message(STATUS "Adding macro for miniupnpc version: pre v1.6")
ENDIF()
- IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6)
+ IF(MINIUPNPC_VERSION_PRE1_7)
+ ADD_DEFINITIONS(-DMINIUPNPC_VERSION_PRE1_7)
+ message(STATUS "Adding macro for miniupnpc version: pre v1.7")
+ ENDIF()
+
+ IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7)
message(STATUS "**No macros required for miniupnpc version")
ENDIF()
--- trunk/mk/cmake/Modules/FindMiniupnpc.cmake 2012/12/24 18:05:13 3957
+++ trunk/mk/cmake/Modules/FindMiniupnpc.cmake 2012/12/26 01:11:11 3958
@@ -58,20 +58,40 @@
#include <stdio.h>
int main()
{
- struct UPNPDev *devlist = NULL;
- int upnp_delay = 5000;
- const char *upnp_multicastif = NULL;
- const char *upnp_minissdpdsock = NULL;
- int upnp_sameport = 0;
- int upnp_ipv6 = 0;
- int upnp_error = 0;
- devlist = upnpDiscover(upnp_delay, upnp_multicastif, upnp_minissdpdsock, upnp_sameport, upnp_ipv6, &upnp_error);
+ static struct UPNPUrls urls;
+ static struct IGDdatas data;
+
+ GetUPNPUrls (&urls, &data, \"myurl\",0);
return 0;
}"
- MINIUPNPC_VERSION_1_6_OR_HIGHER)
-
- IF (NOT MINIUPNPC_VERSION_1_6_OR_HIGHER)
+ MINIUPNPC_VERSION_1_7_OR_HIGHER)
+
+ IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
+ set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
+ check_cxx_source_runs("
+ #include <miniwget.h>
+ #include <miniupnpc.h>
+ #include <upnpcommands.h>
+ #include <stdio.h>
+ int main()
+ {
+ struct UPNPDev *devlist = NULL;
+ int upnp_delay = 5000;
+ const char *upnp_multicastif = NULL;
+ const char *upnp_minissdpdsock = NULL;
+ int upnp_sameport = 0;
+ int upnp_ipv6 = 0;
+ int upnp_error = 0;
+ devlist = upnpDiscover(upnp_delay, upnp_multicastif, upnp_minissdpdsock, upnp_sameport, upnp_ipv6, &upnp_error);
+
+ return 0;
+ }"
+ MINIUPNPC_VERSION_PRE1_7)
+ ENDIF()
+
+ IF (NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
check_cxx_source_runs("
@@ -96,25 +116,27 @@
ENDIF()
- set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
- set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
- check_cxx_source_runs("
- #include <miniwget.h>
- #include <miniupnpc.h>
- #include <upnpcommands.h>
- #include <stdio.h>
- static struct UPNPUrls urls;
- static struct IGDdatas data;
- int main()
- {
- char externalIP[16] = "";
- UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIP);
+ IF (NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
+ set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
+ check_cxx_source_runs("
+ #include <miniwget.h>
+ #include <miniupnpc.h>
+ #include <upnpcommands.h>
+ #include <stdio.h>
+ static struct UPNPUrls urls;
+ static struct IGDdatas data;
+ int main()
+ {
+ char externalIP[16] = "";
+ UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIP);
- return 0;
- }"
- MINIUPNPC_VERSION_1_5_OR_HIGHER)
+ return 0;
+ }"
+ MINIUPNPC_VERSION_1_5_OR_HIGHER)
+ ENDIF()
- IF (NOT MINIUPNPC_VERSION_1_5_OR_HIGHER)
+ IF (NOT MINIUPNPC_VERSION_1_5_OR_HIGHER AND NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
check_cxx_source_runs("
@@ -141,8 +163,12 @@
IF(MINIUPNPC_VERSION_PRE1_6)
message(STATUS "Found miniupnpc version is pre v1.6")
ENDIF()
- IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6)
- message(STATUS "Found miniupnpc version is v1.6 or higher")
+ IF(MINIUPNPC_VERSION_PRE1_7)
+ message(STATUS "Found miniupnpc version is pre v1.7")
+ ENDIF()
+
+ IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7)
+ message(STATUS "Found miniupnpc version is v1.7 or higher")
ENDIF()
else ()
--- trunk/source/shared_lib/sources/platform/posix/socket.cpp 2012/12/24 18:05:13 3957
+++ trunk/source/shared_lib/sources/platform/posix/socket.cpp 2012/12/26 01:11:11 3958
@@ -2478,13 +2478,22 @@
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("UPnP device found: %s %s\n", dev->descURL, dev->st);
//printf("UPnP device found: [%s] [%s] lanaddr [%s]\n", dev->descURL, dev->st,lanaddr);
+#ifndef MINIUPNPC_VERSION_PRE1_7
+ descXML = (char *)miniwget_getaddr(dev->descURL, &descXMLsize, lanaddr, (sizeof(lanaddr) / sizeof(lanaddr[0])),0);
+#else
descXML = (char *)miniwget_getaddr(dev->descURL, &descXMLsize, lanaddr, (sizeof(lanaddr) / sizeof(lanaddr[0])));
+#endif
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"LAN address: %s\n", lanaddr);
if (descXML) {
parserootdesc (descXML, descXMLsize, &data);
free (descXML); descXML = 0;
+
+#ifndef MINIUPNPC_VERSION_PRE1_7
+ GetUPNPUrls (&urls, &data, dev->descURL,0);
+#else
GetUPNPUrls (&urls, &data, dev->descURL);
+#endif
}
snprintf(buf, 255,"UPnP device found: %s %s LAN address %s", dev->descURL, dev->st, lanaddr);
|