PCAP\_SNAPSHOT(3PCAP) PCAP\_SNAPSHOT(3PCAP)

# [NAME](#NAME)

pcap\_snapshot - get the snapshot length

# [SYNOPSIS](#SYNOPSIS)

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

```
int pcap_snapshot(pcap_t *p);
```

# [DESCRIPTION](#DESCRIPTION)

**pcap\_snapshot**() returns the snapshot length specified when [**pcap\_set\_snaplen**(3PCAP)](/man/os/libpcap/pcap_set_snaplen.3PCAP) or [**pcap\_open\_live**(3PCAP)](/man/os/libpcap/pcap_open_live.3PCAP) was called, for a live capture, or the snapshot length from the capture file, for a \`\`savefile''.

It must not be called on a pcap descriptor created by [**pcap\_create**(3PCAP)](/man/os/libpcap/pcap_create.3PCAP) that has not yet been activated by [**pcap\_activate**(3PCAP)](/man/os/libpcap/pcap_activate.3PCAP).

# [RETURN VALUE](#RETURN_VALUE)

**pcap\_snapshot**() returns the snapshot length on success and **PCAP\_ERROR\_NOT\_ACTIVATED** if called on a capture handle that has been created but not activated.

# [SEE ALSO](#SEE_ALSO)

[**pcap**(3PCAP)](/man/os/libpcap/pcap.3PCAP)

7 April 2014

---

Document: pcap_snapshot(3pcap) from libpcap 1.11.0-r0 (Chainguard OS)
Source: https://github.com/the-tcpdump-group/libpcap.git
