PCAP_SET_IMMEDIATE_MODE(3PCAP)
πΈ NAME πΈ
okay bestie, welcome to the PCAP_SET_IMMEDIATE_MODE(3PCAP) manual page β¨ β this is all about pcap_set_immediate_mode, and its whole thing is: set immediate mode for a not-yet-activated capture handle π
. Not activated yet, bestie. Not yet. π«Ά
π SYNOPSIS π
#include <pcap/pcap.h>
int pcap_set_immediate_mode(pcap_t *p, int immediate_mode);
β¨ DESCRIPTION β¨
Okay so pcap_set_immediate_mode() sets whether immediate mode should be set on a capture handle when the handle is activated β¨. In immediate mode, packets are always delivered as soon as they arrive, with no buffering β no little packet queue having a sit-down, no waiting around π.
If immediate_mode is non-zero, immediate mode will be set; otherwise it will not be set. Thatβs the whole switch. Thatβs the vibe check. π
π RETURN VALUE π
pcap_set_immediate_mode() returns 0 on success, or PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated π. So yeah: set it up before activation, or the function will be like βnope, too late, bestie.β π
π¦ BACKWARD COMPATIBILITY π¦
This function became available in libpcap release 1.5.0 β¨. In previous releases, if immediate delivery of packets is required:
- on FreeBSD, NetBSD, OpenBSD, DragonFly BSD, macOS, and Solaris 11 β immediate mode must be turned on with a
BIOCIMMEDIATEioctl(2), as documented inbpf(4), on the descriptor returned bypcap_fileno(3PCAP), afterpcap_activate(3PCAP)is called; - on Solaris 10 and earlier versions of Solaris β immediate mode must be turned on by using a read timeout of
0when opening the device (this will not provide immediate delivery of packets on other platforms, so don't assume it's sufficient) π; - on Digital UNIX/Tru64 UNIX β immediate mode must be turned on by doing a
BIOCMBICioctl(), as documented inpacketfilter(7), to clear theENBATCHflag on the descriptor returned bypcap_fileno(3PCAP), afterpcap_activate(3PCAP)is called; - on Windows β immediate mode must be turned on by calling
pcap_setmintocopy()with a size of0π.
On Linux, with previous releases of libpcap, capture devices are always in immediate mode; however, in 1.5.0 and later, they are, by default, not in immediate mode, so if pcap_set_immediate_mode() is available, it should be used π.
On other platforms, capture devices are always in immediate mode π.
π SEE ALSO π
pcap(3PCAP)pcap_create(3PCAP)pcap_activate(3PCAP)
byeee bestie π«Ά β source/version: PCAP_SET_IMMEDIATE_MODE(3PCAP); date: 23 August 2018 π
π¦ where this page comes from
- alpine 3.22: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- alpine 3.23: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- alpine 3.24: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- centos-stream 10: libpcap-devel 14:1.10.4-8.el10 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- debian bookworm: libpcap0.8-dev 1.10.3-1
- debian trixie: libpcap0.8-dev 1.10.5-2
- fedora 43: libpcap-devel 14:1.10.5-3.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.5-3.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.7-1.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.7-1.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.6-2.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.6-2.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.7-1.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.7-1.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- nixos 26.05: libpcap 1.10.7
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- ubuntu noble: libpcap0.8-dev 1.10.4-4.1ubuntu3
- ubuntu noble: libpcap0.8-dev 1.10.4-4.1ubuntu3.1
- ubuntu questing: libpcap0.8-dev 1.10.5-2ubuntu2
- ubuntu resolute: libpcap0.8-dev 1.10.6-1ubuntu1 Β· BSD-3-clause-var3
- ubuntu resolute: libpcap0.8-dev 1.10.6-1ubuntu1.1 Β· BSD-3-clause-var3
- ubuntu stonking: libpcap0.8-dev 1.10.7-1ubuntu1 Β· BSD-3-clause-var3
- Copyright (c) 1994, 1996, 1997 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms