PCAP_DUMP(3PCAP)

πŸ“¦
version 1.11.0 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– PCAP_DUMP πŸ’–

okay bestie, gather round, because today we're learning about pcap_dump from the 3PCAP manual, and honestly? she's a whole vibe. this is the function that takes a packet and yeets it into a capture file. slay.


✨ NAME ✨

pcap_dump β€” write a packet to a capture file πŸŽ€

no cap, that's literally it. one packet, one savefile, one iconic little moment.


🌸 SYNOPSIS 🌸

#include <pcap/pcap.h>

void pcap_dump(u_char *user, struct pcap_pkthdr *h,
    u_char *sp);

look at her. three little args. she's giving minimalist queen πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie. pcap_dump() outputs a packet to the ``savefile'' that was opened with pcap_dump_open(3PCAP). like, that's her whole job. she dumps. she writes. she moves on. main character energy fr fr.

and the cutest part? her calling arguments are literally designed to be suitable for use with pcap_dispatch(3PCAP) or pcap_loop(3PCAP). so you can just hand her straight to those callback situations and she fits right in, no drama, no awkwardness. it's giving perfectly compatible. 🫢

⚠️ but lowkey important: if you call her directly (like, not through pcap_dispatch() or pcap_loop()), then the user parameter is of type pcap_dumper_t, exactly as returned by pcap_dump_open(). don't get it twisted, bestie. that's the type. periodt. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

  • pcap(3PCAP)

go read her mom, she's iconic too. iykyk 🌈


that's the whole page, bestie, and you ATE it. ✨

this little legend comes to you from the 8 March 2015 era of PCAP_DUMP(3PCAP) β€” vintage but still slaying. mwah. πŸ’œπŸŽ€

πŸ“¦ where this page comes from