Hi all

The app I'm busy with has the common situation of polling for user input,
and waiting for packets from libpcap. I've been through the archives, and the
select() was removed from pcap-linux.c with good reason.
[http://www.tcpdump.org/lists/workers/2000/msg01674.html]

However, according to Guy Harris, select()/poll() it still the best method to
accomplish the test for user input/packets.
[http://www.tcpdump.org/lists/workers/2001/12/msg00087.html]

How about adding a pcap_is_packet_waiting() which will perform the test
for you. The app would call pcap_dispatch() only  if
pcap_is_packet_waiting() returns true, and the app can get on with other
things on false.
Arguments could be a pcap_t struct, and perhaps a timeout in
microsecs. It seems that a select()/poll() based test would work on most
systems, so surely this provides a platform-independent way to test?

I'm an "inexperienced" c and libpcap programmer, so feel free to shoot this
down in descriptive flames.

Regards
Marco Slaviero

PS. Thanks to all the libpcap authors for an excellent product.

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to