creating RAW sockets

Nobody nobody at nowhere.com
Thu Mar 17 21:20:08 EDT 2011


On Wed, 16 Mar 2011 23:50:03 -0700, moijes12 wrote:

> Now,please can someone guide(as in what should I read and NOT as in
> give me the code) me in decoding the IP header of packets using python
> 3.0.1.

The "struct" module is the usual approach for decoding binary data
structures. Fields which aren't whole bytes/words will need to
be extracted manually using >> and &.

In case you don't already have it, the layout of an IPv4 header can be
found at:

	http://en.wikipedia.org/wiki/IPv4#Header

Remember that TCP/IP uses big-endian format.




More information about the Python-list mailing list