---
name: "pcap_dump"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/pcap_dump"
---

# pcap\_dump(3)

write a packet to a capture file

## NAME

pcap\_dump - write a packet to a capture file

## SYNOPSIS

```
#include <pcap/pcap.h>
```

**void pcap\_dump(u\_char \*user, struct pcap\_pkthdr \*h,**\
     **u\_char \*sp);**

## DESCRIPTION

**pcap\_dump**() outputs a packet to the \`\`savefile'' opened with [**pcap\_dump\_open**(3)](/pcap_dump_open/3.md). Note that its calling arguments are suitable for use with [**pcap\_dispatch**(3)](/pcap_dispatch/3.md) or [**pcap\_loop**(3)](/pcap_loop/3.md). If called directly, the *user* parameter is of type **pcap\_dumper\_t** as returned by **pcap\_dump\_open**().

## SEE ALSO

[**pcap**(3)](/pcap/3.md)
