Mine
public text v1 · immutable#include <pcap.h>
main(int argc, char **argv)
{
pcap_t *fp;
char errbuf[PCAP_ERRBUF_SIZE];
int c;
struct bpf_program fcode;
/* Open the capture file */
if ((fp = pcap_open_offline(argv[1], // name of the device
errbuf // error buffer
)) == NULL)
{
fprintf(stderr,"\nUnable to open the file %s.\n", argv[1]);
return -1;
}
pcap_close(fp);
return 0;
}
by typing "gcc -o test.exe test.c -lwpcap"