diff --git a/MSVC/ring-daemon.vcxproj b/MSVC/ring-daemon.vcxproj
index eb9501c10..1f777b471 100644
--- a/MSVC/ring-daemon.vcxproj
+++ b/MSVC/ring-daemon.vcxproj
@@ -244,7 +244,7 @@
TurnOffAllWarnings
Disabled
false
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\msvc\include\upnp;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
RING_UWP;_USE_MATH_DEFINES;DEBUG_FPS;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;WIN32_NATIVE;_MBCS;%(PreprocessorDefinitions)
@@ -279,7 +279,7 @@
TurnOffAllWarnings
Disabled
false
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\msvc\include\upnp;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
RING_UWP;_USE_MATH_DEFINES;DEBUG_FPS;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;WIN32_NATIVE;_MBCS;%(PreprocessorDefinitions)
@@ -322,7 +322,7 @@
TurnOffAllWarnings
Disabled
false
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\msvc\include\upnp;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
RING_UWP;_USE_MATH_DEFINES;DEBUG_FPS;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;WIN32_NATIVE;_MBCS;%(PreprocessorDefinitions)
@@ -365,7 +365,7 @@
TurnOffAllWarnings
Disabled
false
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x64\include;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\msvc\include\upnp;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x64\include;%(AdditionalIncludeDirectories)
RING_UWP;_USE_MATH_DEFINES;DEBUG_FPS;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;WIN32_NATIVE;_MBCS;%(PreprocessorDefinitions)
4996;4503;4180;4244;4267;
true
@@ -392,7 +392,7 @@
TurnOffAllWarnings
Disabled
false
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x64\include;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\msvc\include\upnp;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x64\include;%(AdditionalIncludeDirectories)
RING_UWP;_USE_MATH_DEFINES;DEBUG_FPS;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;WIN32_NATIVE;_MBCS;%(PreprocessorDefinitions)
4996;4503;4180;4244;4267;
true
@@ -424,7 +424,7 @@
TurnOffAllWarnings
Disabled
false
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x64\include;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\msvc\include\upnp;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x64\include;%(AdditionalIncludeDirectories)
RING_UWP;_USE_MATH_DEFINES;DEBUG_FPS;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;WIN32_NATIVE;_MBCS;%(PreprocessorDefinitions)
4996;4503;4180;4244;4267;
true
@@ -458,7 +458,7 @@
true
true
false
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\msvc\include\upnp;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
RING_UWP;_USE_MATH_DEFINES;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;WIN32_NATIVE;_MBCS;%(PreprocessorDefinitions)
@@ -494,7 +494,7 @@
true
true
false
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\msvc\include\upnp;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
_USE_MATH_DEFINES;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;WIN32_NATIVE;_MBCS;%(PreprocessorDefinitions)
@@ -536,7 +536,7 @@
true
true
false
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\msvc\include\upnp;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x86\include;%(AdditionalIncludeDirectories)
_USE_MATH_DEFINES;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;WIN32_NATIVE;_MBCS;%(PreprocessorDefinitions)
@@ -578,7 +578,7 @@
true
true
false
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x64\include;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\pupnp\upnp\inc;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x64\include;%(AdditionalIncludeDirectories)
RING_UWP;STATICLIB;_USE_MATH_DEFINES;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;WIN32_NATIVE;_MBCS;%(PreprocessorDefinitions)
4996;4503;4180;4244;4267;
true
@@ -601,7 +601,7 @@
false
- false
+ true
@@ -616,7 +616,7 @@
true
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x64\include;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\msvc\include\upnp;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x64\include;%(AdditionalIncludeDirectories)
STATIC_GETOPT;_USE_MATH_DEFINES;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;RING_UWP;WIN32_NATIVE;_MBCS;OPENDHT_PROXY_CLIENT;OPENDHT_PROXY_SERVER;OPENDHT_PUSH_NOTIFICATIONS;%(PreprocessorDefinitions)
4996;4503;4180;4244;4267;
true
@@ -644,7 +644,7 @@
- ws2_32.lib;iphlpapi.lib;advapi32.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;libgnutls.lib;lib_json.lib;libopendht.lib;Argon2Ref.lib;secp256k1.lib;libyaml-cppmd.lib;portaudio.lib;libupnp.lib;pjsip-core-x86_64-x64-vc15-Release.lib;pjsip-simple-x86_64-x64-vc15-Release.lib;pjsua2-lib-x86_64-x64-vc15-Release.lib;pjsua-lib-x86_64-x64-vc15-Release.lib;pjsip-ua-x86_64-x64-vc15-Release.lib;pjmedia-x86_64-x64-vc15-Release.lib;pjlib-util-x86_64-x64-vc15-Release.lib;pjlib-x86_64-x64-vc15-Release.lib;pjnath-x86_64-x64-vc15-Release.lib;restbed.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)
+ ws2_32.lib;ixml.lib;pthreads.lib;advapi32.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;libgnutls.lib;lib_json.lib;libopendht.lib;Argon2Ref.lib;secp256k1.lib;libyaml-cppmd.lib;portaudio.lib;libupnp.lib;pjsip-core-x86_64-x64-vc15-Release.lib;pjsip-simple-x86_64-x64-vc15-Release.lib;pjsua2-lib-x86_64-x64-vc15-Release.lib;pjsua-lib-x86_64-x64-vc15-Release.lib;pjsip-ua-x86_64-x64-vc15-Release.lib;pjmedia-x86_64-x64-vc15-Release.lib;pjlib-util-x86_64-x64-vc15-Release.lib;pjlib-x86_64-x64-vc15-Release.lib;pjnath-x86_64-x64-vc15-Release.lib;restbed.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)
$(ProjectDir)..\contrib\build\ffmpeg\Build\Windows10\x64\bin;$(ProjectDir)..\contrib\msvc\lib\x64;$(ProjectDir)..\contrib\build\boost\stage\lib;$(ProjectDir)..\contrib\build\pjproject\pjsip\lib;$(ProjectDir)..\contrib\build\pjproject\pjmedia\lib;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\lib;$(ProjectDir)..\contrib\build\pjproject\third_party\lib;$(ProjectDir)..\contrib\build\pjproject\pjlib\lib;$(ProjectDir)..\contrib\build\pjproject\pjnath\lib;$(ProjectDir)..\contrib\build\restbed\build\Release;$(ProjectDir)..\contrib\build\restbed\dependency\openssl\out32dll;$(ProjectDir)..\contrib\build\argon2\vs2015\Argon2Ref\vs2015\build;$(ProjectDir)..\contrib\build\yaml-cpp\msvc\Release
/ignore:4006 /ignore:4221 %(AdditionalOptions)
true
@@ -658,7 +658,7 @@
true
- $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\win32\x64\include;$(ProjectDir)..\contrib\build\sndfile\src;%(AdditionalIncludeDirectories)
+ $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\src;$(ProjectDir)..\src\client;$(ProjectDir)..\src\config;$(ProjectDir)..\src\dring;$(ProjectDir)..\src\hooks;$(ProjectDir)..\src\im;$(ProjectDir)..\src\media;$(ProjectDir)..\src\jamidht;$(ProjectDir)..\src\security;$(ProjectDir)..\src\sip;$(ProjectDir)..\src\upnp;$(ProjectDir)..\src\upnp\igd;$(ProjectDir)..\src\upnp\protocol;$(ProjectDir)..\src\upnp\mapping;$(ProjectDir)..\src\jamidht\eth;$(ProjectDir)..\contrib\msvc;$(ProjectDir)..\contrib\msvc\include;$(ProjectDir)..\contrib\msvc\include\upnp;$(ProjectDir)..\contrib\build\msgpack-c\include;$(ProjectDir)..\contrib\build\jsoncpp\include;$(ProjectDir)..\contrib\build\yaml-cpp\include;$(ProjectDir)..\contrib\build\pjproject\pjlib\include;$(ProjectDir)..\contrib\build\pjproject\pjnath\include;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\include;$(ProjectDir)..\contrib\build\pjproject\pjsip\include;$(ProjectDir)..\contrib\build\pjproject\third_party;$(ProjectDir)..\contrib\build\pjproject\pjmedia\include;$(ProjectDir)..\contrib\build\restbed\source;$(ProjectDir)..\contrib\build\ffmpeg\Build\win32\x64\include;$(ProjectDir)..\contrib\build\sndfile\src;%(AdditionalIncludeDirectories)
STATIC_GETOPT;_USE_MATH_DEFINES;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;HAVE_CONFIG_H;WIN32_LEAN_AND_MEAN;_MBCS;OPENDHT_PROXY_CLIENT;OPENDHT_PROXY_SERVER;OPENDHT_PUSH_NOTIFICATIONS;%(PreprocessorDefinitions)
4996;4503;4180;4244;4267;
true
@@ -687,7 +687,7 @@
- ws2_32.lib;iphlpapi.lib;advapi32.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;libgnutls.lib;lib_json.lib;libopendht.lib;Argon2Ref.lib;secp256k1.lib;libyaml-cppmd.lib;portaudio.lib;libupnp.lib;pjsip-core-x86_64-x64-vc15-Release.lib;pjsip-simple-x86_64-x64-vc15-Release.lib;pjsua2-lib-x86_64-x64-vc15-Release.lib;pjsua-lib-x86_64-x64-vc15-Release.lib;pjsip-ua-x86_64-x64-vc15-Release.lib;pjmedia-x86_64-x64-vc15-Release.lib;pjlib-util-x86_64-x64-vc15-Release.lib;pjlib-x86_64-x64-vc15-Release.lib;pjnath-x86_64-x64-vc15-Release.lib;restbed.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)
+ ws2_32.lib;advapi32.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;libgnutls.lib;lib_json.lib;libopendht.lib;Argon2Ref.lib;secp256k1.lib;libyaml-cppmd.lib;portaudio.lib;libupnp.lib;pjsip-core-x86_64-x64-vc15-Release.lib;pjsip-simple-x86_64-x64-vc15-Release.lib;pjsua2-lib-x86_64-x64-vc15-Release.lib;pjsua-lib-x86_64-x64-vc15-Release.lib;pjsip-ua-x86_64-x64-vc15-Release.lib;pjmedia-x86_64-x64-vc15-Release.lib;pjlib-util-x86_64-x64-vc15-Release.lib;pjlib-x86_64-x64-vc15-Release.lib;pjnath-x86_64-x64-vc15-Release.lib;restbed.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)
$(ProjectDir)..\contrib\build\ffmpeg\Build\win32\x64\bin;$(ProjectDir)..\contrib\msvc\lib\x64;$(ProjectDir)..\contrib\build\boost\stage\lib;$(ProjectDir)..\contrib\build\pjproject\pjsip\lib;$(ProjectDir)..\contrib\build\pjproject\pjmedia\lib;$(ProjectDir)..\contrib\build\pjproject\pjlib-util\lib;$(ProjectDir)..\contrib\build\pjproject\third_party\lib;$(ProjectDir)..\contrib\build\pjproject\pjlib\lib;$(ProjectDir)..\contrib\build\pjproject\pjnath\lib;$(ProjectDir)..\contrib\build\restbed\build\Release;$(ProjectDir)..\contrib\build\restbed\dependency\openssl\out32dll;$(ProjectDir)..\contrib\build\argon2\vs2015\Argon2Ref\vs2015\build;$(ProjectDir)..\contrib\build\yaml-cpp\msvc\Release;$(ProjectDir)..\contrib\build\sndfile\msvc\x64\Release
/ignore:4006 /ignore:4221 %(AdditionalOptions)
true
@@ -828,9 +828,12 @@
+
+
+
+
-
@@ -987,9 +990,14 @@
+
+
+
+
+
+
-
diff --git a/MSVC/ring-daemon.vcxproj.filters b/MSVC/ring-daemon.vcxproj.filters
index 4c833a923..b61f30c0f 100644
--- a/MSVC/ring-daemon.vcxproj.filters
+++ b/MSVC/ring-daemon.vcxproj.filters
@@ -62,6 +62,12 @@
{96b01e7f-7e05-480c-85a3-fa35ef5f8b87}
+
+ {13d62143-0c05-410a-bc32-8748a87deaa9}
+
+
+ {a75d6869-9eb3-4cdd-8006-08b5ee5e6050}
+
@@ -175,15 +181,6 @@
Source Files\jamidht
-
- Source Files\upnp
-
-
- Source Files\upnp
-
-
- Source Files\upnp
-
Source Files\sip
@@ -328,9 +325,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -409,6 +403,24 @@
Source Files\media\video
+
+ Source Files\upnp
+
+
+ Source Files\upnp
+
+
+ Source Files\upnp\protocol
+
+
+ Source Files\upnp\protocol
+
+
+ Source Files\upnp\protocol\pupnp
+
+
+ Source Files\upnp\protocol\pupnp
+
@@ -507,9 +519,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -606,9 +615,6 @@
Source Files\jamidht
-
- Source Files\jamidht
-
Source Files\jamidht
@@ -792,15 +798,6 @@
Source Files\sip
-
- Source Files\upnp
-
-
- Source Files\upnp
-
-
- Source Files\upnp
-
Source Files\media
@@ -843,10 +840,37 @@
Source Files\media\video
+
+ Source Files\upnp
+
+
+ Source Files\upnp
+
+
+ Source Files\jamidht
+
+
+ Source Files\upnp\protocol
+
+
+ Source Files\upnp\protocol
+
+
+ Source Files\upnp\protocol
+
+
+ Source Files\upnp\protocol
+
+
+ Source Files\upnp\protocol\pupnp
+
+
+ Source Files\upnp\protocol\pupnp
+
Source Files\jamidht\eth\libdevcore
-
\ No newline at end of file
+
diff --git a/configure.ac b/configure.ac
index 0fefb1e0d..536927e52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -566,6 +566,7 @@ AS_IF([test "x$with_upnp" = "xyes"],
[AC_MSG_WARN([Missing libupnp development files])
AC_DEFINE([HAVE_LIBUPNP], 0, [Define if you have libupnp])])
])
+AM_CONDITIONAL([BUILD_PUPNP], test "x$with_upnp" = "xyes")
# LIBNATPMP
dnl check for libnatpmp
@@ -580,6 +581,7 @@ AS_IF([test "x$with_natpmp" != xno],
],[])
AC_DEFINE_UNQUOTED([HAVE_LIBNATPMP], `if test "x$with_natpmp" != xno; then echo 1; else echo 0; fi`, [Define if you have libnatpmp])
+AM_CONDITIONAL([BUILD_NATPMP], test "x$with_natpmp" = "xyes")
AC_DEFINE_UNQUOTED([HAVE_SHM], `if test -z "${HAVE_LINUX_TRUE}" && test -z "${HAVE_ANDROID_FALSE}" ; then echo 1; else echo 0; fi`,
[Define if you have shared memory support])
@@ -632,6 +634,9 @@ AC_CONFIG_FILES([Makefile \
src/media/video/winvideo/Makefile \
src/security/Makefile \
src/upnp/Makefile \
+ src/upnp/protocol/Makefile \
+ src/upnp/protocol/natpmp/Makefile \
+ src/upnp/protocol/pupnp/Makefile \
ringtones/Makefile \
test/Makefile\
test/sip/Makefile
diff --git a/contrib/build_all.bat b/contrib/build_all.bat
index 8e1d306f1..e70ebb3bf 100644
--- a/contrib/build_all.bat
+++ b/contrib/build_all.bat
@@ -68,9 +68,8 @@ msgpack=build\msgpack-c\vs2017\msgpackc-static.vcxproj, ^
opendht=build\opendht\MSVC\opendht.vcxproj, ^
pjproject=pjproject, ^
pthreads=build\pthreads\MSVC\pthreads.vcxproj, ^
-xml=build\libupnp\build\vs2017\ixml.vcxproj, ^
-threadutil=build\libupnp\build\vs2017\threadutil.vcxproj, ^
-upnp=build\libupnp\build\vs2017\libupnp.vcxproj, ^
+xml=build\pupnp\build\vs2017\ixml.vcxproj, ^
+upnp=build\pupnp\build\vs2017\libupnp.vcxproj, ^
secp256k1=build\secp256k1\MSVC\secp256k1.vcxproj, ^
portaudio=build\portaudio\msvc\portaudio.vcxproj, ^
yaml-cpp=build\yaml-cpp\msvc\yaml-cpp.vcxproj, ^
@@ -95,9 +94,8 @@ msgpack=build\msgpack-c\vs2017\msgpackc-static.vcxproj, ^
opendht=build\opendht\MSVC\opendht.vcxproj, ^
pjproject=pjproject, ^
pthreads=build\pthreads\MSVC\pthreads.vcxproj, ^
-xml=build\libupnp\build\vs2017\ixml.vcxproj, ^
-threadutil=build\libupnp\build\vs2017\threadutil.vcxproj, ^
-upnp=build\libupnp\build\vs2017\libupnp.vcxproj, ^
+xml=build\pupnp\build\vs2017\ixml.vcxproj, ^
+upnp=build\pupnp\build\vs2017\libupnp.vcxproj, ^
secp256k1=build\secp256k1\MSVC\secp256k1.vcxproj, ^
portaudio=build\portaudio\msvc\portaudio.vcxproj, ^
yaml-cpp=build\yaml-cpp\msvc\yaml-cpp.vcxproj
diff --git a/contrib/src/upnp/SHA512SUMS b/contrib/src/upnp/SHA512SUMS
index caa04b0b5..9f1d758ec 100644
--- a/contrib/src/upnp/SHA512SUMS
+++ b/contrib/src/upnp/SHA512SUMS
@@ -1 +1 @@
-0c44356cd466c72baa9a15a45bc601d3d88a5c1efea79495e07581d93edfeaf3d6e47a301a51e3fa54a776945e0d6b65a67998c480e918a535eeb80d18b05fa9 pupnp-release-1.6.25.tar.gz
+6d96dc0dcf187a425f3b60f4e750102331bd0a5bd452007e345eeacb63e9287ac213574c8071294809283ff8d8795433706ed2a14bae3d451605bf7a75e5a5bb pupnp-release-1.8.4.tar.gz
diff --git a/contrib/src/upnp/fetch_and_patch.bat b/contrib/src/upnp/fetch_and_patch.bat
index 90ae973a6..219f6e195 100644
--- a/contrib/src/upnp/fetch_and_patch.bat
+++ b/contrib/src/upnp/fetch_and_patch.bat
@@ -1,6 +1,6 @@
set BUILD=%SRC%..\build
-set UPNP_VERSION=1.6.25
+set UPNP_VERSION=1.8.4
set UPNP_URL=https://github.com/mrjimenez/pupnp/archive/release-%UPNP_VERSION%.tar.gz
mkdir %BUILD%
@@ -13,11 +13,10 @@ if %USE_CACHE%==1 (
7z -y x release-%UPNP_VERSION%.tar.gz && 7z -y x release-%UPNP_VERSION%.tar -o%BUILD%
del release-%UPNP_VERSION%.tar && del release-%UPNP_VERSION%.tar.gz && del %BUILD%\pax_global_header
-rename %BUILD%\pupnp-release-%UPNP_VERSION% libupnp
+rename %BUILD%\pupnp-release-%UPNP_VERSION% pupnp
-cd %BUILD%\libupnp
+cd %BUILD%\pupnp
%APPLY_CMD% %SRC%\upnp\libupnp-windows.patch
-%APPLY_CMD% %SRC%\upnp\libupnp-vs2017.patch
-cd %SRC%
\ No newline at end of file
+cd %SRC%
diff --git a/contrib/src/upnp/libupnp-ipv6.patch b/contrib/src/upnp/libupnp-ipv6.patch
index 7b89bc268..81df7a64f 100644
--- a/contrib/src/upnp/libupnp-ipv6.patch
+++ b/contrib/src/upnp/libupnp-ipv6.patch
@@ -15,7 +15,7 @@ index af310ca..1ae422f 100644
@@ -68,6 +68,13 @@
/*! . */
#define APPLICATION_LISTENING_PORT 49152
-
+
+/* IPV6_V6ONLY is missing from MinGW, hack taken from
+ * http://svn.apache.org/repos/asf/apr/apr/trunk/network_io/win32/sockopt.c
+ */
@@ -33,7 +33,7 @@ index 231c2c5..6a9c27f 100644
@@ -69,6 +69,13 @@
#endif /* UPNP_ENABLE_IPV6 */
#endif /* INCLUDE_CLIENT_APIS */
-
+
+/* IPV6_V6ONLY is missing from MinGW, hack taken from
+ * http://svn.apache.org/repos/asf/apr/apr/trunk/network_io/win32/sockopt.c
+ */
@@ -42,8 +42,8 @@ index 231c2c5..6a9c27f 100644
+#endif
+
void RequestHandler();
-
+
enum Listener {
---
+--
1.7.9.7
diff --git a/contrib/src/upnp/libupnp-vs2017.patch b/contrib/src/upnp/libupnp-vs2017.patch
deleted file mode 100644
index f78b812b6..000000000
--- a/contrib/src/upnp/libupnp-vs2017.patch
+++ /dev/null
@@ -1,904 +0,0 @@
---- /dev/null
-+++ b/build/vs2017/ixml.vcxproj
-@@ -0,0 +1,203 @@
-+
-+
-+
-+
-+ Debug
-+ Win32
-+
-+
-+ Debug
-+ x64
-+
-+
-+ Release
-+ Win32
-+
-+
-+ Release
-+ x64
-+
-+
-+
-+ {9C2C266D-35A3-465F-A297-0E21D54E5C89}
-+ ixml
-+ 10.0.16299.0
-+
-+
-+
-+ StaticLibrary
-+ v141
-+ NotSet
-+ true
-+
-+
-+ StaticLibrary
-+ v141
-+ NotSet
-+
-+
-+ StaticLibrary
-+ v141
-+ NotSet
-+ true
-+
-+
-+ StaticLibrary
-+ v141
-+ NotSet
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ <_ProjectFileVersion>14.0.24730.2
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(SolutionDir)\x86\tmp\$(ProjectName)\
-+ true
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(SolutionDir)\$(Platform)\tmp\$(ProjectName)\
-+ true
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(SolutionDir)\x86\tmp\$(ProjectName)\
-+ true
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(ProjectDir)..\..\MSVC\$(Platform)\tmp\$(ProjectName)\
-+ true
-+
-+
-+
-+ Disabled
-+ ..\..\ixml\inc;..\..\ixml\src\inc;..\inc;..\..\upnp\inc;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;DEBUG;WIN32;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ EnableFastChecks
-+ MultiThreadedDebug
-+
-+ $(IntDir)
-+ $(OutDir)\lib\x86\$(ProjectName).pdb
-+ Level3
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ $(OutDir);$(OutDir)..\lib\x86;$(OutDir)..\bin\x86;%(AdditionalLibraryDirectories)
-+ $(OutDir)\lib\x86\$(TargetName)$(TargetExt)
-+
-+
-+
-+
-+ X64
-+
-+
-+ Disabled
-+ ..\..\ixml\inc;..\..\ixml\src\inc;..\inc;..\..\upnp\inc;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;DEBUG;WIN32;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ EnableFastChecks
-+ MultiThreadedDebug
-+
-+ $(IntDir)
-+ $(OutDir)\lib\x64\$(ProjectName).pdb
-+ Level3
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ $(OutDir);$(OutDir)..\lib\x64;$(OutDir)..\bin\x64;%(AdditionalLibraryDirectories)
-+ $(OutDir)\lib\x64\$(TargetName)$(TargetExt)
-+
-+
-+
-+
-+ MaxSpeed
-+ Default
-+ true
-+ ..\..\ixml\inc;..\..\ixml\src\inc;..\inc;..\..\upnp\inc;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;WIN32;NDEBUG;RELEASE;_WINDOWS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ MultiThreaded
-+ true
-+
-+ $(IntDir)
-+ $(OutDir)\lib\x86\$(ProjectName).pdb
-+ Level3
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ $(OutDir);$(OutDir)..\lib\x86;$(OutDir)..\bin\x86;%(AdditionalLibraryDirectories)
-+ $(OutDir)\lib\x86\$(TargetName)$(TargetExt)
-+
-+
-+
-+
-+ X64
-+
-+
-+ MaxSpeed
-+ Default
-+ true
-+ ..\..\ixml\inc;..\..\ixml\src\inc;..\inc;..\..\upnp\inc;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;WIN32;NDEBUG;RELEASE;_WINDOWS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ MultiThreaded
-+ true
-+
-+ $(IntDir)
-+ $(OutDir)\lib\x64\$(ProjectName).pdb
-+ Level3
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ $(OutDir);$(OutDir)..\lib\x64;$(OutDir)..\bin\x64;%(AdditionalLibraryDirectories)
-+ $(OutDir)\lib\x64\$(TargetName)$(TargetExt)
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-\ No newline at end of file
---- /dev/null
-+++ b/build/vs2017/libupnp.sln
-@@ -0,0 +1,51 @@
-+
-+Microsoft Visual Studio Solution File, Format Version 12.00
-+# Visual Studio 15
-+VisualStudioVersion = 15.0.27703.2026
-+MinimumVisualStudioVersion = 10.0.40219.1
-+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libupnp", "libupnp.vcxproj", "{6227F51A-1498-4C4A-B213-F6FDED605125}"
-+EndProject
-+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ixml", "ixml.vcxproj", "{9C2C266D-35A3-465F-A297-0E21D54E5C89}"
-+EndProject
-+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "threadutil", "threadutil.vcxproj", "{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}"
-+EndProject
-+Global
-+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
-+ Debug|Win32 = Debug|Win32
-+ Debug|x64 = Debug|x64
-+ Release|Win32 = Release|Win32
-+ Release|x64 = Release|x64
-+ EndGlobalSection
-+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
-+ {6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.ActiveCfg = Debug|Win32
-+ {6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.Build.0 = Debug|Win32
-+ {6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|x64.ActiveCfg = Debug|x64
-+ {6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|x64.Build.0 = Debug|x64
-+ {6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.ActiveCfg = Release|Win32
-+ {6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.Build.0 = Release|Win32
-+ {6227F51A-1498-4C4A-B213-F6FDED605125}.Release|x64.ActiveCfg = Release|x64
-+ {6227F51A-1498-4C4A-B213-F6FDED605125}.Release|x64.Build.0 = Release|x64
-+ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|Win32.ActiveCfg = Debug|Win32
-+ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|Win32.Build.0 = Debug|Win32
-+ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|x64.ActiveCfg = Debug|x64
-+ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|x64.Build.0 = Debug|x64
-+ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|Win32.ActiveCfg = Release|Win32
-+ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|Win32.Build.0 = Release|Win32
-+ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|x64.ActiveCfg = Release|x64
-+ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|x64.Build.0 = Release|x64
-+ {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Debug|Win32.ActiveCfg = Debug|Win32
-+ {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Debug|Win32.Build.0 = Debug|Win32
-+ {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Debug|x64.ActiveCfg = Debug|x64
-+ {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Debug|x64.Build.0 = Debug|x64
-+ {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Release|Win32.ActiveCfg = Release|Win32
-+ {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Release|Win32.Build.0 = Release|Win32
-+ {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Release|x64.ActiveCfg = Release|x64
-+ {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Release|x64.Build.0 = Release|x64
-+ EndGlobalSection
-+ GlobalSection(SolutionProperties) = preSolution
-+ HideSolutionNode = FALSE
-+ EndGlobalSection
-+ GlobalSection(ExtensibilityGlobals) = postSolution
-+ SolutionGuid = {C0989A12-7B9E-4AF3-8C0F-930A122FC7F4}
-+ EndGlobalSection
-+EndGlobal
---- /dev/null
-+++ b/build/vs2017/libupnp.vcxproj
-@@ -0,0 +1,440 @@
-+
-+
-+
-+
-+ Debug
-+ Win32
-+
-+
-+ Debug
-+ x64
-+
-+
-+ Release
-+ Win32
-+
-+
-+ Release
-+ x64
-+
-+
-+
-+ {6227F51A-1498-4C4A-B213-F6FDED605125}
-+ libupnp
-+ 10.0.16299.0
-+
-+
-+
-+ StaticLibrary
-+ v141
-+ false
-+ NotSet
-+ false
-+
-+
-+ StaticLibrary
-+ v141
-+ false
-+ NotSet
-+
-+
-+ StaticLibrary
-+ v141
-+ false
-+ NotSet
-+ false
-+
-+
-+ StaticLibrary
-+ v141
-+ false
-+ NotSet
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ <_ProjectFileVersion>14.0.24730.2
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(SolutionDir)\x86\tmp\$(ProjectName)\
-+ libupnpd
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(SolutionDir)\$(Platform)\tmp\$(ProjectName)\
-+ libupnpd
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(SolutionDir)\x86\tmp\$(ProjectName)\
-+ libupnp
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(ProjectDir)..\..\MSVC\$(Platform)\tmp\$(ProjectName)\
-+ libupnp
-+
-+
-+
-+ _DEBUG;%(PreprocessorDefinitions)
-+ true
-+ true
-+ Win32
-+ .\Debug/libupnp.tlb
-+
-+
-+
-+ Disabled
-+ ..\inc;..\msvc;..\..\upnp\inc;..\..\upnp\src\inc;..\..\ixml\inc;..\..\ixml\src\inc;..\..\threadutil\inc;..\..\pthreads;..\..\pthreads\include;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;WIN32;DEBUG;_WINDOWS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ EnableFastChecks
-+ MultiThreadedDebug
-+
-+ $(IntDir)
-+ $(IntDir)
-+ $(OutDir)\lib\x86\$(ProjectName).pdb
-+
-+ Level3
-+ true
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ _DEBUG;%(PreprocessorDefinitions)
-+ 0x0407
-+
-+
-+ $(OutDir)\lib\x86;$(OutDir)\bin\x86;%(AdditionalLibraryDirectories)
-+ false
-+ $(OutDir)\lib\x86\$(TargetName)$(TargetExt)
-+
-+
-+ true
-+ $(OutDir)libupnp.bsc
-+
-+
-+ true
-+
-+
-+ mkdir "$(OutDir)"\include
-+
-+mkdir "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\upnp\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\build\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\ixml\src\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\ixml\inc\*.h "$(OutDir)"\include\upnp
-+
-+
-+
-+
-+
-+ _DEBUG;%(PreprocessorDefinitions)
-+ true
-+ true
-+ X64
-+ .\Debug/libupnp.tlb
-+
-+
-+
-+ Disabled
-+ ..\inc;..\msvc;..\..\upnp\inc;..\..\upnp\src\inc;..\..\ixml\inc;..\..\ixml\src\inc;..\..\threadutil\inc;..\..\pthreads;..\..\pthreads\include;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;WIN32;DEBUG;_WINDOWS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ EnableFastChecks
-+ MultiThreadedDebug
-+
-+ $(IntDir)
-+ $(IntDir)
-+ $(OutDir)\lib\x64\$(ProjectName).pdb
-+
-+ Level3
-+ true
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ _DEBUG;%(PreprocessorDefinitions)
-+ 0x0407
-+
-+
-+ $(OutDir)\lib\x64;$(OutDir)\bin\x64;%(AdditionalLibraryDirectories)
-+ $(OutDir)\lib\x64\$(TargetName)$(TargetExt)
-+
-+
-+ true
-+ $(OutDir)libupnp.bsc
-+
-+
-+ mkdir "$(OutDir)"\include
-+
-+mkdir "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\upnp\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\build\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\ixml\src\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\ixml\inc\*.h "$(OutDir)"\include\upnp
-+
-+
-+
-+
-+
-+
-+
-+
-+ NDEBUG;%(PreprocessorDefinitions)
-+ true
-+ true
-+ Win32
-+ .\Release/libupnp.tlb
-+
-+
-+
-+ MaxSpeed
-+ Default
-+ true
-+ false
-+ ..\inc;..\msvc;..\..\upnp\inc;..\..\upnp\src\inc;..\..\ixml\inc;..\..\ixml\src\inc;..\..\threadutil\inc;..\..\pthreads;..\..\pthreads\include;$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\pthreads;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;WIN32;NDEBUG;RELEASE;_WINDOWS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ MultiThreaded
-+ true
-+
-+ $(IntDir)
-+ $(IntDir)
-+ $(OutDir)\lib\x86\$(ProjectName).pdb
-+
-+ Level3
-+ true
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ NDEBUG;%(PreprocessorDefinitions)
-+ 0x0407
-+
-+
-+ $(OutDir)\lib\x86;$(OutDir)\bin\x86;%(AdditionalLibraryDirectories)
-+ $(OutDir)\lib\x86\$(TargetName)$(TargetExt)
-+
-+
-+ true
-+ .\Release/libupnp.bsc
-+
-+
-+ mkdir "$(OutDir)"\include
-+
-+mkdir "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\upnp\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\build\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\ixml\src\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\ixml\inc\*.h "$(OutDir)"\include\upnp
-+
-+
-+
-+
-+
-+ NDEBUG;%(PreprocessorDefinitions)
-+ true
-+ true
-+ X64
-+ .\Release/libupnp.tlb
-+
-+
-+
-+ MinSpace
-+ Default
-+ true
-+ false
-+ ..\inc;..\msvc;..\..\upnp\inc;..\..\upnp\src\inc;..\..\ixml\inc;..\..\ixml\src\inc;..\..\threadutil\inc;..\..\pthreads;..\..\pthreads\include;$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\pthreads;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;WIN32;NDEBUG;RELEASE;_WINDOWS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ MultiThreaded
-+ true
-+
-+ $(IntDir)
-+ $(IntDir)
-+ $(OutDir)\lib\x64\$(ProjectName).pdb
-+
-+ Level3
-+ true
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ NDEBUG;%(PreprocessorDefinitions)
-+ 0x0407
-+
-+
-+ $(OutDir)\lib\x64;$(OutDir)\bin\x64;%(AdditionalLibraryDirectories)
-+
-+
-+ /IGNORE:4006 %(AdditionalOptions)
-+ $(OutDir)\lib\x64\$(TargetName)$(TargetExt)
-+
-+
-+ true
-+ .\Release/libupnp.bsc
-+
-+
-+ mkdir "$(OutDir)"\include
-+
-+mkdir "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\upnp\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\build\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\ixml\src\inc\*.h "$(OutDir)"\include\upnp
-+
-+xcopy /S /Y $(ProjectDir)..\..\ixml\inc\*.h "$(OutDir)"\include\upnp
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ {9c2c266d-35a3-465f-a297-0e21d54e5c89}
-+ false
-+
-+
-+ {1d3eef7a-d248-48c0-b6b5-eca229fe4b3d}
-+ false
-+
-+
-+
-+
-+
-+
-\ No newline at end of file
---- /dev/null
-+++ b/build/vs2017/threadutil.vcxproj
-@@ -0,0 +1,192 @@
-+
-+
-+
-+
-+ Debug
-+ Win32
-+
-+
-+ Debug
-+ x64
-+
-+
-+ Release
-+ Win32
-+
-+
-+ Release
-+ x64
-+
-+
-+
-+ {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}
-+ threadutil
-+ 10.0.16299.0
-+
-+
-+
-+ StaticLibrary
-+ v141
-+ NotSet
-+ true
-+
-+
-+ StaticLibrary
-+ v141
-+ NotSet
-+
-+
-+ StaticLibrary
-+ v141
-+ NotSet
-+ true
-+
-+
-+ StaticLibrary
-+ v141
-+ NotSet
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+ <_ProjectFileVersion>14.0.24730.2
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(SolutionDir)\x86\tmp\$(ProjectName)\
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(SolutionDir)\$(Platform)\tmp\$(ProjectName)\
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(SolutionDir)\x86\tmp\$(ProjectName)\
-+
-+
-+ $(ProjectDir)..\..\..\..\msvc\
-+ $(ProjectDir)..\..\MSVC\$(Platform)\tmp\$(ProjectName)\
-+
-+
-+
-+ Disabled
-+ ..\..\threadutil\inc;..\..\upnp\inc;..\..\..\..\msvc\include;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;DEBUG;WIN32;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ EnableFastChecks
-+ MultiThreadedDebug
-+ $(IntDir)
-+ $(OutDir)\lib\x86\$(ProjectName).pdb
-+ Level3
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ $(OutDir)\lib\x86;$(OutDir)\bin\x86;$(OutDir);%(AdditionalLibraryDirectories)
-+ $(OutDir)\lib\x86\$(TargetName)$(TargetExt)
-+
-+
-+
-+
-+ X64
-+
-+
-+ Disabled
-+ ..\..\threadutil\inc;..\..\upnp\inc;..\..\..\..\msvc\include;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;DEBUG;WIN32;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ EnableFastChecks
-+ MultiThreadedDebug
-+ $(IntDir)
-+ $(OutDir)\lib\x64\$(ProjectName).pdb
-+ Level3
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ $(OutDir)\lib\x64;$(OutDir)\bin\x64;$(OutDir);%(AdditionalLibraryDirectories)
-+ $(OutDir)\lib\x64\$(TargetName)$(TargetExt)
-+
-+
-+
-+
-+ MaxSpeed
-+ Default
-+ true
-+ ..\..\threadutil\inc;..\..\upnp\inc;..\..\..\..\msvc\include;$(ProjectDir)..\..\..\pthreads;$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\pthreads;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;WIN32;NDEBUG;RELEASE;_WINDOWS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ MultiThreaded
-+ true
-+ $(IntDir)
-+ $(OutDir)\lib\x86\$(ProjectName).pdb
-+ Level3
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ $(OutDir)\lib\x86;$(OutDir)\bin\x86;$(OutDir);$(ProjectDir)..\..\..\bin\x64;%(AdditionalLibraryDirectories)
-+ $(OutDir)\lib\x86\$(TargetName)$(TargetExt)
-+
-+
-+
-+
-+ X64
-+
-+
-+ MaxSpeed
-+ Default
-+ true
-+ ..\..\threadutil\inc;..\..\upnp\inc;..\..\..\..\msvc\include;$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\pthreads;%(AdditionalIncludeDirectories)
-+ _TIMESPEC_DEFINED;WIN32;NDEBUG;RELEASE;_WINDOWS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-+ true
-+ MultiThreaded
-+ true
-+ $(IntDir)
-+ $(OutDir)\lib\x64\$(ProjectName).pdb
-+ Level3
-+ ProgramDatabase
-+ CompileAsC
-+ 4244;4267;4311;4477;4996;
-+
-+
-+ $(OutDir)\lib\x64;$(OutDir)\bin\x64;$(OutDir);$(ProjectDir)..\..\..\lib\x64;%(AdditionalLibraryDirectories)
-+ pthreads.lib
-+ /IGNORE:4006 %(AdditionalOptions)
-+ $(OutDir)\lib\x64\$(TargetName)$(TargetExt)
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-\ No newline at end of file
---
-2.10.2.windows.1
-
diff --git a/contrib/src/upnp/libupnp-win32.patch b/contrib/src/upnp/libupnp-win32.patch
deleted file mode 100644
index 2b6c63953..000000000
--- a/contrib/src/upnp/libupnp-win32.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From 1e14f51854a54e0aea7186b7408f2f74621ab4df Mon Sep 17 00:00:00 2001
-From: fner
-Date: Thu, 24 May 2018 11:20:33 -0400
-Subject: [PATCH] b
-
----
- configure.ac | 1 +
- libupnp.pc.in | 2 +-
- upnp/inc/UpnpInet.h | 5 -----
- upnp/src/inc/upnputil.h | 2 +-
- 4 files changed, 3 insertions(+), 7 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index bcf2395..335a516 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -559,6 +559,7 @@ fi
- RT_BOOL_ARG_ENABLE([samples], [yes], [compilation of upnp/sample/ code])
-
-
-+AC_DEFINE([_WIN32_WINNT], 0x0501, [Define to '0x0500' for Windows 2000 APIs.])
- #
- # doc installation
- # autoconf >= 2.60 already defines ${docdir}, but we will not use its
-diff --git a/libupnp.pc.in b/libupnp.pc.in
-index c649c24..f46f774 100644
---- a/libupnp.pc.in
-+++ b/libupnp.pc.in
-@@ -6,6 +6,6 @@ includedir=@includedir@
- Name: libupnp
- Description: Linux SDK for UPnP Devices
- Version: @VERSION@
--Libs: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ -L${libdir} -lupnp -lthreadutil -lixml
-+Libs: @PTHREAD_CFLAGS@ -L${libdir} -lupnp -lthreadutil -lixml -liphlpapi @PTHREAD_LIBS@
- Cflags: -I${includedir}/upnp
-
-diff --git a/upnp/inc/UpnpInet.h b/upnp/inc/UpnpInet.h
-index ad00a7d..14f87f7 100644
---- a/upnp/inc/UpnpInet.h
-+++ b/upnp/inc/UpnpInet.h
-@@ -15,11 +15,6 @@
-
- #ifdef WIN32
- #include
-- #ifndef UPNP_USE_MSVCPP
-- /* Removed: not required (and cause compilation issues) */
-- #include
-- #include
-- #endif
- #include
- #include
- #include
-diff --git a/upnp/src/inc/upnputil.h b/upnp/src/inc/upnputil.h
-index 76292f8..ed922e1 100644
---- a/upnp/src/inc/upnputil.h
-+++ b/upnp/src/inc/upnputil.h
-@@ -130,7 +130,7 @@ void linecopylen(
- #define strncasecmp strnicmp
- #define sleep(a) Sleep((a)*1000)
- #define usleep(a) Sleep((a)/1000)
-- #define strerror_r(a,b,c) (strerror_s((b),(c),(a)))
-+ #define strerror_r(a,b,c) strncpy( b, strerror(a), c)
- #else
- #define max(a, b) (((a)>(b))? (a):(b))
- #define min(a, b) (((a)<(b))? (a):(b))
---
-2.14.3
-
diff --git a/contrib/src/upnp/libupnp-win64.patch b/contrib/src/upnp/libupnp-win64.patch
deleted file mode 100644
index 8064e6d21..000000000
--- a/contrib/src/upnp/libupnp-win64.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- libupnp/threadutil/inc/ThreadPool.h 2011-01-20 07:46:57.000000000 +0100
-+++ libupnp.new/threadutil/inc/ThreadPool.h 2011-09-23 01:36:12.000000000 +0200
-@@ -45,6 +45,7 @@
- #include
-
- #ifdef WIN32
-+ #ifndef _TIMEZONE_DEFINED
- #include
- struct timezone
- {
-@@ -52,6 +53,7 @@
- int tz_dsttime; /* type of dst correction */
- };
- int gettimeofday(struct timeval *tv, struct timezone *tz);
-+ #endif
- #else /* WIN32 */
- #include
- #include /* for gettimeofday() */
---- libupnp-1.6.16/upnp/inc/upnp.h.orig 2012-03-22 00:15:38.000000000 +0100
-+++ libupnp-1.6.16/upnp/inc/upnp.h 2012-03-28 18:58:55.043642000 +0200
-@@ -61,6 +61,20 @@
- /* Other systems ??? */
- #endif
-
-+# if defined( __MINGW32__ )
-+# if !defined( _OFF_T_ )
-+ typedef long long _off_t;
-+ typedef _off_t off_t;
-+# define _OFF_T_
-+# else
-+# ifdef off_t
-+# undef off_t
-+# endif
-+# define off_t long long
-+# endif
-+# endif
-+
-+
- #define LINE_SIZE (size_t)180
- #define NAME_SIZE (size_t)256
- #define MNFT_NAME_SIZE 64
diff --git a/contrib/src/upnp/libupnp-windows.patch b/contrib/src/upnp/libupnp-windows.patch
index 5484fe98d..3c0de75dc 100644
--- a/contrib/src/upnp/libupnp-windows.patch
+++ b/contrib/src/upnp/libupnp-windows.patch
@@ -1,148 +1,2785 @@
+From 338e06a609d4a44458e671f5c93e392fb194688b Mon Sep 17 00:00:00 2001
+From: Eden Abitbol
+Date: Wed, 12 Jun 2019 16:19:25 -0400
+Subject: [PATCH] Windows patch.
+
+---
+ .gitignore | 6 +-
+ build/vs2017/.gitignore | 4 +
+ build/vs2017/ixml.vcxproj | 233 +++++++++++++
+ build/vs2017/ixml.vcxproj.filters | 65 ++++
+ build/vs2017/libupnp.sln | 60 ++++
+ build/vs2017/libupnp.vcxproj | 503 +++++++++++++++++++++++++++++
+ build/vs2017/libupnp.vcxproj.filters | 407 +++++++++++++++++++++++
+ upnp/inc/FreeList.h | 131 ++++++++
+ upnp/inc/LinkedList.h | 289 +++++++++++++++++
+ upnp/inc/ThreadPool.h | 538 +++++++++++++++++++++++++++++++
+ upnp/inc/TimerThread.h | 161 +++++++++
+ upnp/inc/UpnpGlobal.h | 3 +
+ upnp/inc/upnp.h | 13 +
+ upnp/inc/upnpconfig.h | 132 ++++++++
+ upnp/src/api/upnpapi.c | 2 +-
+ upnp/src/api/upnptools.c | 4 +-
+ upnp/src/genlib/miniserver/miniserver.c | 5 +
+ upnp/src/genlib/net/http/httpreadwrite.c | 4 +-
+ upnp/src/genlib/net/http/webserver.c | 4 +-
+ upnp/src/genlib/net/uri/uri.c | 4 +-
+ upnp/src/inc/autoconfig.h | 229 +++++++++++++
+ upnp/src/inc/inet_pton.h | 50 ---
+ upnp/src/inc/upnputil.h | 2 +-
+ upnp/src/inet_pton.c | 323 -------------------
+ upnp/src/soap/soap_device.c | 4 +-
+ upnp/src/ssdp/ssdp_ctrlpt.c | 4 +-
+ upnp/src/ssdp/ssdp_device.c | 4 +-
+ upnp/src/ssdp/ssdp_server.c | 9 +-
+ upnp/src/urlconfig/urlconfig.c | 4 +-
+ upnp/src/uuid/sysdep.c | 13 +-
+ 30 files changed, 2818 insertions(+), 392 deletions(-)
+ create mode 100644 build/vs2017/.gitignore
+ create mode 100644 build/vs2017/ixml.vcxproj
+ create mode 100644 build/vs2017/ixml.vcxproj.filters
+ create mode 100644 build/vs2017/libupnp.sln
+ create mode 100644 build/vs2017/libupnp.vcxproj
+ create mode 100644 build/vs2017/libupnp.vcxproj.filters
+ create mode 100644 upnp/inc/FreeList.h
+ create mode 100644 upnp/inc/LinkedList.h
+ create mode 100644 upnp/inc/ThreadPool.h
+ create mode 100644 upnp/inc/TimerThread.h
+ create mode 100644 upnp/inc/upnpconfig.h
+ create mode 100644 upnp/src/inc/autoconfig.h
+ delete mode 100644 upnp/src/inc/inet_pton.h
+ delete mode 100644 upnp/src/inet_pton.c
+
+--- a/.gitignore
++++ b/.gitignore
+@@ -55,8 +55,6 @@ modules.builtin
+ include/config
+ include/linux/version.h
+ include/generated
+-build/inc/autoconfig.h
+-build/inc/upnpconfig.h
+
+ # stgit generated dirs
+ patches-*
+@@ -91,7 +89,6 @@ pupnp.includes
+ Makefile
+ Makefile.in
+ aclocal.m4
+-autoconfig.h
+ autoconfig.h.in
+ autom4te.cache/
+ build-aux/
+@@ -107,7 +104,7 @@ m4/ltversion.m4
+ m4/lt~obsolete.m4
+ stamp-h1
+ upnp/inc/stamp-h2
+-upnp/inc/upnpconfig.h
++
+ upnp/sample/tv_combo
+ upnp/sample/tv_combo-1.8
+ upnp/sample/tv_ctrlpt
+@@ -135,7 +132,6 @@ upnp/test_url.trs
+ /build/vc10/out.vc9.Win32/Debug
+ /build/vc10/out.vc10.Win32
+ /build/vc10/out.vc10.x64
+-/pthreads
+ /build/vc10/ipch
+ /build/vc10/IUpnpErrFile.txt
+ /build/vc10/IUpnpInfoFile.txt
--- /dev/null
-+++ b/build/inc/upnpconfig.h
-@@ -0,0 +1,136 @@
-+/* upnp/inc/upnpconfig.h. Generated from upnpconfig.h.in by configure. */
-+/* -*- C -*- */
++++ b/build/vs2017/.gitignore
+@@ -0,0 +1,4 @@
++
++*.suo
++*.user
++*.sdf
+\ No newline at end of file
+--- /dev/null
++++ b/build/vs2017/ixml.vcxproj
+@@ -0,0 +1,233 @@
++
++
++
++
++ Debug
++ Win32
++
++
++ Debug
++ x64
++
++
++ Release
++ Win32
++
++
++ Release
++ x64
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++ {9C2C266D-35A3-465F-A297-0E21D54E5C89}
++ ixml
++ 10.0.16299.0
++
++
++
++ StaticLibrary
++ NotSet
++ true
++ v141
++
++
++ StaticLibrary
++ NotSet
++ v141
++
++
++ StaticLibrary
++ NotSet
++ true
++ v141
++
++
++ StaticLibrary
++ NotSet
++ v141
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++ <_ProjectFileVersion>10.0.40219.1
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\
++ $(SolutionDir)Build\$(Platform)\$(Configuration)\tmp\
++ true
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\
++ $(SolutionDir)Build\$(Platform)\$(Configuration)\tmp\
++ true
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\
++ $(SolutionDir)Build\$(Platform)\$(Configuration)\tmp\
++ true
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\
++ $(SolutionDir)Build\$(Platform)\$(Configuration)\tmp\
++ true
++ AllRules.ruleset
++
++
++ AllRules.ruleset
++
++
++ AllRules.ruleset
++
++
++ AllRules.ruleset
++
++
++
++
++
++ Disabled
++ ..\..\ixml\inc;..\..\ixml\src\inc;..\inc;..\..\upnp\inc;..\..\.;%(AdditionalIncludeDirectories)
++ DEBUG;WIN32;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP;IXML_HAVE_SCRIPTSUPPORT;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
++ true
++ EnableFastChecks
++ MultiThreadedDebugDLL
++
++
++ $(IntDir)
++ $(OutDir)$(ProjectName).pdb
++ Level3
++ ProgramDatabase
++ CompileAsC
++
++
++ $(OutDir)..\lib;$(OutDir)..\bin;%(AdditionalLibraryDirectories)
++
++
++ $(IntDir)$(MSBuildProjectName).log
++
++
++ mkdir $(SolutionDir)..\..\..\..\msvc\include
++mkdir $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\ixml\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\ixml\src\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++
++
++
++
++ X64
++
++
++ Disabled
++ ..\..\ixml\inc;..\..\ixml\src\inc;..\inc;..\..\upnp\inc;..\..\.;%(AdditionalIncludeDirectories)
++ DEBUG;WIN32;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
++ true
++ EnableFastChecks
++ MultiThreadedDebugDLL
++
++
++ $(IntDir)
++ $(OutDir)$(ProjectName).pdb
++ Level3
++ ProgramDatabase
++ CompileAsC
++
++
++ $(OutDir)..\lib;$(OutDir)..\bin;%(AdditionalLibraryDirectories)
++
++
++ mkdir $(SolutionDir)..\..\..\..\msvc\include
++mkdir $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\ixml\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\ixml\src\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++
++
++
++
++ MaxSpeed
++ Default
++ true
++ ..\..\ixml\inc;..\..\ixml\src\inc;..\inc;..\..\upnp\inc;..\..\.;%(AdditionalIncludeDirectories)
++ WIN32;RELEASE;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP;IXML_HAVE_SCRIPTSUPPORT;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
++ true
++ MultiThreadedDLL
++ true
++
++
++ $(IntDir)
++ $(OutDir)$(ProjectName).pdb
++ Level3
++ ProgramDatabase
++ CompileAsC
++
++
++ $(OutDir)..\lib;$(OutDir)..\bin;%(AdditionalLibraryDirectories)
++
++
++ mkdir $(SolutionDir)..\..\..\..\msvc\include
++mkdir $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\ixml\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\ixml\src\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++
++
++
++
++ X64
++
++
++ MaxSpeed
++ Default
++ true
++ ..\..\ixml\inc;..\..\ixml\src\inc;..\inc;..\..\upnp\inc;..\..\upnp\src\inc;..\..\.;%(AdditionalIncludeDirectories)
++ WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
++ true
++ MultiThreadedDLL
++ true
++
++
++ $(IntDir)
++ $(OutDir)$(ProjectName).pdb
++ Level3
++ ProgramDatabase
++ CompileAsC
++ false
++
++
++ $(OutDir)..\lib;$(OutDir)..\bin;%(AdditionalLibraryDirectories)
++
++
++ mkdir $(SolutionDir)..\..\..\..\msvc\include
++mkdir $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\ixml\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\ixml\src\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++
++
++
++
++
++
+\ No newline at end of file
+--- /dev/null
++++ b/build/vs2017/ixml.vcxproj.filters
+@@ -0,0 +1,65 @@
++
++
++
++
++ {93995380-89BD-4b04-88EB-625FBE52EBFB}
++ h;hpp;hxx;hm;inl;inc;xsd
++
++
++ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
++ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
++
++
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++
++
++ sources
++
++
++ sources
++
++
++ sources
++
++
++ sources
++
++
++ sources
++
++
++ sources
++
++
++ sources
++
++
++ sources
++
++
++ sources
++
++
++ sources
++
++
++
+\ No newline at end of file
+--- /dev/null
++++ b/build/vs2017/libupnp.sln
+@@ -0,0 +1,60 @@
++
++Microsoft Visual Studio Solution File, Format Version 12.00
++# Visual Studio 15
++VisualStudioVersion = 15.0.28307.645
++MinimumVisualStudioVersion = 10.0.40219.1
++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libupnp", "libupnp.vcxproj", "{6227F51A-1498-4C4A-B213-F6FDED605125}"
++EndProject
++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ixml", "ixml.vcxproj", "{9C2C266D-35A3-465F-A297-0E21D54E5C89}"
++EndProject
++Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{55AF07A8-18AA-45B8-A231-5082F1C6FC08}"
++ ProjectSection(SolutionItems) = preProject
++ ..\..\AUTHORS = ..\..\AUTHORS
++ ..\..\bootstrap = ..\..\bootstrap
++ ..\..\ChangeLog = ..\..\ChangeLog
++ ..\..\configure.ac = ..\..\configure.ac
++ ..\..\COPYING = ..\..\COPYING
++ ..\..\Doxyfile = ..\..\Doxyfile
++ ..\..\INSTALL = ..\..\INSTALL
++ ..\..\libupnp.pc.in = ..\..\libupnp.pc.in
++ ..\..\libupnp.spec = ..\..\libupnp.spec
++ ..\..\LICENSE = ..\..\LICENSE
++ ..\..\Makefile.am = ..\..\Makefile.am
++ ..\..\NEWS = ..\..\NEWS
++ ..\..\README = ..\..\README
++ ..\..\THANKS = ..\..\THANKS
++ ..\..\TODO = ..\..\TODO
++ EndProjectSection
++EndProject
++Global
++ GlobalSection(SolutionConfigurationPlatforms) = preSolution
++ Debug|Win32 = Debug|Win32
++ Debug|x64 = Debug|x64
++ Release|Win32 = Release|Win32
++ Release|x64 = Release|x64
++ EndGlobalSection
++ GlobalSection(ProjectConfigurationPlatforms) = postSolution
++ {6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.ActiveCfg = Debug|Win32
++ {6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.Build.0 = Debug|Win32
++ {6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|x64.ActiveCfg = Debug|x64
++ {6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|x64.Build.0 = Debug|x64
++ {6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.ActiveCfg = Release|Win32
++ {6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.Build.0 = Release|Win32
++ {6227F51A-1498-4C4A-B213-F6FDED605125}.Release|x64.ActiveCfg = Release|x64
++ {6227F51A-1498-4C4A-B213-F6FDED605125}.Release|x64.Build.0 = Release|x64
++ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|Win32.ActiveCfg = Debug|Win32
++ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|Win32.Build.0 = Debug|Win32
++ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|x64.ActiveCfg = Debug|x64
++ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|x64.Build.0 = Debug|x64
++ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|Win32.ActiveCfg = Release|Win32
++ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|Win32.Build.0 = Release|Win32
++ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|x64.ActiveCfg = Release|x64
++ {9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|x64.Build.0 = Release|x64
++ EndGlobalSection
++ GlobalSection(SolutionProperties) = preSolution
++ HideSolutionNode = FALSE
++ EndGlobalSection
++ GlobalSection(ExtensibilityGlobals) = postSolution
++ SolutionGuid = {EC77EE93-6BCC-4784-9370-EFEC22AE22CD}
++ EndGlobalSection
++EndGlobal
+--- /dev/null
++++ b/build/vs2017/libupnp.vcxproj
+@@ -0,0 +1,503 @@
++
++
++
++
++ Debug
++ Win32
++
++
++ Debug
++ x64
++
++
++ Release
++ Win32
++
++
++ Release
++ x64
++
++
++
++ {6227F51A-1498-4C4A-B213-F6FDED605125}
++ libupnp
++ 10.0.16299.0
++
++
++
++ StaticLibrary
++ false
++ NotSet
++ v141
++
++
++ StaticLibrary
++ false
++ NotSet
++ true
++ v141
++
++
++ StaticLibrary
++ false
++ NotSet
++ v141
++
++
++ StaticLibrary
++ Static
++ NotSet
++ true
++ v141
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++ <_ProjectFileVersion>10.0.40219.1
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\
++ $(SolutionDir)Build\$(Platform)\$(Configuration)\tmp\
++ false
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\
++ $(SolutionDir)Build\$(Platform)\$(Configuration)\tmp\
++ false
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\
++ $(SolutionDir)Build\$(Platform)\$(Configuration)\tmp\
++ false
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\
++ $(SolutionDir)Build\$(Platform)\$(Configuration)\tmp\
++ false
++ AllRules.ruleset
++
++
++ AllRules.ruleset
++
++
++ AllRules.ruleset
++
++
++ AllRules.ruleset
++
++
++
++
++
++ NDEBUG;%(PreprocessorDefinitions)
++ true
++ true
++ Win32
++ .\Release/libupnp.tlb
++
++
++
++
++ MaxSpeed
++ Default
++ true
++ true
++ ..\..\upnp\inc;..\..\upnp\src\inc;..\..\..\..\msvc\include;..\..\..\..\msvc\include\upnp;..\..\upnp\src\threadutil;..\..\ixml\inc;..\..\ixml\src\inc;..\..\..\..\msvc\include;..\..\..\..\msvc\lib\win32
++ IXML_HAVE_SCRIPTSUPPORT;WIN32;NDEBUG;RELEASE;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);_WINSOCK_DEPRECATED_NO_WARNINGS;UPNP_STATIC_LIB
++ true
++ MultiThreadedDLL
++ true
++
++
++ $(IntDir)
++ $(IntDir)
++ $(OutDir)$(ProjectName).pdb
++
++
++ Level3
++ true
++ ProgramDatabase
++ CompileAsC
++
++
++ NDEBUG;%(PreprocessorDefinitions)
++ 0x0407
++
++
++ pthreadvc2.lib;ws2_32.lib;iphlpapi.lib;ixml.lib;%(AdditionalDependencies)
++ $(OutDir)$(ProjectName).dll
++ true
++ ..\..\pthreads\;..\..\pthreads\lib;$(OutDir)..\lib\ixml;%(AdditionalLibraryDirectories)
++ true
++ $(OutDir)$(ProjectName).pdb
++ Windows
++ true
++ true
++ UseLinkTimeCodeGeneration
++ false
++
++
++ $(TargetDir)$(TargetName).lib
++ MachineX86
++
++
++ true
++ .\Release/libupnp.bsc
++
++
++ mkdir $(SolutionDir)..\..\..\..\msvc\include
++mkdir $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\upnp\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\upnp\src\inc\membuffer.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\upnp\src\inc\miniserver.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++ Add pthreadVC2.dll to output
++
++
++ ixml.lib;pthreads.lib;%(AdditionalDependencies)
++
++
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\;%(AdditionalLibraryDirectories)
++
++
++
++
++ NDEBUG;%(PreprocessorDefinitions)
++ true
++ true
++ X64
++ .\Release/libupnp.tlb
++
++
++
++
++ MaxSpeed
++ Default
++ true
++ false
++ ..\..\upnp\inc;..\..\upnp\src\inc;..\..\ixml\inc;..\..\ixml\src\inc;$(SolutionDir)..\..\..\..\msvc\include\;
++ WIN32;NDEBUG;_WINDOWS;PTW32_STATIC_LIB;RELEASE;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);_WINSOCK_DEPRECATED_NO_WARNINGS;UPNP_STATIC_LIB
++ true
++ MultiThreadedDLL
++ true
++
++
++ $(IntDir)
++ $(IntDir)
++ $(OutDir)$(ProjectName).pdb
++
++
++ Level3
++ true
++ ProgramDatabase
++ CompileAsC
++ false
++
++
++ NDEBUG;%(PreprocessorDefinitions)
++ 0x0407
++
++
++ pthreadvc2.lib;ws2_32.lib;iphlpapi.lib;ixml.lib;%(AdditionalDependencies)
++ $(OutDir)$(ProjectName).dll
++ true
++ ..\..\pthreads\;..\..\pthreads\lib;$(OutDir)..\lib\ixml;%(AdditionalLibraryDirectories)
++ true
++ $(OutDir)$(ProjectName).pdb
++ Windows
++ true
++ true
++ UseLinkTimeCodeGeneration
++ false
++
++
++ $(TargetDir)$(TargetName).lib
++ MachineX64
++
++
++ true
++ .\Release/libupnp.bsc
++
++
++ ws2_32.lib;ixml.lib;pthreads.lib;iphlpapi.lib;%(AdditionalDependencies)
++
++
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\;%(AdditionalLibraryDirectories)
++
++
++ mkdir $(SolutionDir)..\..\..\..\msvc\include
++mkdir $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\upnp\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++
++
++ true
++
++
++
++
++ _DEBUG;%(PreprocessorDefinitions)
++ true
++ true
++ Win32
++ .\Debug/libupnp.tlb
++
++
++
++
++ Disabled
++ ..\..\upnp\inc;..\..\upnp\src\inc;..\..\..\..\msvc\include;..\..\..\..\msvc\include\upnp;..\..\upnp\src\threadutil;..\..\ixml\inc;..\..\ixml\src\inc;..\..\..\..\msvc\include;..\..\..\..\msvc\lib\win32
++ IXML_HAVE_SCRIPTSUPPORT;DEBUG;WIN32;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);_WINSOCK_DEPRECATED_NO_WARNINGS;UPNP_STATIC_LIB
++ true
++ EnableFastChecks
++ MultiThreadedDebugDLL
++
++
++ $(IntDir)
++ $(IntDir)
++
++
++ Level3
++ true
++ ProgramDatabase
++ CompileAsC
++ $(OutDir)$(ProjectName).pdb
++
++
++ _DEBUG;%(PreprocessorDefinitions)
++ 0x0407
++
++
++ pthreadvc2.lib;ws2_32.lib;iphlpapi.lib;ixml.lib;%(AdditionalDependencies)
++ $(OutDir)$(ProjectName).dll
++ true
++ ..\..\pthreads\include;..\..\pthreads\lib\x86;$(SolutionDir)Build\$(Platform)\$(Configuration)\lib;%(AdditionalLibraryDirectories)
++ true
++ Windows
++ false
++
++
++ $(TargetDir)$(TargetName).lib
++ MachineX86
++
++
++ true
++ $(OutDir)libupnp.bsc
++
++
++ $(IntDir)$(MSBuildProjectName).log
++
++
++
++
++
++ mkdir $(SolutionDir)..\..\..\..\msvc\include
++mkdir $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\upnp\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\upnp\src\inc\membuffer.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\upnp\src\inc\miniserver.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++
++
++ ixml.lib;pthreads.lib;%(AdditionalDependencies)
++
++
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\;%(AdditionalLibraryDirectories)
++
++
++
++
++ _DEBUG;%(PreprocessorDefinitions)
++ true
++ true
++ X64
++ .\Debug/libupnp.tlb
++
++
++
++
++ Disabled
++ ..\..\upnp\inc;..\..\upnp\src\inc;..\..\..\..\msvc\include;..\..\..\..\msvc\include\upnp;..\..\upnp\src\threadutil;..\..\ixml\inc;..\..\ixml\src\inc;..\..\..\..\msvc\include;..\..\..\..\msvc\lib\x64
++ DEBUG;WIN32;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP;_CRT_NONSTDC_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL;_SCL_SECURE_NO_WARNINGS;_SCL_SECURE_NO_DEPRECATE;_AFX_SECURE_NO_WARNINGS;_AFX_SECURE_NO_DEPRECATE;_SECURE_ATL;_ATL_NO_COM_SUPPORT;_ATL_SECURE_NO_WARNINGS;_ATL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);_WINSOCK_DEPRECATED_NO_WARNINGS;UPNP_STATIC_LIB
++ true
++ EnableFastChecks
++ MultiThreadedDebugDLL
++
++
++ $(IntDir)
++ $(IntDir)
++ $(OutDir)$(ProjectName).pdb
++
++
++ Level3
++ true
++ ProgramDatabase
++ CompileAsC
++
++
++ _DEBUG;%(PreprocessorDefinitions)
++ 0x0407
++
++
++ pthreadvc2.lib;ws2_32.lib;iphlpapi.lib;ixml.lib;%(AdditionalDependencies)
++ $(OutDir)$(ProjectName).dll
++ true
++ ..\..\pthreads\;..\..\pthreads\lib;$(OutDir)..\lib\ixml;%(AdditionalLibraryDirectories)
++ true
++ $(OutDir)$(ProjectName).pdb
++ Windows
++ false
++
++
++ $(TargetDir)$(TargetName).lib
++ MachineX64
++
++
++ true
++ $(OutDir)libupnp.bsc
++
++
++ ixml.lib;pthreads.lib;%(AdditionalDependencies)
++
++
++ $(SolutionDir)..\..\..\..\msvc\lib\$(Platform)\;%(AdditionalLibraryDirectories)
++
++
++ mkdir $(SolutionDir)..\..\..\..\msvc\include
++mkdir $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\upnp\inc\*.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\upnp\src\inc\membuffer.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++xcopy /S /Y $(ProjectDir)..\..\upnp\src\inc\miniserver.h $(SolutionDir)..\..\..\..\msvc\include\upnp
++
++
++
++
++ {9c2c266d-35a3-465f-a297-0e21d54e5c89}
++ false
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
+\ No newline at end of file
+--- /dev/null
++++ b/build/vs2017/libupnp.vcxproj.filters
+@@ -0,0 +1,407 @@
++
++
++
++
++ {47d40159-145c-4ff3-98f5-9b2c96c80092}
++ cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
++
++
++ {2a8d348a-a429-4b41-9934-050df3866f50}
++ h;hpp;hxx;hm;inl
++
++
++ {d7e1f6fa-d5eb-46a7-be21-a1de81e1c83b}
++
++
++ {046adcbc-ea36-4b2c-947d-bc49c65dd159}
++
++
++ {63eeed5a-fb55-4c74-87cc-f01b3e65396c}
++
++
++ {ac2412f9-1484-40e5-94e2-601cf585f0ca}
++
++
++ {6918bb2d-ec22-4237-9d43-07f3a469b921}
++
++
++ {13db6453-fe8d-4869-b839-7fceeca36c68}
++
++
++ {ff538420-d04b-4693-b7e5-1231dc3578c3}
++
++
++ {a518a094-dc55-4904-b6f6-54432f881279}
++
++
++ {ae11371f-7271-415f-b938-bded10b1d69b}
++
++
++ {4268e9a2-9786-4559-ab8e-a116194e2431}
++
++
++ {a1f7e40e-0309-468e-b7d5-b06cdb2db669}
++
++
++ {9db59f74-7e5a-4d8a-bea6-dd7ebc6a1bf3}
++
++
++ {da4ae3ad-7d2f-4e3e-962f-5543000541f2}
++
++
++ {62a4fe61-d4d7-4205-99a2-f4a9f5b00914}
++
++
++ {eb789bde-b652-42d1-a691-2ee7b5f39f05}
++
++
++ {43451589-0f69-481c-a63c-0f89f30e61c0}
++
++
++
++
++ sources\ssdp
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ inc
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ headers
++
++
++ inc
++
++
++ headers
++
++
++ headers
++
++
++
++
++ sources
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\api
++
++
++ sources\gena
++
++
++ sources\gena
++
++
++ sources\gena
++
++
++ sources\genlib\client_table
++
++
++ sources\genlib\client_table
++
++
++ sources\genlib\miniserver
++
++
++ sources\genlib\net
++
++
++ sources\genlib\net\http
++
++
++ sources\genlib\net\http
++
++
++ sources\genlib\net\http
++
++
++ sources\genlib\net\http
++
++
++ sources\genlib\net\http
++
++
++ sources\genlib\net\uri
++
++
++ sources\soap
++
++
++ sources\soap
++
++
++ sources\soap
++
++
++ sources\ssdp
++
++
++ sources\ssdp
++
++
++ sources\ssdp
++
++
++ sources\ssdp
++
++
++ sources\threadutil
++
++
++ sources\threadutil
++
++
++ sources\threadutil
++
++
++ sources\threadutil
++
++
++ sources\urlconfig
++
++
++ sources\uuid
++
++
++ sources\uuid
++
++
++ sources\uuid
++
++
++ sources\genlib\service_table
++
++
++ sources\genlib\util
++
++
++ sources\genlib\util
++
++
++ sources\genlib\util
++
++
++ sources\genlib\util
++
++
++
+\ No newline at end of file
+--- /dev/null
++++ b/upnp/inc/FreeList.h
+@@ -0,0 +1,131 @@
++/*******************************************************************************
++ *
++ * Copyright (c) 2000-2003 Intel Corporation
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are met:
++ *
++ * * Redistributions of source code must retain the above copyright notice,
++ * this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright notice,
++ * this list of conditions and the following disclaimer in the documentation
++ * and/or other materials provided with the distribution.
++ * * Neither name of Intel Corporation nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
++ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ ******************************************************************************/
++
++#ifndef FREE_LIST_H
++#define FREE_LIST_H
++
++/*!
++ * \file
++ */
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include "ithread.h"
++
++#include
++
++/*!
++ * Free list node. points to next free item.
++ * Memory for node is borrowed from allocated items.
++ * \internal
++ */
++typedef struct FREELISTNODE
++{
++ struct FREELISTNODE *next;
++} FreeListNode;
++
++/*!
++ * Stores head and size of free list, as well as mutex for protection.
++ * \internal
++ */
++typedef struct FREELIST
++{
++ FreeListNode *head;
++ size_t element_size;
++ int maxFreeListLength;
++ int freeListLength;
++} FreeList;
++
++/*!
++ * \brief Initializes Free List.
++ *
++ * Must be called first and only once for FreeList.
++ *
++ * \return:
++ * \li \c 0 on success.
++ * \li \c EINVAL on failure.
++ */
++int FreeListInit(
++ /*! Must be valid, non null, pointer to a linked list. */
++ FreeList *free_list,
++ /*! Size of elements to store in free list. */
++ size_t elementSize,
++ /*! Max size that the free list can grow to before returning
++ * memory to O.S. */
++ int maxFreeListLength);
++
++/*!
++ * \brief Allocates chunk of set size.
++ *
++ * If a free item is available in the list, returnes the stored item,
++ * otherwise calls the O.S. to allocate memory.
++ *
++ * \return Non NULL on success. NULL on failure.
++ */
++void *FreeListAlloc(
++ /*! Must be valid, non null, pointer to a linked list. */
++ FreeList *free_list);
++
++/*!
++ * \brief Returns an item to the Free List.
++ *
++ * If the free list is smaller than the max size then adds the item to the
++ * free list, otherwise returns the item to the O.S.
++ *
++ * \return:
++ * \li \c 0 on success.
++ * \li \c EINVAL on failure.
++ */
++int FreeListFree(
++ /*! Must be valid, non null, pointer to a free list. */
++ FreeList *free_list,
++ /*! Must be a pointer allocated by FreeListAlloc. */
++ void *element);
++
++/*!
++ * \brief Releases the resources stored with the free list.
++ *
++ * \return:
++ * \li \c 0 on success.
++ * \li \c EINVAL on failure.
++ */
++int FreeListDestroy(
++ /*! Must be valid, non null, pointer to a linked list. */
++ FreeList *free_list);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* FREE_LIST_H */
++
+--- /dev/null
++++ b/upnp/inc/LinkedList.h
+@@ -0,0 +1,289 @@
++/*******************************************************************************
++ *
++ * Copyright (c) 2000-2003 Intel Corporation
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are met:
++ *
++ * * Redistributions of source code must retain the above copyright notice,
++ * this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright notice,
++ * this list of conditions and the following disclaimer in the documentation
++ * and/or other materials provided with the distribution.
++ * * Neither name of Intel Corporation nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
++ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ ******************************************************************************/
++
++#ifndef LINKED_LIST_H
++#define LINKED_LIST_H
++
++/*!
++ * \file
++ */
++
++#include "FreeList.h"
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#define EOUTOFMEM (-7 & 1<<29)
++
++#define FREELISTSIZE 100
++#define LIST_SUCCESS 1
++#define LIST_FAIL 0
++
++/*! Function for freeing list items. */
++typedef void (*free_function)(void *arg);
++
++/*! Function for comparing list items. Returns 1 if itemA==itemB */
++typedef int (*cmp_routine)(void *itemA,void *itemB);
++
++/*! Linked list node. Stores generic item and pointers to next and prev.
++ * \internal
++ */
++typedef struct LISTNODE
++{
++ struct LISTNODE *prev;
++ struct LISTNODE *next;
++ void *item;
++} ListNode;
++
++/*!
++ * Linked list (no protection).
++ *
++ * Because this is for internal use, parameters are NOT checked for validity.
++ * The first item of the list is stored at node: head->next
++ * The last item of the list is stored at node: tail->prev
++ * If head->next=tail, then list is empty.
++ * To iterate through the list:
++ *
++ * LinkedList g;
++ * ListNode *temp = NULL;
++ * for (temp = ListHead(g);temp!=NULL;temp = ListNext(g,temp)) {
++ * }
++ *
++ * \internal
++ */
++typedef struct LINKEDLIST
++{
++ /*! head, first item is stored at: head->next */
++ ListNode head;
++ /*! tail, last item is stored at: tail->prev */
++ ListNode tail;
++ /*! size of list */
++ long size;
++ /*! free list to use */
++ FreeList freeNodeList;
++ /*! free function to use */
++ free_function free_func;
++ /*! compare function to use */
++ cmp_routine cmp_func;
++} LinkedList;
++
++/*!
++ * \brief Initializes LinkedList. Must be called first and only once for List.
++ *
++ * \return
++ * \li \c 0 on success.
++ * \li \c EOUTOFMEM on failure.
++ */
++int ListInit(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list,
++ /*! Function used to compare items. (May be NULL). */
++ cmp_routine cmp_func,
++ /*! Function used to free items. (May be NULL). */
++ free_function free_func);
++
++/*!
++ * \brief Adds a node to the head of the list. Node gets immediately after
++ * list head.
++ *
++ * Precondition:
++ * The list has been initialized.
++ *
++ * \return The pointer to the ListNode on success, NULL on failure.
++ */
++ListNode *ListAddHead(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list,
++ /*! Item to be added. */
++ void *item);
++
++/*!
++ * \brief Adds a node to the tail of the list. Node gets added immediately
++ * before list.tail.
++ *
++ * Precondition: The list has been initialized.
++ *
++ * \return The pointer to the ListNode on success, NULL on failure.
++ */
++ListNode *ListAddTail(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list,
++ /*! Item to be added. */
++ void *item);
++
++/*!
++ * \brief Adds a node after the specified node. Node gets added immediately
++ * after bnode.
++ *
++ * Precondition: The list has been initialized.
++ *
++ * \return The pointer to the ListNode on success, NULL on failure.
++ */
++ListNode *ListAddAfter(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list,
++ /*! Item to be added. */
++ void *item,
++ /*! Node to add after. */
++ ListNode *bnode);
++
++/*!
++ * \brief Adds a node before the specified node. Node gets added immediately
++ * before anode.
++ *
++ * Precondition: The list has been initialized.
++ *
++ * \return The pointer to the ListNode on success, NULL on failure.
++ */
++ListNode *ListAddBefore(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list,
++ /*! Item to be added. */
++ void *item,
++ /*! Node to add in front of. */
++ ListNode *anode);
++
++/*!
++ * \brief Removes a node from the list. The memory for the node is freed.
++ *
++ * Precondition: The list has been initialized.
++ *
++ * \return The pointer to the item stored in the node or NULL if the item
++ * is freed.
++ */
++void *ListDelNode(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list,
++ /*! Node to delete. */
++ ListNode *dnode,
++ /*! if !0 then item is freed using free function. If 0 (or free
++ * function is NULL) then item is not freed. */
++ int freeItem);
++
++/*!
++ * \brief Removes all memory associated with list nodes. Does not free
++ * LinkedList *list.
++ *
++ * Precondition: The list has been initialized.
++ *
++ * \return 0 on success, EINVAL on failure.
++ */
++int ListDestroy(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list,
++ /*! if !0 then item is freed using free function. If 0 (or free
++ * function is NULL) then item is not freed. */
++ int freeItem);
++
++/*!
++ * \brief Returns the head of the list.
++ *
++ * Precondition: The list has been initialized.
++ *
++ * \return The head of the list. NULL if list is empty.
++ */
++ListNode *ListHead(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list);
++
++/*!
++ * \brief Returns the tail of the list.
++ *
++ * Precondition: The list has been initialized.
++ *
++ * \return The tail of the list. NULL if list is empty.
++ */
++ListNode *ListTail(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list);
++
++/*!
++ * \brief Returns the next item in the list.
++ *
++ * Precondition: The list has been initialized.
++ *
++ * \return The next item in the list. NULL if there are no more items in list.
++ */
++ListNode *ListNext(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list,
++ /*! Node from the list. */
++ ListNode *node);
++
++/*!
++ * \brief Returns the previous item in the list.
++ *
++ * Precondition: The list has been initialized.
++ *
++ * \return The previous item in the list. NULL if there are no more items in list.
++ */
++ListNode *ListPrev(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list,
++ /*! Node from the list. */
++ ListNode *node);
++
++/*!
++ * \brief Finds the specified item in the list.
++ *
++ * Uses the compare function specified in ListInit. If compare function
++ * is NULL then compares items as pointers.
++ *
++ * Precondition: The list has been initialized.
++ *
++ * \return The node containing the item. NULL if no node contains the item.
++ */
++ListNode* ListFind(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList *list,
++ /*! The node to start from, NULL if to start from beginning. */
++ ListNode *start,
++ /*! The item to search for. */
++ void *item);
++
++/*!
++ * \brief Returns the size of the list.
++ *
++ * Precondition: The list has been initialized.
++ *
++ * \return The number of items in the list.
++ */
++long ListSize(
++ /*! Must be valid, non null, pointer to a linked list. */
++ LinkedList* list);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* LINKED_LIST_H */
++
+--- /dev/null
++++ b/upnp/inc/ThreadPool.h
+@@ -0,0 +1,538 @@
++/*******************************************************************************
++ *
++ * Copyright (c) 2000-2003 Intel Corporation
++ * All rights reserved.
++ * Copyright (c) 2012 France Telecom All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are met:
++ *
++ * * Redistributions of source code must retain the above copyright notice,
++ * this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright notice,
++ * this list of conditions and the following disclaimer in the documentation
++ * and/or other materials provided with the distribution.
++ * * Neither name of Intel Corporation nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
++ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ ******************************************************************************/
++
++#ifndef THREADPOOL_H
++#define THREADPOOL_H
++
++/*!
++ * \file
++ */
++
++#include "FreeList.h"
++#include "ithread.h"
++#include "LinkedList.h"
++#include "UpnpInet.h"
++#include "UpnpGlobal.h" /* for UPNP_INLINE, EXPORT_SPEC */
++
++#include
++
++#ifdef _WIN32
++#ifndef _TIMEZONE_DEFINED
++ #include
++ struct timezone
++ {
++ int tz_minuteswest; /* minutes W of Greenwich */
++ int tz_dsttime; /* type of dst correction */
++ };
++ int gettimeofday(struct timeval *tv, struct timezone *tz);
++#endif
++#else /* _WIN32 */
++ #include
++ #include /* for gettimeofday() */
++ #if defined(__OSX__) || defined(__APPLE__) || defined(__NetBSD__)
++ #include /* for setpriority() */
++ #endif
++#endif
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/*! Size of job free list */
++#define JOBFREELISTSIZE 100
++
++#define INFINITE_THREADS -1
++
++#define EMAXTHREADS (-8 & 1<<29)
++
++/*! Invalid Policy */
++#define INVALID_POLICY (-9 & 1<<29)
++
++/*! Invalid JOB Id */
++#define INVALID_JOB_ID (-2 & 1<<29)
++
++typedef enum duration {
++ SHORT_TERM,
++ PERSISTENT
++} Duration;
++
++typedef enum priority {
++ LOW_PRIORITY,
++ MED_PRIORITY,
++ HIGH_PRIORITY
++} ThreadPriority;
++
++/*! default priority used by TPJobInit */
++#define DEFAULT_PRIORITY MED_PRIORITY
++
++/*! default minimum used by TPAttrInit */
++#define DEFAULT_MIN_THREADS 1
++
++/*! default max used by TPAttrInit */
++#define DEFAULT_MAX_THREADS 10
++
++/*! default stack size used by TPAttrInit */
++#define DEFAULT_STACK_SIZE 0u
++
++/*! default jobs per thread used by TPAttrInit */
++#define DEFAULT_JOBS_PER_THREAD 10
++
++/*! default starvation time used by TPAttrInit */
++#define DEFAULT_STARVATION_TIME 500
++
++/*! default idle time used by TPAttrInit */
++#define DEFAULT_IDLE_TIME 10 * 1000
++
++/*! default free routine used TPJobInit */
++#define DEFAULT_FREE_ROUTINE NULL
++
++/*! default max jobs used TPAttrInit */
++#define DEFAULT_MAX_JOBS_TOTAL 100
++
++/*!
++ * \brief Statistics.
++ *
++ * Always include stats because code change is minimal.
++ */
++#define STATS 1
++
++#ifdef _DEBUG
++ #define DEBUG 1
++#endif
++
++typedef int PolicyType;
++
++#define DEFAULT_POLICY SCHED_OTHER
++
++/*! Function for freeing a thread argument. */
++typedef void (*free_routine)(void *arg);
++
++
++/*! Attributes for thread pool. Used to set and change parameters of thread
++ * pool. */
++typedef struct THREADPOOLATTR
++{
++ /*! ThreadPool will always maintain at least this many threads. */
++ int minThreads;
++ /*! ThreadPool will never have more than this number of threads. */
++ int maxThreads;
++ /*! This is the minimum stack size allocated for each thread. */
++ size_t stackSize;
++ /*! This is the maximum time a thread will
++ * remain idle before dying (in milliseconds). */
++ int maxIdleTime;
++ /*! Jobs per thread to maintain. */
++ int jobsPerThread;
++ /*! Maximum number of jobs that can be queued totally. */
++ int maxJobsTotal;
++ /*! the time a low priority or med priority job waits before getting
++ * bumped up a priority (in milliseconds). */
++ int starvationTime;
++ /*! scheduling policy to use. */
++ PolicyType schedPolicy;
++} ThreadPoolAttr;
++
++/*! Internal ThreadPool Job. */
++typedef struct THREADPOOLJOB
++{
++ start_routine func;
++ void *arg;
++ free_routine free_func;
++ struct timeval requestTime;
++ ThreadPriority priority;
++ int jobId;
++} ThreadPoolJob;
++
++/*! Structure to hold statistics. */
++typedef struct TPOOLSTATS
++{
++ double totalTimeHQ;
++ int totalJobsHQ;
++ double avgWaitHQ;
++ double totalTimeMQ;
++ int totalJobsMQ;
++ double avgWaitMQ;
++ double totalTimeLQ;
++ int totalJobsLQ;
++ double avgWaitLQ;
++ double totalWorkTime;
++ double totalIdleTime;
++ int workerThreads;
++ int idleThreads;
++ int persistentThreads;
++ int totalThreads;
++ int maxThreads;
++ int currentJobsHQ;
++ int currentJobsLQ;
++ int currentJobsMQ;
++} ThreadPoolStats;
++
++/*!
++ * \brief A thread pool similar to the thread pool in the UPnP SDK.
++ *
++ * Allows jobs to be scheduled for running by threads in a
++ * thread pool. The thread pool is initialized with a
++ * minimum and maximum thread number as well as a max idle time
++ * and a jobs per thread ratio. If a worker thread waits the whole
++ * max idle time without receiving a job and the thread pool
++ * currently has more threads running than the minimum
++ * then the worker thread will exit. If when
++ * scheduling a job the current job to thread ratio
++ * becomes greater than the set ratio and the thread pool currently has
++ * less than the maximum threads then a new thread will
++ * be created.
++ */
++typedef struct THREADPOOL
++{
++ /*! Mutex to protect job qs. */
++ ithread_mutex_t mutex;
++ /*! Condition variable to signal Q. */
++ ithread_cond_t condition;
++ /*! Condition variable for start and stop. */
++ ithread_cond_t start_and_shutdown;
++ /*! ids for jobs */
++ int lastJobId;
++ /*! whether or not we are shutting down */
++ int shutdown;
++ /*! total number of threads */
++ int totalThreads;
++ /*! flag that's set when waiting for a new worker thread to start */
++ int pendingWorkerThreadStart;
++ /*! number of threads that are currently executing jobs */
++ int busyThreads;
++ /*! number of persistent threads */
++ int persistentThreads;
++ /*! free list of jobs */
++ FreeList jobFreeList;
++ /*! low priority job Q */
++ LinkedList lowJobQ;
++ /*! med priority job Q */
++ LinkedList medJobQ;
++ /*! high priority job Q */
++ LinkedList highJobQ;
++ /*! persistent job */
++ ThreadPoolJob *persistentJob;
++ /*! thread pool attributes */
++ ThreadPoolAttr attr;
++ /*! statistics */
++ ThreadPoolStats stats;
++} ThreadPool;
++
++/*!
++ * \brief Initializes and starts ThreadPool. Must be called first and
++ * only once for ThreadPool.
++ *
++ * \return
++ * \li \c 0 on success.
++ * \li \c EAGAIN if not enough system resources to create minimum threads.
++ * \li \c INVALID_POLICY if schedPolicy can't be set.
++ * \li \c EMAXTHREADS if minimum threads is greater than maximum threads.
++ */
++int ThreadPoolInit(
++ /*! Must be valid, non null, pointer to ThreadPool. */
++ ThreadPool *tp,
++ /*! Can be null. if not null then attr contains the following fields:
++ * \li \c minWorkerThreads - minimum number of worker threads thread
++ * pool will never have less than this number of threads.
++ * \li \c maxWorkerThreads - maximum number of worker threads thread
++ * pool will never have more than this number of threads.
++ * \li \c maxIdleTime - maximum time that a worker thread will spend
++ * idle. If a worker is idle longer than this time and there are more
++ * than the min number of workers running, then the worker thread
++ * exits.
++ * \li \c jobsPerThread - ratio of jobs to thread to try and maintain
++ * if a job is scheduled and the number of jobs per thread is greater
++ * than this number,and if less than the maximum number of workers are
++ * running then a new thread is started to help out with efficiency.
++ * \li \c schedPolicy - scheduling policy to try and set (OS dependent).
++ */
++ ThreadPoolAttr *attr);
++
++/*!
++ * \brief Adds a persistent job to the thread pool.
++ *
++ * Job will be run as soon as possible. Call will block until job is scheduled.
++ *
++ * \return
++ * \li \c 0 on success.
++ * \li \c EOUTOFMEM not enough memory to add job.
++ * \li \c EMAXTHREADS not enough threads to add persistent job.
++ */
++int ThreadPoolAddPersistent(
++ /*! Valid thread pool pointer. */
++ ThreadPool*tp,
++ /*! Valid thread pool job. */
++ ThreadPoolJob *job,
++ /*! . */
++ int *jobId);
++
++/*!
++ * \brief Gets the current set of attributes associated with the thread pool.
++ *
++ * \return
++ * \li \c 0 on success, nonzero on failure.
++ */
++int ThreadPoolGetAttr(
++ /*! valid thread pool pointer. */
++ ThreadPool *tp,
++ /*! non null pointer to store attributes. */
++ ThreadPoolAttr *out);
++
++/*!
++ * \brief Sets the attributes for the thread pool.
++ * Only affects future calculations.
++ *
++ * \return
++ * \li \c 0 on success, nonzero on failure.
++ * \li \c INVALID_POLICY if policy can not be set.
++ */
++int ThreadPoolSetAttr(
++ /*! valid thread pool pointer. */
++ ThreadPool *tp,
++ /*! pointer to attributes, null sets attributes to default. */
++ ThreadPoolAttr *attr);
++
++/*!
++ * \brief Adds a job to the thread pool. Job will be run as soon as possible.
++ *
++ * \return
++ * \li \c 0 on success, nonzero on failure.
++ * \li \c EOUTOFMEM if not enough memory to add job.
++ */
++int ThreadPoolAdd(
++ /*! valid thread pool pointer. */
++ ThreadPool*tp,
++ /*! . */
++ ThreadPoolJob *job,
++ /*! id of job. */
++ int *jobId);
++
++/*!
++ * \brief Removes a job from the thread pool. Can only remove jobs which
++ * are not currently running.
++ *
++ * \return
++ * \li \c 0 on success, nonzero on failure.
++ * \li \c INVALID_JOB_ID if job not found.
++ */
++int ThreadPoolRemove(
++ /*! valid thread pool pointer. */
++ ThreadPool *tp,
++ /*! id of job. */
++ int jobId,
++ /*! space for removed job. */
++ ThreadPoolJob *out);
++
++/*!
++ * \brief Shuts the thread pool down. Waits for all threads to finish.
++ * May block indefinitely if jobs do not exit.
++ *
++ * \return 0 on success, nonzero on failure
++ */
++int ThreadPoolShutdown(
++ /*! must be valid tp. */
++ ThreadPool *tp);
++
++/*!
++ * \brief Initializes thread pool job. Sets the priority to default defined
++ * in ThreadPool.h. Sets the free_routine to default defined in ThreadPool.h.
++ *
++ * \return Always returns 0.
++ */
++int TPJobInit(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolJob *job,
++ /*! function to run, must be valid. */
++ start_routine func,
++ /*! argument to pass to function. */
++ void *arg);
++
++/*!
++ * \brief Sets the max threads for the thread pool attributes.
++ *
++ * \return Always returns 0.
++ */
++int TPJobSetPriority(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolJob *job,
++ /*! value to set. */
++ ThreadPriority priority);
++
++/*!
++ * \brief Sets the max threads for the thread pool attributes.
++ *
++ * \return Always returns 0.
++ */
++int TPJobSetFreeFunction(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolJob *job,
++ /*! value to set. */
++ free_routine func);
++
++/*!
++ * \brief Initializes thread pool attributes. Sets values to defaults defined
++ * in ThreadPool.h.
++ *
++ * \return Always returns 0.
++ */
++int TPAttrInit(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolAttr *attr);
++
++/*!
++ * \brief Sets the max threads for the thread pool attributes.
++ *
++ * \return Always returns 0.
++ */
++int TPAttrSetMaxThreads(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolAttr *attr,
++ /*! value to set. */
++ int maxThreads);
++
++/*!
++ * \brief Sets the min threads for the thread pool attributes.
++ *
++ * \return Always returns 0.
++ */
++int TPAttrSetMinThreads(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolAttr *attr,
++ /*! value to set. */
++ int minThreads);
++
++/*!
++ * \brief Sets the stack size for the thread pool attributes.
++ *
++ * \return Always returns 0.
++ */
++int TPAttrSetStackSize(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolAttr *attr,
++ /*! value to set. */
++ size_t stackSize);
++
++/*!
++ * \brief Sets the idle time for the thread pool attributes.
++ *
++ * \return Always returns 0.
++ */
++int TPAttrSetIdleTime(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolAttr *attr,
++ /*! . */
++ int idleTime);
++
++/*!
++ * \brief Sets the jobs per thread ratio
++ *
++ * \return Always returns 0.
++ */
++int TPAttrSetJobsPerThread(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolAttr *attr,
++ /*! number of jobs per thread to maintain. */
++ int jobsPerThread);
++
++/*!
++ * \brief Sets the starvation time for the thread pool attributes.
++ *
++ * \return Always returns 0.
++ */
++int TPAttrSetStarvationTime(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolAttr *attr,
++ /*! milliseconds. */
++ int starvationTime);
++
++/*!
++ * \brief Sets the scheduling policy for the thread pool attributes.
++ *
++ * \return Always returns 0.
++ */
++int TPAttrSetSchedPolicy(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolAttr *attr,
++ /*! must be a valid policy type. */
++ PolicyType schedPolicy);
++
++/*!
++ * \brief Sets the maximum number jobs that can be qeued totally.
++ *
++ * \return Always returns 0.
++ */
++int TPAttrSetMaxJobsTotal(
++ /*! must be valid thread pool attributes. */
++ ThreadPoolAttr *attr,
++ /*! maximum number of jobs. */
++ int maxJobsTotal);
++
++/*!
++ * \brief Returns various statistics about the thread pool.
++ *
++ * Only valid if STATS has been defined.
++ *
++ * \return Always returns 0.
++ */
++#ifdef STATS
++ EXPORT_SPEC int ThreadPoolGetStats(
++ /*! Valid initialized threadpool. */
++ ThreadPool *tp,
++ /*! Valid stats, out parameter. */
++ ThreadPoolStats *stats);
++#else
++ static UPNP_INLINE int ThreadPoolGetStats(
++ /*! Valid initialized threadpool. */
++ ThreadPool *tp,
++ /*! Valid stats, out parameter. */
++ ThreadPoolStats *stats) {}
++#endif
++
++/*!
++ * \brief
++ */
++#ifdef STATS
++ EXPORT_SPEC void ThreadPoolPrintStats(
++ /*! . */
++ ThreadPoolStats *stats);
++#else
++ static UPNP_INLINE void ThreadPoolPrintStats(
++ /*! . */
++ ThreadPoolStats *stats) {}
++#endif
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* THREADPOOL_H */
++
+--- /dev/null
++++ b/upnp/inc/TimerThread.h
+@@ -0,0 +1,161 @@
++/*******************************************************************************
++ *
++ * Copyright (c) 2000-2003 Intel Corporation
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are met:
++ *
++ * * Redistributions of source code must retain the above copyright notice,
++ * this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright notice,
++ * this list of conditions and the following disclaimer in the documentation
++ * and/or other materials provided with the distribution.
++ * * Neither name of Intel Corporation nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
++ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ ******************************************************************************/
++
++#ifndef TIMERTHREAD_H
++#define TIMERTHREAD_H
++
++/*!
++ * \file
++ */
++
++#include "FreeList.h"
++#include "ithread.h"
++#include "LinkedList.h"
++#include "ThreadPool.h"
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#define INVALID_EVENT_ID (-10 & 1<<29)
++
++/*! Timeout Types. */
++typedef enum timeoutType {
++ /*! seconds from Jan 1, 1970. */
++ ABS_SEC,
++ /*! seconds from current time. */
++ REL_SEC
++} TimeoutType;
++
++/*!
++ * A timer thread similar to the one in the Upnp SDK that allows
++ * the scheduling of a job to run at a specified time in the future.
++ *
++ * Because the timer thread uses the thread pool there is no
++ * gurantee of timing, only approximate timing.
++ *
++ * Uses ThreadPool, Mutex, Condition, Thread.
++ */
++typedef struct TIMERTHREAD
++{
++ ithread_mutex_t mutex;
++ ithread_cond_t condition;
++ int lastEventId;
++ LinkedList eventQ;
++ int shutdown;
++ FreeList freeEvents;
++ ThreadPool *tp;
++} TimerThread;
++
++/*!
++ * Struct to contain information for a timer event.
++ *
++ * Internal to the TimerThread.
++ */
++typedef struct TIMEREVENT
++{
++ ThreadPoolJob job;
++ /*! [in] Absolute time for event in seconds since Jan 1, 1970. */
++ time_t eventTime;
++ /*! [in] Long term or short term job. */
++ Duration persistent;
++ int id;
++} TimerEvent;
++
++/*!
++ * \brief Initializes and starts timer thread.
++ *
++ * \return 0 on success, nonzero on failure. Returns error from
++ * ThreadPoolAddPersistent on failure.
++ */
++int TimerThreadInit(
++ /*! [in] Valid timer thread pointer. */
++ TimerThread *timer,
++ /*! [in] Valid thread pool to use. Must be started. Must be valid for
++ * lifetime of timer. Timer must be shutdown BEFORE thread pool. */
++ ThreadPool *tp);
++
++/*!
++ * \brief Schedules an event to run at a specified time.
++ *
++ * \return 0 on success, nonzero on failure, EOUTOFMEM if not enough memory
++ * to schedule job.
++ */
++int TimerThreadSchedule(
++ /*! [in] Valid timer thread pointer. */
++ TimerThread* timer,
++ /*! [in] time of event. Either in absolute seconds, or relative
++ * seconds in the future. */
++ time_t time,
++ /*! [in] either ABS_SEC, or REL_SEC. If REL_SEC, then the event
++ * will be scheduled at the current time + REL_SEC. */
++ TimeoutType type,
++ /*! [in] Valid Thread pool job with following fields. */
++ ThreadPoolJob *job,
++ /*! [in] . */
++ Duration duration,
++ /*! [in] Id of timer event. (out, can be null). */
++ int *id);
++
++/*!
++ * \brief Removes an event from the timer Q.
++ *
++ * Events can only be removed before they have been placed in the thread pool.
++ *
++ * \return 0 on success, INVALID_EVENT_ID on failure.
++ */
++int TimerThreadRemove(
++ /*! [in] Valid timer thread pointer. */
++ TimerThread *timer,
++ /*! [in] Id of event to remove. */
++ int id,
++ /*! [in] Space for thread pool job. */
++ ThreadPoolJob *out);
++
++/*!
++ * \brief Shutdown the timer thread.
++ *
++ * Events scheduled in the future will NOT be run.
++ *
++ * Timer thread should be shutdown BEFORE it's associated thread pool.
++ *
++ * \return 0 if succesfull, nonzero otherwise. Always returns 0.
++ */
++int TimerThreadShutdown(
++ /*! [in] Valid timer thread pointer. */
++ TimerThread *timer);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* TIMER_THREAD_H */
++
+--- a/upnp/inc/UpnpGlobal.h
++++ b/upnp/inc/UpnpGlobal.h
+@@ -1,5 +1,6 @@
+ #ifndef UPNPGLOBAL_H
+ #define UPNPGLOBAL_H
++#include
+
+ /*!
+ * \file
+@@ -42,7 +43,9 @@
+ /* define some things the M$ VC++ doesn't know */
+ #define UPNP_INLINE _inline
+ typedef __int64 int64_t;
++#if !defined(PRId64)
+ #define PRId64 "I64d"
++#endif
+ #define PRIzd "ld"
+ #define PRIzu "lu"
+ #define PRIzx "lx"
+--- a/upnp/inc/upnp.h
++++ b/upnp/inc/upnp.h
+@@ -61,6 +61,19 @@
+ /* Other systems ??? */
+ #endif
+
++# if defined(__MINGW32__)
++# if !defined(_OFF_T_)
++typedef long long _off_t;
++typedef _off_t off_t;
++# define _OFF_T_
++# else
++# ifdef off_t
++# undef off_t
++# endif
++# define off_t long long
++# endif
++# endif
++
+ #ifdef UPNP_ENABLE_OPEN_SSL
+ #include
+ #endif
+--- /dev/null
++++ b/upnp/inc/upnpconfig.h
+@@ -0,0 +1,132 @@
+/*******************************************************************************
+ *
+ * Copyright (c) 2006 Rémi Turboult
-+ * All rights reserved.
++ * All rights reserved.
+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions are met:
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are met:
+ *
-+ * * Redistributions of source code must retain the above copyright notice,
-+ * this list of conditions and the following disclaimer.
-+ * * Redistributions in binary form must reproduce the above copyright notice,
-+ * this list of conditions and the following disclaimer in the documentation
-+ * and/or other materials provided with the distribution.
-+ * * Neither name of Intel Corporation nor the names of its contributors
-+ * may be used to endorse or promote products derived from this software
++ * * Redistributions of source code must retain the above copyright notice,
++ * this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright notice,
++ * this list of conditions and the following disclaimer in the documentation
++ * and/or other materials provided with the distribution.
++ * * Neither name of Intel Corporation nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
-+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ ******************************************************************************/
+
+#ifndef UPNP_CONFIG_H
-+#define UPNP_CONFIG_H
++#define UPNP_CONFIG_H
+
+
+/***************************************************************************
-+ * Library version
-+ ***************************************************************************/
++ * Library version
++ ***************************************************************************/
+
+/** The library version (string) e.g. "1.3.0" */
-+#define UPNP_VERSION_STRING "1.6.19"
++#define UPNP_VERSION_STRING "1.8.5"
+
+/** Major version of the library */
+#define UPNP_VERSION_MAJOR 1
+
+/** Minor version of the library */
-+#define UPNP_VERSION_MINOR 6
++#define UPNP_VERSION_MINOR 8
+
+/** Patch version of the library */
-+#define UPNP_VERSION_PATCH 19
++#define UPNP_VERSION_PATCH 5
+
+/** The library version (numeric) e.g. 10300 means version 1.3.0 */
+#define UPNP_VERSION \
+ ((UPNP_VERSION_MAJOR * 100 + UPNP_VERSION_MINOR) * 100 + UPNP_VERSION_PATCH)
+
-+
-+
+/***************************************************************************
+ * Large file support
+ ***************************************************************************/
+
-+/** File Offset size */
-+#define _FILE_OFFSET_BITS 64
-+
-+/** Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
-+/* #undef _LARGEFILE_SOURCE */
-+
-+/** Large files support */
-+#define _LARGE_FILE_SOURCE /**/
++/* #undef UPNP_LARGEFILE_SENSITIVE */
+
+/***************************************************************************
+ * Library optional features
+ ***************************************************************************/
+
+/*
-+ * The following defines can be tested in order to know which
++ * The following defines can be tested in order to know which
+ * optional features have been included in the installed library.
+ */
+
+
-+/** Defined to 1 if the library has been compiled with DEBUG enabled
++/** Defined to 1 if the library has been compiled with DEBUG enabled
+ * (i.e. configure --enable-debug) : file is available */
+/* #undef UPNP_HAVE_DEBUG */
+
-+
-+/** Defined to 1 if the library has been compiled with client API enabled
++/** Defined to 1 if the library has been compiled with client API enabled
+ * (i.e. configure --enable-client) */
+#define UPNP_HAVE_CLIENT 1
+
-+
-+/** Defined to 1 if the library has been compiled with device API enabled
++/** Defined to 1 if the library has been compiled with device API enabled
+ * (i.e. configure --enable-device) */
+#define UPNP_HAVE_DEVICE 1
+
-+
+/** Defined to 1 if the library has been compiled with integrated web server
+ * (i.e. configure --enable-webserver --enable-device) */
+#define UPNP_HAVE_WEBSERVER 1
+
-+
+/** Defined to 1 if the library has been compiled with the SSDP part enabled
+ * (i.e. configure --enable-ssdp) */
+#define UPNP_HAVE_SSDP 1
+
-+
+/** Defined to 1 if the library has been compiled with optional SSDP headers
+ * support (i.e. configure --enable-optssdp) */
+#define UPNP_HAVE_OPTSSDP 1
+
-+
+/** Defined to 1 if the library has been compiled with the SOAP part enabled
+ * (i.e. configure --enable-soap) */
+#define UPNP_HAVE_SOAP 1
+
-+
+/** Defined to 1 if the library has been compiled with the GENA part enabled
+ * (i.e. configure --enable-gena) */
+#define UPNP_HAVE_GENA 1
+
-+
+/** Defined to 1 if the library has been compiled with helper API
+ * (i.e. configure --enable-tools) : file is available */
+#define UPNP_HAVE_TOOLS 1
+
+/** Defined to 1 if the library has been compiled with ipv6 support
+ * (i.e. configure --enable-ipv6) */
-+/* #undef UPNP_ENABLE_IPV6 */
++/*#undef UPNP_ENABLE_IPV6 */
+
+/** Defined to 1 if the library has been compiled with unspecified SERVER
+ * header (i.e. configure --enable-unspecified_server) */
+/* #undef UPNP_ENABLE_UNSPECIFIED_SERVER */
+
-+#endif /* UPNP_CONFIG_H */
++/** Defined to 1 if the library has been compiled with OpenSSL support
++ * (i.e. configure --enable-open_ssl) */
++/* #undef UPNP_ENABLE_OPEN_SSL */
+
++/** Defined to 1 if the library has been compiled to use blocking TCP socket calls
++ * (i.e. configure --enable_blocking_tcp_connections) */
++#define UPNP_ENABLE_BLOCKING_TCP_CONNECTIONS 0
++
++/** Defined to 1 if the library has been compiled to support filesystem writes on POST
++ * (i.e. configure --enable-postwrite) */
++/* #undef UPNP_ENABLE_POST_WRITE */
++
++/** Defined to 1 if the library has been compiled bind the miniserver socket with SO_REUSEADDR
++ * (i.e. configure --enable_reuseaddr) */
++/* #undef UPNP_MINISERVER_REUSEADDR */
++
++#endif /* UPNP_CONFIG_H */
+--- a/upnp/src/api/upnpapi.c
++++ b/upnp/src/api/upnpapi.c
+@@ -383,13 +383,13 @@ static int UpnpInitPreamble(void)
+ return retVal;
+ }
+
++#ifdef INTERNAL_WEB_SERVER
+ #ifdef INCLUDE_DEVICE_APIS
+ #if EXCLUDE_SOAP == 0
+ SetSoapCallback(soap_device_callback);
+ #endif
+ #endif /* INCLUDE_DEVICE_APIS */
+
+-#ifdef INTERNAL_WEB_SERVER
+ #if EXCLUDE_GENA == 0
+ SetGenaCallback(genaCallback);
+ #endif
+--- a/upnp/src/api/upnptools.c
++++ b/upnp/src/api/upnptools.c
+@@ -57,7 +57,9 @@
+ #define HEADER_LENGTH 2000
+
+ #ifdef _WIN32
+- #define snprintf _snprintf
++ #if _MSC_VER < 1900
++ #define snprintf _snprintf
++ #endif
+ #endif
+
+ /*!
+--- a/upnp/src/genlib/miniserver/miniserver.c
++++ b/upnp/src/genlib/miniserver/miniserver.c
+@@ -68,6 +68,11 @@
+ /*! . */
+ #define APPLICATION_LISTENING_PORT 49152
+
++#ifndef IPV6_V6ONLY
++#define IPV6_V6ONLY 27
++#endif
++
++
+ struct mserv_request_t {
+ /*! Connection handle. */
+ SOCKET connfd;
+--- a/upnp/src/genlib/net/http/httpreadwrite.c
++++ b/upnp/src/genlib/net/http/httpreadwrite.c
+@@ -59,7 +59,9 @@
+ #ifdef _WIN32
+ #include
+ #define fseeko fseek
+- #define snprintf _snprintf
++ #if _MSC_VER < 1900
++ #define snprintf _snprintf
++ #endif
+ #else
+ #include
+ #include
+--- a/upnp/src/genlib/net/http/webserver.c
++++ b/upnp/src/genlib/net/http/webserver.c
+@@ -65,7 +65,9 @@
+ #include
+
+ #ifdef _WIN32
+- #define snprintf _snprintf
++ #if _MSC_VER < 1900
++ #define snprintf _snprintf
++ #endif
+ #endif
+
+ /*!
+--- a/upnp/src/genlib/net/uri/uri.c
++++ b/upnp/src/genlib/net/uri/uri.c
+@@ -45,7 +45,9 @@
+ #endif
+ #endif
+ #ifdef _WIN32
+- #define snprintf _snprintf
++ #if _MSC_VER < 1900
++ #define snprintf _snprintf
++ #endif
+ #endif
+ #include
+
--- /dev/null
-+++ b/build/inc/autoconfig.h
-@@ -0,0 +1,202 @@
++++ b/upnp/src/inc/autoconfig.h
+@@ -0,0 +1,229 @@
+/* autoconfig.h. Generated from autoconfig.h.in by configure. */
+/* autoconfig.h.in. Generated from configure.ac by autoheader. */
+
++/* Define if building universal (internal helper macro) */
++/* #undef AC_APPLE_UNIVERSAL_BUILD */
++
+/* Define to 1 to compile debug code */
+/* #undef DEBUG */
+
@@ -224,19 +2861,19 @@
+/* Define to 1 if you have the header file. */
+/* #undef HAVE_WS2TCPIP_H */
+
-+/* Define to the sub-directory in which libtool stores uninstalled libraries.
++/* see upnpconfig.h */
++#define IXML_HAVE_SCRIPTSUPPORT 1
++
++/* whether the system defaults to 32bit off_t but can do 64bit when requested
+ */
++/* #undef LARGEFILE_SENSITIVE */
++
++/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 to prevent compilation of assert() */
+#define NDEBUG 1
+
-+/* Define to 1 to prevent some debug code */
-+#define NO_DEBUG 1
-+
-+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-+/* #undef NO_MINUS_C_MINUS_O */
-+
+/* Name of package */
+#define PACKAGE "libupnp"
+
@@ -247,7 +2884,7 @@
+#define PACKAGE_NAME "libupnp"
+
+/* Define to the full name and version of this package. */
-+#define PACKAGE_STRING "libupnp 1.6.19"
++#define PACKAGE_STRING "libupnp 1.8.5"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libupnp"
@@ -256,7 +2893,7 @@
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
-+#define PACKAGE_VERSION "1.6.19"
++#define PACKAGE_VERSION "1.8.5"
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+ your system. */
@@ -266,13 +2903,16 @@
+#define STDC_HEADERS 1
+
+/* see upnpconfig.h */
-+#define UPNP_ENABLE_BLOCKING_TCP_CONNECTIONS 1
++/*#undef UPNP_ENABLE_BLOCKING_TCP_CONNECTIONS */
+
+/* see upnpconfig.h */
-+/* #undef UPNP_ENABLE_IPV6 */
++/*#undef UPNP_ENABLE_IPV6 */
+
+/* see upnpconfig.h */
-+#define UPNP_ENABLE_NOTIFICATION_REORDERING 1
++/* #undef UPNP_ENABLE_OPEN_SSL */
++
++/* see upnpconfig.h */
++/* #undef UPNP_ENABLE_POST_WRITE */
+
+/* see upnpconfig.h */
+/* #undef UPNP_ENABLE_UNSPECIFIED_SERVER */
@@ -304,6 +2944,13 @@
+/* see upnpconfig.h */
+#define UPNP_HAVE_WEBSERVER 1
+
++/* whether the system defaults to 32bit off_t but can do 64bit when requested
++ */
++/* #undef UPNP_LARGEFILE_SENSITIVE */
++
++/* see upnpconfig.h */
++/* #undef UPNP_MINISERVER_REUSEADDR */
++
+/* Do not use pthread_rwlock_t */
+#define UPNP_USE_RWLOCK 1
+
@@ -311,218 +2958,104 @@
+#define UPNP_VERSION_MAJOR 1
+
+/* see upnpconfig.h */
-+#define UPNP_VERSION_MINOR 6
++#define UPNP_VERSION_MINOR 8
+
+/* see upnpconfig.h */
-+#define UPNP_VERSION_PATCH 19
++#define UPNP_VERSION_PATCH 5
+
+/* see upnpconfig.h */
-+#define UPNP_VERSION_STRING "1.6.19"
++#define UPNP_VERSION_STRING "1.8.5"
+
+/* Version number of package */
-+#define VERSION "1.6.19"
++#define VERSION "1.8.5"
+
-+/* File Offset size */
-+#define _FILE_OFFSET_BITS 64
++/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
++ significant byte first (like Motorola and SPARC, unlike Intel). */
++#if defined AC_APPLE_UNIVERSAL_BUILD
++# if defined __BIG_ENDIAN__
++# define WORDS_BIGENDIAN 1
++# endif
++#else
++# ifndef WORDS_BIGENDIAN
++/* # undef WORDS_BIGENDIAN */
++# endif
++#endif
++
++/* Enable large inode numbers on Mac OS X 10.5. */
++#ifndef _DARWIN_USE_64_BIT_INODE
++# define _DARWIN_USE_64_BIT_INODE 1
++#endif
++
++/* Number of bits in a file offset, on hosts where this is settable. */
++/* #undef _FILE_OFFSET_BITS */
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
-+#define _LARGEFILE_SOURCE 1
++/* #undef _LARGEFILE_SOURCE */
+
-+/* Large files support */
-+#define _LARGE_FILE_SOURCE /**/
++/* Define for large files, on AIX-style hosts. */
++/* #undef _LARGE_FILES */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
-+/* Define to `long int' if does not define. */
-+/* #undef off_t */
-+
+/* Define to `unsigned int' if does not define. */
+/* #undef size_t */
+
+/* Type for storing the length of struct sockaddr */
+/* #undef socklen_t */
---- a/threadutil/inc/ThreadPool.h
-+++ b/threadutil/inc/ThreadPool.h
-@@ -46,6 +46,7 @@
- #include
-
- #ifdef WIN32
-+#ifndef _TIMEZONE_DEFINED
- #include
- struct timezone
- {
-@@ -53,6 +54,7 @@
- int tz_dsttime; /* type of dst correction */
- };
- int gettimeofday(struct timeval *tv, struct timezone *tz);
-+#endif
- #else /* WIN32 */
- #include
- #include /* for gettimeofday() */
---- a/upnp/src/api/upnpapi.c
-+++ b/upnp/src/api/upnpapi.c
-@@ -357,8 +357,8 @@ static int UpnpInitPreamble(void)
-
- #ifdef UPNP_HAVE_OPTSSDP
- /* Create the NLS uuid. */
-- uuid_create(&nls_uuid);
-- uuid_unpack(&nls_uuid, gUpnpSdkNLSuuid);
-+ uuid_upnp_create(&nls_uuid);
-+ uuid_upnp_unpack(&nls_uuid, gUpnpSdkNLSuuid);
- #endif /* UPNP_HAVE_OPTSSDP */
-
- /* Initializes the handle list. */
-@@ -374,13 +374,13 @@ static int UpnpInitPreamble(void)
- return retVal;
- }
-
-+#ifdef INTERNAL_WEB_SERVER
- #ifdef INCLUDE_DEVICE_APIS
- #if EXCLUDE_SOAP == 0
- SetSoapCallback(soap_device_callback);
- #endif
- #endif /* INCLUDE_DEVICE_APIS */
-
--#ifdef INTERNAL_WEB_SERVER
- #if EXCLUDE_GENA == 0
- SetGenaCallback(genaCallback);
- #endif
---- a/upnp/src/api/upnptools.c
-+++ b/upnp/src/api/upnptools.c
-@@ -57,7 +57,9 @@
- #define HEADER_LENGTH 2000
-
- #ifdef WIN32
-- #define snprintf _snprintf
-+ #if _MSC_VER < 1900
-+ #define snprintf _snprintf
-+ #endif
- #endif
-
- /*!
---- a/upnp/src/gena/gena_ctrlpt.c
-+++ b/upnp/src/gena/gena_ctrlpt.c
-@@ -53,7 +53,9 @@
- #include "upnpapi.h"
-
- #ifdef WIN32
-- #define snprintf _snprintf
-+ #if _MSC_VER < 1900
-+ #define snprintf _snprintf
-+ #endif
- #endif
-
- extern ithread_mutex_t GlobalClientSubscribeMutex;
-@@ -561,8 +563,8 @@ int genaSubscribe(
- }
-
- /* generate client SID */
-- uuid_create(&uid );
-- uuid_unpack(&uid, temp_sid);
-+ uuid_upnp_create(&uid );
-+ uuid_upnp_unpack(&uid, temp_sid);
- rc = snprintf(temp_sid2, sizeof(temp_sid2), "uuid:%s", temp_sid);
- if (rc < 0 || (unsigned int) rc >= sizeof(temp_sid2)) {
- return_code = UPNP_E_OUTOF_MEMORY;
---- a/upnp/src/gena/gena_device.c
-+++ b/upnp/src/gena/gena_device.c
-@@ -53,7 +53,9 @@
- #include "uuid.h"
-
- #ifdef WIN32
-- #define snprintf _snprintf
-+ #if _MSC_VER < 1900
-+ #define snprintf _snprintf
-+ #endif
- #endif
-
- #define STALE_JOBID (INVALID_JOB_ID -1)
-@@ -1271,8 +1273,8 @@ void gena_process_subscription_request(
- }
-
- /* generate SID */
-- uuid_create(&uid);
-- uuid_unpack(&uid, temp_sid);
-+ uuid_upnp_create(&uid);
-+ uuid_upnp_unpack(&uid, temp_sid);
- rc = snprintf(sub->sid, sizeof(sub->sid), "uuid:%s", temp_sid);
-
- /* respond OK */
---- a/upnp/src/genlib/miniserver/miniserver.c
-+++ b/upnp/src/genlib/miniserver/miniserver.c
-@@ -68,6 +68,13 @@
- /*! . */
- #define APPLICATION_LISTENING_PORT 49152
-
-+/* IPV6_V6ONLY is missing from MinGW, hack taken from
-+ * http://svn.apache.org/repos/asf/apr/apr/trunk/network_io/win32/sockopt.c
-+ */
-+#ifndef IPV6_V6ONLY
-+#define IPV6_V6ONLY 27
-+#endif
-+
- struct mserv_request_t {
- /*! Connection handle. */
- SOCKET connfd;
---- a/upnp/src/genlib/net/http/httpreadwrite.c
-+++ b/upnp/src/genlib/net/http/httpreadwrite.c
-@@ -59,7 +59,9 @@
- #ifdef WIN32
- #include
- #define fseeko fseek
-- #define snprintf _snprintf
-+ #if _MSC_VER < 1900
-+ #define snprintf _snprintf
-+ #endif
- #else
- #include
- #include
-@@ -2165,6 +2167,7 @@ void get_sdk_info(OUT char *info, IN size_t infoSize)
- OSVERSIONINFO versioninfo;
- versioninfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-
-+#if (WINAPI_FAMILY_APP != WINAPI_FAMILY_PC_APP)
- if (GetVersionEx(&versioninfo) != 0)
- snprintf(info, infoSize,
- "%d.%d.%d %d/%s, UPnP/1.0, Portable SDK for UPnP devices/"
-@@ -2174,6 +2177,10 @@ void get_sdk_info(OUT char *info, IN size_t infoSize)
- else
- *info = '\0';
- #else
-+ snprintf(info, infoSize, "%d.%d.%d %d/%s, UPnP/1.0, Portable SDK for UPnP devices/" PACKAGE_VERSION "\r\n",
-+ 0, 0, 0, 0, 0);
-+ #endif
-+ #else
- int ret_code;
- struct utsname sys_info;
-
---- a/upnp/src/genlib/net/http/webserver.c
-+++ b/upnp/src/genlib/net/http/webserver.c
-@@ -63,7 +63,9 @@
- #include
-
- #ifdef WIN32
-- #define snprintf _snprintf
-+ #if _MSC_VER < 1900
-+ #define snprintf _snprintf
-+ #endif
- #endif
-
- /*!
---- a/upnp/src/genlib/net/uri/uri.c
-+++ b/upnp/src/genlib/net/uri/uri.c
-@@ -45,7 +45,9 @@
- #endif
- #endif
- #ifdef WIN32
-- #define snprintf _snprintf
-+ #if _MSC_VER < 1900
-+ #define snprintf _snprintf
-+ #endif
- #endif
- #include
-
+--- a/upnp/src/inc/inet_pton.h
++++ /dev/null
+@@ -1,50 +0,0 @@
+-#ifndef INET_PTON
+-#define INET_PTON
+-
+-#ifdef _WIN32
+-
+-#ifdef IPV6_
+-#define INET_IPV6
+-#endif
+-
+-#include "unixutil.h"
+-
+-#include
+-#include
+-#include
+-
+-/*!
+- * \file
+- *
+- * \author: Paul Vixie, 1996.
+- *
+- * \brief Network support routines missing in WIN32.
+- *
+- * \warning Don't even consider trying to compile this on a system where
+- * sizeof(int) < 4. sizeof(int) 4 is fine; all the world's not a VAX.
+- *
+- */
+-
+-/*!
+- * \brief convert a network format address to presentation format.
+- *
+- * \return
+- * pointer to presentation format address (`dst'), or NULL (see errno).
+- */
+-extern const char *inet_ntop(int af, const void *src, char *dst,
+- socklen_t size);
+-
+-/*!
+- * \brief convert from presentation format (which usually means ASCII printable)
+- * to network format (which is usually some kind of binary format).
+- *
+- * \return
+- * \li 1 if the address was valid for the specified address family
+- * \li 0 if the address wasn't valid (`dst' is untouched in this case)
+- * \li -1 if some other error occurred (`dst' is untouched in this case, too)
+- */
+-extern int inet_pton(int af, const char *src, void *dst);
+-
+-#endif /* _WIN32 */
+-
+-#endif /* INET_PTON */
--- a/upnp/src/inc/upnputil.h
+++ b/upnp/src/inc/upnputil.h
@@ -130,7 +130,7 @@ void linecopylen(
@@ -530,71 +3063,360 @@
#define sleep(a) Sleep((a)*1000)
#define usleep(a) Sleep((a)/1000)
- #define strerror_r(a,b,c) (strerror_s((b),(c),(a)))
-+ #define strerror_r(a,b,c) strncpy( b, strerror(a), c)
++ #define strerror_r(a,b,c) strncpy( b, strerror(a), c)
#else
#define max(a, b) (((a)>(b))? (a):(b))
#define min(a, b) (((a)<(b))? (a):(b))
---- a/upnp/src/inc/uuid.h
-+++ b/upnp/src/inc/uuid.h
-@@ -41,14 +41,14 @@ typedef struct _uuid_upnp {
- /*!
- * \brief Generate a UUID.
- */
--int uuid_create(
-+int uuid_upnp_create(
- /*! . */
- uuid_upnp * id);
-
- /*!
- * \brief Out will be xxxx-xx-xx-xx-xxxxxx format.
- */
--void uuid_unpack(
-+void uuid_upnp_unpack(
- /*! . */
- uuid_upnp * u,
- /*! . */
-@@ -57,7 +57,7 @@ void uuid_unpack(
- /*!
- * \brief Create a UUID using a "name" from a "name space"
- */
--void uuid_create_from_name(
-+void uuid_upnp_create_from_name(
- /*! Resulting UUID. */
- uuid_upnp * uid,
- /*! UUID to serve as context, so identical names from different name
-@@ -78,7 +78,7 @@ void uuid_create_from_name(
- *
- * \note Lexical ordering is not temporal ordering!
- */
--int uuid_compare(
-+int uuid_upnp_compare(
- /*! . */
- uuid_upnp * u1,
- /*! . */
+--- a/upnp/src/inet_pton.c
++++ /dev/null
+@@ -1,323 +0,0 @@
+-/*
+- * Copyright (c) 1996-1999 by Internet Software Consortium.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- */
+-
+-/*!
+- * \file
+- */
+-
+-/* This file is _WIN32 only */
+-#ifdef _WIN32
+-
+-#include "inet_pton.h"
+-
+-/*!
+- * \brief format an IPv4 address
+- *
+- * \return `dst' (as a const)
+- *
+- * \note
+- * \li (1) uses no statics
+- * \li (2) takes a u_char* not an in_addr as input
+- */
+-static const char *inet_ntop4(const u_char *src, char *dst, socklen_t size)
+-{
+- char tmp[sizeof ("255.255.255.255") + 1] = "\0";
+- int octet;
+- int i;
+-
+- i = 0;
+- for (octet = 0; octet <= 3; octet++) {
+-
+- if (src[octet]>255) {
+- //__set_errno (ENOSPC);
+- return (NULL);
+- }
+- tmp[i++] = '0' + src[octet] / 100;
+- if (tmp[i - 1] == '0') {
+- tmp[i - 1] = '0' + (src[octet] / 10 % 10);
+- if (tmp[i - 1] == '0') i--;
+- } else {
+- tmp[i++] = '0' + (src[octet] / 10 % 10);
+- }
+- tmp[i++] = '0' + src[octet] % 10;
+- tmp[i++] = '.';
+- }
+- tmp[i - 1] = '\0';
+-
+- if ((socklen_t)strlen(tmp)>size) {
+- //__set_errno (ENOSPC);
+- return (NULL);
+- }
+-
+- return strcpy(dst, tmp);
+-}
+-
+-#ifdef INET_IPV6
+-/*!
+- * \brief convert IPv6 binary address into presentation (printable) format
+- */
+-static const char *inet_ntop6(const u_char *src, char *dst, socklen_t size)
+-{
+- /*
+- * Note that int32_t and int16_t need only be "at least" large enough
+- * to contain a value of the specified size. On some systems, like
+- * Crays, there is no such thing as an integer variable with 16 bits.
+- * Keep this in mind if you think this function should have been coded
+- * to use pointer overlays. All the world's not a VAX.
+- */
+- char tmp[sizeof ("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")], *tp;
+- struct { int base, len; } best, cur;
+- u_int words[8];
+- int i;
+-
+- /*
+- * Preprocess:
+- * Copy the input (bytewise) array into a wordwise array.
+- * Find the longest run of 0x00's in src[] for :: shorthanding.
+- */
+- memset(words, '\0', sizeof words);
+- for (i = 0; i < 16; i += 2)
+- words[i / 2] = (src[i] << 8) | src[i + 1];
+- best.base = -1;
+- cur.base = -1;
+- for (i = 0; i < 8; i++) {
+- if (words[i] == 0) {
+- if (cur.base == -1)
+- cur.base = i, cur.len = 1;
+- else
+- cur.len++;
+- } else {
+- if (cur.base != -1) {
+- if (best.base == -1 || cur.len best.len)
+- best = cur;
+- cur.base = -1;
+- }
+- }
+- }
+- if (cur.base != -1) {
+- if (best.base == -1 || cur.len best.len)
+- best = cur;
+- }
+- if (best.base != -1 && best.len < 2)
+- best.base = -1;
+-
+- /*
+- * Format the result.
+- */
+- tp = tmp;
+- for (i = 0; i < 8; i++) {
+- /* Are we inside the best run of 0x00's? */
+- if (best.base != -1 && i >= best.base &&
+- i < (best.base + best.len)) {
+- if (i == best.base)
+- *tp++ = ':';
+- continue;
+- }
+- /* Are we following an initial run of 0x00s or any real hex? */
+- if (i != 0)
+- *tp++ = ':';
+- /* Is this address an encapsulated IPv4? */
+- if (i == 6 && best.base == 0 &&
+- (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
+- if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
+- return (NULL);
+- tp += strlen(tp);
+- break;
+- }
+- tp += SPRINTF((tp, "%x", words[i]));
+- }
+- /* Was it a trailing run of 0x00's? */
+- if (best.base != -1 && (best.base + best.len) == 8)
+- *tp++ = ':';
+- *tp++ = '\0';
+-
+- /* Check for overflow, copy, and we're done. */
+- if ((socklen_t)(tp - tmp) size) {
+- //__set_errno (ENOSPC);
+- return (NULL);
+- }
+- return strcpy(dst, tmp);
+-}
+-#endif /* INET_IPV6 */
+-
+-/*!
+- * \brief like inet_aton() but without all the hexadecimal and shorthand.
+- *
+- * \return 1 if `src' is a valid dotted quad, else 0.
+- *
+- * \note does not touch `dst' unless it's returning 1.
+- */
+-static int inet_pton4(const char *src,u_char *dst)
+-{
+- int saw_digit, octets, ch;
+- u_char tmp[4], *tp;
+-
+- saw_digit = 0;
+- octets = 0;
+- *(tp = tmp) = 0;
+- while ((ch = *src++) != '\0') {
+- if (ch >= '0' && ch <= '9') {
+- u_int new = *tp * 10 + (ch - '0');
+- if (new>255)
+- return (0);
+- *tp = new;
+- if (! saw_digit) {
+- if (++octets>4)
+- return (0);
+- saw_digit = 1;
+- }
+- } else if (ch == '.' && saw_digit) {
+- if (octets == 4)
+- return (0);
+- *++tp = 0;
+- saw_digit = 0;
+- } else
+- return (0);
+- }
+- if (octets < 4)
+- return (0);
+- memcpy(dst, tmp, 4);
+- return 1;
+-}
+-
+-#ifdef INET_IPV6
+-/*!
+- * \brief convert presentation level address to network order binary form.
+- *
+- * \return 1 if `src' is a valid [RFC1884 2.2] address, else 0.
+- *
+- * \note
+- * \li (1) does not touch `dst' unless it's returning 1.
+- * \li (2) :: in a full address is silently ignored.
+- */
+-static int inet_pton6(const char *src, u_char *dst)
+-{
+- static const char xdigits[] = "0123456789abcdef";
+- u_char tmp[16], *tp, *endp, *colonp;
+- const char *curtok;
+- int ch, saw_xdigit;
+- u_int val;
+-
+- tp = memset(tmp, '\0', 16);
+- endp = tp + 16;
+- colonp = NULL;
+- /* Leading :: requires some special handling. */
+- if (*src == ':')
+- if (*++src != ':')
+- return (0);
+- curtok = src;
+- saw_xdigit = 0;
+- val = 0;
+- while ((ch = tolower (*src++)) != '\0') {
+- const char *pch;
+-
+- pch = strchr(xdigits, ch);
+- if (pch != NULL) {
+- val <<= 4;
+- val |= (pch - xdigits);
+- if (val 0xffff)
+- return (0);
+- saw_xdigit = 1;
+- continue;
+- }
+- if (ch == ':') {
+- curtok = src;
+- if (!saw_xdigit) {
+- if (colonp)
+- return (0);
+- colonp = tp;
+- continue;
+- } else if (*src == '\0') {
+- return (0);
+- }
+- if (tp + 2 endp)
+- return (0);
+- *tp++ = (u_char) (val >8) & 0xff;
+- *tp++ = (u_char) val & 0xff;
+- saw_xdigit = 0;
+- val = 0;
+- continue;
+- }
+- if (ch == '.' && ((tp + 4) <= endp) &&
+- inet_pton4(curtok, tp) 0) {
+- tp += 4;
+- saw_xdigit = 0;
+- break; /* '\0' was seen by inet_pton4(). */
+- }
+- return (0);
+- }
+- if (saw_xdigit) {
+- if (tp + 2 endp)
+- return (0);
+- *tp++ = (u_char) (val >8) & 0xff;
+- *tp++ = (u_char) val & 0xff;
+- }
+- if (colonp != NULL) {
+- /* Since some memmove()'s erroneously fail to handle
+- * overlapping regions, we'll do the shift by hand. */
+- const int n = tp - colonp;
+- int i;
+-
+- if (tp == endp)
+- return (0);
+- for (i = 1; i <= n; i++) {
+- endp[- i] = colonp[n - i];
+- colonp[n - i] = 0;
+- }
+- tp = endp;
+- }
+- if (tp != endp)
+- return (0);
+- memcpy(dst, tmp, 16);
+- return (1);
+-}
+-#endif /* INET_IPV6 */
+-
+-
+-const char *inet_ntop(int af, const void *src, char *dst,socklen_t size)
+-{
+- switch (af) {
+- case AF_INET:
+- return inet_ntop4(src, dst, size);
+-#ifdef INET_IPV6
+- case AF_INET6:
+- return inet_ntop6(src, dst, size);
+-#endif
+- default:
+- /*__set_errno(EAFNOSUPPORT);*/
+- return NULL;
+- }
+- /* NOTREACHED */
+-}
+-
+-int inet_pton(int af, const char *src, void *dst)
+-{
+- switch (af) {
+- case AF_INET:
+- return inet_pton4(src, dst);
+-#ifdef INET_IPV6
+- case AF_INET6:
+- return inet_pton6(src, dst);
+-#endif
+- default:
+- /*__set_errno(EAFNOSUPPORT);*/
+- return -1;
+- }
+- /* NOTREACHED */
+-}
+-
+-#endif /* _WIN32 */
--- a/upnp/src/soap/soap_device.c
+++ b/upnp/src/soap/soap_device.c
-@@ -52,7 +52,9 @@
+@@ -53,7 +53,9 @@
#include
- #ifdef WIN32
+ #ifdef _WIN32
- #define snprintf _snprintf
-+ #if _MSC_VER < 1900
-+ #define snprintf _snprintf
-+ #endif
++ #if _MSC_VER < 1900
++ #define snprintf _snprintf
++ #endif
#endif
/*! timeout duration in secs for transmission/reception */
--- a/upnp/src/ssdp/ssdp_ctrlpt.c
+++ b/upnp/src/ssdp/ssdp_ctrlpt.c
-@@ -59,7 +59,9 @@
+@@ -58,7 +58,9 @@
- #ifdef WIN32
+ #ifdef _WIN32
#include
-#define snprintf _snprintf
-+ #if _MSC_VER < 1900
-+ #define snprintf _snprintf
-+ #endif
- #endif /* WIN32 */
++ #if _MSC_VER < 1900
++ #define snprintf _snprintf
++ #endif
+ #endif /* _WIN32 */
/*!
--- a/upnp/src/ssdp/ssdp_device.c
@@ -602,37 +3424,35 @@
@@ -57,7 +57,9 @@
#include
- #ifdef WIN32
+ #ifdef _WIN32
- #define snprintf _snprintf
-+ #if _MSC_VER < 1900
-+ #define snprintf _snprintf
-+ #endif
++ #if _MSC_VER < 1900
++ #define snprintf _snprintf
++ #endif
#endif
#define MSGTYPE_SHUTDOWN 0
--- a/upnp/src/ssdp/ssdp_server.c
+++ b/upnp/src/ssdp/ssdp_server.c
@@ -41,7 +41,9 @@
- #ifndef WIN32
+ #ifndef _WIN32
#include
#else
- #define snprintf _snprintf
-+ #if _MSC_VER < 1900
-+ #define snprintf _snprintf
-+ #endif
- #endif /* WIN32 */
++ #if _MSC_VER < 1900
++ #define snprintf _snprintf
++ #endif
+ #endif /* _WIN32 */
#include "config.h"
-@@ -69,6 +71,13 @@
+@@ -69,6 +71,11 @@
#endif /* UPNP_ENABLE_IPV6 */
#endif /* INCLUDE_CLIENT_APIS */
-+/* IPV6_V6ONLY is missing from MinGW, hack taken from
-+ * http://svn.apache.org/repos/asf/apr/apr/trunk/network_io/win32/sockopt.c
-+ */
+#ifndef IPV6_V6ONLY
+#define IPV6_V6ONLY 27
+#endif
++
+
void RequestHandler();
@@ -642,37 +3462,36 @@
@@ -50,7 +50,9 @@
#include
- #ifdef WIN32
+ #ifdef _WIN32
- #define snprintf _snprintf
-+ #if _MSC_VER < 1900
-+ #define snprintf _snprintf
-+ #endif
++ #if _MSC_VER < 1900
++ #define snprintf _snprintf
++ #endif
#else
#include
#endif
--- a/upnp/src/uuid/sysdep.c
+++ b/upnp/src/uuid/sysdep.c
-@@ -30,6 +30,8 @@
+@@ -29,6 +29,7 @@
+
#include
#include
++#include
-+#include
-+
/*!
* \brief System dependent call to get IEEE node ID.
- *
-@@ -93,7 +95,9 @@ void get_random_info(unsigned char seed[16])
+@@ -93,7 +94,9 @@ void get_random_info(unsigned char seed[16])
/* Initialize memory area so that valgrind does not complain */
memset(&r, 0, sizeof r);
/* memory usage stats */
- GlobalMemoryStatus( &r.m );
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
-+ GlobalMemoryStatus(&r.m);
++ GlobalMemoryStatus(&r.m);
+#endif
/* random system stats */
GetSystemInfo( &r.s );
/* 100ns resolution (nominally) time of day */
-@@ -101,9 +105,13 @@ void get_random_info(unsigned char seed[16])
+@@ -101,9 +104,13 @@ void get_random_info(unsigned char seed[16])
/* high resolution performance counter */
QueryPerformanceCounter( &r.pc );
/* milliseconds since last boot */
@@ -681,51 +3500,13 @@
r.l = MAX_COMPUTERNAME_LENGTH + 1;
- GetComputerName( r.hostname, &r.l );
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
-+ GetComputerName(r.hostname, &r.l);
++ GetComputerName(r.hostname, &r.l);
+#else
-+ GetHostNameW(r.hostname, &r.l);
++ GetHostNameW(r.hostname, &r.l);
+#endif
/* MD5 it */
MD5Init(&c);
MD5Update(&c, (unsigned char *)(&r), sizeof r);
---- a/upnp/src/uuid/uuid.c
-+++ b/upnp/src/uuid/uuid.c
-@@ -50,7 +50,7 @@ static uint16_t true_random(void);
- /*!
- * \brief Generator of a UUID.
- */
--int uuid_create(uuid_upnp * uid)
-+int uuid_upnp_create(uuid_upnp * uid)
- {
- uuid_time_t timestamp;
- uuid_time_t last_time;
-@@ -82,7 +82,7 @@ int uuid_create(uuid_upnp * uid)
- return 1;
- };
-
--void uuid_unpack(uuid_upnp * u, char *out)
-+void uuid_upnp_unpack(uuid_upnp * u, char *out)
- {
- sprintf(out,
- "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
-@@ -221,7 +221,7 @@ static uint16_t true_random(void)
- /*!
- * \brief Create a UUID using a "name" from a "name space".
- */
--void uuid_create_from_name(
-+void uuid_upnp_create_from_name(
- /*! resulting UUID. */
- uuid_upnp *uid,
- /*! UUID to serve as context, so identical names from different name
-@@ -280,7 +280,7 @@ void format_uuid_v3(uuid_upnp *uid, unsigned char hash[16])
- *
- * Note: Lexical ordering is not temporal ordering!
- */
--int uuid_compare(uuid_upnp *u1, uuid_upnp *u2)
-+int uuid_upnp_compare(uuid_upnp *u1, uuid_upnp *u2)
- {
- int i;
-
---
+--
2.10.2.windows.1
diff --git a/contrib/src/upnp/miniserver.patch b/contrib/src/upnp/miniserver.patch
index 45ff90c67..a2114bef2 100644
--- a/contrib/src/upnp/miniserver.patch
+++ b/contrib/src/upnp/miniserver.patch
@@ -1,17 +1,31 @@
---- upnp/upnp/src/api/upnpapi.c.orig 2013-04-08 00:23:46.000000000 +0200
-+++ upnp/upnp/src/api/upnpapi.c 2013-04-08 00:25:49.000000000 +0200
-@@ -358,13 +358,13 @@
+From 39f8e5f5379607166cf6e54d270590e1fd13c12f Mon Sep 17 00:00:00 2001
+From: Eden Abitbol
+Date: Mon, 3 Jun 2019 15:55:40 -0400
+Subject: [PATCH] web server patch
+
+---
+ upnp/src/api/upnpapi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c
+index 9ddc7fb..d286092 100644
+--- a/upnp/src/api/upnpapi.c
++++ b/upnp/src/api/upnpapi.c
+@@ -383,13 +383,13 @@ static int UpnpInitPreamble(void)
return retVal;
}
-
+
+#ifdef INTERNAL_WEB_SERVER
#ifdef INCLUDE_DEVICE_APIS
#if EXCLUDE_SOAP == 0
SetSoapCallback(soap_device_callback);
#endif
#endif /* INCLUDE_DEVICE_APIS */
-
+
-#ifdef INTERNAL_WEB_SERVER
#if EXCLUDE_GENA == 0
SetGenaCallback(genaCallback);
#endif
+--
+2.17.1
+
diff --git a/contrib/src/upnp/rules.mak b/contrib/src/upnp/rules.mak
index 749a8611f..d058de119 100644
--- a/contrib/src/upnp/rules.mak
+++ b/contrib/src/upnp/rules.mak
@@ -1,9 +1,9 @@
# UPNP
-UPNP_VERSION := 1.6.25
+UPNP_VERSION := 1.8.4
UPNP_URL := https://github.com/mrjimenez/pupnp/archive/release-$(UPNP_VERSION).tar.gz
PKGS += upnp
-ifeq ($(call need_pkg,"libupnp >= 1.6.25"),)
+ifeq ($(call need_pkg,"libupnp >= 1.8.2"),)
PKGS_FOUND += upnp
endif
@@ -14,27 +14,21 @@ $(TARBALLS)/pupnp-release-$(UPNP_VERSION).tar.gz:
upnp: pupnp-release-$(UPNP_VERSION).tar.gz .sum-upnp
$(UNPACK)
-ifdef HAVE_WIN32
- $(APPLY) $(SRC)/upnp/libupnp-win32.patch
- $(APPLY) $(SRC)/upnp/libupnp-win64.patch
- $(APPLY) $(SRC)/upnp/threadpool.patch
-endif
-ifdef HAVE_WIN64
- $(APPLY) $(SRC)/upnp/win_inet_pton.patch
+ifeq ($(OS),Windows_NT)
+ $(APPLY) $(SRC)/upnp/libupnp-windows.patch
endif
$(APPLY) $(SRC)/upnp/libupnp-ipv6.patch
$(APPLY) $(SRC)/upnp/miniserver.patch
- $(APPLY) $(SRC)/upnp/uuid_upnp.patch
$(UPDATE_AUTOCONFIG) && cd $(UNPACK_DIR) && mv config.guess config.sub
$(MOVE)
.upnp: upnp
ifdef HAVE_WIN32
$(RECONF)
- cd $< && $(HOSTVARS) CFLAGS="-DUPNP_STATIC_LIB" ./configure --disable-samples --without-documentation --disable-blocking_tcp_connections $(HOSTCONF)
+ cd $< && $(HOSTVARS) CFLAGS="-DUPNP_STATIC_LIB" ./configure --disable-largefile --disable-samples --without-documentation --disable-blocking_tcp_connections $(HOSTCONF)
else
$(RECONF)
- cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) -DUPNP_STATIC_LIB" ./configure --disable-samples --without-documentation --disable-blocking_tcp_connections $(HOSTCONF)
+ cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) -DUPNP_STATIC_LIB" ./configure --disable-largefile --disable-samples --without-documentation --disable-blocking_tcp_connections $(HOSTCONF)
endif
cd $< && $(MAKE) install
touch $@
diff --git a/contrib/src/upnp/threadpool.patch b/contrib/src/upnp/threadpool.patch
index b0a5a6335..db8b89568 100644
--- a/contrib/src/upnp/threadpool.patch
+++ b/contrib/src/upnp/threadpool.patch
@@ -1,29 +1,34 @@
---- a/threadutil/src/ThreadPool.c 2012-04-03 09:01:15.000000000 -0400
-+++ b/threadutil/src/ThreadPool.c 2015-05-07 14:37:13.168494069 -0400
-@@ -264,7 +264,7 @@
- setpriority(PRIO_PROCESS, 0, 0);
- retVal = 0;
- #elif defined(WIN32)
-- retVal = sched_setscheduler(0, in);
-+ retVal = 0;
- #elif defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
- struct sched_param current;
- int sched_result;
-@@ -416,7 +416,7 @@
+From 1da6fe09a3387d31c111e5d26c98653e39bf1d46 Mon Sep 17 00:00:00 2001
+From: Eden Abitbol
+Date: Mon, 3 Jun 2019 17:48:04 -0400
+Subject: [PATCH] threadpool patch
- gettimeofday(&t, NULL);
- #if defined(WIN32)
+---
+ upnp/src/threadutil/ThreadPool.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/upnp/src/threadutil/ThreadPool.c b/upnp/src/threadutil/ThreadPool.c
+index 2441d38..6de4d3d 100644
+--- a/upnp/src/threadutil/ThreadPool.c
++++ b/upnp/src/threadutil/ThreadPool.c
+@@ -264,7 +264,7 @@ static int SetPolicyType(
+ setpriority(PRIO_PROCESS, 0, 0);
+ retVal = 0;
+ #elif defined(_WIN32)
+- retVal = sched_setscheduler(0, in);
++ retVal = 0
+ #elif defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
+ struct sched_param current;
+ int sched_result;
+@@ -416,7 +416,7 @@ static void SetSeed(void)
+
+ gettimeofday(&t, NULL);
+ #if defined(_WIN32)
- srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id().p);
+ srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id());
#elif defined(BSD) || defined(__OSX__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
- srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id());
+ srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id());
#elif defined(__linux__) || defined(__sun) || defined(__CYGWIN__) || defined(__GLIBC__)
-@@ -654,7 +654,7 @@
- rc = ithread_detach(temp);
- /* ithread_detach will return EINVAL if thread has been
- successfully detached by ithread_create */
-- if (rc == EINVAL)
-+ if (rc == EINVAL || rc == ESRCH)
- rc = 0;
- tp->pendingWorkerThreadStart = 1;
- /* wait until the new worker thread starts */
+--
+2.17.1
+
diff --git a/contrib/src/upnp/uuid_upnp.patch b/contrib/src/upnp/uuid_upnp.patch
deleted file mode 100644
index 339b9668a..000000000
--- a/contrib/src/upnp/uuid_upnp.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c
-index 8f36822..322c724 100644
---- a/upnp/src/api/upnpapi.c
-+++ b/upnp/src/api/upnpapi.c
-@@ -341,8 +341,8 @@ static int UpnpInitPreamble(void)
-
- #ifdef UPNP_HAVE_OPTSSDP
- /* Create the NLS uuid. */
-- uuid_create(&nls_uuid);
-- uuid_unpack(&nls_uuid, gUpnpSdkNLSuuid);
-+ uuid_upnp_create(&nls_uuid);
-+ uuid_upnp_unpack(&nls_uuid, gUpnpSdkNLSuuid);
- #endif /* UPNP_HAVE_OPTSSDP */
-
- /* Initializes the handle list. */
-diff --git a/upnp/src/gena/gena_ctrlpt.c b/upnp/src/gena/gena_ctrlpt.c
-index bca4981..0c428fc 100644
---- a/upnp/src/gena/gena_ctrlpt.c
-+++ b/upnp/src/gena/gena_ctrlpt.c
-@@ -561,8 +561,8 @@ int genaSubscribe(
- }
-
- /* generate client SID */
-- uuid_create(&uid );
-- uuid_unpack(&uid, temp_sid);
-+ uuid_upnp_create(&uid );
-+ uuid_upnp_unpack(&uid, temp_sid);
- rc = snprintf(temp_sid2, sizeof(temp_sid2), "uuid:%s", temp_sid);
- if (rc < 0 || (unsigned int) rc >= sizeof(temp_sid2)) {
- return_code = UPNP_E_OUTOF_MEMORY;
-diff --git a/upnp/src/gena/gena_device.c b/upnp/src/gena/gena_device.c
-index 39edc0b..b1ec3c4 100644
---- a/upnp/src/gena/gena_device.c
-+++ b/upnp/src/gena/gena_device.c
-@@ -1353,8 +1353,8 @@ void gena_process_subscription_request(
- }
-
- /* generate SID */
-- uuid_create(&uid);
-- uuid_unpack(&uid, temp_sid);
-+ uuid_upnp_create(&uid);
-+ uuid_upnp_unpack(&uid, temp_sid);
- rc = snprintf(sub->sid, sizeof(sub->sid), "uuid:%s", temp_sid);
-
- /* respond OK */
-diff --git a/upnp/src/inc/uuid.h b/upnp/src/inc/uuid.h
-index 93f5681..17fd463 100644
---- a/upnp/src/inc/uuid.h
-+++ b/upnp/src/inc/uuid.h
-@@ -41,14 +41,14 @@ typedef struct _uuid_upnp {
- /*!
- * \brief Generate a UUID.
- */
--int uuid_create(
-+int uuid_upnp_create(
- /*! . */
- uuid_upnp * id);
-
- /*!
- * \brief Out will be xxxx-xx-xx-xx-xxxxxx format.
- */
--void uuid_unpack(
-+void uuid_upnp_unpack(
- /*! . */
- uuid_upnp * u,
- /*! . */
-@@ -57,7 +57,7 @@ void uuid_unpack(
- /*!
- * \brief Create a UUID using a "name" from a "name space"
- */
--void uuid_create_from_name(
-+void uuid_upnp_create_from_name(
- /*! Resulting UUID. */
- uuid_upnp * uid,
- /*! UUID to serve as context, so identical names from different name
-@@ -78,7 +78,7 @@ void uuid_create_from_name(
- *
- * \note Lexical ordering is not temporal ordering!
- */
--int uuid_compare(
-+int uuid_upnp_compare(
- /*! . */
- uuid_upnp * u1,
- /*! . */
-diff --git a/upnp/src/uuid/uuid.c b/upnp/src/uuid/uuid.c
-index 211b61f..ecd5904 100644
---- a/upnp/src/uuid/uuid.c
-+++ b/upnp/src/uuid/uuid.c
-@@ -50,7 +50,7 @@ static uint16_t true_random(void);
- /*!
- * \brief Generator of a UUID.
- */
--int uuid_create(uuid_upnp * uid)
-+int uuid_upnp_create(uuid_upnp * uid)
- {
- uuid_time_t timestamp;
- uuid_time_t last_time;
-@@ -82,7 +82,7 @@ int uuid_create(uuid_upnp * uid)
- return 1;
- };
-
--void uuid_unpack(uuid_upnp * u, char *out)
-+void uuid_upnp_unpack(uuid_upnp * u, char *out)
- {
- sprintf(out,
- "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
-@@ -221,7 +221,7 @@ static uint16_t true_random(void)
- /*!
- * \brief Create a UUID using a "name" from a "name space".
- */
--void uuid_create_from_name(
-+void uuid_upnp_create_from_name(
- /*! resulting UUID. */
- uuid_upnp *uid,
- /*! UUID to serve as context, so identical names from different name
-@@ -280,7 +280,7 @@ void format_uuid_v3(uuid_upnp *uid, unsigned char hash[16])
- *
- * Note: Lexical ordering is not temporal ordering!
- */
--int uuid_compare(uuid_upnp *u1, uuid_upnp *u2)
-+int uuid_upnp_compare(uuid_upnp *u1, uuid_upnp *u2)
- {
- int i;
-
diff --git a/src/account.cpp b/src/account.cpp
index 4bb0bbdd5..4111ad595 100644
--- a/src/account.cpp
+++ b/src/account.cpp
@@ -471,11 +471,11 @@ Account::getUPnPIpAddress() const
* ie: if it is able to make port mappings
*/
bool
-Account::getUPnPActive(std::chrono::seconds timeout) const
+Account::getUPnPActive() const
{
std::lock_guard lk(upnp_mtx);
if (upnp_)
- return upnp_->hasValidIGD(timeout);
+ return upnp_->hasValidIGD();
return false;
}
diff --git a/src/account.h b/src/account.h
index 097e7071f..575da296b 100644
--- a/src/account.h
+++ b/src/account.h
@@ -295,7 +295,7 @@ class Account : public Serializable, public std::enable_shared_from_thisaddAnyMapping(port, portType, true, &port_used)) {
+ if (upnp_->addMapping(port, portType, true, &port_used)) {
publicIP.setPort(port_used);
addReflectiveCandidate(comp_id, candidate.addr, publicIP, candidate.transport);
} else
- JAMI_WARN("[ice:%p] UPnP: Could not create a port mapping for the ICE candide", this);
+ JAMI_WARN("[ice:%p] Could not create a port mapping for the ICE candide", this);
}
}
} else {
- JAMI_WARN("[ice:%p] UPnP: Could not determine public IP for ICE candidates", this);
+ JAMI_WARN("[ice:%p] Could not determine public IP for ICE candidates", this);
}
}
}
diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp
index fe1b8a469..d7e4146ee 100644
--- a/src/jamidht/jamiaccount.cpp
+++ b/src/jamidht/jamiaccount.cpp
@@ -2024,10 +2024,10 @@ JamiAccount::mapPortUPnP()
uint16_t port_used;
std::lock_guard lock(upnp_mtx);
upnp_->removeMappings();
- added = upnp_->addAnyMapping(dhtPort_, jami::upnp::PortType::UDP, false, &port_used);
+ added = upnp_->addMapping(dhtPort_, jami::upnp::PortType::UDP, false, &port_used);
if (added) {
if (port_used != dhtPort_)
- JAMI_DBG("UPnP could not map port %u for DHT, using %u instead", dhtPort_, port_used);
+ JAMI_WARN("[Account %s] Could not map port %u for DHT, using %u instead.", getAccountID().c_str(), dhtPort_, port_used);
dhtPortUsed_ = port_used;
}
}
diff --git a/src/sip/sipaccount.cpp b/src/sip/sipaccount.cpp
index 4ab8a078a..aed61a2b4 100644
--- a/src/sip/sipaccount.cpp
+++ b/src/sip/sipaccount.cpp
@@ -705,10 +705,10 @@ bool SIPAccount::mapPortUPnP()
* a different port, if succesfull, then we have to use that port for SIP
*/
uint16_t port_used;
- bool added = upnp_->addAnyMapping(publishedPort_, localPort_, jami::upnp::PortType::UDP, false, false, &port_used);
+ bool added = upnp_->addMapping(publishedPort_, jami::upnp::PortType::UDP, false, &port_used, localPort_);
if (added) {
if (port_used != publishedPort_)
- JAMI_DBG("UPnP could not map published port %u for SIP, using %u instead", publishedPort_, port_used);
+ JAMI_WARN("[Account %s] Could not map published port %u for SIP, using %u instead.", getAccountID().c_str(), publishedPort_, port_used);
publishedPortUsed_ = port_used;
}
}
@@ -740,7 +740,7 @@ void SIPAccount::doRegister()
if (auto acc = w.lock()) {
sip_utils::register_thread();
if (not acc->mapPortUPnP())
- JAMI_WARN("UPnP: Could not successfully map SIP port with UPnP, continuing with account registration anyways.");
+ JAMI_WARN("UPnP: Could not successfully map SIP port with UPnP, continuing with account registration anyways");
acc->doRegister1_();
}
}}.detach();
diff --git a/src/sip/sipcall.cpp b/src/sip/sipcall.cpp
index 773195e01..bc6b73ce8 100644
--- a/src/sip/sipcall.cpp
+++ b/src/sip/sipcall.cpp
@@ -1186,17 +1186,17 @@ SIPCall::openPortsUPnP()
*/
JAMI_DBG("[call:%s] opening ports via UPNP for SDP session", getCallId().c_str());
uint16_t audio_port_used;
- if (upnp_->addAnyMapping(sdp_->getLocalAudioPort(), upnp::PortType::UDP, true, &audio_port_used)) {
+ if (upnp_->addMapping(sdp_->getLocalAudioPort(), upnp::PortType::UDP, true, &audio_port_used)) {
uint16_t control_port_used;
- if (upnp_->addAnyMapping(sdp_->getLocalAudioControlPort(), upnp::PortType::UDP, true, &control_port_used)) {
+ if (upnp_->addMapping(sdp_->getLocalAudioControlPort(), upnp::PortType::UDP, true, &control_port_used)) {
sdp_->setLocalPublishedAudioPorts(audio_port_used, control_port_used);
}
}
#ifdef ENABLE_VIDEO
uint16_t video_port_used;
- if (upnp_->addAnyMapping(sdp_->getLocalVideoPort(), upnp::PortType::UDP, true, &video_port_used)) {
+ if (upnp_->addMapping(sdp_->getLocalVideoPort(), upnp::PortType::UDP, true, &video_port_used)) {
uint16_t control_port_used;
- if (upnp_->addAnyMapping(sdp_->getLocalVideoControlPort(), upnp::PortType::UDP, true, &control_port_used)) {
+ if (upnp_->addMapping(sdp_->getLocalVideoControlPort(), upnp::PortType::UDP, true, &control_port_used)) {
sdp_->setLocalPublishedVideoPorts(video_port_used, control_port_used);
}
}
diff --git a/src/upnp/Makefile.am b/src/upnp/Makefile.am
index 60a07466c..01975e779 100644
--- a/src/upnp/Makefile.am
+++ b/src/upnp/Makefile.am
@@ -2,13 +2,16 @@ include $(top_srcdir)/globals.mk
noinst_LTLIBRARIES = libupnpcontrol.la
+SUBDIRS = protocol
+
libupnpcontrol_la_CXXFLAGS = \
- @CXXFLAGS@
+ @CXXFLAGS@
libupnpcontrol_la_SOURCES = \
upnp_control.cpp \
upnp_control.h \
upnp_context.cpp \
- upnp_context.h \
- upnp_igd.cpp \
- upnp_igd.h
+ upnp_context.h
+
+libupnpcontrol_la_LIBADD = \
+ ./protocol/libupnpprotocol.la
\ No newline at end of file
diff --git a/src/upnp/protocol/Makefile.am b/src/upnp/protocol/Makefile.am
new file mode 100644
index 000000000..5e5c56839
--- /dev/null
+++ b/src/upnp/protocol/Makefile.am
@@ -0,0 +1,33 @@
+include $(top_srcdir)/globals.mk
+
+noinst_LTLIBRARIES = libupnpprotocol.la
+
+SUBDIRS =
+
+if BUILD_PUPNP
+SUBDIRS += pupnp
+endif
+if BUILD_NATPMP
+SUBDIRS += natpmp
+endif
+
+libupnpprotocol_la_CXXFLAGS = \
+ @CXXFLAGS@
+
+libupnpprotocol_la_SOURCES = \
+ igd.h \
+ igd.cpp \
+ mapping.h \
+ mapping.cpp \
+ global_mapping.h \
+ upnp_protocol.h
+
+libupnpprotocol_la_LIBADD =
+
+if BUILD_PUPNP
+libupnpprotocol_la_LIBADD += ./pupnp/libpupnp.la
+endif
+
+if BUILD_NATPMP
+libupnpprotocol_la_LIBADD += ./natpmp/libnat_pmp.la
+endif
\ No newline at end of file
diff --git a/src/upnp/protocol/global_mapping.h b/src/upnp/protocol/global_mapping.h
new file mode 100644
index 000000000..ead084417
--- /dev/null
+++ b/src/upnp/protocol/global_mapping.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2004-2019 Savoir-faire Linux Inc.
+ *
+ * Author: Stepan Salenikovich
+ * Author: Eden Abitbol
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#pragma once
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mapping.h"
+
+#include "noncopyable.h"
+
+namespace jami { namespace upnp {
+
+/*
+ * GlobalMapping is like a mapping, but it tracks the number of global users,
+ * ie: the number of upnp:Controller which are using this mapping
+ * this is usually only relevant for accounts (not calls) as multiple SIP accounts
+ * can use the same SIP port and we don't want to delete a mapping from the router
+ * if other accounts are using it
+ */
+class GlobalMapping : public Mapping
+{
+public:
+ GlobalMapping(const Mapping& mapping, unsigned users = 1) :
+ Mapping(mapping.getPortExternal(),
+ mapping.getPortInternal(),
+ mapping.getType(),
+ mapping.getDescription()),
+ users(users) {}
+
+public:
+ unsigned users; // Number of users of this mapping. Multiple accounts can use the same SIP ports.
+};
+
+}} // namespace jami::upnp
\ No newline at end of file
diff --git a/src/upnp/protocol/igd.cpp b/src/upnp/protocol/igd.cpp
new file mode 100644
index 000000000..7e5f1701a
--- /dev/null
+++ b/src/upnp/protocol/igd.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2004-2019 Savoir-faire Linux Inc.
+ *
+ * Author: Stepan Salenikovich
+ * Author: Eden Abitbol
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "igd.h"
+
+namespace jami { namespace upnp {
+
+IGD::IGD(IpAddr&& localIp, IpAddr&& publicIp)
+{
+ localIp_ = std::move(localIp);
+ publicIp_ = std::move(publicIp);
+}
+
+bool
+IGD::operator==(IGD& other) const
+{
+ return (localIp_ == other.localIp_ and publicIp_ == other.publicIp_);
+}
+
+}} // namespace jami::upnp
\ No newline at end of file
diff --git a/src/upnp/protocol/igd.h b/src/upnp/protocol/igd.h
new file mode 100644
index 000000000..856c7311b
--- /dev/null
+++ b/src/upnp/protocol/igd.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2004-2019 Savoir-faire Linux Inc.
+ *
+ * Author: Eden Abitbol
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "global_mapping.h"
+
+#include "noncopyable.h"
+#include "ip_utils.h"
+#include "string_utils.h"
+
+namespace jami { namespace upnp {
+
+// Subclasses to make it easier to differentiate and cast maps of port mappings.
+class PortMapLocal : public std::map {};
+class PortMapGlobal : public std::map {};
+
+class IGD
+{
+public:
+ IGD(IpAddr&& localIp = {}, IpAddr&& publicIp = {});
+ IGD(IGD&&) = default;
+ virtual ~IGD() = default;
+
+ IGD& operator=(IGD&&) = default;
+ bool operator==(IGD& other) const;
+
+public:
+ IpAddr localIp_ {}; // Internal IP interface used to communication with IGD.
+ IpAddr publicIp_ {}; // External IP of IGD.
+
+ PortMapGlobal udpMappings {}; // IGD UDP port mappings.
+ PortMapGlobal tcpMappings {}; // IGD TCP port mappings.
+
+private:
+ NON_COPYABLE(IGD);
+};
+
+
+}} // namespace jami::upnp
\ No newline at end of file
diff --git a/src/upnp/upnp_igd.cpp b/src/upnp/protocol/mapping.cpp
similarity index 75%
rename from src/upnp/upnp_igd.cpp
rename to src/upnp/protocol/mapping.cpp
index bbe92bc79..b24a645ce 100644
--- a/src/upnp/upnp_igd.cpp
+++ b/src/upnp/protocol/mapping.cpp
@@ -2,6 +2,7 @@
* Copyright (C) 2004-2019 Savoir-faire Linux Inc.
*
* Author: Stepan Salenikovich
+ * Author: Eden Abitbol
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,16 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "upnp_igd.h"
+#include "mapping.h"
namespace jami { namespace upnp {
-/* move constructor and operator */
-Mapping::Mapping(Mapping&& other) noexcept
- : port_external_(other.port_external_)
- , port_internal_(other.port_internal_)
- , type_(other.type_)
- , description_(std::move(other.description_))
+Mapping::Mapping(Mapping&& other) noexcept:
+ port_external_(other.port_external_),
+ port_internal_(other.port_internal_),
+ type_(other.type_),
+ description_(std::move(other.description_))
{
other.port_external_ = 0;
other.port_internal_ = 0;
@@ -48,10 +48,6 @@ Mapping& Mapping::operator=(Mapping&& other) noexcept
bool operator== (const Mapping& cMap1, const Mapping& cMap2)
{
- /* we don't compare the description because it doesn't change the function of the
- * mapping; we don't compare the IGD because for now we assume that we always
- * use the same one and that all mappings are active
- */
return (cMap1.port_external_ == cMap2.port_external_ &&
cMap1.port_internal_ == cMap2.port_internal_ &&
cMap1.type_ == cMap2.type_);
@@ -62,4 +58,14 @@ bool operator!= (const Mapping& cMap1, const Mapping& cMap2)
return !(cMap1 == cMap2);
}
-}} // namespace jami::upnp
+std::string Mapping::toString() const
+{
+ return getPortExternalStr() + ":" + getPortInternalStr() + " " + getTypeStr();
+}
+
+bool Mapping::isValid() const
+{
+ return port_external_ == 0 or port_internal_ == 0 ? false : true;
+};
+
+}} // namespace jami::upnp
\ No newline at end of file
diff --git a/src/upnp/protocol/mapping.h b/src/upnp/protocol/mapping.h
new file mode 100644
index 000000000..2be31ea72
--- /dev/null
+++ b/src/upnp/protocol/mapping.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2004-2019 Savoir-faire Linux Inc.
+ *
+ * Author: Eden Abitbol
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#pragma once
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "noncopyable.h"
+#include "ip_utils.h"
+#include "string_utils.h"
+
+#include