pcapy listen on multiple devices

Jorgen Grahn jgrahn-nntq at algonet.se
Sat Sep 17 23:30:04 CEST 2005

On Mon, 12 Sep 2005 17:02:31 +0200, billiejoex <billiejoex at fastwebnet.it> wrote:
> Hi all. I noticed that with the original pcap sniffing library it is 
> possible to listen on multiple devices by using "select()" or "poll()" 
> function.

Yes; you can ask pcap for the file descriptor which corresponds to your
sniffed device. That works at least on Unixes.

(There is also the 'any' pseudo-interface, if you are on Linux (and other
Unixes?). You get to listen /everywhere/ in one session.)

> These function aren't present in pcapy module. Do you got any suggestion to 
> avoid this problem?

Modify pcapy so you can get the file descriptor from it. Pcapy is great, but
it doesn't expose libpcap literally. Maybe the original authors had no use
for getfd().

I've been meaning to write The Pcap Bindings To End All Pcap Bindings for
almost a year now, but I never seem to get around to it ;-)


  // Jorgen Grahn <jgrahn@       Ph'nglui mglw'nafh Cthulhu
\X/                algonet.se>   R'lyeh wgah'nagl fhtagn!

More information about the Python-list mailing list