在上一篇博客中简单对libpcap库基本函数及基本工作流程做了些简单说明, 今天我们先了解一下pcap_loop()及pcap_dispatch()函数的功能及作用: (1)pcap_loop()循环进行数据包的抓取: 函数原型如下: typedef void (*pcap_handler)(u_char *user, const struct pcap_pkthdr *h, const u_char *bytes); int pcap_loop(pcap_t *p, int cnt, pcap…