[tcpdump-workers] libpcap: real time usage of file descriptor returned by pcap_get_selectable_fd

2013-06-28 Thread liu lily
I'm programming for a network program using libevent. I posted a question previously, but I have some new discoveries. In this program, I want to capture packets using libpcap, modify these packets and then sends them out. These steps should be in real time. So I create a live capture, use pcap_g

[tcpdump-workers] libpcap: what is the efficiency of pcap_dispatch or pcap_next

2013-06-27 Thread liu lily
I use libpcap to capture a lot packets, and then process/modify these packets and send them to another host. First, I create a libpcap handler `handle` and set it NON-BLOCKING, and use `pcap_get_selecable_fd(handle)` to get a corresponding file descriptor `pcap_fd`. Then I add an event for this `