So I am writing a packet sniffer using pcap.h and I thought I'd pose a question here that is confusing me.
I have a very simple C program that captures packets from my network device in an infinite loop. But for some reason, it only picks up on packets when I create a new TCP connection. So when I open a browser and go to a URL, do a wget, or start up my IRC client it picks up on a bunch of packets.
However, if I already have my IRC client running, it won't pick up on the text messages exchanged on the IRC server. Furthermore, it won't pick up on any packets when I ping a website.
Does anyone know why this is? My guess is that the network programs I am using (such as X-Chat for IRC or ping on unix) are removing the packets from the packet queue as they process them, so there is nothing to pick up.
Do you think my hunch is correct?