| Main index | Section 3 | Options |
#include <pcap/pcap.h>char errbuf[PCAP_ERRBUF_SIZE];
pcap_t *pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, char *errbuf);
snaplen specifies the snapshot length to be set on the handle. If the packet data should not be truncated at the end, a value of 262144 should be sufficient for most devices, but D-Bus devices require a value of 128MB (128*1024*1024).
promisc specifies whether the interface is to be put into promiscuous mode. If promisc is non-zero, promiscuous mode will be set, otherwise it will not be set.
to_ms specifies the packet buffer timeout, as a non-negative value, in milliseconds. (See pcap(3) for an explanation of the packet buffer timeout.)
errbuf is a buffer large enough to hold at least PCAP_ERRBUF_SIZE chars.
| 4 March 2024 | PCAP_OPEN_LIVE (3) |
| Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | UNIX has been evolving feverishly for close to 30 years, sort of like bacteria in a cesspool — only not as attractive | ” |
| — John Levine, "Unix for Dummies" | ||