def dotted_netmask(mask):
 bits = (4294967295 ^ ((1 << (32 - mask)) - 1))
 return socket.inet_ntoa(struct.pack('>I', bits))

def dotted_netmask ( mask ) : bits = ( 4294967295 ^ ( ( 1 << ( 32 - mask ) ) - 1 ) ) return socket . inet_ntoa ( struct . pack ( '>I' , bits ) )
converts mask from /xx format to xxx .