pcap_setdirection(3PCAP) man page
#include <pcap/pcap.h> int pcap_setdirection(pcap_t *p, pcap_direction_t d);
will only capture packets received by the device,
will only capture packets sent by the device and
will capture packets received by or sent by the device.
is the default setting if this function is not called.
isn't necessarily fully supported on all platforms; some platforms might
return an error for all values, and some other platforms might not
This operation is not supported if a ``savefile'' is being read.
if called on a capture handle that has been created but not activated, or
on other errors. If
may be called with
as an argument to fetch or display the error text.