【问题标题】:How to use pcap_open_live for a particular ethernet port如何将 pcap_open_live 用于特定的以太网端口
【发布时间】:2016-07-15 14:15:19
【问题描述】:

对于下面的函数,如果我想在多个特定以太网端口上获取数据包捕获句柄,我在哪里可以获得值 参数 const char *device ?

pcap_t *pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, char *errbuf);

【问题讨论】:

    标签: c++ c network-programming winpcap


    【解决方案1】:

    设备属于formatrpcap://device,其中每个端口都有不同的设备字符串。 WinPcap tutorial 的第一页显示了如何使用 pcap_findalldevs_ex 枚举所有设备:Obtaining the device list

    first complete example 展示了如何将它与pcap_open 结合使用。我建议您按照教程进行操作。挺好的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-12
      • 1970-01-01
      • 2011-06-26
      • 1970-01-01
      • 1970-01-01
      • 2016-06-20
      • 1970-01-01
      • 2012-12-04
      相关资源
      最近更新 更多