miniupnpc 2.2.8__tar.gz → 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/Makefile +1 -1
- miniupnpc-2.3.0/PKG-INFO +48 -0
- miniupnpc-2.3.0/VERSION +1 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/include/miniupnpc.h +15 -9
- miniupnpc-2.3.0/miniupnpc.egg-info/PKG-INFO +48 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/setup.py +2 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/setupmingw32.py +9 -1
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/miniupnpc.c +13 -13
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/upnpc.c +9 -9
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/upnpcommands.c +37 -37
- miniupnpc-2.2.8/PKG-INFO +0 -10
- miniupnpc-2.2.8/VERSION +0 -1
- miniupnpc-2.2.8/miniupnpc.egg-info/PKG-INFO +0 -10
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/LICENSE +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/MANIFEST.in +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/README +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/external-ip.sh +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/include/igd_desc_parse.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/include/miniupnpc_declspec.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/include/miniupnpctypes.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/include/miniwget.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/include/portlistingparse.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/include/upnpcommands.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/include/upnpdev.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/include/upnperrors.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/include/upnpreplyparse.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/miniupnpc.egg-info/SOURCES.txt +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/miniupnpc.egg-info/dependency_links.txt +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/miniupnpc.egg-info/top_level.txt +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/miniupnpcstrings.h.in +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/setup.cfg +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/addr_is_reserved.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/addr_is_reserved.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/codelength.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/connecthostport.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/connecthostport.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/igd_desc_parse.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/listdevices.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/minihttptestserver.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/minisoap.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/minisoap.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/minissdpc.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/minissdpc.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/miniupnpc_socketdef.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/miniupnpcmodule.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/miniwget.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/miniwget_private.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/minixml.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/minixml.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/minixmlvalid.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/portlistingparse.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/receivedata.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/receivedata.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/testaddr_is_reserved.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/testigddescparse.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/testminiwget.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/testminixml.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/testportlistingparse.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/testupnpreplyparse.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/upnpdev.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/upnperrors.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/upnpreplyparse.c +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/src/win32_snprintf.h +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/testminiwget.sh +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/testupnpreplyparse.sh +0 -0
- {miniupnpc-2.2.8 → miniupnpc-2.3.0}/updateminiupnpcstrings.sh +0 -0
miniupnpc-2.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: miniupnpc
|
|
3
|
+
Version: 2.3.0
|
|
4
|
+
Summary: MiniUPnP IGD client
|
|
5
|
+
Home-page: https://miniupnp.tuxfamily.org/
|
|
6
|
+
Author: Thomas BERNARD
|
|
7
|
+
Author-email: miniupnp@free.fr
|
|
8
|
+
License: BSD 3-Clause License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2005-2024, Thomas BERNARD
|
|
11
|
+
All rights reserved.
|
|
12
|
+
|
|
13
|
+
Redistribution and use in source and binary forms, with or without
|
|
14
|
+
modification, are permitted provided that the following conditions are met:
|
|
15
|
+
|
|
16
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
17
|
+
list of conditions and the following disclaimer.
|
|
18
|
+
|
|
19
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
20
|
+
this list of conditions and the following disclaimer in the documentation
|
|
21
|
+
and/or other materials provided with the distribution.
|
|
22
|
+
|
|
23
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
24
|
+
contributors may be used to endorse or promote products derived from
|
|
25
|
+
this software without specific prior written permission.
|
|
26
|
+
|
|
27
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
28
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
29
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
30
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
31
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
32
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
33
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
34
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
35
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
36
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
37
|
+
|
|
38
|
+
Platform: UNKNOWN
|
|
39
|
+
Description-Content-Type: text/plain
|
|
40
|
+
License-File: LICENSE
|
|
41
|
+
|
|
42
|
+
MiniUPnPc is a library enabling applications to access the services provided
|
|
43
|
+
by an UPnP "Internet Gateway Device" present on the network. In UPnP
|
|
44
|
+
terminology, MiniUPnPc is a UPnP Control Point.
|
|
45
|
+
|
|
46
|
+
MiniUPnPc is designed to have low footprint and the libc as unique
|
|
47
|
+
dependency.
|
|
48
|
+
|
miniupnpc-2.3.0/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.3.0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* $Id: miniupnpc.h,v 1.
|
|
1
|
+
/* $Id: miniupnpc.h,v 1.69 2025/01/10 23:19:30 nanard Exp $ */
|
|
2
2
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
|
3
3
|
* Project: miniupnp
|
|
4
4
|
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
|
5
5
|
* Author: Thomas Bernard
|
|
6
|
-
* Copyright (c) 2005-
|
|
6
|
+
* Copyright (c) 2005-2025 Thomas Bernard
|
|
7
7
|
* This software is subjects to the conditions detailed
|
|
8
8
|
* in the LICENCE file provided within this distribution */
|
|
9
9
|
#ifndef MINIUPNPC_H_INCLUDED
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
#define UPNPDISCOVER_MEMORY_ERROR (-102)
|
|
21
21
|
|
|
22
22
|
/* versions : */
|
|
23
|
-
#define MINIUPNPC_VERSION "2.
|
|
24
|
-
#define MINIUPNPC_API_VERSION
|
|
23
|
+
#define MINIUPNPC_VERSION "2.3.0"
|
|
24
|
+
#define MINIUPNPC_API_VERSION 19
|
|
25
25
|
|
|
26
26
|
/* Source port:
|
|
27
27
|
Using "1" as an alias for 1900 for backwards compatibility
|
|
@@ -37,7 +37,7 @@ extern "C" {
|
|
|
37
37
|
struct UPNParg { const char * elt; const char * val; };
|
|
38
38
|
|
|
39
39
|
char *
|
|
40
|
-
simpleUPnPcommand(
|
|
40
|
+
simpleUPnPcommand(const char *, const char *,
|
|
41
41
|
const char *, struct UPNParg *,
|
|
42
42
|
int *);
|
|
43
43
|
|
|
@@ -104,15 +104,21 @@ struct UPNPUrls {
|
|
|
104
104
|
char * rootdescURL;
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
+
#define UPNP_NO_IGD (0)
|
|
108
|
+
#define UPNP_CONNECTED_IGD (1)
|
|
109
|
+
#define UPNP_PRIVATEIP_IGD (2)
|
|
110
|
+
#define UPNP_DISCONNECTED_IGD (3)
|
|
111
|
+
#define UPNP_UNKNOWN_DEVICE (4)
|
|
107
112
|
/* UPNP_GetValidIGD() :
|
|
108
113
|
* return values :
|
|
109
|
-
* 0 = NO IGD found
|
|
110
|
-
* 1 = A valid connected IGD has been found
|
|
114
|
+
* 0 = NO IGD found (UPNP_NO_IGD)
|
|
115
|
+
* 1 = A valid connected IGD has been found (UPNP_CONNECTED_IGD)
|
|
111
116
|
* 2 = A valid connected IGD has been found but its
|
|
112
|
-
* IP address is reserved (non routable)
|
|
117
|
+
* IP address is reserved (non routable) (UPNP_PRIVATEIP_IGD)
|
|
113
118
|
* 3 = A valid IGD has been found but it reported as
|
|
114
|
-
* not connected
|
|
119
|
+
* not connected (UPNP_DISCONNECTED_IGD)
|
|
115
120
|
* 4 = an UPnP device has been found but was not recognized as an IGD
|
|
121
|
+
* (UPNP_UNKNOWN_DEVICE)
|
|
116
122
|
*
|
|
117
123
|
* In any non zero return case, the urls and data structures
|
|
118
124
|
* passed as parameters are set. Donc forget to call FreeUPNPUrls(urls) to
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: miniupnpc
|
|
3
|
+
Version: 2.3.0
|
|
4
|
+
Summary: MiniUPnP IGD client
|
|
5
|
+
Home-page: https://miniupnp.tuxfamily.org/
|
|
6
|
+
Author: Thomas BERNARD
|
|
7
|
+
Author-email: miniupnp@free.fr
|
|
8
|
+
License: BSD 3-Clause License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2005-2024, Thomas BERNARD
|
|
11
|
+
All rights reserved.
|
|
12
|
+
|
|
13
|
+
Redistribution and use in source and binary forms, with or without
|
|
14
|
+
modification, are permitted provided that the following conditions are met:
|
|
15
|
+
|
|
16
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
17
|
+
list of conditions and the following disclaimer.
|
|
18
|
+
|
|
19
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
20
|
+
this list of conditions and the following disclaimer in the documentation
|
|
21
|
+
and/or other materials provided with the distribution.
|
|
22
|
+
|
|
23
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
24
|
+
contributors may be used to endorse or promote products derived from
|
|
25
|
+
this software without specific prior written permission.
|
|
26
|
+
|
|
27
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
28
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
29
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
30
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
31
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
32
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
33
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
34
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
35
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
36
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
37
|
+
|
|
38
|
+
Platform: UNKNOWN
|
|
39
|
+
Description-Content-Type: text/plain
|
|
40
|
+
License-File: LICENSE
|
|
41
|
+
|
|
42
|
+
MiniUPnPc is a library enabling applications to access the services provided
|
|
43
|
+
by an UPnP "Internet Gateway Device" present on the network. In UPnP
|
|
44
|
+
terminology, MiniUPnPc is a UPnP Control Point.
|
|
45
|
+
|
|
46
|
+
MiniUPnPc is designed to have low footprint and the libc as unique
|
|
47
|
+
dependency.
|
|
48
|
+
|
|
@@ -27,6 +27,8 @@ setup(name="miniupnpc",
|
|
|
27
27
|
license=open('LICENSE').read(),
|
|
28
28
|
url='https://miniupnp.tuxfamily.org/',
|
|
29
29
|
description='MiniUPnP IGD client',
|
|
30
|
+
long_description=open('DESCRIPTION').read().strip(),
|
|
31
|
+
long_description_content_type='text/plain',
|
|
30
32
|
cmdclass={'build_ext': make_then_build_ext},
|
|
31
33
|
ext_modules=[
|
|
32
34
|
Extension(name="miniupnpc", sources=["src/miniupnpcmodule.c"],
|
|
@@ -20,13 +20,21 @@ except ImportError:
|
|
|
20
20
|
from distutils import sysconfig
|
|
21
21
|
sysconfig.get_config_vars()["OPT"] = ''
|
|
22
22
|
sysconfig.get_config_vars()["CFLAGS"] = ''
|
|
23
|
+
|
|
24
|
+
lic = open('LICENSE').read()
|
|
25
|
+
# follow the symbolic link manually if needed
|
|
26
|
+
if lic.startswith('../'):
|
|
27
|
+
lic = open(lic).read()
|
|
28
|
+
|
|
23
29
|
setup(name="miniupnpc",
|
|
24
30
|
version=open('VERSION').read().strip(),
|
|
25
31
|
author='Thomas BERNARD',
|
|
26
32
|
author_email='miniupnp@free.fr',
|
|
27
|
-
license=
|
|
33
|
+
license=lic,
|
|
28
34
|
url='https://miniupnp.tuxfamily.org/',
|
|
29
35
|
description='MiniUPnP IGD client',
|
|
36
|
+
long_description=open('DESCRIPTION').read().strip(),
|
|
37
|
+
long_description_content_type='text/plain',
|
|
30
38
|
ext_modules=[
|
|
31
39
|
Extension(name="miniupnpc", sources=["src/miniupnpcmodule.c"],
|
|
32
40
|
libraries=["ws2_32", "iphlpapi"] + compat_lib,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* $Id: miniupnpc.c,v 1.
|
|
1
|
+
/* $Id: miniupnpc.c,v 1.165 2025/01/10 22:57:21 nanard Exp $ */
|
|
2
2
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
|
3
3
|
* Project : miniupnp
|
|
4
4
|
* Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
|
5
5
|
* Author : Thomas BERNARD
|
|
6
|
-
* copyright (c) 2005-
|
|
6
|
+
* copyright (c) 2005-2025 Thomas Bernard
|
|
7
7
|
* This software is subjet to the conditions detailed in the
|
|
8
8
|
* provided LICENSE file. */
|
|
9
9
|
#include <stdlib.h>
|
|
@@ -98,7 +98,7 @@ MINIUPNP_LIBSPEC void parserootdesc(const char * buffer, int bufsize, struct IGD
|
|
|
98
98
|
* pointer - OK
|
|
99
99
|
* NULL - error */
|
|
100
100
|
char *
|
|
101
|
-
simpleUPnPcommand(
|
|
101
|
+
simpleUPnPcommand(const char * url, const char * service,
|
|
102
102
|
const char * action, struct UPNParg * args,
|
|
103
103
|
int * bufsize)
|
|
104
104
|
{
|
|
@@ -111,6 +111,7 @@ simpleUPnPcommand(int s, const char * url, const char * service,
|
|
|
111
111
|
char * buf;
|
|
112
112
|
int n;
|
|
113
113
|
int status_code;
|
|
114
|
+
SOCKET s;
|
|
114
115
|
|
|
115
116
|
*bufsize = 0;
|
|
116
117
|
snprintf(soapact, sizeof(soapact), "%s#%s", service, action);
|
|
@@ -197,12 +198,10 @@ simpleUPnPcommand(int s, const char * url, const char * service,
|
|
|
197
198
|
return NULL;
|
|
198
199
|
}
|
|
199
200
|
if(!parseURL(url, hostname, &port, &path, NULL)) return NULL;
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return NULL;
|
|
205
|
-
}
|
|
201
|
+
s = connecthostport(hostname, port, 0);
|
|
202
|
+
if(ISINVALID(s)) {
|
|
203
|
+
/* failed to connect */
|
|
204
|
+
return NULL;
|
|
206
205
|
}
|
|
207
206
|
|
|
208
207
|
n = soapPostSubmit(s, path, hostname, port, soapact, soapbody, "1.1");
|
|
@@ -505,13 +504,14 @@ UPNPIGD_IsConnected(struct UPNPUrls * urls, struct IGDdatas * data)
|
|
|
505
504
|
/* UPNP_GetValidIGD() :
|
|
506
505
|
* return values :
|
|
507
506
|
* -1 = Internal error
|
|
508
|
-
* 0 = NO IGD found
|
|
509
|
-
* 1 = A valid connected IGD has been found
|
|
507
|
+
* 0 = NO IGD found (UPNP_NO_IGD)
|
|
508
|
+
* 1 = A valid connected IGD has been found (UPNP_CONNECTED_IGD)
|
|
510
509
|
* 2 = A valid connected IGD has been found but its
|
|
511
|
-
* IP address is reserved (non routable)
|
|
510
|
+
* IP address is reserved (non routable) (UPNP_PRIVATEIP_IGD)
|
|
512
511
|
* 3 = A valid IGD has been found but it reported as
|
|
513
|
-
* not connected
|
|
512
|
+
* not connected (UPNP_DISCONNECTED_IGD)
|
|
514
513
|
* 4 = an UPnP device has been found but was not recognized as an IGD
|
|
514
|
+
* (UPNP_UNKNOWN_DEVICE)
|
|
515
515
|
*
|
|
516
516
|
* In any positive non zero return case, the urls and data structures
|
|
517
517
|
* passed as parameters are set. Don't forget to call FreeUPNPUrls(urls) to
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* $Id: upnpc.c,v 1.
|
|
1
|
+
/* $Id: upnpc.c,v 1.146 2025/01/10 23:02:54 nanard Exp $ */
|
|
2
2
|
/* Project : miniupnp
|
|
3
3
|
* Author : Thomas Bernard
|
|
4
|
-
* Copyright (c) 2005-
|
|
4
|
+
* Copyright (c) 2005-2025 Thomas Bernard
|
|
5
5
|
* This software is subject to the conditions detailed in the
|
|
6
6
|
* LICENCE file provided in this distribution. */
|
|
7
7
|
|
|
@@ -609,7 +609,7 @@ int main(int argc, char ** argv)
|
|
|
609
609
|
int commandargc = 0;
|
|
610
610
|
struct UPNPDev * devlist = 0;
|
|
611
611
|
char lanaddr[64] = "unset"; /* my ip address on the LAN */
|
|
612
|
-
char wanaddr[64] = "
|
|
612
|
+
char wanaddr[64] = "unset"; /* up address of the IGD on the WAN */
|
|
613
613
|
int i;
|
|
614
614
|
const char * rootdescurl = 0;
|
|
615
615
|
const char * multicastif = 0;
|
|
@@ -632,7 +632,7 @@ int main(int argc, char ** argv)
|
|
|
632
632
|
}
|
|
633
633
|
#endif
|
|
634
634
|
printf("upnpc: miniupnpc library test client, version %s.\n", MINIUPNPC_VERSION_STRING);
|
|
635
|
-
printf(" (c) 2005-
|
|
635
|
+
printf(" (c) 2005-2025 Thomas Bernard.\n");
|
|
636
636
|
printf("More information at https://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/\n\n");
|
|
637
637
|
|
|
638
638
|
/* command line processing */
|
|
@@ -736,17 +736,17 @@ int main(int argc, char ** argv)
|
|
|
736
736
|
|| (i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), wanaddr, sizeof(wanaddr))))
|
|
737
737
|
{
|
|
738
738
|
switch(i) {
|
|
739
|
-
case
|
|
739
|
+
case UPNP_CONNECTED_IGD:
|
|
740
740
|
printf("Found valid IGD : %s\n", urls.controlURL);
|
|
741
741
|
break;
|
|
742
|
-
case
|
|
742
|
+
case UPNP_PRIVATEIP_IGD:
|
|
743
743
|
printf("Found an IGD with a reserved IP address (%s) : %s\n", wanaddr, urls.controlURL);
|
|
744
744
|
break;
|
|
745
|
-
case
|
|
745
|
+
case UPNP_DISCONNECTED_IGD:
|
|
746
746
|
printf("Found a (not connected?) IGD : %s\n", urls.controlURL);
|
|
747
747
|
if (ignore) printf("Trying to continue anyway\n");
|
|
748
748
|
break;
|
|
749
|
-
case
|
|
749
|
+
case UPNP_UNKNOWN_DEVICE:
|
|
750
750
|
printf("UPnP device found. Is it an IGD ? : %s\n", urls.controlURL);
|
|
751
751
|
if (ignore) printf("Trying to continue anyway\n");
|
|
752
752
|
break;
|
|
@@ -754,7 +754,7 @@ int main(int argc, char ** argv)
|
|
|
754
754
|
printf("Found device (igd ?) : %s\n", urls.controlURL);
|
|
755
755
|
if (ignore) printf("Trying to continue anyway\n");
|
|
756
756
|
}
|
|
757
|
-
if(i==
|
|
757
|
+
if(i==UPNP_CONNECTED_IGD || i==UPNP_PRIVATEIP_IGD || ignore) {
|
|
758
758
|
|
|
759
759
|
printf("Local LAN ip address : %s\n", lanaddr);
|
|
760
760
|
#if 0
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
|
3
3
|
* Project : miniupnp
|
|
4
4
|
* Author : Thomas Bernard
|
|
5
|
-
* Copyright (c) 2005-
|
|
5
|
+
* Copyright (c) 2005-2025 Thomas Bernard
|
|
6
6
|
* This software is subject to the conditions detailed in the
|
|
7
7
|
* LICENCE file provided in this distribution.
|
|
8
8
|
* */
|
|
@@ -31,7 +31,7 @@ UPNP_GetTotalBytesSent(const char * controlURL,
|
|
|
31
31
|
int bufsize;
|
|
32
32
|
unsigned int r = 0;
|
|
33
33
|
char * p;
|
|
34
|
-
if(!(buffer = simpleUPnPcommand(
|
|
34
|
+
if(!(buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
35
35
|
"GetTotalBytesSent", 0, &bufsize))) {
|
|
36
36
|
return (UNSIGNED_INTEGER)UPNPCOMMAND_HTTP_ERROR;
|
|
37
37
|
}
|
|
@@ -55,7 +55,7 @@ UPNP_GetTotalBytesReceived(const char * controlURL,
|
|
|
55
55
|
int bufsize;
|
|
56
56
|
unsigned int r = 0;
|
|
57
57
|
char * p;
|
|
58
|
-
if(!(buffer = simpleUPnPcommand(
|
|
58
|
+
if(!(buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
59
59
|
"GetTotalBytesReceived", 0, &bufsize))) {
|
|
60
60
|
return (UNSIGNED_INTEGER)UPNPCOMMAND_HTTP_ERROR;
|
|
61
61
|
}
|
|
@@ -79,7 +79,7 @@ UPNP_GetTotalPacketsSent(const char * controlURL,
|
|
|
79
79
|
int bufsize;
|
|
80
80
|
unsigned int r = 0;
|
|
81
81
|
char * p;
|
|
82
|
-
if(!(buffer = simpleUPnPcommand(
|
|
82
|
+
if(!(buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
83
83
|
"GetTotalPacketsSent", 0, &bufsize))) {
|
|
84
84
|
return (UNSIGNED_INTEGER)UPNPCOMMAND_HTTP_ERROR;
|
|
85
85
|
}
|
|
@@ -103,7 +103,7 @@ UPNP_GetTotalPacketsReceived(const char * controlURL,
|
|
|
103
103
|
int bufsize;
|
|
104
104
|
unsigned int r = 0;
|
|
105
105
|
char * p;
|
|
106
|
-
if(!(buffer = simpleUPnPcommand(
|
|
106
|
+
if(!(buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
107
107
|
"GetTotalPacketsReceived", 0, &bufsize))) {
|
|
108
108
|
return (UNSIGNED_INTEGER)UPNPCOMMAND_HTTP_ERROR;
|
|
109
109
|
}
|
|
@@ -136,7 +136,7 @@ UPNP_GetStatusInfo(const char * controlURL,
|
|
|
136
136
|
if(!status && !uptime)
|
|
137
137
|
return UPNPCOMMAND_INVALID_ARGS;
|
|
138
138
|
|
|
139
|
-
if(!(buffer = simpleUPnPcommand(
|
|
139
|
+
if(!(buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
140
140
|
"GetStatusInfo", 0, &bufsize))) {
|
|
141
141
|
return UPNPCOMMAND_HTTP_ERROR;
|
|
142
142
|
}
|
|
@@ -197,7 +197,7 @@ UPNP_GetConnectionTypeInfo(const char * controlURL,
|
|
|
197
197
|
if(!connectionType)
|
|
198
198
|
return UPNPCOMMAND_INVALID_ARGS;
|
|
199
199
|
|
|
200
|
-
if(!(buffer = simpleUPnPcommand(
|
|
200
|
+
if(!(buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
201
201
|
"GetConnectionTypeInfo", 0, &bufsize))) {
|
|
202
202
|
return UPNPCOMMAND_HTTP_ERROR;
|
|
203
203
|
}
|
|
@@ -244,7 +244,7 @@ UPNP_GetLinkLayerMaxBitRates(const char * controlURL,
|
|
|
244
244
|
return UPNPCOMMAND_INVALID_ARGS;
|
|
245
245
|
|
|
246
246
|
/* shouldn't we use GetCommonLinkProperties ? */
|
|
247
|
-
if(!(buffer = simpleUPnPcommand(
|
|
247
|
+
if(!(buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
248
248
|
"GetCommonLinkProperties", 0, &bufsize))) {
|
|
249
249
|
/*"GetLinkLayerMaxBitRates", 0, &bufsize);*/
|
|
250
250
|
return UPNPCOMMAND_HTTP_ERROR;
|
|
@@ -309,7 +309,7 @@ UPNP_GetExternalIPAddress(const char * controlURL,
|
|
|
309
309
|
if(!extIpAdd || !controlURL || !servicetype)
|
|
310
310
|
return UPNPCOMMAND_INVALID_ARGS;
|
|
311
311
|
|
|
312
|
-
if(!(buffer = simpleUPnPcommand(
|
|
312
|
+
if(!(buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
313
313
|
"GetExternalIPAddress", 0, &bufsize))) {
|
|
314
314
|
return UPNPCOMMAND_HTTP_ERROR;
|
|
315
315
|
}
|
|
@@ -374,7 +374,7 @@ UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
|
|
|
374
374
|
AddPortMappingArgs[6].val = desc?desc:"libminiupnpc";
|
|
375
375
|
AddPortMappingArgs[7].elt = "NewLeaseDuration";
|
|
376
376
|
AddPortMappingArgs[7].val = leaseDuration?leaseDuration:"0";
|
|
377
|
-
buffer = simpleUPnPcommand(
|
|
377
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
378
378
|
"AddPortMapping", AddPortMappingArgs,
|
|
379
379
|
&bufsize);
|
|
380
380
|
free(AddPortMappingArgs);
|
|
@@ -438,7 +438,7 @@ UPNP_AddAnyPortMapping(const char * controlURL, const char * servicetype,
|
|
|
438
438
|
AddPortMappingArgs[6].val = desc?desc:"libminiupnpc";
|
|
439
439
|
AddPortMappingArgs[7].elt = "NewLeaseDuration";
|
|
440
440
|
AddPortMappingArgs[7].val = leaseDuration?leaseDuration:"0";
|
|
441
|
-
buffer = simpleUPnPcommand(
|
|
441
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
442
442
|
"AddAnyPortMapping", AddPortMappingArgs,
|
|
443
443
|
&bufsize);
|
|
444
444
|
free(AddPortMappingArgs);
|
|
@@ -492,7 +492,7 @@ UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,
|
|
|
492
492
|
DeletePortMappingArgs[1].val = extPort;
|
|
493
493
|
DeletePortMappingArgs[2].elt = "NewProtocol";
|
|
494
494
|
DeletePortMappingArgs[2].val = proto;
|
|
495
|
-
buffer = simpleUPnPcommand(
|
|
495
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
496
496
|
"DeletePortMapping",
|
|
497
497
|
DeletePortMappingArgs, &bufsize);
|
|
498
498
|
free(DeletePortMappingArgs);
|
|
@@ -515,9 +515,9 @@ UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,
|
|
|
515
515
|
|
|
516
516
|
MINIUPNP_LIBSPEC int
|
|
517
517
|
UPNP_DeletePortMappingRange(const char * controlURL, const char * servicetype,
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
518
|
+
const char * extPortStart, const char * extPortEnd,
|
|
519
|
+
const char * proto,
|
|
520
|
+
const char * manage)
|
|
521
521
|
{
|
|
522
522
|
struct UPNParg * DeletePortMappingArgs;
|
|
523
523
|
char * buffer;
|
|
@@ -541,7 +541,7 @@ UPNP_DeletePortMappingRange(const char * controlURL, const char * servicetype,
|
|
|
541
541
|
DeletePortMappingArgs[3].elt = "NewManage";
|
|
542
542
|
DeletePortMappingArgs[3].val = manage;
|
|
543
543
|
|
|
544
|
-
buffer = simpleUPnPcommand(
|
|
544
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
545
545
|
"DeletePortMappingRange",
|
|
546
546
|
DeletePortMappingArgs, &bufsize);
|
|
547
547
|
free(DeletePortMappingArgs);
|
|
@@ -589,7 +589,7 @@ UPNP_GetGenericPortMappingEntry(const char * controlURL,
|
|
|
589
589
|
return UPNPCOMMAND_MEM_ALLOC_ERROR;
|
|
590
590
|
GetPortMappingArgs[0].elt = "NewPortMappingIndex";
|
|
591
591
|
GetPortMappingArgs[0].val = index;
|
|
592
|
-
buffer = simpleUPnPcommand(
|
|
592
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
593
593
|
"GetGenericPortMappingEntry",
|
|
594
594
|
GetPortMappingArgs, &bufsize);
|
|
595
595
|
free(GetPortMappingArgs);
|
|
@@ -663,12 +663,12 @@ UPNP_GetPortMappingNumberOfEntries(const char * controlURL,
|
|
|
663
663
|
const char * servicetype,
|
|
664
664
|
unsigned int * numEntries)
|
|
665
665
|
{
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
666
|
+
struct NameValueParserData pdata;
|
|
667
|
+
char * buffer;
|
|
668
|
+
int bufsize;
|
|
669
|
+
char* p;
|
|
670
670
|
int ret = UPNPCOMMAND_UNKNOWN_ERROR;
|
|
671
|
-
|
|
671
|
+
if(!(buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
672
672
|
"GetPortMappingNumberOfEntries", 0,
|
|
673
673
|
&bufsize))) {
|
|
674
674
|
return UPNPCOMMAND_HTTP_ERROR;
|
|
@@ -676,15 +676,15 @@ UPNP_GetPortMappingNumberOfEntries(const char * controlURL,
|
|
|
676
676
|
#ifdef DEBUG
|
|
677
677
|
DisplayNameValueList(buffer, bufsize);
|
|
678
678
|
#endif
|
|
679
|
-
|
|
679
|
+
ParseNameValue(buffer, bufsize, &pdata);
|
|
680
680
|
free(buffer);
|
|
681
681
|
|
|
682
|
-
|
|
683
|
-
|
|
682
|
+
p = GetValueFromNameValueList(&pdata, "NewPortMappingNumberOfEntries");
|
|
683
|
+
if(numEntries && p) {
|
|
684
684
|
*numEntries = 0;
|
|
685
|
-
|
|
685
|
+
sscanf(p, "%u", numEntries);
|
|
686
686
|
ret = UPNPCOMMAND_SUCCESS;
|
|
687
|
-
|
|
687
|
+
}
|
|
688
688
|
|
|
689
689
|
p = GetValueFromNameValueList(&pdata, "errorCode");
|
|
690
690
|
if(p) {
|
|
@@ -692,7 +692,7 @@ UPNP_GetPortMappingNumberOfEntries(const char * controlURL,
|
|
|
692
692
|
sscanf(p, "%d", &ret);
|
|
693
693
|
}
|
|
694
694
|
|
|
695
|
-
|
|
695
|
+
ClearNameValueList(&pdata);
|
|
696
696
|
return ret;
|
|
697
697
|
}
|
|
698
698
|
|
|
@@ -730,7 +730,7 @@ UPNP_GetSpecificPortMappingEntry(const char * controlURL,
|
|
|
730
730
|
GetPortMappingArgs[1].val = extPort;
|
|
731
731
|
GetPortMappingArgs[2].elt = "NewProtocol";
|
|
732
732
|
GetPortMappingArgs[2].val = proto;
|
|
733
|
-
buffer = simpleUPnPcommand(
|
|
733
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
734
734
|
"GetSpecificPortMappingEntry",
|
|
735
735
|
GetPortMappingArgs, &bufsize);
|
|
736
736
|
free(GetPortMappingArgs);
|
|
@@ -826,7 +826,7 @@ UPNP_GetListOfPortMappings(const char * controlURL,
|
|
|
826
826
|
GetListOfPortMappingsArgs[4].elt = "NewNumberOfPorts";
|
|
827
827
|
GetListOfPortMappingsArgs[4].val = numberOfPorts?numberOfPorts:"1000";
|
|
828
828
|
|
|
829
|
-
buffer = simpleUPnPcommand(
|
|
829
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
830
830
|
"GetListOfPortMappings",
|
|
831
831
|
GetListOfPortMappingsArgs, &bufsize);
|
|
832
832
|
free(GetListOfPortMappingsArgs);
|
|
@@ -892,7 +892,7 @@ UPNP_GetFirewallStatus(const char * controlURL,
|
|
|
892
892
|
if(!firewallEnabled || !inboundPinholeAllowed)
|
|
893
893
|
return UPNPCOMMAND_INVALID_ARGS;
|
|
894
894
|
|
|
895
|
-
buffer = simpleUPnPcommand(
|
|
895
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
896
896
|
"GetFirewallStatus", 0, &bufsize);
|
|
897
897
|
if(!buffer) {
|
|
898
898
|
return UPNPCOMMAND_HTTP_ERROR;
|
|
@@ -953,7 +953,7 @@ UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype
|
|
|
953
953
|
GetOutboundPinholeTimeoutArgs[3].val = intPort;
|
|
954
954
|
GetOutboundPinholeTimeoutArgs[4].elt = "InternalClient";
|
|
955
955
|
GetOutboundPinholeTimeoutArgs[4].val = intClient;
|
|
956
|
-
buffer = simpleUPnPcommand(
|
|
956
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
957
957
|
"GetOutboundPinholeTimeout", GetOutboundPinholeTimeoutArgs, &bufsize);
|
|
958
958
|
free(GetOutboundPinholeTimeoutArgs);
|
|
959
959
|
if(!buffer)
|
|
@@ -1030,7 +1030,7 @@ UPNP_AddPinhole(const char * controlURL, const char * servicetype,
|
|
|
1030
1030
|
}
|
|
1031
1031
|
AddPinholeArgs[5].elt = "LeaseTime";
|
|
1032
1032
|
AddPinholeArgs[5].val = leaseTime;
|
|
1033
|
-
buffer = simpleUPnPcommand(
|
|
1033
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
1034
1034
|
"AddPinhole", AddPinholeArgs, &bufsize);
|
|
1035
1035
|
free(AddPinholeArgs);
|
|
1036
1036
|
if(!buffer)
|
|
@@ -1080,7 +1080,7 @@ UPNP_UpdatePinhole(const char * controlURL, const char * servicetype,
|
|
|
1080
1080
|
UpdatePinholeArgs[0].val = uniqueID;
|
|
1081
1081
|
UpdatePinholeArgs[1].elt = "NewLeaseTime";
|
|
1082
1082
|
UpdatePinholeArgs[1].val = leaseTime;
|
|
1083
|
-
buffer = simpleUPnPcommand(
|
|
1083
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
1084
1084
|
"UpdatePinhole", UpdatePinholeArgs, &bufsize);
|
|
1085
1085
|
free(UpdatePinholeArgs);
|
|
1086
1086
|
if(!buffer)
|
|
@@ -1121,7 +1121,7 @@ UPNP_DeletePinhole(const char * controlURL, const char * servicetype, const char
|
|
|
1121
1121
|
return UPNPCOMMAND_MEM_ALLOC_ERROR;
|
|
1122
1122
|
DeletePinholeArgs[0].elt = "UniqueID";
|
|
1123
1123
|
DeletePinholeArgs[0].val = uniqueID;
|
|
1124
|
-
buffer = simpleUPnPcommand(
|
|
1124
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
1125
1125
|
"DeletePinhole", DeletePinholeArgs, &bufsize);
|
|
1126
1126
|
free(DeletePinholeArgs);
|
|
1127
1127
|
if(!buffer)
|
|
@@ -1162,7 +1162,7 @@ UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype,
|
|
|
1162
1162
|
return UPNPCOMMAND_MEM_ALLOC_ERROR;
|
|
1163
1163
|
CheckPinholeWorkingArgs[0].elt = "UniqueID";
|
|
1164
1164
|
CheckPinholeWorkingArgs[0].val = uniqueID;
|
|
1165
|
-
buffer = simpleUPnPcommand(
|
|
1165
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
1166
1166
|
"CheckPinholeWorking", CheckPinholeWorkingArgs, &bufsize);
|
|
1167
1167
|
free(CheckPinholeWorkingArgs);
|
|
1168
1168
|
if(!buffer)
|
|
@@ -1211,7 +1211,7 @@ UPNP_GetPinholePackets(const char * controlURL, const char * servicetype,
|
|
|
1211
1211
|
return UPNPCOMMAND_MEM_ALLOC_ERROR;
|
|
1212
1212
|
GetPinholePacketsArgs[0].elt = "UniqueID";
|
|
1213
1213
|
GetPinholePacketsArgs[0].val = uniqueID;
|
|
1214
|
-
buffer = simpleUPnPcommand(
|
|
1214
|
+
buffer = simpleUPnPcommand(controlURL, servicetype,
|
|
1215
1215
|
"GetPinholePackets", GetPinholePacketsArgs, &bufsize);
|
|
1216
1216
|
free(GetPinholePacketsArgs);
|
|
1217
1217
|
if(!buffer)
|
miniupnpc-2.2.8/PKG-INFO
DELETED
miniupnpc-2.2.8/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.2.8
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|