ubuntu libpcap pcap_open_live()函数怎么打开pppoe的网口
1查找网络设备:目的是发现可用的网卡,实现的函数为pcap_lookupdev(),如果当前有多个网卡,函数就会返回一个网络设备名的指针列表。char * pcap_lookupdev(char * errbuf)
2打开网络设备:利用上一步中的返回值,可以决定使用哪个网卡,通过函数pcap_open_live()打开网卡,返回用于捕捉网络数据包的秒数字。int pcap_lookupnet(const char * device, bpf_u_int32 * netp, bpf_u_int32 * maskp, char * errbuf)
我现在的网络用ifconfig 显示有eht0 、lo 、pppo
用pcap_lookupdev()默认是etho端口,我想搜索到pppo网卡。
请问具体的代码语句怎么写