{ "info": { "author": "Jason R. Coombs", "author_email": "jaraco@jaraco.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": ".. image:: https://img.shields.io/pypi/v/NAT-PMP.svg\n :target: https://pypi.org/project/NAT-PMP\n\n.. image:: https://img.shields.io/pypi/pyversions/NAT-PMP.svg\n\n.. image:: https://img.shields.io/travis/jaraco/NAT-PMP/master.svg\n :target: https://travis-ci.org/jaraco/NAT-PMP\n\n.. .. image:: https://img.shields.io/appveyor/ci/jaraco/NAT-PMP/master.svg\n.. :target: https://ci.appveyor.com/project/jaraco/NAT-PMP/branch/master\n\n.. .. image:: https://readthedocs.org/projects/NAT-PMP/badge/?version=latest\n.. :target: https://NAT-PMP.readthedocs.io/en/latest/?badge=latest\n\nProvides functions to interact with NAT-PMP gateways implementing version 0\nof the NAT-PMP draft specification.\n\nForked from `py-natpmp `_ by\nYiming Liu.\n\n** Introduction\npy-natpmp is a NAT-PMP (Network Address Translation Port Mapping Protocol) library and testing client in Python. The client allows you to set up dynamic port mappings on NAT-PMP compatible routers. Thus this is a means for dynamic NAT traversal with routers that talk NAT-PMP. In practical terms, this is basically limited to the newer Apple AirPort base stations and the AirPort Express, which have support for this protocol.\n\nIn any case, this library puts a thin layer of Python abstraction over the NAT-PMP protocol, version 0, as specified by the NAT-PMP draft standard.\n\n** Library\nThe library provides a set of high-level and low-level functions to interact via the NAT-PMP protocol. The functions map_port and get_public_address provide the two high-level functions offered by NAT-PMP. Responses are stored as Python objects.\n\n** Client\nTo use the client, grab it and the above library. Make sure you have the library in the same directory as the client script or otherwise on your Python instance\u2019s sys.path. Invoke the client on the command-line (Terminal.app) as python natpmp-client.py [-u] [-l lifetime] [-g gateway_addr] public_port private_port.\n\nFor example:\n\npython natpmp-client.py -u -l 1800 60009 60009\nCreate a mapping for the public UDP port 60009 to the private UDP port 60009 for 1,800 seconds (30 minutes)\npython natpmp-client.py 60010 60010\nCreate a mapping for the public TCP port 60010 to the private TCP port 60010\npython natpmp-client.py -g 10.0.1.1 60011 60022\nExplicitly instruct the gateway router 10.0.1.1 to create the TCP mapping from 60010 to 60022\n\nRemember to turn off your firewall for those ports that you map.\n\n** Caveats\nThis is an incomplete implementation of the specification. When the router reboots, all dynamic mappings are lost. The specification provides for notification packets to be sent by the router to each client when this happens. There is no support in this library and client to monitor for such notifications, nor does it implement a daemon process to do so. The specification recommends queuing requests \u2013 that is, all NAT-PMP interactions should happen serially. This simple library does not queue requests \u2013 if you abuse it with multithreading, it will send those requests in parallel and possibly overwhelm the router.\n\nThe library will attempt to auto-detect your NAT gateway. This is done via a popen to netstat on BSDs/Darwin and ip on Linux. This is likely to fail miserably, depending on how standard the output is. In the library, a keyword argument is provided to override the default and specify your own gateway address. In the client, use the -g switch to manually specify your gateway.\n\n** License & Disclaimer\nIn short, this little package is licensed under the new BSD license. I keep copyright on the code, but let you use it to do whatever you want, including putting it into your own software. Do not hold me responsible if things blow up -- you're the one downloading random code from the Internet.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jaraco/NAT-PMP", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "NAT-PMP", "package_url": "https://pypi.org/project/NAT-PMP/", "platform": "", "project_url": "https://pypi.org/project/NAT-PMP/", "project_urls": { "Homepage": "https://github.com/jaraco/NAT-PMP" }, "release_url": "https://pypi.org/project/NAT-PMP/1.1/", "requires_dist": [ "netifaces", "sphinx; extra == 'docs'", "jaraco.packaging (>=3.2); extra == 'docs'", "rst.linker (>=1.9); extra == 'docs'", "pytest (>=3.5); extra == 'testing'", "pytest-sugar (>=0.9.1); extra == 'testing'", "collective.checkdocs; extra == 'testing'", "pytest-flake8; extra == 'testing'" ], "requires_python": ">=2.7", "summary": "Python classes for interacting with NAT-PMP v0", "version": "1.1" }, "last_serial": 3893420, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "5eefd66affb2bdcd59d9d39beb84e119", "sha256": "cec49536559b2282d5a60d04533ccad3c67b5a010fd892db8e134aa25076bce9" }, "downloads": -1, "filename": "NAT-PMP-1.0.tar.gz", "has_sig": false, "md5_digest": "5eefd66affb2bdcd59d9d39beb84e119", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9205, "upload_time": "2015-07-12T15:25:37", "url": "https://files.pythonhosted.org/packages/71/d2/f7094233c6e0ebacf950e970f19a4a9b2315b617a00b18407d78f655cb7c/NAT-PMP-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "894bddfe8e6d4ee24466acd2de1fcbbd", "sha256": "92434376316a5036f16e3fd1bf99acee9632c8a2bc85d4652c29db249b13f900" }, "downloads": -1, "filename": "NAT-PMP-1.0.1.tar.gz", "has_sig": false, "md5_digest": "894bddfe8e6d4ee24466acd2de1fcbbd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9178, "upload_time": "2015-07-12T16:08:59", "url": "https://files.pythonhosted.org/packages/6f/44/4300fd78794a3f36c75598bc7d431271e24a41ef7ee8999b1a35961934d1/NAT-PMP-1.0.1.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "323b9d539160f04addacdce4bcb6d6cb", "sha256": "90b5d97d8e8d3d0cccf855b9fcfd19fe5896df27e24210bb9d493f6d7ee11dc0" }, "downloads": -1, "filename": "NAT_PMP-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "323b9d539160f04addacdce4bcb6d6cb", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7", "size": 8539, "upload_time": "2018-05-24T02:11:09", "url": "https://files.pythonhosted.org/packages/0e/2b/0a78123bcc580418b0cf03136fc5fe92ed7919b97f0116d2cf0fee6b3e1a/NAT_PMP-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8950d29ff0463a6e19b9fd7648aa7c7a", "sha256": "9821f270c2029790ff8c649f92d0137b56d4b01fe60ac86c6ca073951ef67088" }, "downloads": -1, "filename": "NAT-PMP-1.1.tar.gz", "has_sig": false, "md5_digest": "8950d29ff0463a6e19b9fd7648aa7c7a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 12654, "upload_time": "2018-05-24T02:11:10", "url": "https://files.pythonhosted.org/packages/3f/c4/3ccff6b8e19e3d68a3c83449dd66bdc5555b029f195bd1ad31d3b7e4c540/NAT-PMP-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "323b9d539160f04addacdce4bcb6d6cb", "sha256": "90b5d97d8e8d3d0cccf855b9fcfd19fe5896df27e24210bb9d493f6d7ee11dc0" }, "downloads": -1, "filename": "NAT_PMP-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "323b9d539160f04addacdce4bcb6d6cb", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7", "size": 8539, "upload_time": "2018-05-24T02:11:09", "url": "https://files.pythonhosted.org/packages/0e/2b/0a78123bcc580418b0cf03136fc5fe92ed7919b97f0116d2cf0fee6b3e1a/NAT_PMP-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8950d29ff0463a6e19b9fd7648aa7c7a", "sha256": "9821f270c2029790ff8c649f92d0137b56d4b01fe60ac86c6ca073951ef67088" }, "downloads": -1, "filename": "NAT-PMP-1.1.tar.gz", "has_sig": false, "md5_digest": "8950d29ff0463a6e19b9fd7648aa7c7a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 12654, "upload_time": "2018-05-24T02:11:10", "url": "https://files.pythonhosted.org/packages/3f/c4/3ccff6b8e19e3d68a3c83449dd66bdc5555b029f195bd1ad31d3b7e4c540/NAT-PMP-1.1.tar.gz" } ] }