chg: [pibs] added usecs and close the dumper

master
Gerard Wagener 2019-03-18 15:23:14 +01:00
parent b74ade61dd
commit 0c9a205dc6
1 changed files with 4 additions and 1 deletions

View File

@ -306,7 +306,7 @@ void process_frame(pibs_t* pibs, wtap *wth,
if (pibs->should_writepcap) { if (pibs->should_writepcap) {
pchdr.ts.tv_sec = wth->rec.ts.secs; pchdr.ts.tv_sec = wth->rec.ts.secs;
//TODO other part of the timestamp //TODO other part of the timestamp
pchdr.ts.tv_usec = 0; pchdr.ts.tv_usec = wth->rec.ts.nsecs / 1000;
pchdr.caplen = wth->rec.rec_header.packet_header.caplen; pchdr.caplen = wth->rec.rec_header.packet_header.caplen;
pchdr.len = wth->rec.rec_header.packet_header.len; pchdr.len = wth->rec.rec_header.packet_header.len;
pcap_dump((u_char*)pibs->dumper, &pchdr, eth); pcap_dump((u_char*)pibs->dumper, &pchdr, eth);
@ -554,5 +554,8 @@ int main(int argc, char* argv[])
if (pibs->show_stats){ if (pibs->show_stats){
pibs_dump_stats(pibs); pibs_dump_stats(pibs);
} }
if (pibs->should_writepcap) {
pcap_dump_close(pibs->dumper);
}
return EXIT_FAILURE; return EXIT_FAILURE;
} }