How do I receive network layer (OSI Layer 3) packets in Linux? More specifically, IPv4 packets regardless of transport layer protocol (UDP, TCP, ...). Preferably in C without libraries.
Using socket(AF_INET, SOCK_RAW, IPPROTO_RAW)
, I'm only able to send IPv4 packets; not receive.