So, I'm writing an application that will sit on my network (a span port on one of my core switches, actually) and monitor the traffic going across the fabric... specifically, I am looking to generate assoications between applications. Which servers talk to which other servers, etc.
Will be very informative and interesting.
The first step is of course to drop the NIC into promiscuous mode, and read the packets.
I've got the pcap.h file, and the libraries working... I can access the functions within the library, and I can both list and open adapters. However, following the documented examples provided, I'm not getting any packets dumped out.
//open the adapter
cout<<"Unable to open adapter "<<adapter->name<<"\n";
cout<<"Capture process started on adapter "<<adapter->name<<"\n";
//recieve packets, this part does not work.
cout<<"Packet Length: "<<packetHeader->len<<"Received at :"<<packetHeader->ts.tv_sec<<"\n\n";
Basically, my screen just sits blank and empty... I did generate traffic by browsing webpages (though there's a lot of background traffic that it should pick up anyways, ARP if nothing else) while the app was open and running.