You *could* try
1. using the `openDead ` method of `PcapHandle` to create a fake handle for link-layer type `DLT_RAW`;
2. using that to create the `PcapDumper`;
3. for each chunk of data you read from the TCP socket, putting a fake IP header (with the right contents) and a fake TCP header in front of the chunk of data, and writing that to the file.
↧