NatMap 0.0

May 21, 2009

These days everyone got a “home router” of sort, and these either support UPnP IGD (Microsoftish) or NAT-PMP (Appleish). I’ve been looking for a good NAT mapping library for Python for a while now, without finding one that fits my needs:

  • Uses Twisted 2.5
  • No big dependencies (No SOAP library, no large-ass UPnP stack)
  • Neat in general

There’s nattraverso which provides UPnP mapping and is based on Twisted. But it requires a rather large SOAP library. For NAT-PMP there’s a few hacks (notably this) around, but nothing really serious.

I there for went a head of hacked up something I called NatMap; a small NAT mapping library. It requires Twisted 2.5 and Python 2.5. That’s it. If someone give me an incentive I might even refactor parts so that it works with Python 2.3 and 2.4 (patches are welcome).

The source can be found at github, where you also can download version 0.0. It has been developed on MacOS X 1.5.6 and only tested there. There is a small example included in the tarball.

Currently it only supportsUPnP, because I only own UPnP devices at this stage. When I get my shit together I’ll pick up a AirPort and implement NAT-PMP.

Comments are more than welcome.

Leave a Reply