---
name: "pcap_dump"
section: "3pcap"
platform: "macos"
package: "libpcap"
version: "146"
release: "macOS 26.5"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/pcap_dump/3pcap"
---

# pcap\_dump(3pcap)

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**(3PCAP). Note that its calling arguments are suitable for use with **pcap\_dispatch**(3PCAP) or **pcap\_loop**(3PCAP). If called directly, the *user* parameter is of type **pcap\_dumper\_t** as returned by **pcap\_dump\_open**().

## SEE ALSO

**pcap**(3PCAP)
