在贴源码之前先介绍一个将要用到的很重要的函数--pcap_open(),下面是pcap_open()在remote-ex.h中的声明: pcap_t *pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *errbuf); 第一个参数不用多说,它表示的是设备的名称.在获取适配器链表后,通过返回数据域name即可知道设备的名称. 第二个参数制定…