Any one here experience in opening a list of PCAP files in one shot and output the list of PCAP files to one output file? For example I have 1.pcap, 2.pcap and 3.pcap and I would like to do some processing on 1.pcap, 2.pcap and 3.pcap, then combine the outcome to just one output pcap file (output.pcap). Following is my code for now:
static pcap_t *input = NULL;
input = pcap_open_offline(packet_path, errbuf);
if (input == NULL){exit(0);}
pktMatch = pcap_dump_open(input, "-");
/*Do some processing, eg to find an IP*/
compareIP=true;
if (compareIP){
pcap_dump(pktMatch, &pktHeader, pktData);
continue;
}
The code above can work for reading a single input pcap file. Question: If I want to modify this code such that it can open a list of files (1.pcap, 2.pcap, 3.pcap) in a single pcap_open_offline() method, what do I need to change? Any expert would like to advise? Thanks