updated miniupnp

This commit is contained in:
Riccardo Spagni 2016-09-17 10:11:02 +02:00
parent f62ebc5c81
commit bb69371f66
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
8 changed files with 48 additions and 26 deletions

View File

@ -59,15 +59,15 @@ else()
add_subdirectory(miniupnpc) add_subdirectory(miniupnpc)
set_property(TARGET upnpc-static PROPERTY FOLDER "external") set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
if(MSVC) if(MSVC)
set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
elseif(NOT MSVC) elseif(NOT MSVC)
set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
endif() endif()
set(UPNP_STATIC true PARENT_SCOPE) set(UPNP_STATIC true PARENT_SCOPE)
set(UPNP_LIBRARIES "upnpc-static" PARENT_SCOPE) set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
endif() endif()
find_package(Unbound) find_package(Unbound)

View File

@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 2.6) cmake_minimum_required (VERSION 2.6)
project (miniupnpc C) project (miniupnpc C)
set (MINIUPNPC_VERSION 1.9) set (MINIUPNPC_VERSION 2.0)
set (MINIUPNPC_API_VERSION 16) set (MINIUPNPC_API_VERSION 16)
# - we comment out this block as we don't support these other build types # - we comment out this block as we don't support these other build types
@ -34,6 +34,10 @@ endif (NO_GETADDRINFO)
if (NOT WIN32) if (NOT WIN32)
add_definitions (-DMINIUPNPC_SET_SOCKET_TIMEOUT) add_definitions (-DMINIUPNPC_SET_SOCKET_TIMEOUT)
add_definitions (-D_BSD_SOURCE -D_DEFAULT_SOURCE) add_definitions (-D_BSD_SOURCE -D_DEFAULT_SOURCE)
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
# add_definitions (-D_POSIX_C_SOURCE=200112L)
add_definitions (-D_XOPEN_SOURCE=600)
endif (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
else (NOT WIN32) else (NOT WIN32)
add_definitions (-D_WIN32_WINNT=0x0501) # XP or higher for getnameinfo and friends add_definitions (-D_WIN32_WINNT=0x0501) # XP or higher for getnameinfo and friends
endif (NOT WIN32) endif (NOT WIN32)
@ -68,8 +72,8 @@ if (CMAKE_COMPILER_IS_GNUC)
endif () endif ()
endif() endif()
configure_file (miniupnpcstrings.h.cmake ${CMAKE_BINARY_DIR}/miniupnpcstrings.h) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/miniupnpcstrings.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h)
include_directories (${CMAKE_BINARY_DIR}) include_directories (${CMAKE_CURRENT_BINARY_DIR})
set (MINIUPNPC_SOURCES set (MINIUPNPC_SOURCES
igd_desc_parse.c igd_desc_parse.c
@ -78,7 +82,6 @@ set (MINIUPNPC_SOURCES
minisoap.c minisoap.c
minissdpc.c minissdpc.c
miniwget.c miniwget.c
upnpc.c
upnpcommands.c upnpcommands.c
upnpdev.c upnpdev.c
upnpreplyparse.c upnpreplyparse.c
@ -117,21 +120,25 @@ if (NOT UPNPC_BUILD_STATIC AND NOT UPNPC_BUILD_SHARED)
endif (NOT UPNPC_BUILD_STATIC AND NOT UPNPC_BUILD_SHARED) endif (NOT UPNPC_BUILD_STATIC AND NOT UPNPC_BUILD_SHARED)
if (UPNPC_BUILD_STATIC) if (UPNPC_BUILD_STATIC)
add_library (upnpc-static STATIC ${MINIUPNPC_SOURCES}) add_library (libminiupnpc-static STATIC ${MINIUPNPC_SOURCES})
set_target_properties (upnpc-static PROPERTIES OUTPUT_NAME "miniupnpc") set_target_properties (libminiupnpc-static PROPERTIES OUTPUT_NAME "miniupnpc")
target_link_libraries (upnpc-static ${LDLIBS}) target_link_libraries (libminiupnpc-static ${LDLIBS})
set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} upnpc-static) set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} libminiupnpc-static)
set (UPNPC_LIBRARY_TARGET upnpc-static) set (UPNPC_LIBRARY_TARGET libminiupnpc-static)
add_executable (upnpc-static upnpc.c)
target_link_libraries (upnpc-static LINK_PRIVATE libminiupnpc-static)
endif (UPNPC_BUILD_STATIC) endif (UPNPC_BUILD_STATIC)
if (UPNPC_BUILD_SHARED) if (UPNPC_BUILD_SHARED)
add_library (upnpc-shared SHARED ${MINIUPNPC_SOURCES}) add_library (libminiupnpc-shared SHARED ${MINIUPNPC_SOURCES})
set_target_properties (upnpc-shared PROPERTIES OUTPUT_NAME "miniupnpc") set_target_properties (libminiupnpc-shared PROPERTIES OUTPUT_NAME "miniupnpc")
set_target_properties (upnpc-shared PROPERTIES VERSION ${MINIUPNPC_VERSION}) set_target_properties (libminiupnpc-shared PROPERTIES VERSION ${MINIUPNPC_VERSION})
set_target_properties (upnpc-shared PROPERTIES SOVERSION ${MINIUPNPC_API_VERSION}) set_target_properties (libminiupnpc-shared PROPERTIES SOVERSION ${MINIUPNPC_API_VERSION})
target_link_libraries (upnpc-shared ${LDLIBS}) target_link_libraries (libminiupnpc-shared ${LDLIBS})
set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} upnpc-shared) set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} libminiupnpc-shared)
set (UPNPC_LIBRARY_TARGET upnpc-shared) set (UPNPC_LIBRARY_TARGET libminiupnpc-shared)
add_executable (upnpc-shared upnpc.c)
target_link_libraries (upnpc-shared LINK_PRIVATE libminiupnpc-shared)
endif (UPNPC_BUILD_SHARED) endif (UPNPC_BUILD_SHARED)
if (UPNPC_BUILD_TESTS) if (UPNPC_BUILD_TESTS)

View File

@ -1,6 +1,8 @@
$Id: Changelog.txt,v 1.222 2016/01/24 17:24:35 nanard Exp $ $Id: Changelog.txt,v 1.223 2016/04/19 21:06:20 nanard Exp $
miniUPnP client Changelog. miniUPnP client Changelog.
VERSION 2.0 : released 2016/04/19
2016/01/24: 2016/01/24:
change miniwget to return HTTP status code change miniwget to return HTTP status code
increments API_VERSION to 16 increments API_VERSION to 16

View File

@ -38,6 +38,9 @@ CFLAGS += -DMINIUPNPC_SET_SOCKET_TIMEOUT
CFLAGS += -DMINIUPNPC_GET_SRC_ADDR CFLAGS += -DMINIUPNPC_GET_SRC_ADDR
CFLAGS += -D_BSD_SOURCE CFLAGS += -D_BSD_SOURCE
CFLAGS += -D_DEFAULT_SOURCE CFLAGS += -D_DEFAULT_SOURCE
ifeq ($(OS), NetBSD)
CFLAGS += -D_NETBSD_SOURCE
endif
ifneq ($(OS), FreeBSD) ifneq ($(OS), FreeBSD)
ifneq ($(OS), Darwin) ifneq ($(OS), Darwin)
#CFLAGS += -D_POSIX_C_SOURCE=200112L #CFLAGS += -D_POSIX_C_SOURCE=200112L
@ -136,7 +139,11 @@ endif
LIBDIR ?= lib LIBDIR ?= lib
# install directories # install directories
INSTALLPREFIX ?= $(PREFIX)/usr ifeq ($(strip $(PREFIX)),)
INSTALLPREFIX ?= /usr
else
INSTALLPREFIX ?= $(PREFIX)
endif
INSTALLDIRINC = $(INSTALLPREFIX)/include/miniupnpc INSTALLDIRINC = $(INSTALLPREFIX)/include/miniupnpc
INSTALLDIRLIB = $(INSTALLPREFIX)/$(LIBDIR) INSTALLDIRLIB = $(INSTALLPREFIX)/$(LIBDIR)
INSTALLDIRBIN = $(INSTALLPREFIX)/bin INSTALLDIRBIN = $(INSTALLPREFIX)/bin

View File

@ -3,7 +3,7 @@ Project web page: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
github: https://github.com/miniupnp/miniupnp github: https://github.com/miniupnp/miniupnp
freecode: http://freecode.com/projects/miniupnp freecode: http://freecode.com/projects/miniupnp
Author: Thomas Bernard Author: Thomas Bernard
Copyright (c) 2005-2014 Thomas Bernard Copyright (c) 2005-2016 Thomas Bernard
This software is subject to the conditions detailed in the This software is subject to the conditions detailed in the
LICENSE file provided within this distribution. LICENSE file provided within this distribution.
@ -32,6 +32,7 @@ To use the libminiupnpc in your application, link it with
libminiupnpc.a (or .so) and use the following functions found in miniupnpc.h, libminiupnpc.a (or .so) and use the following functions found in miniupnpc.h,
upnpcommands.h and miniwget.h : upnpcommands.h and miniwget.h :
- upnpDiscover() - upnpDiscover()
- UPNP_GetValidIGD()
- miniwget() - miniwget()
- parserootdesc() - parserootdesc()
- GetUPNPUrls() - GetUPNPUrls()
@ -59,3 +60,5 @@ send me an email !
For any question, you can use the web forum : For any question, you can use the web forum :
http://miniupnp.tuxfamily.org/forum/ http://miniupnp.tuxfamily.org/forum/
Bugs should be reported on github :
https://github.com/miniupnp/miniupnp/issues

View File

@ -1 +1 @@
1.9 2.0

View File

@ -11,6 +11,9 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#if defined (__NetBSD__)
#include <net/if.h>
#endif
#if defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__) #if defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__)
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>

View File

@ -1,4 +1,4 @@
/* $Id: miniupnpc.h,v 1.49 2016/01/24 17:24:36 nanard Exp $ */ /* $Id: miniupnpc.h,v 1.50 2016/04/19 21:06:21 nanard Exp $ */
/* Project: miniupnp /* Project: miniupnp
* http://miniupnp.free.fr/ * http://miniupnp.free.fr/
* Author: Thomas Bernard * Author: Thomas Bernard
@ -19,7 +19,7 @@
#define UPNPDISCOVER_MEMORY_ERROR (-102) #define UPNPDISCOVER_MEMORY_ERROR (-102)
/* versions : */ /* versions : */
#define MINIUPNPC_VERSION "1.9" #define MINIUPNPC_VERSION "2.0"
#define MINIUPNPC_API_VERSION 16 #define MINIUPNPC_API_VERSION 16
/* Source port: /* Source port: