PCAP\_SET\_SNAPLEN(3PCAP) PCAP\_SET\_SNAPLEN(3PCAP)

# [NAME](#NAME)

pcap\_set\_snaplen - set the snapshot length for a not-yet-activated capture handle

# [SYNOPSIS](#SYNOPSIS)

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

```
int pcap_set_snaplen(pcap_t *p, int snaplen);
```

# [DESCRIPTION](#DESCRIPTION)

**pcap\_set\_snaplen**() sets the snapshot length to be used on a capture handle when the handle is activated to *snaplen*.

# [RETURN VALUE](#RETURN_VALUE)

**pcap\_set\_snaplen**() returns **0** on success or **PCAP\_ERROR\_ACTIVATED** if called on a capture handle that has been activated.

# [SEE ALSO](#SEE_ALSO)

[**pcap**(3PCAP)](/man/os/libpcap/pcap.3PCAP), [**pcap\_create**(3PCAP)](/man/os/libpcap/pcap_create.3PCAP), [**pcap\_activate**(3PCAP)](/man/os/libpcap/pcap_activate.3PCAP)

3 January 2014

---

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