I understand that a TCP "packet" contains several headers (Ethernet, IP, TCP, ...). When calling read()
on a SOCK_STREAM
socket, what header information is included? Does the kernel strip off some of the headers before exposing the data the application-space?
Scenario: I want to read TCP packets on a socket in my application. To get a full packet, I need to know the length of the packet. To know that, I need to know how to interpret the data read by the SOCK_STREAM
socket, and to do that I need to know if the data I read includes the TCP header or only the information after the header.