---
name: "pcap_dump"
section: "3pcap"
platform: "linux"
package: "libpcap"
version: "1.11.0-1"
release: "Arch Linux 2026-11-01"
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)
