PCAP_SET_TIMEOUT(3PCAP)
β¨ PCAP_SET_TIMEOUT(3PCAP) β¨
okay bestie, welcome to the 3PCAP section of the manual, and today's main character is pcap_set_timeout β she sets the packet buffer timeout for a capture handle that hasn't been activated yet. no cap. π
πΈ NAME πΈ
pcap_set_timeout β set the packet buffer timeout for a not-yet-activated capture handle π
π¦ SYNOPSIS π¦
#include <pcap/pcap.h>
int pcap_set_timeout(pcap_t *p, int to_ms);
β¨ DESCRIPTION β¨
so here's the tea, bestie: pcap_set_timeout() sets the packet buffer timeout that's gonna be used on a capture handle when the handle is activated, and it sets it to to_ms, which is measured in units of milliseconds. β±οΈ (if you need the whole explanation of what a packet buffer timeout even is, go read pcap(3PCAP) β she explains it, iykyk.)
now for the part that's giving danger π¨: the behavior if the timeout isn't specified is undefined. and so is the behavior if the timeout is set to zero or to a negative value. like, truly undefined, not in a cute way.
π so what do we do? we recommend always setting the timeout to a non-zero value β unless immediate mode is set, in which case the timeout has no effect at all. periodt. β
π RETURN VALUE π
pcap_set_timeout() returns 0 on success π«Ά β or PCAP_ERROR_ACTIVATED if you called it on a capture handle that has already been activated. like girl, she's already awake, you can't set her timeout anymore π
π SEE ALSO π
pcap_create(3PCAP)pcap_activate(3PCAP)pcap_set_immediate_mode(3PCAP)
and that's the whole vibe, bestie β this page is from 6 December 2017, and it lives in the PCAP_SET_TIMEOUT(3PCAP) manual. go set a non-zero timeout and slay π
β¨πΈ
π¦ 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
- arch rolling: libpcap 1.11.0-1 Β· 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
- centos-stream 9: libpcap-devel 14:1.10.0-5.el9 Β· BSD with advertising
- centos-stream 9: libpcap-devel 14:1.10.0-5.el9 Β· BSD with advertising
- 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
- nixpkgs unstable: libpcap 146
- 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 jammy: libpcap0.8-dev 1.10.1-4build1
- ubuntu jammy: libpcap0.8-dev 1.10.1-4ubuntu1.22.04.2
- 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 on : a language model's rewrite of the original, under its terms