Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - capture PCAP_D_OUT direction packets from libpcap: (2 Items)
   
capture PCAP_D_OUT direction packets from libpcap  
I am writing a tool to capture the outgoing packets at a radio interface using libpcap. The device uses NXP driver and 
QNX OS.
When I set the direction as OUT in pcap_setdirection API, I am getting error from libpcap as below:

"Setting direction to PCAP_D_OUT is not supported on BPF"

However, if I set direction as PCAP_D_INOUT, it is able to capture both incoming and outgoing packets together.

Please suggest me any IOCTL or any way to enable only the outgoing packet capture.

Tcpdump also dosen't captures with only out direction.
Re: capture PCAP_D_OUT direction packets from libpcap  
libpcap is just a wrapper on to the BPF implementation. You are probably better off using the BPF API and installing a 
BPF filter to only receive outgoing packets.