mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-28 14:47:13 +01:00
Ported: miniupnpc: Update to version 2.2.3
Library code and public headers are now properly separated, we can fix include paths
to remove the redundant subfolder.
- akien-mga
912cd43418
This commit is contained in:
parent
f42e413a51
commit
1a4a526f97
@ -233,7 +233,7 @@ Copyright: lieff
|
|||||||
License: CC0-1.0
|
License: CC0-1.0
|
||||||
|
|
||||||
Files: ./thirdparty/miniupnpc/
|
Files: ./thirdparty/miniupnpc/
|
||||||
Comment: MiniUPnPc
|
Comment: MiniUPnP Project
|
||||||
Copyright: 2005-2021, Thomas Bernard
|
Copyright: 2005-2021, Thomas Bernard
|
||||||
License: BSD-3-clause
|
License: BSD-3-clause
|
||||||
|
|
||||||
|
@ -26,9 +26,9 @@ if env["builtin_miniupnpc"]:
|
|||||||
"receivedata.c",
|
"receivedata.c",
|
||||||
"addr_is_reserved.c",
|
"addr_is_reserved.c",
|
||||||
]
|
]
|
||||||
thirdparty_sources = [thirdparty_dir + "miniupnpc/" + file for file in thirdparty_sources]
|
thirdparty_sources = [thirdparty_dir + "src/" + file for file in thirdparty_sources]
|
||||||
|
|
||||||
env_upnp.Prepend(CPPPATH=[thirdparty_dir])
|
env_upnp.Prepend(CPPPATH=[thirdparty_dir + "include"])
|
||||||
env_upnp.Append(CPPDEFINES=["MINIUPNP_STATICLIB"])
|
env_upnp.Append(CPPDEFINES=["MINIUPNP_STATICLIB"])
|
||||||
env_upnp.Append(CPPDEFINES=["MINIUPNPC_SET_SOCKET_TIMEOUT"])
|
env_upnp.Append(CPPDEFINES=["MINIUPNPC_SET_SOCKET_TIMEOUT"])
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
#include "upnp.h"
|
#include "upnp.h"
|
||||||
|
|
||||||
#include <miniupnpc/miniwget.h>
|
#include <miniwget.h>
|
||||||
#include <miniupnpc/upnpcommands.h>
|
#include <upnpcommands.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#include "upnp_device.h"
|
#include "upnp_device.h"
|
||||||
|
|
||||||
#include <miniupnpc/miniupnpc.h>
|
#include <miniupnpc.h>
|
||||||
|
|
||||||
class UPNP : public Reference {
|
class UPNP : public Reference {
|
||||||
GDCLASS(UPNP, Reference);
|
GDCLASS(UPNP, Reference);
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "upnp.h"
|
#include "upnp.h"
|
||||||
|
|
||||||
#include <miniupnpc/upnpcommands.h>
|
#include <upnpcommands.h>
|
||||||
|
|
||||||
String UPNPDevice::query_external_address() const {
|
String UPNPDevice::query_external_address() const {
|
||||||
ERR_FAIL_COND_V(!is_valid_gateway(), "");
|
ERR_FAIL_COND_V(!is_valid_gateway(), "");
|
||||||
|
15
thirdparty/README.md
vendored
15
thirdparty/README.md
vendored
@ -224,22 +224,19 @@ Files extracted from upstream repository:
|
|||||||
## miniupnpc
|
## miniupnpc
|
||||||
|
|
||||||
- Upstream: https://github.com/miniupnp/miniupnp
|
- Upstream: https://github.com/miniupnp/miniupnp
|
||||||
- Version: 2.2.2 (81029a860baf1f727903e5b85307903b3f40cbc8, 2021)
|
- Version: 2.2.3 (2df8120326ed4246e049a7a6de707539604cd514, 2021)
|
||||||
- License: BSD-3-Clause
|
- License: BSD-3-Clause
|
||||||
|
|
||||||
Files extracted from upstream source:
|
Files extracted from upstream source:
|
||||||
|
|
||||||
- All `*.c` and `*.h` files from `miniupnpc` to `thirdparty/miniupnpc/miniupnpc`
|
- Copy `miniupnpc/src` and `miniupnpc/include` to `thirdparty/miniupnpc`
|
||||||
- Remove the following test or sample files:
|
- Remove the following test or sample files:
|
||||||
`listdevices.c minihttptestserver.c miniupnpcmodule.c upnpc.c upnperrors.* test* wingenminiupnpcstrings.c`
|
`listdevices.c minihttptestserver.c miniupnpcmodule.c upnpc.c upnperrors.* test*`
|
||||||
- `LICENSE`
|
- `LICENSE`
|
||||||
|
|
||||||
The only modified file is `miniupnpcstrings.h`, which was created for Godot
|
The only modified file is `src/miniupnpcstrings.h`, which was created for Godot
|
||||||
(it is usually autogenerated by cmake). Bump the version number for miniupnpc in that
|
(it is usually autogenerated by cmake). Bump the version number for miniupnpc in
|
||||||
file when upgrading.
|
that file when upgrading.
|
||||||
|
|
||||||
Note: The following upstream patch has been applied, remove this notice on next update.
|
|
||||||
https://github.com/miniupnp/miniupnp/commit/3a08dd4b89af2e9effa22a136bac86f2f306fd79
|
|
||||||
|
|
||||||
|
|
||||||
## minizip
|
## minizip
|
||||||
|
40
thirdparty/miniupnpc/LICENSE
vendored
40
thirdparty/miniupnpc/LICENSE
vendored
@ -1,27 +1,29 @@
|
|||||||
MiniUPnPc
|
BSD 3-Clause License
|
||||||
Copyright (c) 2005-2020, Thomas BERNARD
|
|
||||||
|
Copyright (c) 2005-2022, Thomas BERNARD
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
this list of conditions and the following disclaimer.
|
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
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
and/or other materials provided with the distribution.
|
this list of conditions and the following disclaimer in the documentation
|
||||||
* The name of the author may not be used to endorse or promote products
|
and/or other materials provided with the distribution.
|
||||||
derived from this software without specific prior written permission.
|
|
||||||
|
3. Neither the name of the copyright holder 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"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#ifndef IGD_DESC_PARSE_H_INCLUDED
|
|
||||||
#define IGD_DESC_PARSE_H_INCLUDED
|
|
||||||
/* $Id: igd_desc_parse.h,v 1.12 2014/11/17 17:19:13 nanard Exp $ */
|
/* $Id: igd_desc_parse.h,v 1.12 2014/11/17 17:19:13 nanard Exp $ */
|
||||||
/* Project : miniupnp
|
/* Project : miniupnp
|
||||||
* http://miniupnp.free.fr/
|
* http://miniupnp.free.fr/
|
||||||
@ -8,8 +6,8 @@
|
|||||||
* This software is subject to the conditions detailed in the
|
* This software is subject to the conditions detailed in the
|
||||||
* LICENCE file provided in this distribution.
|
* LICENCE file provided in this distribution.
|
||||||
* */
|
* */
|
||||||
|
#ifndef IGD_DESC_PARSE_H_INCLUDED
|
||||||
|
#define IGD_DESC_PARSE_H_INCLUDED
|
||||||
|
|
||||||
/* Structure to store the result of the parsing of UPnP
|
/* Structure to store the result of the parsing of UPnP
|
||||||
* descriptions of Internet Gateway Devices */
|
* descriptions of Internet Gateway Devices */
|
@ -1,15 +1,13 @@
|
|||||||
#ifndef MINIUPNPC_H_INCLUDED
|
/* $Id: miniupnpc.h,v 1.61 2022/10/21 21:15:02 nanard Exp $ */
|
||||||
#define MINIUPNPC_H_INCLUDED
|
|
||||||
/* $Id: miniupnpc.h,v 1.58 2021/03/02 23:49:52 nanard Exp $ */
|
|
||||||
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
||||||
* Project: miniupnp
|
* Project: miniupnp
|
||||||
* http://miniupnp.free.fr/
|
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
||||||
* Author: Thomas Bernard
|
* Author: Thomas Bernard
|
||||||
* Copyright (c) 2005-2021 Thomas Bernard
|
* Copyright (c) 2005-2022 Thomas Bernard
|
||||||
* This software is subjects to the conditions detailed
|
* This software is subjects to the conditions detailed
|
||||||
* in the LICENCE file provided within this distribution */
|
* in the LICENCE file provided within this distribution */
|
||||||
|
#ifndef MINIUPNPC_H_INCLUDED
|
||||||
|
#define MINIUPNPC_H_INCLUDED
|
||||||
|
|
||||||
#include "miniupnpc_declspec.h"
|
#include "miniupnpc_declspec.h"
|
||||||
#include "igd_desc_parse.h"
|
#include "igd_desc_parse.h"
|
||||||
@ -22,7 +20,7 @@
|
|||||||
#define UPNPDISCOVER_MEMORY_ERROR (-102)
|
#define UPNPDISCOVER_MEMORY_ERROR (-102)
|
||||||
|
|
||||||
/* versions : */
|
/* versions : */
|
||||||
#define MINIUPNPC_VERSION "2.2.2"
|
#define MINIUPNPC_VERSION "2.2.4"
|
||||||
#define MINIUPNPC_API_VERSION 17
|
#define MINIUPNPC_API_VERSION 17
|
||||||
|
|
||||||
/* Source port:
|
/* Source port:
|
@ -1,15 +1,15 @@
|
|||||||
#ifndef MINIUPNPCTYPES_H_INCLUDED
|
|
||||||
#define MINIUPNPCTYPES_H_INCLUDED
|
|
||||||
/* $Id: miniupnpctypes.h,v 1.1 2011/02/15 11:10:40 nanard Exp $ */
|
/* $Id: miniupnpctypes.h,v 1.1 2011/02/15 11:10:40 nanard Exp $ */
|
||||||
/* Miniupnp project : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org
|
/* Miniupnp project : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org
|
||||||
* Author : Thomas Bernard
|
* Author : Thomas Bernard
|
||||||
* Copyright (c) 2011 Thomas Bernard
|
* Copyright (c) 2021 Thomas Bernard
|
||||||
* This software is subject to the conditions detailed in the
|
* This software is subject to the conditions detailed in the
|
||||||
* LICENCE file provided within this distribution */
|
* LICENCE file provided within this distribution */
|
||||||
|
#ifndef MINIUPNPCTYPES_H_INCLUDED
|
||||||
|
#define MINIUPNPCTYPES_H_INCLUDED
|
||||||
|
|
||||||
|
/* Use unsigned long long when available :
|
||||||
|
* strtoull is C99 */
|
||||||
#if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||||
#define UNSIGNED_INTEGER unsigned long long
|
#define UNSIGNED_INTEGER unsigned long long
|
||||||
#define STRTOUI strtoull
|
#define STRTOUI strtoull
|
||||||
#else
|
#else
|
@ -1,5 +1,3 @@
|
|||||||
#ifndef MINIWGET_H_INCLUDED
|
|
||||||
#define MINIWGET_H_INCLUDED
|
|
||||||
/* $Id: miniwget.h,v 1.12 2016/01/24 17:24:36 nanard Exp $ */
|
/* $Id: miniwget.h,v 1.12 2016/01/24 17:24:36 nanard Exp $ */
|
||||||
/* Project : miniupnp
|
/* Project : miniupnp
|
||||||
* Author : Thomas Bernard
|
* Author : Thomas Bernard
|
||||||
@ -7,8 +5,8 @@
|
|||||||
* This software is subject to the conditions detailed in the
|
* This software is subject to the conditions detailed in the
|
||||||
* LICENCE file provided in this distribution.
|
* LICENCE file provided in this distribution.
|
||||||
* */
|
* */
|
||||||
|
#ifndef MINIWGET_H_INCLUDED
|
||||||
|
#define MINIWGET_H_INCLUDED
|
||||||
|
|
||||||
#include "miniupnpc_declspec.h"
|
#include "miniupnpc_declspec.h"
|
||||||
|
|
@ -1,13 +1,11 @@
|
|||||||
#ifndef PORTLISTINGPARSE_H_INCLUDED
|
|
||||||
#define PORTLISTINGPARSE_H_INCLUDED
|
|
||||||
/* $Id: portlistingparse.h,v 1.10 2014/11/01 10:37:32 nanard Exp $ */
|
/* $Id: portlistingparse.h,v 1.10 2014/11/01 10:37:32 nanard Exp $ */
|
||||||
/* MiniUPnP project
|
/* MiniUPnP project
|
||||||
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||||
* (c) 2011-2015 Thomas Bernard
|
* (c) 2011-2015 Thomas Bernard
|
||||||
* This software is subject to the conditions detailed
|
* This software is subject to the conditions detailed
|
||||||
* in the LICENCE file provided within the distribution */
|
* in the LICENCE file provided within the distribution */
|
||||||
|
#ifndef PORTLISTINGPARSE_H_INCLUDED
|
||||||
|
#define PORTLISTINGPARSE_H_INCLUDED
|
||||||
|
|
||||||
#include "miniupnpc_declspec.h"
|
#include "miniupnpc_declspec.h"
|
||||||
/* for the definition of UNSIGNED_INTEGER */
|
/* for the definition of UNSIGNED_INTEGER */
|
@ -1,13 +1,11 @@
|
|||||||
#ifndef UPNPCOMMANDS_H_INCLUDED
|
|
||||||
#define UPNPCOMMANDS_H_INCLUDED
|
|
||||||
/* $Id: upnpcommands.h,v 1.32 2018/03/13 23:34:47 nanard Exp $ */
|
/* $Id: upnpcommands.h,v 1.32 2018/03/13 23:34:47 nanard Exp $ */
|
||||||
/* Miniupnp project : http://miniupnp.free.fr/
|
/* Miniupnp project : http://miniupnp.free.fr/
|
||||||
* Author : Thomas Bernard
|
* Author : Thomas Bernard
|
||||||
* Copyright (c) 2005-2018 Thomas Bernard
|
* Copyright (c) 2005-2018 Thomas Bernard
|
||||||
* This software is subject to the conditions detailed in the
|
* This software is subject to the conditions detailed in the
|
||||||
* LICENCE file provided within this distribution */
|
* LICENCE file provided within this distribution */
|
||||||
|
#ifndef UPNPCOMMANDS_H_INCLUDED
|
||||||
|
#define UPNPCOMMANDS_H_INCLUDED
|
||||||
|
|
||||||
#include "miniupnpc_declspec.h"
|
#include "miniupnpc_declspec.h"
|
||||||
#include "miniupnpctypes.h"
|
#include "miniupnpctypes.h"
|
@ -1,14 +1,12 @@
|
|||||||
#ifndef UPNPDEV_H_INCLUDED
|
/* $Id: upnpdev.h,v 1.4 2021/08/21 09:45:01 nanard Exp $ */
|
||||||
#define UPNPDEV_H_INCLUDED
|
|
||||||
/* $Id: upnpdev.h,v 1.3 2020/05/29 15:57:42 nanard Exp $ */
|
|
||||||
/* Project : miniupnp
|
/* Project : miniupnp
|
||||||
* Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
* Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
||||||
* Author : Thomas BERNARD
|
* Author : Thomas BERNARD
|
||||||
* copyright (c) 2005-2020 Thomas Bernard
|
* copyright (c) 2005-2021 Thomas Bernard
|
||||||
* This software is subjet to the conditions detailed in the
|
* This software is subjet to the conditions detailed in the
|
||||||
* provided LICENSE file. */
|
* provided LICENSE file. */
|
||||||
|
#ifndef UPNPDEV_H_INCLUDED
|
||||||
|
#define UPNPDEV_H_INCLUDED
|
||||||
|
|
||||||
#include "miniupnpc_declspec.h"
|
#include "miniupnpc_declspec.h"
|
||||||
|
|
||||||
@ -22,7 +20,7 @@ struct UPNPDev {
|
|||||||
char * st;
|
char * st;
|
||||||
char * usn;
|
char * usn;
|
||||||
unsigned int scope_id;
|
unsigned int scope_id;
|
||||||
#if defined(__STDC_VERSION) && __STDC_VERSION__ >= 199901L
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||||
/* C99 flexible array member */
|
/* C99 flexible array member */
|
||||||
char buffer[];
|
char buffer[];
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
@ -1,5 +1,3 @@
|
|||||||
#ifndef UPNPREPLYPARSE_H_INCLUDED
|
|
||||||
#define UPNPREPLYPARSE_H_INCLUDED
|
|
||||||
/* $Id: upnpreplyparse.h,v 1.19 2014/10/27 16:33:19 nanard Exp $ */
|
/* $Id: upnpreplyparse.h,v 1.19 2014/10/27 16:33:19 nanard Exp $ */
|
||||||
/* MiniUPnP project
|
/* MiniUPnP project
|
||||||
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||||
@ -7,8 +5,8 @@
|
|||||||
* This software is subject to the conditions detailed
|
* This software is subject to the conditions detailed
|
||||||
* in the LICENCE file provided within the distribution */
|
* in the LICENCE file provided within the distribution */
|
||||||
|
|
||||||
|
#ifndef UPNPREPLYPARSE_H_INCLUDED
|
||||||
|
#define UPNPREPLYPARSE_H_INCLUDED
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
@ -56,7 +56,7 @@ int addr_is_reserved(const char * addr_str)
|
|||||||
uint32_t addr_n, address;
|
uint32_t addr_n, address;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
#if defined(_WIN32) && (!defined(_WIN32_WINNT_VISTA) || (_WIN32_WINNT < _WIN32_WINNT_VISTA))
|
#if defined(_WIN32) && _WIN32_WINNT < 0x0600 // _WIN32_WINNT_VISTA
|
||||||
addr_n = inet_addr(addr_str);
|
addr_n = inet_addr(addr_str);
|
||||||
if (addr_n == INADDR_NONE)
|
if (addr_n == INADDR_NONE)
|
||||||
return 1;
|
return 1;
|
@ -1,5 +1,3 @@
|
|||||||
#ifndef ADDR_IS_RESERVED_H_INCLUDED
|
|
||||||
#define ADDR_IS_RESERVED_H_INCLUDED
|
|
||||||
/* $Id: $ */
|
/* $Id: $ */
|
||||||
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
||||||
* Project: miniupnp
|
* Project: miniupnp
|
||||||
@ -8,8 +6,8 @@
|
|||||||
* Copyright (c) 2005-2020 Thomas Bernard
|
* Copyright (c) 2005-2020 Thomas Bernard
|
||||||
* This software is subjects to the conditions detailed
|
* This software is subjects to the conditions detailed
|
||||||
* in the LICENCE file provided within this distribution */
|
* in the LICENCE file provided within this distribution */
|
||||||
|
#ifndef ADDR_IS_RESERVED_H_INCLUDED
|
||||||
|
#define ADDR_IS_RESERVED_H_INCLUDED
|
||||||
|
|
||||||
int addr_is_reserved(const char * addr_str);
|
int addr_is_reserved(const char * addr_str);
|
||||||
|
|
@ -1,13 +1,11 @@
|
|||||||
#ifndef CODELENGTH_H_INCLUDED
|
|
||||||
#define CODELENGTH_H_INCLUDED
|
|
||||||
/* $Id: codelength.h,v 1.3 2011/07/30 13:10:05 nanard Exp $ */
|
/* $Id: codelength.h,v 1.3 2011/07/30 13:10:05 nanard Exp $ */
|
||||||
/* Project : miniupnp
|
/* Project : miniupnp
|
||||||
* Author : Thomas BERNARD
|
* Author : Thomas BERNARD
|
||||||
* copyright (c) 2005-2015 Thomas Bernard
|
* copyright (c) 2005-2015 Thomas Bernard
|
||||||
* This software is subjet to the conditions detailed in the
|
* This software is subjet to the conditions detailed in the
|
||||||
* provided LICENCE file. */
|
* provided LICENCE file. */
|
||||||
|
#ifndef CODELENGTH_H_INCLUDED
|
||||||
|
#define CODELENGTH_H_INCLUDED
|
||||||
|
|
||||||
/* Encode length by using 7bit per Byte :
|
/* Encode length by using 7bit per Byte :
|
||||||
* Most significant bit of each byte specifies that the
|
* Most significant bit of each byte specifies that the
|
@ -1,5 +1,3 @@
|
|||||||
#ifndef CONNECTHOSTPORT_H_INCLUDED
|
|
||||||
#define CONNECTHOSTPORT_H_INCLUDED
|
|
||||||
/* $Id: connecthostport.h,v 1.2 2012/06/23 22:32:33 nanard Exp $ */
|
/* $Id: connecthostport.h,v 1.2 2012/06/23 22:32:33 nanard Exp $ */
|
||||||
/* Project: miniupnp
|
/* Project: miniupnp
|
||||||
* http://miniupnp.free.fr/
|
* http://miniupnp.free.fr/
|
||||||
@ -7,8 +5,8 @@
|
|||||||
* Copyright (c) 2010-2018 Thomas Bernard
|
* Copyright (c) 2010-2018 Thomas Bernard
|
||||||
* This software is subjects to the conditions detailed
|
* This software is subjects to the conditions detailed
|
||||||
* in the LICENCE file provided within this distribution */
|
* in the LICENCE file provided within this distribution */
|
||||||
|
#ifndef CONNECTHOSTPORT_H_INCLUDED
|
||||||
|
#define CONNECTHOSTPORT_H_INCLUDED
|
||||||
|
|
||||||
#include "miniupnpc_socketdef.h"
|
#include "miniupnpc_socketdef.h"
|
||||||
|
|
@ -1,13 +1,11 @@
|
|||||||
#ifndef MINISOAP_H_INCLUDED
|
|
||||||
#define MINISOAP_H_INCLUDED
|
|
||||||
/* $Id: minisoap.h,v 1.4 2010/04/12 20:39:41 nanard Exp $ */
|
/* $Id: minisoap.h,v 1.4 2010/04/12 20:39:41 nanard Exp $ */
|
||||||
/* Project : miniupnp
|
/* Project : miniupnp
|
||||||
* Author : Thomas Bernard
|
* Author : Thomas Bernard
|
||||||
* Copyright (c) 2005-2018 Thomas Bernard
|
* Copyright (c) 2005-2018 Thomas Bernard
|
||||||
* This software is subject to the conditions detailed in the
|
* This software is subject to the conditions detailed in the
|
||||||
* LICENCE file provided in this distribution. */
|
* LICENCE file provided in this distribution. */
|
||||||
|
#ifndef MINISOAP_H_INCLUDED
|
||||||
|
#define MINISOAP_H_INCLUDED
|
||||||
|
|
||||||
#include "miniupnpc_socketdef.h"
|
#include "miniupnpc_socketdef.h"
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: minissdpc.c,v 1.47 2021/03/02 23:38:30 nanard Exp $ */
|
/* $Id: minissdpc.c,v 1.49 2021/05/13 11:00:36 nanard Exp $ */
|
||||||
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
||||||
* Project : miniupnp
|
* Project : miniupnp
|
||||||
* Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
* Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
||||||
@ -460,7 +460,7 @@ parseMSEARCHReply(const char * reply, int size,
|
|||||||
static int upnp_gettimeofday(struct timeval * tv)
|
static int upnp_gettimeofday(struct timeval * tv)
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#if defined(_WIN32_WINNT_VISTA) && (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
|
#if _WIN32_WINNT >= 0x0600 // _WIN32_WINNT_VISTA
|
||||||
ULONGLONG ts = GetTickCount64();
|
ULONGLONG ts = GetTickCount64();
|
||||||
#else
|
#else
|
||||||
DWORD ts = GetTickCount();
|
DWORD ts = GetTickCount();
|
||||||
@ -469,14 +469,29 @@ static int upnp_gettimeofday(struct timeval * tv)
|
|||||||
tv->tv_usec = (ts % 1000) * 1000;
|
tv->tv_usec = (ts % 1000) * 1000;
|
||||||
return 0; /* success */
|
return 0; /* success */
|
||||||
#elif defined(CLOCK_MONOTONIC_FAST) || defined(CLOCK_MONOTONIC)
|
#elif defined(CLOCK_MONOTONIC_FAST) || defined(CLOCK_MONOTONIC)
|
||||||
struct timespec ts;
|
#if defined(__APPLE__)
|
||||||
int ret_code = clock_gettime(UPNP_CLOCKID, &ts);
|
#if defined(__clang__)
|
||||||
if (ret_code == 0)
|
if (__builtin_available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)) {
|
||||||
{
|
#else /* !defined(__clang__) */
|
||||||
tv->tv_sec = ts.tv_sec;
|
if (clock_gettime != NULL) {
|
||||||
tv->tv_usec = ts.tv_nsec / 1000;
|
#endif /* defined(__clang__) */
|
||||||
|
#endif /* defined(__APPLE__) */
|
||||||
|
struct timespec ts;
|
||||||
|
int ret_code = clock_gettime(UPNP_CLOCKID, &ts);
|
||||||
|
if (ret_code == 0)
|
||||||
|
{
|
||||||
|
tv->tv_sec = ts.tv_sec;
|
||||||
|
tv->tv_usec = ts.tv_nsec / 1000;
|
||||||
|
}
|
||||||
|
return ret_code;
|
||||||
|
#if defined(__APPLE__)
|
||||||
}
|
}
|
||||||
return ret_code;
|
else
|
||||||
|
{
|
||||||
|
/* fall-back for earlier Apple platforms */
|
||||||
|
return gettimeofday(tv, NULL);
|
||||||
|
}
|
||||||
|
#endif /* defined(__APPLE__) */
|
||||||
#else
|
#else
|
||||||
return gettimeofday(tv, NULL);
|
return gettimeofday(tv, NULL);
|
||||||
#endif
|
#endif
|
||||||
@ -705,7 +720,7 @@ ssdpDiscoverDevices(const char * const deviceTypes[],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(multicastif)
|
if(multicastif && multicastif[0] != '\0')
|
||||||
{
|
{
|
||||||
if(ipv6) {
|
if(ipv6) {
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
@ -732,7 +747,7 @@ ssdpDiscoverDevices(const char * const deviceTypes[],
|
|||||||
} else {
|
} else {
|
||||||
struct in_addr mc_if;
|
struct in_addr mc_if;
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#if defined(_WIN32_WINNT_VISTA) && (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
|
#if _WIN32_WINNT >= 0x0600 // _WIN32_WINNT_VISTA
|
||||||
InetPtonA(AF_INET, multicastif, &mc_if);
|
InetPtonA(AF_INET, multicastif, &mc_if);
|
||||||
#else
|
#else
|
||||||
mc_if.s_addr = inet_addr(multicastif); /* old Windows SDK do not support InetPtoA() */
|
mc_if.s_addr = inet_addr(multicastif); /* old Windows SDK do not support InetPtoA() */
|
@ -1,5 +1,3 @@
|
|||||||
#ifndef MINISSDPC_H_INCLUDED
|
|
||||||
#define MINISSDPC_H_INCLUDED
|
|
||||||
/* $Id: minissdpc.h,v 1.6 2015/09/18 12:45:16 nanard Exp $ */
|
/* $Id: minissdpc.h,v 1.6 2015/09/18 12:45:16 nanard Exp $ */
|
||||||
/* Project: miniupnp
|
/* Project: miniupnp
|
||||||
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||||
@ -7,8 +5,8 @@
|
|||||||
* Copyright (c) 2005-2015 Thomas Bernard
|
* Copyright (c) 2005-2015 Thomas Bernard
|
||||||
* This software is subjects to the conditions detailed
|
* This software is subjects to the conditions detailed
|
||||||
* in the LICENCE file provided within this distribution */
|
* in the LICENCE file provided within this distribution */
|
||||||
|
#ifndef MINISSDPC_H_INCLUDED
|
||||||
|
#define MINISSDPC_H_INCLUDED
|
||||||
|
|
||||||
#include "miniupnpc_declspec.h"
|
#include "miniupnpc_declspec.h"
|
||||||
#include "upnpdev.h"
|
#include "upnpdev.h"
|
@ -1,13 +1,11 @@
|
|||||||
#ifndef MINIUPNPC_SOCKETDEF_H_INCLUDED
|
|
||||||
#define MINIUPNPC_SOCKETDEF_H_INCLUDED
|
|
||||||
/* $Id: miniupnpc_socketdef.h,v 1.1 2018/03/13 23:44:10 nanard Exp $ */
|
/* $Id: miniupnpc_socketdef.h,v 1.1 2018/03/13 23:44:10 nanard Exp $ */
|
||||||
/* Miniupnp project : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
/* Miniupnp project : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
||||||
* Author : Thomas Bernard
|
* Author : Thomas Bernard
|
||||||
* Copyright (c) 2018 Thomas Bernard
|
* Copyright (c) 2018 Thomas Bernard
|
||||||
* This software is subject to the conditions detailed in the
|
* This software is subject to the conditions detailed in the
|
||||||
* LICENCE file provided within this distribution */
|
* LICENCE file provided within this distribution */
|
||||||
|
#ifndef MINIUPNPC_SOCKETDEF_H_INCLUDED
|
||||||
|
#define MINIUPNPC_SOCKETDEF_H_INCLUDED
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
@ -4,7 +4,7 @@
|
|||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
|
||||||
#define OS_STRING VERSION_NAME "/1.0"
|
#define OS_STRING VERSION_NAME "/1.0"
|
||||||
#define MINIUPNPC_VERSION_STRING "2.2.2"
|
#define MINIUPNPC_VERSION_STRING "2.2.4"
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* according to "UPnP Device Architecture 1.0" */
|
/* according to "UPnP Device Architecture 1.0" */
|
@ -1,5 +1,3 @@
|
|||||||
#ifndef MINIWGET_INTERNAL_H_INCLUDED
|
|
||||||
#define MINIWGET_INTERNAL_H_INCLUDED
|
|
||||||
/* $Id: miniwget_private.h,v 1.1 2018/04/06 10:17:58 nanard Exp $ */
|
/* $Id: miniwget_private.h,v 1.1 2018/04/06 10:17:58 nanard Exp $ */
|
||||||
/* Project : miniupnp
|
/* Project : miniupnp
|
||||||
* Author : Thomas Bernard
|
* Author : Thomas Bernard
|
||||||
@ -7,8 +5,8 @@
|
|||||||
* This software is subject to the conditions detailed in the
|
* This software is subject to the conditions detailed in the
|
||||||
* LICENCE file provided in this distribution.
|
* LICENCE file provided in this distribution.
|
||||||
* */
|
* */
|
||||||
|
#ifndef MINIWGET_INTERNAL_H_INCLUDED
|
||||||
|
#define MINIWGET_INTERNAL_H_INCLUDED
|
||||||
|
|
||||||
#include "miniupnpc_socketdef.h"
|
#include "miniupnpc_socketdef.h"
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: minixml.c,v 1.10 2012/03/05 19:42:47 nanard Exp $ */
|
/* $Id: minixml.c,v 1.12 2017/12/12 11:17:40 nanard Exp $ */
|
||||||
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
||||||
* minixml.c : the minimum size a xml parser can be ! */
|
* minixml.c : the minimum size a xml parser can be ! */
|
||||||
/* Project : miniupnp
|
/* Project : miniupnp
|
@ -1,5 +1,3 @@
|
|||||||
#ifndef MINIXML_H_INCLUDED
|
|
||||||
#define MINIXML_H_INCLUDED
|
|
||||||
/* $Id: minixml.h,v 1.6 2006/11/30 11:47:21 nanard Exp $ */
|
/* $Id: minixml.h,v 1.6 2006/11/30 11:47:21 nanard Exp $ */
|
||||||
/* minimal xml parser
|
/* minimal xml parser
|
||||||
*
|
*
|
||||||
@ -10,8 +8,8 @@
|
|||||||
* This software is subject to the conditions detailed in the
|
* This software is subject to the conditions detailed in the
|
||||||
* LICENCE file provided in this distribution.
|
* LICENCE file provided in this distribution.
|
||||||
* */
|
* */
|
||||||
|
#ifndef MINIXML_H_INCLUDED
|
||||||
|
#define MINIXML_H_INCLUDED
|
||||||
#define IS_WHITE_SPACE(c) ((c)==' ' || (c)=='\t' || (c)=='\r' || (c)=='\n')
|
#define IS_WHITE_SPACE(c) ((c)==' ' || (c)=='\t' || (c)=='\r' || (c)=='\n')
|
||||||
|
|
||||||
/* if a callback function pointer is set to NULL,
|
/* if a callback function pointer is set to NULL,
|
@ -1,5 +1,3 @@
|
|||||||
#ifndef RECEIVEDATA_H_INCLUDED
|
|
||||||
#define RECEIVEDATA_H_INCLUDED
|
|
||||||
/* $Id: receivedata.h,v 1.3 2012/06/23 22:34:47 nanard Exp $ */
|
/* $Id: receivedata.h,v 1.3 2012/06/23 22:34:47 nanard Exp $ */
|
||||||
/* Project: miniupnp
|
/* Project: miniupnp
|
||||||
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||||
@ -7,8 +5,8 @@
|
|||||||
* Copyright (c) 2011-2018 Thomas Bernard
|
* Copyright (c) 2011-2018 Thomas Bernard
|
||||||
* This software is subjects to the conditions detailed
|
* This software is subjects to the conditions detailed
|
||||||
* in the LICENCE file provided within this distribution */
|
* in the LICENCE file provided within this distribution */
|
||||||
|
#ifndef RECEIVEDATA_H_INCLUDED
|
||||||
|
#define RECEIVEDATA_H_INCLUDED
|
||||||
|
|
||||||
#include "miniupnpc_socketdef.h"
|
#include "miniupnpc_socketdef.h"
|
||||||
|
|
@ -1,5 +1,3 @@
|
|||||||
#ifndef WIN32_SNPRINTF_H
|
|
||||||
#define WIN32_SNPRINTF_H
|
|
||||||
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
||||||
* MiniUPnP project
|
* MiniUPnP project
|
||||||
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
||||||
@ -7,8 +5,8 @@
|
|||||||
* This software is subject to the conditions detailed
|
* This software is subject to the conditions detailed
|
||||||
* in the LICENCE file provided within the distribution */
|
* in the LICENCE file provided within the distribution */
|
||||||
|
|
||||||
|
#ifndef WIN32_SNPRINTF_H
|
||||||
|
#define WIN32_SNPRINTF_H
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
Loading…
Reference in New Issue
Block a user