RJ / libportfwd

Set up port fwds and find external IP: C++/CMake wrapper for miniupnpc and nat-pmp libs

This URL has Read+Write access

RJ (author)
Tue Jul 14 11:00:56 -0700 2009
commit  0e93633e7fddd1146eabd502a96923730ec60b85
tree    1d263558b995817f9855b9436138901c36e2c463
parent  5c21aae81c524841fa63d51db9afaa90cf57cdc9 parent  a2ef9fa697504108e667a945511d4573e899f507
name age message
file CMakeLists.txt Loading commit data...
file README
directory include/
directory src/
directory third-party/
README
libportfwd
----------
A basic, lightweight c++ wrapper around miniupnp and nat-pmp libraries
for setting up port fwds, detecting max up/downstream bandwidth, and 
finding out external IP address.

See: http://miniupnp.free.fr/

Designed to wrap up miniupnpc+natpmp libs into a static lib with a small API
so other projects can easily setup port fwds without shipping extra libs/deps.

Should detect any upnp or nat-pmp router and automatically use the appropriate
library under the hood.

Uses cmake to build needed bits of miniupnpc..

NB/TODO
-------
I don't have a nat-pmp capable device (eg: airport express)
so haven't implemented that bit yet. only supports upnp atm.

Usage
-----
See the demo in main.cpp, but here's the jist:

 Portfwd pf;
 pf.init(2000);   // 2000 = ms to wait for response from router
 pf.add(1234);    // port to fwd to you
 pf.remove(1234); // remove port fwding on exit