def _ip_to_number(ipstr):
 net = ([int(digit) for digit in ipstr.split('.')] + [0, 0, 0])
 net = net[:4]
 return (((((((0L + net[0]) << 8) + net[1]) << 8) + net[2]) << 8) + net[3])

def _ip_to_number ( ipstr ) : net = ( [ int ( digit ) for digit in ipstr . split ( '.' ) ] + [ 0 , 0 , 0 ] ) net = net [ : 4 ] return ( ( ( ( ( ( ( 0 L + net [ 0 ] ) << 8 ) + net [ 1 ] ) << 8 ) + net [ 2 ] ) << 8 ) + net [ 3 ] )
translate a string ip address to a packed number .