miniupnp / libnatpmp Goto Github PK
View Code? Open in Web Editor NEWThis project forked from getlantern/libnatpmp
Libnatpmp with Java support
License: BSD 3-Clause "New" or "Revised" License
This project forked from getlantern/libnatpmp
Libnatpmp with Java support
License: BSD 3-Clause "New" or "Revised" License
This repository of libnatpmp was initialized from libnatpmp-20120821. Then I (Leah X. Schmidt) added automatically Java bindings. The java bindings use JNI directly, but they use JNAerator's extractor to allow the native libraries to be used in a simple fashion. So you'll need jnaerator to use them. Running make jnitest should download JNAerator and run a very simple test. libnatpmp (c) 2007-2009 Thomas Bernard contact : [email protected] see http://miniupnp.free.fr/libnatpmp.html or http://miniupnp.tuxfamily.org/libnatpmp.html for some documentation and code samples.
Hi,
To discover libraries, various systems uses pkg-config
. For now, libnatpmp is not discoverable with this method.
pkg-config --libs natpmp
Package natpmp was not found in the pkg-config search path.
Perhaps you should add the directory containing `natpmp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'natpmp' found
auto res = getnatpmprequesttimeout(&handle, &timeout);
int millis = (timeout.tv_sec * 1000) + (timeout.tv_usec / 1000);
log.d("@@@@ readResponse: timeout: %d %d %d %d\n", millis, res, timeout.tv_sec, timeout.tv_usec);
Result:
@@@@ readResponse: timeout: 199 0 0 199597
@@@@ readResponse: timeout: -300 0 -1 700301
Version used: 20230423
The latest available tarball for libnatpmp on http://miniupnp.free.fr/files/ is this file: http://miniupnp.free.fr/files/download.php?file=libnatpmp-20150609.tar.gz. It would be great to get a new official tag / release as:
The current tarball is now > 7 years old, and the source is missing bug fixes, as well as new features, like the recently merged support for pkg-config.
The current tarball is somewhat misleading / confusing. It's dated 09/06/2015, however it actually contains the source code for an earlier commit, f376ab7 (11/4/2014). It's not really clear why this commit was used, when at the time the tarball was created (I assume 09/06/2015), the latest commit was this one: cf7f452 (04/03/2015).
Distros / packagers will look for official releases / sources, meaning that basically all are pointing to the 20150609 source, i.e https://repology.org/project/libnatpmp/versions, while carrying additional patches.
When searching for a PCP library most users get to the libpcp which is kind of a reference implementation. The library has IPv6 support. But it's not published in Linux distros and as far I understood is not widelly used. But it still receives some PRs. Having two libraries that do the same thing confuses users.
Is it possible to merge the PCP code from the libpcp into the libnatpmp?
I asked their authors libpcp/pcp#22 but maybe libnatpmp can do that.
Maybe if you are ok but don't have a time to do this then please mark the issue as "help wanted".
I have a webserver on a port 8000 and need to expose it with natpmpc on WAN on any random port. So then I'll simply generate a link to it and share.
But currently I have to specify explicitly the external port:
natpmpc -a 8000 8000 tcp
The problem here is that I don't know if this external 8000 port is not already taken or allowed by the miniupnpd. So that's why I can't rely on this.
Basically the local port 9000 may be also busy and it would be also useful if the natpmpc can also take some random and free port (maybe ephemeral).
Maybe it can be something like:
natpmpc -a rand rand tcp
Is it possible to implement something like this? Or the PCP spec requires to specify the requested port?
Ideally the natpmpc should print the port numbers to stdout in form
loc_port ext_ip ext_port
Then it would be easy to parse with a script.
Any other logging messages of the natpmpc may be printed to stderr so that a script needs to parse only clear stdout.
Hello,
As mentioned in the title, 'make install' installs a lone natpmp.h header that refers to a missing natpmp_declspec.h. That's been known to Gentoo since 2014 but apparently not reported (see: https://bugs.gentoo.org/506832).
The workaround is to specify the HEADERS=natpmp.h natpmp_declspec.h
make flag.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.