Closed GoogleCodeExporter closed 8 years ago
ip.src and ip.dst are stored as four raw bytes, not as printable strings.
Do the following:
import socket
...
print socket.inet_ntoa( ip.src )
Original comment by brampton
on 26 Jan 2010 at 5:11
You can convert the rawbyte character to int with built-in function ord,
ie:
>>> '.'.join([str(ord(c)) for c in ip.src])
Outputs something like: '10.1.0.233'
Original comment by allisonv...@gmail.com
on 3 Feb 2010 at 1:21
Original comment by dugsong
on 3 Feb 2010 at 2:14
Here is a patch for ip.py that shows the ip in readable form when you use
repr().
This issue has been brought up before.
Original comment by alrho...@gmail.com
on 3 Feb 2010 at 11:27
Attachments:
Original issue reported on code.google.com by
till.sal...@gmail.com
on 26 Jan 2010 at 4:55