tcpdump mailing list archives

libpcap and threading


From: Francois Goudal <francois () goudal net>
Date: Mon, 14 Jun 2010 09:41:53 +0200

Hi,

I'm currently trying to write a piece of code using libpcap.
So far, I have been successfully able to capture some packets on an interface using libpcap with a filter.
Now, I'd like to be able to change this filter while capturing.
My program is threaded. There's a thread dedicated to running pcap_loop(). I'd like to know if it's possible to call pcap_setfilter() from another thread while pcap_loop() is executing and also if this will have the expected behaviour (i.e. change the filter on the fly) or instead if I will need to break out of pcap_loop(), then set the new filter and enter pcap_loop() again ?

Best regards,

--
Francois Goudal
EPITA Promo 2008 - GISTR
francois@goudal dot net

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: