I have written a simple program that watches a port (using an AF_INET socket) and prints out the contents of the TCP packet. The thing is i would also like to read the header information aswell (source IP and port and destination IP and port).
Do i need to use a different type of socket (ie not AF_INET)?
Should i be using raw sockets to do this or do i need to work at a lower level, at the moment i am at the application layer so the underlying layers are stripping the data i want.
Can someone please point in the right dircetion?
(writing in C , compiling for Slackware/10 with gcc)