开发者

missing elements from pcap?

开发者 https://www.devze.com 2022-12-23 17:42 出处:网络
When I check the attributes available to the module pcap, I expect to see something like [ ...snip... \'dltvalue\', \'findalldevs\',

When I check the attributes available to the module pcap, I expect to see something like

[ ...snip...

'dltvalue', 'findalldevs', 'lookupdev', 'lookupnet', 'ntoa', 'pcapObject', 'pcapObjectPtr']

With note on pcapObject. However, all I get when running dir(pcap) is

[ ... snip... 'copyright', 'doc', 'file', 'license', '开发者_JS百科name', 'url', 'version', 'bpf', 'dltoff', 'ex_name', 'lookupdev', 'pcap', 'sys']

Noting the lack of pcapObject. Why is this? What could cause this?


You want pylibpcap but what you have installed is pypcap, a different Python libpcap binding with an incompatible API.

There are three Python libpcap bindings used in the wild: pypcap (recommended by scapy for use on Windowas), pylibcap and pcapy. See scapy/pcapdnet.py for a taste of their API differences. With their similar names people must have them mixed up pretty regularly ...


You could also try

sudo apt-get install libpcap-dev

0

精彩评论

暂无评论...
验证码 换一张
取 消