---
name: "pcap_is_swapped"
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_is_swapped/3pcap"
---

# pcap\_is\_swapped(3pcap)

find out whether a savefile has the native byte order

## NAME

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

## SYNOPSIS

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

**int pcap\_is\_swapped(pcap\_t \*p);**

## 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) that has not yet been activated by **pcap\_activate**(3PCAP).

## 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

**pcap**(3PCAP)
