(prefixlen, version)
return ((2 << prefixlen - 1) - 1) << (_ipVersionToLen(version) - prefixlen)
Return a mask of n bits as a long integer.

    From 'IP address conversion functions with the builtin socket module' by Alex Martelli
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66517
Return a mask of n bits as a long integer.
Return a mask of n bits as a long integer .
def _prefixlenToNetmask(prefixlen, version):
    """Return a mask of n bits as a long integer.

    From 'IP address conversion functions with the builtin socket module' by Alex Martelli
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66517
    """
    if prefixlen == 0:
        return 0
    elif prefixlen < 0:
        raise ValueError("Prefixlen must be > 0")
    return ((2 << prefixlen - 1) - 1) << (_ipVersionToLen(version) - prefixlen)
def _prefixlenToNetmask ( prefixlen , version ) : if prefixlen == 0 : return 0 elif prefixlen < 0 : raise ValueError ( "Prefixlen must be > 0" ) return ( ( 2 << prefixlen - 1 ) - 1 ) << ( _ipVersionToLen ( version ) - prefixlen )