Giter VIP home page Giter VIP logo

libnatpmp's Introduction

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.

libnatpmp's People

Contributors

brett208 avatar bschwind avatar cgutman avatar cicku avatar fanquake avatar gamepad64 avatar hebasto avatar jeraymond avatar khng300 avatar leahxschmidt avatar lgv5 avatar logan007 avatar mikedld avatar miniupnp avatar niamster avatar pali avatar stefantalpalaru avatar stokito avatar wdlkmpx avatar xavierproton avatar yangfl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

libnatpmp's Issues

Add natpmp.pc.in (pkg-config)

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

getnatpmprequesttimeout can return negative timeout on success

        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

release: tag a new release / commit ?

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.

Merge libpcp into the libnatpmp

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".

natpmpc open a random port

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.