<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: A NAT-PMP client library for Python</title>
	<atom:link href="http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/</link>
	<description>source control for my (useless) knowledge</description>
	<lastBuildDate>Fri, 06 Jan 2012 16:44:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: yiming</title>
		<link>http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/comment-page-1/#comment-12896</link>
		<dc:creator>yiming</dc:creator>
		<pubDate>Mon, 18 Jul 2011 14:53:49 +0000</pubDate>
		<guid isPermaLink="false">https://blog.yimingliu.com/2008/01/07/a-nat-pmp-client-library-for-python/#comment-12896</guid>
		<description>No, because if you read the draft standard, you&#039;ll notice that there is no &quot;list all&quot; operation in the NAT-PMP protocol.  The two basic ops are &quot;determine external address&quot; and &quot;map port&quot;.

In fact, the standard implies that if you want to determine whether a port is already mapped, you must send another map request.  For example, you previously mapped private port 60000 to public port 50000, but lost state.  Now you want to know what public port the server assigned previously for private port 60000.  In this case, if you send a request to map private port 60000 to arbitrary port N, then you will receive a response containing the current public port mapping for that port, namely, 50000.  If it wasn&#039;t mapped, you&#039;d receive the actual mapping you requested, namely N.  After that, you can destroy the mapping by sending a request with lifetime 0 and external port 0.

If you want to know what the server&#039;s *public* port 50000 is mapped to, then it doesn&#039;t look like there is an operation for that query in the protocol.  If you find a way in the RFC, I&#039;m happy to add a method or take a patch.</description>
		<content:encoded><![CDATA[<p>No, because if you read the draft standard, you&#8217;ll notice that there is no &#8220;list all&#8221; operation in the NAT-PMP protocol.  The two basic ops are &#8220;determine external address&#8221; and &#8220;map port&#8221;.</p>
<p>In fact, the standard implies that if you want to determine whether a port is already mapped, you must send another map request.  For example, you previously mapped private port 60000 to public port 50000, but lost state.  Now you want to know what public port the server assigned previously for private port 60000.  In this case, if you send a request to map private port 60000 to arbitrary port N, then you will receive a response containing the current public port mapping for that port, namely, 50000.  If it wasn&#8217;t mapped, you&#8217;d receive the actual mapping you requested, namely N.  After that, you can destroy the mapping by sending a request with lifetime 0 and external port 0.</p>
<p>If you want to know what the server&#8217;s *public* port 50000 is mapped to, then it doesn&#8217;t look like there is an operation for that query in the protocol.  If you find a way in the RFC, I&#8217;m happy to add a method or take a patch.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/comment-page-1/#comment-12894</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 18 Jul 2011 14:10:53 +0000</pubDate>
		<guid isPermaLink="false">https://blog.yimingliu.com/2008/01/07/a-nat-pmp-client-library-for-python/#comment-12894</guid>
		<description>Does this module return the list of all NAT-PMP ports added. For e.g.

If i have a application which will add NAT-PMP port automatically, i want to check whether this port is added or not? How i can do this?</description>
		<content:encoded><![CDATA[<p>Does this module return the list of all NAT-PMP ports added. For e.g.</p>
<p>If i have a application which will add NAT-PMP port automatically, i want to check whether this port is added or not? How i can do this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/comment-page-1/#comment-8682</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Wed, 02 Feb 2011 03:02:23 +0000</pubDate>
		<guid isPermaLink="false">https://blog.yimingliu.com/2008/01/07/a-nat-pmp-client-library-for-python/#comment-8682</guid>
		<description>Thanks for releasing this. It came in handy just now.</description>
		<content:encoded><![CDATA[<p>Thanks for releasing this. It came in handy just now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dobes</title>
		<link>http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/comment-page-1/#comment-6117</link>
		<dc:creator>Dobes</dc:creator>
		<pubDate>Wed, 27 Oct 2010 18:53:31 +0000</pubDate>
		<guid isPermaLink="false">https://blog.yimingliu.com/2008/01/07/a-nat-pmp-client-library-for-python/#comment-6117</guid>
		<description>There seems to be a bug in the client.

If it fails to automatically get_gateway_addr() it throws an exception, even if you specify the gateway on the command line.

It should not call get_gateway_addr() if -g is passed on the command line.</description>
		<content:encoded><![CDATA[<p>There seems to be a bug in the client.</p>
<p>If it fails to automatically get_gateway_addr() it throws an exception, even if you specify the gateway on the command line.</p>
<p>It should not call get_gateway_addr() if -g is passed on the command line.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NatMap 0.0 &#171; Stranger At Large</title>
		<link>http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/comment-page-1/#comment-619</link>
		<dc:creator>NatMap 0.0 &#171; Stranger At Large</dc:creator>
		<pubDate>Thu, 21 May 2009 13:42:25 +0000</pubDate>
		<guid isPermaLink="false">https://blog.yimingliu.com/2008/01/07/a-nat-pmp-client-library-for-python/#comment-619</guid>
		<description>[...] But it requires a rather large SOAP library.  For NAT-PMP there&#8217;s a few hacks (notably this) around, but nothing really [...]</description>
		<content:encoded><![CDATA[<p>[...] But it requires a rather large SOAP library.  For NAT-PMP there&#8217;s a few hacks (notably this) around, but nothing really [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yiming</title>
		<link>http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/comment-page-1/#comment-16</link>
		<dc:creator>yiming</dc:creator>
		<pubDate>Tue, 05 Feb 2008 11:45:00 +0000</pubDate>
		<guid isPermaLink="false">https://blog.yimingliu.com/2008/01/07/a-nat-pmp-client-library-for-python/#comment-16</guid>
		<description>Hi roee shlomo,&lt;br/&gt;&lt;br/&gt;Thanks for the regex.  I&#039;ve integrated it.</description>
		<content:encoded><![CDATA[<p>Hi roee shlomo,</p>
<p>Thanks for the regex.  I&#8217;ve integrated it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roee Shlomo</title>
		<link>http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/comment-page-1/#comment-15</link>
		<dc:creator>Roee Shlomo</dc:creator>
		<pubDate>Tue, 05 Feb 2008 11:12:00 +0000</pubDate>
		<guid isPermaLink="false">https://blog.yimingliu.com/2008/01/07/a-nat-pmp-client-library-for-python/#comment-15</guid>
		<description>Hi,&lt;br/&gt;&lt;br/&gt;I noticed the get_gateway_addr for nt systems is still TODO.&lt;br/&gt;I think the following pattern would work, the rest of the code should be exactly the same as the posix code. it works fine here.&lt;br/&gt;&lt;br/&gt;&gt;pattern = re.compile(&quot;.*?Default Gateway:[ ]+(.*?)\n&quot;)</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I noticed the get_gateway_addr for nt systems is still TODO.<br />I think the following pattern would work, the rest of the code should be exactly the same as the posix code. it works fine here.</p>
<p>>pattern = re.compile(&#8220;.*?Default Gateway:[ ]+(.*?)\n&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yiming</title>
		<link>http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/comment-page-1/#comment-14</link>
		<dc:creator>yiming</dc:creator>
		<pubDate>Tue, 05 Feb 2008 01:10:00 +0000</pubDate>
		<guid isPermaLink="false">https://blog.yimingliu.com/2008/01/07/a-nat-pmp-client-library-for-python/#comment-14</guid>
		<description>Hi anon,&lt;br/&gt;&lt;br/&gt;Thanks for the suggest/bug report.  The mutex was left over from when I tried to do a simple thread-safe queue for requests, as per the spec.   I decided to leave it for 0.0.2, and forgot to remove the half-baked attempt.&lt;br/&gt;&lt;br/&gt;I&#039;ve removed it for now until the exception raising and handling code gets cleaned up a bit.</description>
		<content:encoded><![CDATA[<p>Hi anon,</p>
<p>Thanks for the suggest/bug report.  The mutex was left over from when I tried to do a simple thread-safe queue for requests, as per the spec.   I decided to leave it for 0.0.2, and forgot to remove the half-baked attempt.</p>
<p>I&#8217;ve removed it for now until the exception raising and handling code gets cleaned up a bit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/comment-page-1/#comment-13</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 04 Feb 2008 21:45:00 +0000</pubDate>
		<guid isPermaLink="false">https://blog.yimingliu.com/2008/01/07/a-nat-pmp-client-library-for-python/#comment-13</guid>
		<description>One suggestion:&lt;br/&gt;put the send_request_with_retry calls inside a try-finally block.&lt;br/&gt;    &gt;try:&lt;br/&gt;    &gt; addr_response = send_request_with_retry(...)&lt;br/&gt;    &gt;finally:&lt;br/&gt;    &gt; request_mutex.unlock()</description>
		<content:encoded><![CDATA[<p>One suggestion:<br />put the send_request_with_retry calls inside a try-finally block.<br />    >try:<br />    > addr_response = send_request_with_retry(&#8230;)<br />    >finally:<br />    > request_mutex.unlock()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.yimingliu.com/2008/01/07/nat-pmp-client-library-for-python/comment-page-1/#comment-12</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 04 Feb 2008 18:54:00 +0000</pubDate>
		<guid isPermaLink="false">https://blog.yimingliu.com/2008/01/07/a-nat-pmp-client-library-for-python/#comment-12</guid>
		<description>Many thanks!&lt;br/&gt;&lt;br/&gt;I really needed this one :)&lt;br/&gt;I&#039;m sure it would be useful for many python applications.&lt;br/&gt;Thanks again.</description>
		<content:encoded><![CDATA[<p>Many thanks!</p>
<p>I really needed this one <img src='http://blog.yimingliu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />I&#8217;m sure it would be useful for many python applications.<br />Thanks again.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

