Re: inet_aton and struct issue

2006-08-30 Thread David Bear
David Bear wrote: > Diez B. Roggisch wrote: > >> David Bear schrieb: >>> I found this simple recipe for converting a dotted quad ip address to a >>> string of a long int. >>> >>> struct.unpack('L',socket.inet_aton(ip))[0] >>> >>> trouble is when I use this, I get >>> >>> struct.error: unpack s

Re: inet_aton and struct issue

2006-08-30 Thread David Bear
Diez B. Roggisch wrote: > David Bear schrieb: >> I found this simple recipe for converting a dotted quad ip address to a >> string of a long int. >> >> struct.unpack('L',socket.inet_aton(ip))[0] >> >> trouble is when I use this, I get >> >> struct.error: unpack str size does not match format >>

Re: inet_aton and struct issue

2006-08-30 Thread Diez B. Roggisch
David Bear schrieb: > I found this simple recipe for converting a dotted quad ip address to a > string of a long int. > > struct.unpack('L',socket.inet_aton(ip))[0] > > trouble is when I use this, I get > > struct.error: unpack str size does not match format > > I thought ip addresses were unsi

inet_aton and struct issue

2006-08-30 Thread David Bear
I found this simple recipe for converting a dotted quad ip address to a string of a long int. struct.unpack('L',socket.inet_aton(ip))[0] trouble is when I use this, I get struct.error: unpack str size does not match format I thought ip addresses were unsigned 32 bit integers. Is there a better