PCAP_SET_TIMEOUT(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

okay so this is PCAP_SET_TIMEOUT(3), straight out of the Library Functions Manual, and we're gonna make packet buffer timeout make sense, fr fr ✨

πŸŽ€ NAME πŸŽ€

pcap_set_timeout β€” set the packet buffer timeout for a capture handle that is not yet activated πŸ’…

✨ SYNOPSIS ✨

#include <pcap/pcap.h>

int pcap_set_timeout(pcap_t *p, int to_ms);

πŸ’… DESCRIPTION πŸ’…

okay bestie, so pcap_set_timeout() sets the packet buffer timeout that will be used on a capture handle when that handle gets activated. You pass it as to_ms, and the units are milliseconds ⏱️✨

(if you need the full lore on what the packet buffer timeout even is, go peek at pcap(3) β€” it's giving explained-in-detail energy 🫢)

🚨 undefined behavior alert, no cap: the behavior is undefined if the timeout isn't specified. It's also undefined if the timeout is set to 0 or to a negative value. Like… don't do that, bestie πŸ˜­πŸ’€

we recommend always setting the timeout to a non-zero value, unless immediate mode is set β€” in that case, the timeout has no effect at all 🌈

πŸ”₯ RETURN VALUE πŸ”₯

pcap_set_timeout() returns 0 on success ✨

or it returns PCAP_ERROR_ACTIVATED if you call it on a capture handle that has already been activated πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹


that's the whole page, bestie πŸŽ€ the footer's source/version tag is PCAP_SET_TIMEOUT(3), and the date on it is 6 December 2017 β€” iconic, periodt πŸ’–πŸ¦‹

πŸ“¦ where this page comes from