Open omarekik opened 3 years ago
As workaround for capturing packets of all interfaces, we need to open adapter devices sequencely in the main program and then for each opened adapter device we can create a thread to read the packets from the device and dump them to a pcap file.
main program { fp= pcap_open_live(adapterName.c_str(), 65535, 0, 500, errorBuffer)}
Thread: while (!stopDumping) { pcap_next_ex( fp, &header, &pkt_data); pcap_dump((u_char*)dumpfile, header, pkt_data); }
pcap_open_live is thread safe in winpcap 4.1.3 but not in win10pcap.