PCAP\_IS\_SWAPPED(3PCAP) PCAP\_IS\_SWAPPED(3PCAP)

# [NAME](#NAME)

pcap\_is\_swapped - find out whether a savefile has the native byte order

# [SYNOPSIS](#SYNOPSIS)

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

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

# [DESCRIPTION](#DESCRIPTION)

**pcap\_is\_swapped**() returns true (**1**) if *p* refers to a \`\`savefile'' that uses a different byte order than the current system. For a live capture, it always returns false (**0**).

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\_is\_swapped**() returns true (**1**) or false (**0**) 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_is_swapped(3pcap) from libpcap 1.11.0-r0 (Chainguard OS)
Source: https://github.com/the-tcpdump-group/libpcap.git
