I need to read a complete (raw) IP frame from a TCP stream socket using Python. Essentially I want an unmodified frame just as if it came off the physical line, including all the header information.
I have been looking into raw sockets in Python but I have ran into some issues. I don't need to form my own packets, I simply need to read and forward them verbatim.
So, how can I read an entire IP frame (incl. header) from an existing TCP socket (in Python)?
Preferably I'd like to use only standard libraries. Also, I am on a Linux host.
Thanks!