Hi. I've seen that when PacketWriter is instantiated, its init method makes a call to:
pcap_dump_open(handle_, file_name.c_str());
If a previous pcap exists, this will clear the existing file and start a new pcap, so the data is lost. Maybe an "append" option could be added calling instead to:
pcap_dump_open_append(handle_, file_name.c_str());
According to the documentation: _"pcap_dump_open_append() is like pcap_dumpopen() but, if the file already exists, and is a pcap file with the same byte order as the host opening the file, and has the same time stamp precision, link-layer header type, and snapshot length as p, it will write new packets at the end of the file."
Hi. I've seen that when
PacketWriter
is instantiated, itsinit
method makes a call to:pcap_dump_open(handle_, file_name.c_str());
If a previous pcap exists, this will clear the existing file and start a new pcap, so the data is lost. Maybe an "append" option could be added calling instead to:
pcap_dump_open_append(handle_, file_name.c_str());
According to the documentation: _"pcap_dump_open_append() is like pcap_dumpopen() but, if the file already exists, and is a pcap file with the same byte order as the host opening the file, and has the same time stamp precision, link-layer header type, and snapshot length as p, it will write new packets at the end of the file."