'Return netmask as an string. Mostly useful for IPv6.
>>> print IP(\'195.185.0.0/16\').strNetmask()
255.255.0.0
>>> print IP(\'2001:0658:022a:cafe::0/64\').strNetmask()
/64'

def strNetmask(self):

    if (self._ipversion == 4):
        locallen = (32 - self._prefixlen)
        return intToIp((((2 ** self._prefixlen) - 1) << locallen), 4)
    elif (self._ipversion == 6):
        locallen = (128 - self._prefixlen)
        return ('/%d' % self._prefixlen)
    else:
        raise ValueError('only    IPv4    and    IPv6    supported')
