PCAP_SNAPSHOT(3)

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

πŸ’… PCAP_SNAPSHOT(3) πŸ’…

okay so bestie, welcome to the PCAP_SNAPSHOT(3) page from the Library Functions Manual β€” it's giving β€œget the snapshot length” energy, and honestly? iconic. ✨


πŸŽ€ NAME πŸŽ€

pcap_snapshot - get the snapshot length

✨ SYNOPSIS ✨

#include <pcap/pcap.h>

int pcap_snapshot(pcap_t *p);

πŸ’– DESCRIPTION πŸ’–

pcap_snapshot() returns the snapshot length specified when pcap_set_snaplen(3) or pcap_open_live(3) was called, for a live capture β€” or the snapshot length from the capture file, for a savefile. lowkey straightforward, fr fr. 🫢

okay but the vibe check here is serious: it must not be called on a pcap descriptor created by pcap_create(3) that has not yet been activated by pcap_activate(3). not me warning you twice. πŸš«πŸ’…

🌸 RETURN VALUE 🌸

pcap_snapshot() returns the snapshot length on success. and if you call it on a capture handle that has been created but not activated? it returns PCAP_ERROR_NOT_ACTIVATED. 😭 periodt.

πŸ¦‹ SEE ALSO πŸ¦‹


xoxo, your Library Functions Manual bestie β€” PCAP_SNAPSHOT(3), dated 7 April 2014 πŸ’–βœ¨

πŸ“¦ where this page comes from