Assign a pcap_t* File Descriptor to a Chunk of Memory?
问题 I’ve written a C program which write a valid PCAP file into a malloc’ed chunk of memory: u_char* myPCAP = writePCAP( ... ); The program works wonderfully, and if I write myPCAP to a file, I can read that file in Wireshark and everything. So I know that everything is working. But now, I want to assign myPCAP a pcap_t* file descriptor and pass that FD to another program. (nDPI, for those who are curious.) How could I do this? I was hoping this would work: pcap_t* pcap = fdopen( ((int*)myPCAP),