Retrieving network mask in Python
<p>How would one go about retrieving a network device's netmask (In Linux preferably, but if it's cross-platform then cool)? I know how in C on Linux but I can't find a way in Python -- minus ctypes perhaps. That or parsing ifconfig. Any other way?</p>

<pre><code>ioctl(socknr, SIOCGIFNETMASK, &amp;ifreq) // C version
</code></pre>
